4
2
Fork 0

feat: display message when no conversations are available

v0.1-dev
shihern 2019-11-28 21:25:50 +08:00
parent a40bb21ad0
commit b5dc1ed2d5
1 changed files with 8 additions and 3 deletions

View File

@ -82,12 +82,17 @@ class _HomeViewState extends State<HomeView> {
StreamBuilder(
stream: conversationsBloc.conversations,
builder: (context, AsyncSnapshot<List<Conversation>> snapshot) {
if (snapshot.hasData) {
if (snapshot.data.isNotEmpty) {
return buildList(snapshot.data);
} else if (snapshot.hasError) {
return Text(snapshot.error.toString());
}
return Center(child: CircularProgressIndicator());
}
return Center(
child: Padding(
padding: const EdgeInsets.only(top: 20.0),
child: Text("No conversations found. Start one now!"),
));
// return Center(child: CircularProgressIndicator());
})
]))
]);