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
Jonatas Borges
2021-03-03 17:43:13 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
84fb10e6f39e49dba266a47841d4a26962d20771
84fb10e6
1 parent
4141e290
added append to stateMixin
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
View file @
84fb10e
...
...
@@ -62,6 +62,15 @@ mixin StateMixin<T> on ListNotifier {
refresh
();
}
}
void
append
(
Future
<
T
>
Function
()
body
(),
{
String
errorMessage
})
{
final
compute
=
body
();
compute
().
then
((
newValue
)
{
change
(
newValue
,
status:
RxStatus
.
success
());
},
onError:
(
err
)
{
change
(
state
,
status:
RxStatus
.
error
(
errorMessage
??
err
.
toString
()));
});
}
}
class
Value
<
T
>
extends
ListNotifier
...
...
Please
register
or
login
to post a comment