Jonny Borges

solving dart migrate errors pt 2

... ... @@ -14,12 +14,14 @@ class GetCupertinoApp extends StatelessWidget {
this.theme,
this.navigatorKey,
this.home,
Map<String, Widget Function(BuildContext)> this.routes = const <String, WidgetBuilder>{},
Map<String, Widget Function(BuildContext)> this.routes =
const <String, WidgetBuilder>{},
this.initialRoute,
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
List<NavigatorObserver> this.navigatorObservers = const <NavigatorObserver>[],
List<NavigatorObserver> this.navigatorObservers =
const <NavigatorObserver>[],
this.builder,
this.translationsKeys,
this.translations,
... ... @@ -58,15 +60,7 @@ class GetCupertinoApp extends StatelessWidget {
this.highContrastTheme,
this.highContrastDarkTheme,
this.actions,
}) : assert(routes != null),
assert(navigatorObservers != null),
assert(title != null),
assert(showPerformanceOverlay != null),
assert(checkerboardRasterCacheImages != null),
assert(checkerboardOffscreenLayers != null),
assert(showSemanticsDebugger != null),
assert(debugShowCheckedModeBanner != null),
routeInformationProvider = null,
}) : routeInformationProvider = null,
routeInformationParser = null,
routerDelegate = null,
backButtonDispatcher = null,
... ... @@ -103,7 +97,7 @@ class GetCupertinoApp extends StatelessWidget {
final ThemeData? highContrastTheme;
final ThemeData? highContrastDarkTheme;
final Map<Type, Action<Intent>>? actions;
final Function(Routing)? routingCallback;
final Function(Routing?)? routingCallback;
final Transition? defaultTransition;
final bool? opaqueRoute;
final VoidCallback? onInit;
... ... @@ -169,15 +163,7 @@ class GetCupertinoApp extends StatelessWidget {
this.defaultGlobalState,
this.getPages,
this.unknownRoute,
}) : assert(routeInformationParser != null),
assert(routerDelegate != null),
assert(title != null),
assert(showPerformanceOverlay != null),
assert(checkerboardRasterCacheImages != null),
assert(checkerboardOffscreenLayers != null),
assert(showSemanticsDebugger != null),
assert(debugShowCheckedModeBanner != null),
navigatorObservers = null,
}) : navigatorObservers = null,
navigatorKey = null,
onGenerateRoute = null,
home = null,
... ... @@ -248,21 +234,19 @@ class GetCupertinoApp extends StatelessWidget {
child: builder == null ? child! : builder!(context, child),
);
},
title: title ?? '',
title: title,
onGenerateTitle: onGenerateTitle,
color: color,
locale: Get.locale ?? locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales:
supportedLocales ?? const <Locale>[Locale('en', 'US')],
showPerformanceOverlay: showPerformanceOverlay ?? false,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages ?? false,
checkerboardOffscreenLayers: checkerboardOffscreenLayers ?? false,
showSemanticsDebugger: showSemanticsDebugger ?? false,
debugShowCheckedModeBanner: debugShowCheckedModeBanner ?? true,
supportedLocales: supportedLocales,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
)
: CupertinoApp(
... ... @@ -295,21 +279,19 @@ class GetCupertinoApp extends StatelessWidget {
child: builder == null ? child! : builder!(context, child),
);
},
title: title ?? '',
title: title,
onGenerateTitle: onGenerateTitle,
color: color,
locale: Get.locale ?? locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales:
supportedLocales ?? const <Locale>[Locale('en', 'US')],
showPerformanceOverlay: showPerformanceOverlay ?? false,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages ?? false,
checkerboardOffscreenLayers: checkerboardOffscreenLayers ?? false,
showSemanticsDebugger: showSemanticsDebugger ?? false,
debugShowCheckedModeBanner: debugShowCheckedModeBanner ?? true,
supportedLocales: supportedLocales,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
// actions: actions,
));
... ...
... ... @@ -13,12 +13,14 @@ class GetMaterialApp extends StatelessWidget {
Key? key,
this.navigatorKey,
this.home,
Map<String, Widget Function(BuildContext)> this.routes = const <String, WidgetBuilder>{},
Map<String, Widget Function(BuildContext)> this.routes =
const <String, WidgetBuilder>{},
this.initialRoute,
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
List<NavigatorObserver> this.navigatorObservers = const <NavigatorObserver>[],
List<NavigatorObserver> this.navigatorObservers =
const <NavigatorObserver>[],
this.builder,
this.textDirection,
this.title = '',
... ... @@ -61,16 +63,7 @@ class GetMaterialApp extends StatelessWidget {
this.highContrastTheme,
this.highContrastDarkTheme,
this.actions,
}) : assert(routes != null),
assert(navigatorObservers != null),
assert(title != null),
assert(debugShowMaterialGrid != null),
assert(showPerformanceOverlay != null),
assert(checkerboardRasterCacheImages != null),
assert(checkerboardOffscreenLayers != null),
assert(showSemanticsDebugger != null),
assert(debugShowCheckedModeBanner != null),
routeInformationProvider = null,
}) : routeInformationProvider = null,
routeInformationParser = null,
routerDelegate = null,
backButtonDispatcher = null,
... ... @@ -111,7 +104,7 @@ class GetMaterialApp extends StatelessWidget {
final ThemeData? highContrastDarkTheme;
final Map<Type, Action<Intent>>? actions;
final bool debugShowMaterialGrid;
final ValueChanged<Routing>? routingCallback;
final ValueChanged<Routing?>? routingCallback;
final Transition? defaultTransition;
final bool? opaqueRoute;
final VoidCallback? onInit;
... ... @@ -179,16 +172,7 @@ class GetMaterialApp extends StatelessWidget {
this.defaultGlobalState,
this.getPages,
this.unknownRoute,
}) : assert(routeInformationParser != null),
assert(routerDelegate != null),
assert(title != null),
assert(debugShowMaterialGrid != null),
assert(showPerformanceOverlay != null),
assert(checkerboardRasterCacheImages != null),
assert(checkerboardOffscreenLayers != null),
assert(showSemanticsDebugger != null),
assert(debugShowCheckedModeBanner != null),
navigatorObservers = null,
}) : navigatorObservers = null,
navigatorKey = null,
onGenerateRoute = null,
home = null,
... ... @@ -257,25 +241,23 @@ class GetMaterialApp extends StatelessWidget {
child: builder == null ? child! : builder!(context, child),
);
},
title: title ?? '',
title: title,
onGenerateTitle: onGenerateTitle,
color: color,
theme: _.theme ?? theme ?? ThemeData.fallback(),
darkTheme: darkTheme,
themeMode: _.themeMode ?? themeMode ?? ThemeMode.system,
themeMode: _.themeMode ?? themeMode,
locale: Get.locale ?? locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales:
supportedLocales ?? const <Locale>[Locale('en', 'US')],
debugShowMaterialGrid: debugShowMaterialGrid ?? false,
showPerformanceOverlay: showPerformanceOverlay ?? false,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages ?? false,
checkerboardOffscreenLayers: checkerboardOffscreenLayers ?? false,
showSemanticsDebugger: showSemanticsDebugger ?? false,
debugShowCheckedModeBanner: debugShowCheckedModeBanner ?? true,
supportedLocales: supportedLocales,
debugShowMaterialGrid: debugShowMaterialGrid,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
)
: MaterialApp(
... ... @@ -307,25 +289,23 @@ class GetMaterialApp extends StatelessWidget {
child: builder == null ? child! : builder!(context, child),
);
},
title: title ?? '',
title: title,
onGenerateTitle: onGenerateTitle,
color: color,
theme: _.theme ?? theme ?? ThemeData.fallback(),
darkTheme: darkTheme,
themeMode: _.themeMode ?? themeMode ?? ThemeMode.system,
themeMode: _.themeMode ?? themeMode,
locale: Get.locale ?? locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales:
supportedLocales ?? const <Locale>[Locale('en', 'US')],
debugShowMaterialGrid: debugShowMaterialGrid ?? false,
showPerformanceOverlay: showPerformanceOverlay ?? false,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages ?? false,
checkerboardOffscreenLayers: checkerboardOffscreenLayers ?? false,
showSemanticsDebugger: showSemanticsDebugger ?? false,
debugShowCheckedModeBanner: debugShowCheckedModeBanner ?? true,
supportedLocales: supportedLocales,
debugShowMaterialGrid: debugShowMaterialGrid,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
// actions: actions,
));
... ...
import '../../../get_core/src/get_main.dart';
import 'package:collection/collection.dart' show IterableExtension;
import '../../../get_core/src/get_main.dart';
import '../../get_navigation.dart';
import '../routes/get_route.dart';
import 'package:collection/collection.dart' show IterableExtension;
class RouteDecoder {
final GetPage? route;
final Map<String?, String> parameters;
final Map<String, String?> parameters;
const RouteDecoder(this.route, this.parameters);
}
... ... @@ -16,10 +16,10 @@ class ParseRouteTree {
RouteDecoder matchRoute(String name) {
final uri = Uri.parse(name);
final route = _findRoute(uri.path);
final params = Map<String?, String>.from(uri.queryParameters);
final params = Map<String, String?>.from(uri.queryParameters);
if (route != null) {
final parsedParams = _parseParams(name, route.path);
if (parsedParams != null && parsedParams.isNotEmpty) {
if (parsedParams.isNotEmpty) {
params.addAll(parsedParams);
}
} else {
... ... @@ -95,13 +95,13 @@ class ParseRouteTree {
);
}
Map<String?, String> _parseParams(String path, PathDecoded routePath) {
final params = <String?, String>{};
Map<String, String?> _parseParams(String path, PathDecoded routePath) {
final params = <String, String?>{};
Match? paramsMatch = routePath.regex.firstMatch(path);
for (var i = 0; i < routePath.keys.length; i++) {
var param = Uri.decodeQueryComponent(paramsMatch![i + 1]!);
params[routePath.keys[i]] = param;
params[routePath.keys[i]!] = param;
}
return params;
}
... ...
... ... @@ -25,9 +25,9 @@ class GetMaterialController extends GetxController {
final routing = Routing();
Map<String?, String> parameters = {};
Map<String, String?> parameters = {};
ParseRouteTree? routeTree;
late ParseRouteTree routeTree;
CustomTransition? customTransition;
... ...
... ... @@ -493,11 +493,9 @@ class _CupertinoBackGestureDetectorState<T>
return -value;
case TextDirection.ltr:
return value;
default:
return value;
}
// FIXME: shouldn't we return a default here?
// or perhaps throw error
// ignore: avoid_returning_null
return null;
}
@override
... ... @@ -579,7 +577,8 @@ class _CupertinoBackGestureController<T> {
_kMaxDroppedSwipePageForwardAnimationTime,
0,
controller.value,
)!.floor(),
)!
.floor(),
_kMaxPageBackAnimationTime,
);
controller.animateTo(1.0,
... ... @@ -597,7 +596,8 @@ class _CupertinoBackGestureController<T> {
0,
_kMaxDroppedSwipePageForwardAnimationTime,
controller.value,
)!.floor();
)!
.floor();
controller.animateBack(
0.0,
duration: Duration(milliseconds: droppedPageBackAnimationTime),
... ...