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
2020-11-09 18:39:32 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
19b983f11197c0d26351fa743cdccdc3152ab6d4
19b983f1
2 parents
d860640f
f2841937
Merge branch 'master' of
https://github.com/jonataslaw/getx
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
.github/workflows/main.yml
lib/get_navigation/src/routes/observers/route_observer.dart
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
lib/get_utils/src/get_utils/get_utils.dart
.github/workflows/main.yml
View file @
19b983f
...
...
@@ -23,7 +23,7 @@ jobs:
# https://github.com/marketplace/actions/flutter-action
-
uses
:
subosito/flutter-action@v1
with
:
flutter-version
:
"
1.22.
2
"
flutter-version
:
"
1.22.
3
"
channel
:
"
stable"
-
run
:
flutter pub get
#- run: flutter analyze
...
...
lib/get_navigation/src/routes/observers/route_observer.dart
View file @
19b983f
...
...
@@ -127,14 +127,15 @@ class GetObserver extends NavigatorObserver {
@override
void
didPop
(
Route
route
,
Route
previousRoute
)
{
super
.
didPop
(
route
,
previousRoute
);
final
newRoute
=
_RouteData
.
ofRoute
(
route
);
if
(
newRoute
.
isSnackbar
)
{
Get
.
log
(
"CLOSE SNACKBAR
${newRoute.name}
"
);
}
else
if
(
newRoute
.
isBottomSheet
||
newRoute
.
isDialog
)
{
Get
.
log
(
"CLOSE
${newRoute.name}
"
);
}
else
if
(
newRoute
.
isGetPageRoute
)
{
Get
.
log
(
"CLOSE TO ROUTE
${newRoute.name}
"
);
final
currentRoute
=
_RouteData
.
ofRoute
(
route
);
final
newRoute
=
_RouteData
.
ofRoute
(
previousRoute
);
if
(
currentRoute
.
isSnackbar
)
{
Get
.
log
(
"CLOSE SNACKBAR
${currentRoute.name}
"
);
}
else
if
(
currentRoute
.
isBottomSheet
||
currentRoute
.
isDialog
)
{
Get
.
log
(
"CLOSE
${currentRoute.name}
"
);
}
else
if
(
currentRoute
.
isGetPageRoute
)
{
Get
.
log
(
"CLOSE TO ROUTE
${currentRoute.name}
"
);
}
Get
.
reference
=
newRoute
.
name
;
...
...
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
View file @
19b983f
...
...
@@ -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
);
}
...
...
lib/get_utils/src/get_utils/get_utils.dart
View file @
19b983f
...
...
@@ -94,6 +94,9 @@ class GetUtils {
/// Checks if string consist only Alphabet. (No Whitespace)
static
bool
isAlphabetOnly
(
String
s
)
=>
hasMatch
(
s
,
r'^[a-zA-Z]+$'
);
/// Checks if string contains at least one Capital Letter
static
bool
hasCapitalletter
(
String
s
)
=>
hasMatch
(
s
,
r'[A-Z]'
);
/// Checks if string is boolean.
static
bool
isBool
(
String
value
)
{
...
...
Please
register
or
login
to post a comment