Skip to content

Instantly share code, notes, and snippets.

@nparsons08
Created Dec 11, 2019
Embed
What would you like to do?
// mobile/lib/profile.dart:34
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: _activities,
builder: (BuildContext context, AsyncSnapshot<List<dynamic>> snapshot) {
if (!snapshot.hasData) {
return Center(child: CircularProgressIndicator());
}
return Container(
child: Center(
child: RefreshIndicator(
onRefresh: _refreshActivities,
child: ListView(
children: snapshot.data
.map((activity) => ListTile(
title: Text(activity['message']),
))
.toList(),
),
),
),
);
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment