fmt: dartfmt
This commit is contained in:
@@ -169,18 +169,22 @@ class _ChannelListViewState extends State<ChannelListView>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var child = ChannelListCore(
|
var child = ChannelListCore(
|
||||||
channelListController: _channelListController,
|
channelListController: _channelListController,
|
||||||
listBuilder: widget.listBuilder ?? (context, list) {
|
listBuilder: widget.listBuilder ??
|
||||||
return _buildListView(list);
|
(context, list) {
|
||||||
},
|
return _buildListView(list);
|
||||||
emptyBuilder: widget.emptyBuilder ?? (BuildContext context) {
|
},
|
||||||
return _buildEmptyWidget();
|
emptyBuilder: widget.emptyBuilder ??
|
||||||
},
|
(BuildContext context) {
|
||||||
errorBuilder: widget.errorBuilder ?? (BuildContext context, dynamic error) {
|
return _buildEmptyWidget();
|
||||||
return _buildErrorWidget(context);
|
},
|
||||||
},
|
errorBuilder: widget.errorBuilder ??
|
||||||
loadingBuilder: widget.loadingBuilder ?? (BuildContext context) {
|
(BuildContext context, dynamic error) {
|
||||||
return _buildLoadingWidget();
|
return _buildErrorWidget(context);
|
||||||
},
|
},
|
||||||
|
loadingBuilder: widget.loadingBuilder ??
|
||||||
|
(BuildContext context) {
|
||||||
|
return _buildLoadingWidget();
|
||||||
|
},
|
||||||
pagination: widget.pagination,
|
pagination: widget.pagination,
|
||||||
options: widget.options,
|
options: widget.options,
|
||||||
sort: widget.sort,
|
sort: widget.sort,
|
||||||
|
|||||||
@@ -262,41 +262,45 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MessageListCore(
|
return MessageListCore(
|
||||||
loadingBuilder: widget.loadingBuilder ?? (context) {
|
loadingBuilder: widget.loadingBuilder ??
|
||||||
return Center(
|
(context) {
|
||||||
child: const CircularProgressIndicator(),
|
return Center(
|
||||||
);
|
child: const CircularProgressIndicator(),
|
||||||
},
|
);
|
||||||
emptyBuilder: widget.emptyBuilder ?? (context) {
|
},
|
||||||
return Center(
|
emptyBuilder: widget.emptyBuilder ??
|
||||||
child: Text(
|
(context) {
|
||||||
'No chats here yet...',
|
return Center(
|
||||||
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
child: Text(
|
||||||
color: StreamChatTheme.of(context)
|
'No chats here yet...',
|
||||||
.colorTheme
|
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
||||||
.black
|
color: StreamChatTheme.of(context)
|
||||||
.withOpacity(.5)),
|
.colorTheme
|
||||||
),
|
.black
|
||||||
);
|
.withOpacity(.5)),
|
||||||
},
|
),
|
||||||
messageListBuilder: widget.messageListBuilder ?? (context, list) {
|
);
|
||||||
return _buildListView(list);
|
},
|
||||||
},
|
messageListBuilder: widget.messageListBuilder ??
|
||||||
|
(context, list) {
|
||||||
|
return _buildListView(list);
|
||||||
|
},
|
||||||
messageListController: _messageListController,
|
messageListController: _messageListController,
|
||||||
parentMessage: widget.parentMessage,
|
parentMessage: widget.parentMessage,
|
||||||
showScrollToBottom: widget.showScrollToBottom,
|
showScrollToBottom: widget.showScrollToBottom,
|
||||||
errorWidgetBuilder: widget.errorWidgetBuilder ?? (BuildContext context, Object error) {
|
errorWidgetBuilder: widget.errorWidgetBuilder ??
|
||||||
return Center(
|
(BuildContext context, Object error) {
|
||||||
child: Text(
|
return Center(
|
||||||
'Something went wrong',
|
child: Text(
|
||||||
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
'Something went wrong',
|
||||||
color: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
||||||
.colorTheme
|
color: StreamChatTheme.of(context)
|
||||||
.black
|
.colorTheme
|
||||||
.withOpacity(.5)),
|
.black
|
||||||
),
|
.withOpacity(.5)),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,94 +136,98 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
|||||||
paginationParams: widget.paginationParams,
|
paginationParams: widget.paginationParams,
|
||||||
messageFilters: widget.messageFilters,
|
messageFilters: widget.messageFilters,
|
||||||
messageSearchListController: _messageSearchListController,
|
messageSearchListController: _messageSearchListController,
|
||||||
emptyBuilder: widget.emptyBuilder ?? (context) {
|
emptyBuilder: widget.emptyBuilder ??
|
||||||
return LayoutBuilder(
|
(context) {
|
||||||
builder: (context, viewportConstraints) {
|
return LayoutBuilder(
|
||||||
return SingleChildScrollView(
|
builder: (context, viewportConstraints) {
|
||||||
physics: AlwaysScrollableScrollPhysics(),
|
return SingleChildScrollView(
|
||||||
child: ConstrainedBox(
|
physics: AlwaysScrollableScrollPhysics(),
|
||||||
constraints: BoxConstraints(
|
child: ConstrainedBox(
|
||||||
minHeight: viewportConstraints.maxHeight,
|
constraints: BoxConstraints(
|
||||||
),
|
minHeight: viewportConstraints.maxHeight,
|
||||||
child: Center(
|
),
|
||||||
child: Text('There are no messages currently'),
|
child: Center(
|
||||||
),
|
child: Text('There are no messages currently'),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
errorBuilder: widget.emptyBuilder ?? (BuildContext context, dynamic error) {
|
|
||||||
if (error is Error) {
|
|
||||||
print((error).stackTrace);
|
|
||||||
}
|
|
||||||
|
|
||||||
var message = error.toString();
|
|
||||||
if (error is DioError) {
|
|
||||||
if (error.type == DioErrorType.RESPONSE) {
|
|
||||||
message = error.message;
|
|
||||||
} else {
|
|
||||||
message = 'Check your connection and retry';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return InfoTile(
|
|
||||||
showMessage: widget.showErrorTile,
|
|
||||||
tileAnchor: Alignment.topCenter,
|
|
||||||
childAnchor: Alignment.topCenter,
|
|
||||||
message: 'An error occurred.',
|
|
||||||
child: Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
|
||||||
WidgetSpan(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 2.0),
|
|
||||||
child: Icon(Icons.error_outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(text: 'Error loading messages'),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
style: Theme.of(context).textTheme.headline6,
|
);
|
||||||
),
|
},
|
||||||
Padding(
|
);
|
||||||
padding: const EdgeInsets.only(top: 16.0),
|
},
|
||||||
child: Text(message),
|
errorBuilder: widget.emptyBuilder ??
|
||||||
),
|
(BuildContext context, dynamic error) {
|
||||||
RaisedButton(
|
if (error is Error) {
|
||||||
onPressed: () {
|
print((error).stackTrace);
|
||||||
_messageSearchListController.loadData();
|
}
|
||||||
},
|
|
||||||
child: Text('Retry'),
|
var message = error.toString();
|
||||||
),
|
if (error is DioError) {
|
||||||
],
|
if (error.type == DioErrorType.RESPONSE) {
|
||||||
),
|
message = error.message;
|
||||||
),
|
} else {
|
||||||
);
|
message = 'Check your connection and retry';
|
||||||
},
|
}
|
||||||
loadingBuilder: widget.loadingBuilder ?? (context) {
|
}
|
||||||
return LayoutBuilder(
|
return InfoTile(
|
||||||
builder: (context, viewportConstraints) {
|
showMessage: widget.showErrorTile,
|
||||||
return SingleChildScrollView(
|
tileAnchor: Alignment.topCenter,
|
||||||
physics: AlwaysScrollableScrollPhysics(),
|
childAnchor: Alignment.topCenter,
|
||||||
child: ConstrainedBox(
|
message: 'An error occurred.',
|
||||||
constraints: BoxConstraints(
|
child: Center(
|
||||||
minHeight: viewportConstraints.maxHeight,
|
child: Column(
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Center(
|
children: <Widget>[
|
||||||
child: CircularProgressIndicator(),
|
Text.rich(
|
||||||
|
TextSpan(
|
||||||
|
children: [
|
||||||
|
WidgetSpan(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 2.0),
|
||||||
|
child: Icon(Icons.error_outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(text: 'Error loading messages'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
style: Theme.of(context).textTheme.headline6,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 16.0),
|
||||||
|
child: Text(message),
|
||||||
|
),
|
||||||
|
RaisedButton(
|
||||||
|
onPressed: () {
|
||||||
|
_messageSearchListController.loadData();
|
||||||
|
},
|
||||||
|
child: Text('Retry'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
loadingBuilder: widget.loadingBuilder ??
|
||||||
},
|
(context) {
|
||||||
childBuilder: widget.childBuilder ?? (list) {
|
return LayoutBuilder(
|
||||||
return _buildListView(list);
|
builder: (context, viewportConstraints) {
|
||||||
},
|
return SingleChildScrollView(
|
||||||
|
physics: AlwaysScrollableScrollPhysics(),
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: viewportConstraints.maxHeight,
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
childBuilder: widget.childBuilder ??
|
||||||
|
(list) {
|
||||||
|
return _buildListView(list);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,32 +151,36 @@ class _UserListViewState extends State<UserListView>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var child = UserListCore(
|
var child = UserListCore(
|
||||||
errorBuilder: widget.errorBuilder ?? (err) {
|
errorBuilder: widget.errorBuilder ??
|
||||||
return _buildError(err);
|
(err) {
|
||||||
},
|
return _buildError(err);
|
||||||
emptyBuilder: widget.emptyBuilder ?? (context) {
|
},
|
||||||
return _buildEmpty();
|
emptyBuilder: widget.emptyBuilder ??
|
||||||
},
|
(context) {
|
||||||
loadingBuilder: widget.loadingBuilder ?? (context) {
|
return _buildEmpty();
|
||||||
return LayoutBuilder(
|
},
|
||||||
builder: (context, viewportConstraints) {
|
loadingBuilder: widget.loadingBuilder ??
|
||||||
return SingleChildScrollView(
|
(context) {
|
||||||
physics: AlwaysScrollableScrollPhysics(),
|
return LayoutBuilder(
|
||||||
child: ConstrainedBox(
|
builder: (context, viewportConstraints) {
|
||||||
constraints: BoxConstraints(
|
return SingleChildScrollView(
|
||||||
minHeight: viewportConstraints.maxHeight,
|
physics: AlwaysScrollableScrollPhysics(),
|
||||||
),
|
child: ConstrainedBox(
|
||||||
child: Center(
|
constraints: BoxConstraints(
|
||||||
child: CircularProgressIndicator(),
|
minHeight: viewportConstraints.maxHeight,
|
||||||
),
|
),
|
||||||
),
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
listBuilder: widget.listBuilder ??
|
||||||
},
|
(context, list) {
|
||||||
listBuilder: widget.listBuilder ?? (context, list) {
|
return _buildListView(list);
|
||||||
return _buildListView(list);
|
},
|
||||||
},
|
|
||||||
pagination: widget.pagination,
|
pagination: widget.pagination,
|
||||||
options: widget.options,
|
options: widget.options,
|
||||||
sort: widget.sort,
|
sort: widget.sort,
|
||||||
|
|||||||
Reference in New Issue
Block a user