Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DoctorsList extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return new StreamBuilder<QuerySnapshot>(
- stream: Firestore.instance.collection('Doctors').snapshots(),
- builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
- if (!snapshot.hasData) return CircularProgressIndicator();
- return new ListView(
- children: snapshot.data.documents.map((DocumentSnapshot document) {
- return new CustomScrollView(
- slivers: <Widget>[
- new SliverAppBar(
- expandedHeight: 180.0,
- floating: false,
- pinned: true,
- flexibleSpace: new FlexibleSpaceBar(
- title: new Text("Select a Doctor",
- style: new TextStyle(color: Colors.white),),
- background: new Image.asset("lib/images/listofdoctors.jpg",
- fit: BoxFit.cover),
- ),
- ),
- new SliverList(
- delegate: new SliverChildBuilderDelegate((context, index) =>
- new Card(
- child: new Container(
- padding: EdgeInsets.all(10.0),
- child: new Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children: <Widget>[
- CircleAvatar(
- backgroundColor: Colors.transparent,
- backgroundImage: new NetworkImage(
- "${document['Picture']}"),
- radius: 30.0,
- ),
- SizedBox(width: 10.0),
- Text(document['Name'])
- ],
- ),
- ),
- )
- ),
- ),
- ],
- );
- }).toList(),
- );
- },
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement