Skip to content

Commit

Permalink
fix: Show a tile with progress and error indicators to keep look cons…
Browse files Browse the repository at this point in the history
…istent
  • Loading branch information
rlperez committed Apr 22, 2022
1 parent 2bde186 commit b0c9b22
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/traits/slim/base_slim_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ class BaseSlimWidget extends StatelessWidget with ToastNotifications {
@override
Widget build(BuildContext context) {
if ((provider?.isLoading ?? false)) {
return CircularProgressIndicator();
return ListTile(
tileColor: backgroundColor,
title: CircularProgressIndicator(),
horizontalTitleGap: 16.0,
key: key,
);
} else if (provider?.isInErrorState ?? false) {
showToast(
context, provider?.getErrorMessage ?? 'An unknown error occurred');
return Icon(Icons.error);
return ListTile(
tileColor: backgroundColor,
title: Icon(Icons.error),
horizontalTitleGap: 16.0,
key: key,
);
} else {
return Column(
children: <Widget>[
Expand Down

0 comments on commit b0c9b22

Please sign in to comment.