Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Widget _buildList() {
- return FutureBuilder(
- future: _loadDataFromDb(),
- builder: (context, snapshot) {
- List<Widget> widgets = [];
- if (data == null || data.length == 0) {
- return Center(
- child: Text(
- Languages.of(context).textNoHiddenCourses,
- style: Theme.of(context).textTheme.bodyText1,
- textAlign: TextAlign.center,
- ),
- );
- }
- else {
- for (int i = 0; i < data.length; ++i) {
- widgets.add(ListTile(
- title: Text(
- data[i]['name'],
- style: Theme.of(context).textTheme.bodyText1,
- ),
- onTap: () { _cardTapped(i); },
- trailing: Icon(Icons.close),
- ));
- widgets.add(Divider());
- }
- return ListView(
- children: widgets,
- physics: const BouncingScrollPhysics(parent: const AlwaysScrollableScrollPhysics()),
- );
- }
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement