Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Eduardo Florence
2020-10-27 10:54:24 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0339f0926a4c3305a6fa7309d1333836a8f70b0e
0339f092
1 parent
423cba28
Provide error for StateMixin obx widget
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
View file @
0339f09
...
...
@@ -122,13 +122,15 @@ abstract class GetNotifier<T> extends Value<T> with GetLifeCycleBase {
}
extension
StateExt
<
T
>
on
StateMixin
<
T
>
{
Widget
obx
(
NotifierBuilder
<
T
>
widget
,
{
Widget
onError
,
Widget
onLoading
})
{
Widget
obx
(
NotifierBuilder
<
T
>
widget
,
{
Widget
Function
(
String
error
)
onError
,
Widget
onLoading
})
{
assert
(
widget
!=
null
);
return
SimpleBuilder
(
builder:
(
_
)
{
if
(
status
.
isLoading
)
{
return
onLoading
??
CircularProgressIndicator
();
}
else
if
(
status
.
isError
)
{
return
onError
??
Text
(
'A error occured:
${status.errorMessage}
'
);
return
onError
!=
null
?
onError
(
status
.
errorMessage
)
:
Text
(
'A error occured:
${status.errorMessage}
'
);
}
else
{
return
widget
(
value
);
}
...
...
Please
register
or
login
to post a comment