From b97d10238937cc447e930031737fbdfe58f08e52 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 8 Sep 2020 09:29:43 +0200 Subject: [PATCH] add no channels info text --- lib/src/channel_list_view.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/src/channel_list_view.dart b/lib/src/channel_list_view.dart index b0f39ea6..c31c4649 100644 --- a/lib/src/channel_list_view.dart +++ b/lib/src/channel_list_view.dart @@ -211,6 +211,25 @@ class _ChannelListViewState extends State } final channels = snapshot.data; + + if (channels.isEmpty) { + return LayoutBuilder( + builder: (context, viewportConstraints) { + return SingleChildScrollView( + physics: AlwaysScrollableScrollPhysics(), + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: viewportConstraints.maxHeight, + ), + child: Center( + child: Text('You have no channels currently'), + ), + ), + ); + }, + ); + } + return ListView.custom( physics: AlwaysScrollableScrollPhysics(), controller: _scrollController,