Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @override
- Widget build(BuildContext context) {
- currentTheme();
- return new FutureBuilder<QuerySnapshot>(
- future: Firestore.instance.collection('events').where(widget.currentuid, isEqualTo: widget.refuid).getDocuments(),
- builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot){
- if (snapshot.hasError) {
- return new Container(width: 0.0, height: 0.0,); // error message (snapshot error)
- }
- if (snapshot.connectionState == ConnectionState.waiting) {
- return new Container(width: 0.0, height: 0.0,); // waiting to connect - loading indicator?
- }
- if (!snapshot.hasData) {
- return new Container(width: 0.0, height: 0.0,); // make add new event
- } if (snapshot.hasData) {
- var id = snapshot.data.documents[0]['id'];
- return new GestureDetector(
- onTap: (){},
- child: new Container(
- decoration: new BoxDecoration(
- color: cards,
- image: new DecorationImage(
- image: new NetworkImage('https://i.imgur.com/cbmuQft.jpg'),
- colorFilter: new ColorFilter.mode(
- Color.fromRGBO(15, 27, 44, 0.6),
- BlendMode.dstATop),
- fit: BoxFit.cover)),
- child: Column(
- //crossAxisAlignment: CrossAxisAlignment.end,
- children: <Widget>[
- //Padding(padding: EdgeInsets.only(bottom: 188.0)),
- Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Padding(padding: EdgeInsets.only(top: 20.0), child: Text('Title', style: TextStyle(color: text, fontSize: 24.0, fontWeight: FontWeight.bold),),),
- Padding(padding: EdgeInsets.only(top: 2.0), child: Text('date and time', style: TextStyle(color: text, fontSize: 18.0),),)
- ],
- ),
- Padding(
- padding:
- EdgeInsets.only(left: 10.0, top: 70.0),
- child: Row(
- children: <Widget>[
- Container(
- decoration: new BoxDecoration(
- color: cards,
- image: new DecorationImage(
- image: new NetworkImage('https://i.imgur.com/cbmuQft.jpg'),
- colorFilter: new ColorFilter.mode(
- Color.fromRGBO(15, 27, 44, 0.6),
- BlendMode.dstATop),
- fit: BoxFit.cover))),
- Padding(
- padding: EdgeInsets.only(left: 5.0),
- // event makers
- child: Text(
- 'organizer',
- style: TextStyle(
- color: text,
- fontSize: 16.0,),
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
- return new Container( child: Card(child: Column(children: <Widget> [ListTile(leading: Icon(Icons.person_pin_circle), title: Text('Faild to load...'),)])),);
- }
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement