add loadingbuilder in messagelistview

This commit is contained in:
Salvatore Giordano
2021-01-25 09:56:38 +01:00
parent e0c8068fbd
commit 0ef454acc6
+9
View File
@@ -109,6 +109,7 @@ class MessageListView extends StatefulWidget {
this.scrollPhysics = const AlwaysScrollableScrollPhysics(),
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
this.messageFilter,
this.loadingBuilder,
}) : super(key: key);
/// Function used to build a custom message widget
@@ -120,6 +121,9 @@ class MessageListView extends StatefulWidget {
/// Function used to build a custom thread widget
final ThreadBuilder threadBuilder;
/// The builder used while loading.
final WidgetBuilder loadingBuilder;
/// Filter applied to the message list before rendering
final bool Function(Message) messageFilter;
@@ -308,6 +312,11 @@ class _MessageListViewState extends State<MessageListView> {
if (!snapshot.data) {
return Container();
}
if (widget.loadingBuilder != null) {
return widget.loadingBuilder(context);
}
return Center(
child: Padding(
padding: const EdgeInsets.all(8.0),