Showing
1 changed file
with
2 additions
and
2 deletions
@@ -94,13 +94,13 @@ abstract class GetNotifier<T> extends Value<T> with GetLifeCycle { | @@ -94,13 +94,13 @@ abstract class GetNotifier<T> extends Value<T> with GetLifeCycle { | ||
94 | } | 94 | } |
95 | 95 | ||
96 | Widget call(NotifierBuilder<T> widget, {Widget onError, Widget onLoading}) { | 96 | Widget call(NotifierBuilder<T> widget, {Widget onError, Widget onLoading}) { |
97 | + assert(widget != null); | ||
97 | return SimpleBuilder(builder: (_) { | 98 | return SimpleBuilder(builder: (_) { |
98 | if (status.isLoading) { | 99 | if (status.isLoading) { |
99 | return onLoading ?? CircularProgressIndicator(); | 100 | return onLoading ?? CircularProgressIndicator(); |
100 | } else if (status.isError) { | 101 | } else if (status.isError) { |
101 | - return onError ?? Text('A error occured'); | 102 | + return onError ?? Text('A error occured: ${status.errorMessage}'); |
102 | } else { | 103 | } else { |
103 | - if (widget == null) throw 'Widget cannot be null'; | ||
104 | return widget(value); | 104 | return widget(value); |
105 | } | 105 | } |
106 | }); | 106 | }); |
-
Please register or login to post a comment