Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.77 KB | None | 0 0
  1. @override
  2.     Widget build(BuildContext context) {
  3.     currentTheme();
  4.      return new FutureBuilder<QuerySnapshot>(
  5.        future: Firestore.instance.collection('events').where(widget.currentuid, isEqualTo: widget.refuid).getDocuments(),
  6.        builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot){
  7.          if (snapshot.hasError) {
  8.             return new Container(width: 0.0, height: 0.0,); // error message (snapshot error)
  9.          }
  10.          if (snapshot.connectionState == ConnectionState.waiting) {
  11.             return new Container(width: 0.0, height: 0.0,); // waiting to connect - loading indicator?
  12.          }
  13.          if (!snapshot.hasData) {
  14.             return new Container(width: 0.0, height: 0.0,); // make add new event
  15.          } if (snapshot.hasData) {
  16.             var id = snapshot.data.documents[0]['id'];
  17.             return new GestureDetector(
  18.               onTap: (){},
  19.               child: new Container(
  20.                 decoration: new BoxDecoration(
  21.                     color: cards,
  22.                     image: new DecorationImage(
  23.                         image: new NetworkImage('https://i.imgur.com/cbmuQft.jpg'),
  24.                         colorFilter: new ColorFilter.mode(
  25.                             Color.fromRGBO(15, 27, 44, 0.6),
  26.                             BlendMode.dstATop),
  27.                         fit: BoxFit.cover)),
  28.                 child: Column(
  29.                   //crossAxisAlignment: CrossAxisAlignment.end,
  30.                   children: <Widget>[
  31.                     //Padding(padding: EdgeInsets.only(bottom: 188.0)),
  32.                     Column(
  33.                                   mainAxisAlignment: MainAxisAlignment.center,
  34.                                 children: <Widget>[
  35.                                   Padding(padding: EdgeInsets.only(top: 20.0), child: Text('Title', style: TextStyle(color: text, fontSize: 24.0, fontWeight: FontWeight.bold),),),
  36.                                   Padding(padding: EdgeInsets.only(top: 2.0), child: Text('date and time', style: TextStyle(color: text, fontSize: 18.0),),)
  37.                                 ],
  38.                               ),
  39.                               Padding(
  40.                                       padding:
  41.                                           EdgeInsets.only(left: 10.0, top: 70.0),
  42.                               child: Row(
  43.                                 children: <Widget>[
  44.                                   Container(
  45.                 decoration: new BoxDecoration(
  46.                     color: cards,
  47.                     image: new DecorationImage(
  48.                         image: new NetworkImage('https://i.imgur.com/cbmuQft.jpg'),
  49.                         colorFilter: new ColorFilter.mode(
  50.                             Color.fromRGBO(15, 27, 44, 0.6),
  51.                             BlendMode.dstATop),
  52.                         fit: BoxFit.cover))),
  53.                                   Padding(
  54.                                     padding: EdgeInsets.only(left: 5.0),
  55.                                     // event makers
  56.                                     child: Text(
  57.                                       'organizer',
  58.                                       style: TextStyle(
  59.                                           color: text,
  60.                                           fontSize: 16.0,),
  61.                                     ),
  62.                                   )
  63.                                 ],
  64.                               ),
  65.                           ),
  66.                         ],
  67.                       ),
  68.                     ),
  69.                 );
  70.          }
  71.  
  72.          return new Container( child: Card(child: Column(children: <Widget> [ListTile(leading: Icon(Icons.person_pin_circle), title: Text('Faild to load...'),)])),);
  73.        }
  74.      );
  75.     }
  76.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement