Jonatas

Merge branch 'master' of https://github.com/jonataslaw/getx

... ... @@ -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
... ...
... ... @@ -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;
... ...
... ... @@ -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);
}
... ...
... ... @@ -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) {
... ...