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
Jonny Borges
2023-11-02 03:43:13 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2023-11-02 03:43:13 -0300
Commit
499b4a2be24a3cc6c19845573b56e37f66f33ca4
499b4a2b
2 parents
359e831f
ce6d4efe
Merge pull request #2942 from MuhammamdArslanKhan/format-files
style: format code
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 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 @
499b4a2
...
...
@@ -247,10 +247,15 @@ typedef NotifierBuilder<T> = Widget Function(T state);
abstract
class
GetStatus
<
T
>
with
Equality
{
const
GetStatus
();
factory
GetStatus
.
loading
()
=>
LoadingStatus
<
T
>();
factory
GetStatus
.
error
(
String
message
)
=>
ErrorStatus
<
T
,
String
>(
message
);
factory
GetStatus
.
empty
()
=>
EmptyStatus
<
T
>();
factory
GetStatus
.
success
(
T
data
)
=>
SuccessStatus
<
T
>(
data
);
factory
GetStatus
.
custom
()
=>
CustomStatus
<
T
>();
}
...
...
@@ -266,6 +271,7 @@ class LoadingStatus<T> extends GetStatus<T> {
class
SuccessStatus
<
T
>
extends
GetStatus
<
T
>
{
final
T
data
;
const
SuccessStatus
(
this
.
data
);
@override
...
...
@@ -274,6 +280,7 @@ class SuccessStatus<T> extends GetStatus<T> {
class
ErrorStatus
<
T
,
S
>
extends
GetStatus
<
T
>
{
final
S
?
error
;
const
ErrorStatus
([
this
.
error
]);
@override
...
...
@@ -287,10 +294,15 @@ class EmptyStatus<T> extends GetStatus<T> {
extension
StatusDataExt
<
T
>
on
GetStatus
<
T
>
{
bool
get
isLoading
=>
this
is
LoadingStatus
;
bool
get
isSuccess
=>
this
is
SuccessStatus
;
bool
get
isError
=>
this
is
ErrorStatus
;
bool
get
isEmpty
=>
this
is
EmptyStatus
;
bool
get
isCustom
=>
!
isLoading
&&
!
isSuccess
&&
!
isError
&&
!
isEmpty
;
String
get
errorMessage
{
final
isError
=
this
is
ErrorStatus
;
if
(
isError
)
{
...
...
Please
register
or
login
to post a comment