Extracted the list building on the events screen to a separate method, updated the firebase function to handle updates on the "done" field in tasks
This commit is contained in:
parent
dfe52b77ef
commit
09555aeadf
3 changed files with 23 additions and 14 deletions
|
|
@ -52,23 +52,27 @@ class _EventsScreenState extends State<EventsScreen> {
|
|||
child: LoadingIndicator(),
|
||||
);
|
||||
}
|
||||
return ListView(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
children: eventsSnap.data
|
||||
.map(
|
||||
(event) => Padding(
|
||||
padding: EdgeInsets.only(bottom: 15),
|
||||
child: EventListTile(
|
||||
event: event,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
return buildList(eventsSnap.data);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildList(List<EventModel> events) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
children: events
|
||||
.map(
|
||||
(event) => Padding(
|
||||
padding: EdgeInsets.only(bottom: 15),
|
||||
child: EventListTile(
|
||||
event: event,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue