Committed by
GitHub
Merge pull request #3095 from Aniketkhote/master
Showing
46 changed files
with
150 additions
and
178 deletions
@@ -23,7 +23,7 @@ jobs: | @@ -23,7 +23,7 @@ jobs: | ||
23 | # https://github.com/marketplace/actions/flutter-action | 23 | # https://github.com/marketplace/actions/flutter-action |
24 | - uses: subosito/flutter-action@v2 | 24 | - uses: subosito/flutter-action@v2 |
25 | with: | 25 | with: |
26 | - flutter-version: "3.19.3" | 26 | + flutter-version: "3.22.0" |
27 | channel: "stable" | 27 | channel: "stable" |
28 | - run: flutter pub get | 28 | - run: flutter pub get |
29 | #- run: flutter analyze | 29 | #- run: flutter analyze |
@@ -316,17 +316,20 @@ class GetConnect extends GetConnectInterface { | @@ -316,17 +316,20 @@ class GetConnect extends GetConnectInterface { | ||
316 | return GraphQLResponse<T>( | 316 | return GraphQLResponse<T>( |
317 | graphQLErrors: listError | 317 | graphQLErrors: listError |
318 | .map((e) => GraphQLError( | 318 | .map((e) => GraphQLError( |
319 | - code: (e['extensions'] != null ? e['extensions']['code'] ?? '' : '').toString(), | 319 | + code: (e['extensions'] != null |
320 | + ? e['extensions']['code'] ?? '' | ||
321 | + : '') | ||
322 | + .toString(), | ||
320 | message: (e['message'] ?? '').toString(), | 323 | message: (e['message'] ?? '').toString(), |
321 | )) | 324 | )) |
322 | .toList()); | 325 | .toList()); |
323 | } | 326 | } |
324 | return GraphQLResponse<T>.fromResponse(res); | 327 | return GraphQLResponse<T>.fromResponse(res); |
325 | - } on Exception catch (_) { | 328 | + } on Exception catch (err) { |
326 | return GraphQLResponse<T>(graphQLErrors: [ | 329 | return GraphQLResponse<T>(graphQLErrors: [ |
327 | GraphQLError( | 330 | GraphQLError( |
328 | code: null, | 331 | code: null, |
329 | - message: _.toString(), | 332 | + message: err.toString(), |
330 | ) | 333 | ) |
331 | ]); | 334 | ]); |
332 | } | 335 | } |
@@ -357,11 +360,11 @@ class GetConnect extends GetConnectInterface { | @@ -357,11 +360,11 @@ class GetConnect extends GetConnectInterface { | ||
357 | .toList()); | 360 | .toList()); |
358 | } | 361 | } |
359 | return GraphQLResponse<T>.fromResponse(res); | 362 | return GraphQLResponse<T>.fromResponse(res); |
360 | - } on Exception catch (_) { | 363 | + } on Exception catch (err) { |
361 | return GraphQLResponse<T>(graphQLErrors: [ | 364 | return GraphQLResponse<T>(graphQLErrors: [ |
362 | GraphQLError( | 365 | GraphQLError( |
363 | code: null, | 366 | code: null, |
364 | - message: _.toString(), | 367 | + message: err.toString(), |
365 | ) | 368 | ) |
366 | ]); | 369 | ]); |
367 | } | 370 | } |
@@ -8,7 +8,7 @@ import '../status/http_status.dart'; | @@ -8,7 +8,7 @@ import '../status/http_status.dart'; | ||
8 | class GraphQLResponse<T> extends Response<T> { | 8 | class GraphQLResponse<T> extends Response<T> { |
9 | final List<GraphQLError>? graphQLErrors; | 9 | final List<GraphQLError>? graphQLErrors; |
10 | 10 | ||
11 | - GraphQLResponse({T? body, this.graphQLErrors}) : super(body: body); | 11 | + GraphQLResponse({super.body, this.graphQLErrors}); |
12 | 12 | ||
13 | GraphQLResponse.fromResponse(Response res) | 13 | GraphQLResponse.fromResponse(Response res) |
14 | : graphQLErrors = null, | 14 | : graphQLErrors = null, |
@@ -3,7 +3,5 @@ import 'src/sockets_stub.dart' | @@ -3,7 +3,5 @@ import 'src/sockets_stub.dart' | ||
3 | if (dart.library.io) 'src/sockets_io.dart'; | 3 | if (dart.library.io) 'src/sockets_io.dart'; |
4 | 4 | ||
5 | class GetSocket extends BaseWebSocket { | 5 | class GetSocket extends BaseWebSocket { |
6 | - GetSocket(String url, | ||
7 | - {Duration ping = const Duration(seconds: 5), bool allowSelfSigned = true}) | ||
8 | - : super(url, ping: ping, allowSelfSigned: allowSelfSigned); | 6 | + GetSocket(super.url, {super.ping, super.allowSelfSigned}); |
9 | } | 7 | } |
@@ -18,11 +18,11 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> { | @@ -18,11 +18,11 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> { | ||
18 | this.isDismissible = true, | 18 | this.isDismissible = true, |
19 | this.enableDrag = true, | 19 | this.enableDrag = true, |
20 | required this.isScrollControlled, | 20 | required this.isScrollControlled, |
21 | - RouteSettings? settings, | 21 | + super.settings, |
22 | this.enterBottomSheetDuration = const Duration(milliseconds: 250), | 22 | this.enterBottomSheetDuration = const Duration(milliseconds: 250), |
23 | this.exitBottomSheetDuration = const Duration(milliseconds: 200), | 23 | this.exitBottomSheetDuration = const Duration(milliseconds: 200), |
24 | this.curve, | 24 | this.curve, |
25 | - }) : super(settings: settings) { | 25 | + }) { |
26 | RouterReportManager.instance.reportCurrentRoute(this); | 26 | RouterReportManager.instance.reportCurrentRoute(this); |
27 | } | 27 | } |
28 | final bool? isPersistent; | 28 | final bool? isPersistent; |
@@ -115,7 +115,7 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> { | @@ -115,7 +115,7 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> { | ||
115 | 115 | ||
116 | class _GetModalBottomSheet<T> extends StatefulWidget { | 116 | class _GetModalBottomSheet<T> extends StatefulWidget { |
117 | const _GetModalBottomSheet({ | 117 | const _GetModalBottomSheet({ |
118 | - Key? key, | 118 | + super.key, |
119 | this.route, | 119 | this.route, |
120 | this.backgroundColor, | 120 | this.backgroundColor, |
121 | this.elevation, | 121 | this.elevation, |
@@ -124,7 +124,7 @@ class _GetModalBottomSheet<T> extends StatefulWidget { | @@ -124,7 +124,7 @@ class _GetModalBottomSheet<T> extends StatefulWidget { | ||
124 | this.isScrollControlled = false, | 124 | this.isScrollControlled = false, |
125 | this.enableDrag = true, | 125 | this.enableDrag = true, |
126 | this.isPersistent = false, | 126 | this.isPersistent = false, |
127 | - }) : super(key: key); | 127 | + }); |
128 | final bool isPersistent; | 128 | final bool isPersistent; |
129 | final GetModalBottomSheetRoute<T>? route; | 129 | final GetModalBottomSheetRoute<T>? route; |
130 | final bool isScrollControlled; | 130 | final bool isScrollControlled; |
@@ -214,7 +214,7 @@ class _GetModalBottomSheetState<T> extends State<_GetModalBottomSheet<T>> { | @@ -214,7 +214,7 @@ class _GetModalBottomSheetState<T> extends State<_GetModalBottomSheet<T>> { | ||
214 | 214 | ||
215 | class _GetPerModalBottomSheet<T> extends StatefulWidget { | 215 | class _GetPerModalBottomSheet<T> extends StatefulWidget { |
216 | const _GetPerModalBottomSheet({ | 216 | const _GetPerModalBottomSheet({ |
217 | - Key? key, | 217 | + super.key, |
218 | this.route, | 218 | this.route, |
219 | this.isPersistent, | 219 | this.isPersistent, |
220 | this.backgroundColor, | 220 | this.backgroundColor, |
@@ -223,7 +223,7 @@ class _GetPerModalBottomSheet<T> extends StatefulWidget { | @@ -223,7 +223,7 @@ class _GetPerModalBottomSheet<T> extends StatefulWidget { | ||
223 | this.clipBehavior, | 223 | this.clipBehavior, |
224 | this.isScrollControlled = false, | 224 | this.isScrollControlled = false, |
225 | this.enableDrag = true, | 225 | this.enableDrag = true, |
226 | - }) : super(key: key); | 226 | + }); |
227 | final bool? isPersistent; | 227 | final bool? isPersistent; |
228 | final GetModalBottomSheetRoute<T>? route; | 228 | final GetModalBottomSheetRoute<T>? route; |
229 | final bool isScrollControlled; | 229 | final bool isScrollControlled; |
@@ -10,14 +10,13 @@ class GetDialogRoute<T> extends PopupRoute<T> { | @@ -10,14 +10,13 @@ class GetDialogRoute<T> extends PopupRoute<T> { | ||
10 | Color barrierColor = const Color(0x80000000), | 10 | Color barrierColor = const Color(0x80000000), |
11 | Duration transitionDuration = const Duration(milliseconds: 200), | 11 | Duration transitionDuration = const Duration(milliseconds: 200), |
12 | RouteTransitionsBuilder? transitionBuilder, | 12 | RouteTransitionsBuilder? transitionBuilder, |
13 | - RouteSettings? settings, | 13 | + super.settings, |
14 | }) : widget = pageBuilder, | 14 | }) : widget = pageBuilder, |
15 | _barrierDismissible = barrierDismissible, | 15 | _barrierDismissible = barrierDismissible, |
16 | _barrierLabel = barrierLabel, | 16 | _barrierLabel = barrierLabel, |
17 | _barrierColor = barrierColor, | 17 | _barrierColor = barrierColor, |
18 | _transitionDuration = transitionDuration, | 18 | _transitionDuration = transitionDuration, |
19 | - _transitionBuilder = transitionBuilder, | ||
20 | - super(settings: settings) { | 19 | + _transitionBuilder = transitionBuilder { |
21 | RouterReportManager.instance.reportCurrentRoute(this); | 20 | RouterReportManager.instance.reportCurrentRoute(this); |
22 | } | 21 | } |
23 | 22 | ||
@@ -68,6 +67,6 @@ class GetDialogRoute<T> extends PopupRoute<T> { | @@ -68,6 +67,6 @@ class GetDialogRoute<T> extends PopupRoute<T> { | ||
68 | ), | 67 | ), |
69 | child: child); | 68 | child: child); |
70 | } // Some default transition | 69 | } // Some default transition |
71 | - return _transitionBuilder!(context, animation, secondaryAnimation, child); | 70 | + return _transitionBuilder(context, animation, secondaryAnimation, child); |
72 | } | 71 | } |
73 | } | 72 | } |
@@ -171,7 +171,7 @@ extension ExtensionDialog on GetInterface { | @@ -171,7 +171,7 @@ extension ExtensionDialog on GetInterface { | ||
171 | List<Widget>? actions, | 171 | List<Widget>? actions, |
172 | 172 | ||
173 | // onWillPop Scope | 173 | // onWillPop Scope |
174 | - WillPopCallback? onWillPop, | 174 | + PopInvokedCallback? onWillPop, |
175 | 175 | ||
176 | // the navigator used to push the dialog | 176 | // the navigator used to push the dialog |
177 | GlobalKey<NavigatorState>? navigatorKey, | 177 | GlobalKey<NavigatorState>? navigatorKey, |
@@ -225,7 +225,7 @@ extension ExtensionDialog on GetInterface { | @@ -225,7 +225,7 @@ extension ExtensionDialog on GetInterface { | ||
225 | child: Text( | 225 | child: Text( |
226 | textConfirm ?? "Ok", | 226 | textConfirm ?? "Ok", |
227 | style: TextStyle( | 227 | style: TextStyle( |
228 | - color: confirmTextColor ?? theme.colorScheme.background), | 228 | + color: confirmTextColor ?? theme.colorScheme.surface), |
229 | ), | 229 | ), |
230 | onPressed: () { | 230 | onPressed: () { |
231 | onConfirm?.call(); | 231 | onConfirm?.call(); |
@@ -267,8 +267,8 @@ extension ExtensionDialog on GetInterface { | @@ -267,8 +267,8 @@ extension ExtensionDialog on GetInterface { | ||
267 | 267 | ||
268 | return dialog<T>( | 268 | return dialog<T>( |
269 | onWillPop != null | 269 | onWillPop != null |
270 | - ? WillPopScope( | ||
271 | - onWillPop: onWillPop, | 270 | + ? PopScope( |
271 | + onPopInvoked: onWillPop, | ||
272 | child: baseAlertDialog, | 272 | child: baseAlertDialog, |
273 | ) | 273 | ) |
274 | : baseAlertDialog, | 274 | : baseAlertDialog, |
@@ -1283,7 +1283,7 @@ extension GetNavigationExt on GetInterface { | @@ -1283,7 +1283,7 @@ extension GetNavigationExt on GetInterface { | ||
1283 | 1283 | ||
1284 | /// Check if dark mode theme is enable on platform on android Q+ | 1284 | /// Check if dark mode theme is enable on platform on android Q+ |
1285 | bool get isPlatformDarkMode => | 1285 | bool get isPlatformDarkMode => |
1286 | - (ui.window.platformBrightness == Brightness.dark); | 1286 | + (ui.PlatformDispatcher.instance.platformBrightness == Brightness.dark); |
1287 | 1287 | ||
1288 | /// give access to Theme.of(context).iconTheme.color | 1288 | /// give access to Theme.of(context).iconTheme.color |
1289 | Color? get iconColor => theme.iconTheme.color; | 1289 | Color? get iconColor => theme.iconTheme.color; |
@@ -67,7 +67,7 @@ class GetCupertinoApp extends StatelessWidget { | @@ -67,7 +67,7 @@ class GetCupertinoApp extends StatelessWidget { | ||
67 | final ScrollBehavior? scrollBehavior; | 67 | final ScrollBehavior? scrollBehavior; |
68 | 68 | ||
69 | const GetCupertinoApp({ | 69 | const GetCupertinoApp({ |
70 | - Key? key, | 70 | + super.key, |
71 | this.theme, | 71 | this.theme, |
72 | this.navigatorKey, | 72 | this.navigatorKey, |
73 | this.home, | 73 | this.home, |
@@ -124,11 +124,10 @@ class GetCupertinoApp extends StatelessWidget { | @@ -124,11 +124,10 @@ class GetCupertinoApp extends StatelessWidget { | ||
124 | backButtonDispatcher = null, | 124 | backButtonDispatcher = null, |
125 | routeInformationParser = null, | 125 | routeInformationParser = null, |
126 | routerDelegate = null, | 126 | routerDelegate = null, |
127 | - routerConfig = null, | ||
128 | - super(key: key); | 127 | + routerConfig = null; |
129 | 128 | ||
130 | const GetCupertinoApp.router({ | 129 | const GetCupertinoApp.router({ |
131 | - Key? key, | 130 | + super.key, |
132 | this.theme, | 131 | this.theme, |
133 | this.routeInformationProvider, | 132 | this.routeInformationProvider, |
134 | this.routeInformationParser, | 133 | this.routeInformationParser, |
@@ -183,8 +182,7 @@ class GetCupertinoApp extends StatelessWidget { | @@ -183,8 +182,7 @@ class GetCupertinoApp extends StatelessWidget { | ||
183 | onGenerateInitialRoutes = null, | 182 | onGenerateInitialRoutes = null, |
184 | onUnknownRoute = null, | 183 | onUnknownRoute = null, |
185 | routes = null, | 184 | routes = null, |
186 | - initialRoute = null, | ||
187 | - super(key: key); | 185 | + initialRoute = null; |
188 | 186 | ||
189 | @override | 187 | @override |
190 | Widget build(BuildContext context) { | 188 | Widget build(BuildContext context) { |
@@ -68,7 +68,7 @@ class GetMaterialApp extends StatelessWidget { | @@ -68,7 +68,7 @@ class GetMaterialApp extends StatelessWidget { | ||
68 | final bool useInheritedMediaQuery; | 68 | final bool useInheritedMediaQuery; |
69 | 69 | ||
70 | const GetMaterialApp({ | 70 | const GetMaterialApp({ |
71 | - Key? key, | 71 | + super.key, |
72 | this.navigatorKey, | 72 | this.navigatorKey, |
73 | this.scaffoldMessengerKey, | 73 | this.scaffoldMessengerKey, |
74 | this.home, | 74 | this.home, |
@@ -128,11 +128,10 @@ class GetMaterialApp extends StatelessWidget { | @@ -128,11 +128,10 @@ class GetMaterialApp extends StatelessWidget { | ||
128 | backButtonDispatcher = null, | 128 | backButtonDispatcher = null, |
129 | routeInformationParser = null, | 129 | routeInformationParser = null, |
130 | routerDelegate = null, | 130 | routerDelegate = null, |
131 | - routerConfig = null, | ||
132 | - super(key: key); | 131 | + routerConfig = null; |
133 | 132 | ||
134 | const GetMaterialApp.router({ | 133 | const GetMaterialApp.router({ |
135 | - Key? key, | 134 | + super.key, |
136 | this.routeInformationProvider, | 135 | this.routeInformationProvider, |
137 | this.scaffoldMessengerKey, | 136 | this.scaffoldMessengerKey, |
138 | this.routeInformationParser, | 137 | this.routeInformationParser, |
@@ -190,8 +189,7 @@ class GetMaterialApp extends StatelessWidget { | @@ -190,8 +189,7 @@ class GetMaterialApp extends StatelessWidget { | ||
190 | onGenerateInitialRoutes = null, | 189 | onGenerateInitialRoutes = null, |
191 | onUnknownRoute = null, | 190 | onUnknownRoute = null, |
192 | routes = null, | 191 | routes = null, |
193 | - initialRoute = null, | ||
194 | - super(key: key); | 192 | + initialRoute = null; |
195 | 193 | ||
196 | @override | 194 | @override |
197 | Widget build(BuildContext context) { | 195 | Widget build(BuildContext context) { |
@@ -278,10 +278,10 @@ class ConfigData { | @@ -278,10 +278,10 @@ class ConfigData { | ||
278 | 278 | ||
279 | class GetRoot extends StatefulWidget { | 279 | class GetRoot extends StatefulWidget { |
280 | const GetRoot({ | 280 | const GetRoot({ |
281 | - Key? key, | 281 | + super.key, |
282 | required this.config, | 282 | required this.config, |
283 | required this.child, | 283 | required this.child, |
284 | - }) : super(key: key); | 284 | + }); |
285 | final ConfigData config; | 285 | final ConfigData config; |
286 | final Widget child; | 286 | final Widget child; |
287 | @override | 287 | @override |
@@ -39,7 +39,7 @@ class GetPageRoute<T> extends PageRoute<T> | @@ -39,7 +39,7 @@ class GetPageRoute<T> extends PageRoute<T> | ||
39 | /// The [builder], [maintainState], and [fullscreenDialog] arguments must not | 39 | /// The [builder], [maintainState], and [fullscreenDialog] arguments must not |
40 | /// be null. | 40 | /// be null. |
41 | GetPageRoute({ | 41 | GetPageRoute({ |
42 | - RouteSettings? settings, | 42 | + super.settings, |
43 | this.transitionDuration = const Duration(milliseconds: 300), | 43 | this.transitionDuration = const Duration(milliseconds: 300), |
44 | this.reverseTransitionDuration = const Duration(milliseconds: 300), | 44 | this.reverseTransitionDuration = const Duration(milliseconds: 300), |
45 | this.opaque = true, | 45 | this.opaque = true, |
@@ -61,13 +61,9 @@ class GetPageRoute<T> extends PageRoute<T> | @@ -61,13 +61,9 @@ class GetPageRoute<T> extends PageRoute<T> | ||
61 | this.showCupertinoParallax = true, | 61 | this.showCupertinoParallax = true, |
62 | this.barrierLabel, | 62 | this.barrierLabel, |
63 | this.maintainState = true, | 63 | this.maintainState = true, |
64 | - bool fullscreenDialog = false, | 64 | + super.fullscreenDialog, |
65 | this.middlewares, | 65 | this.middlewares, |
66 | - }) : bindings = (binding == null) ? bindings : [...bindings, binding], | ||
67 | - super( | ||
68 | - settings: settings, | ||
69 | - fullscreenDialog: fullscreenDialog, | ||
70 | - ); | 66 | + }) : bindings = (binding == null) ? bindings : [...bindings, binding]; |
71 | 67 | ||
72 | @override | 68 | @override |
73 | final Duration transitionDuration; | 69 | final Duration transitionDuration; |
@@ -4,18 +4,16 @@ import '../../../get.dart'; | @@ -4,18 +4,16 @@ import '../../../get.dart'; | ||
4 | 4 | ||
5 | class GetNavigator extends Navigator { | 5 | class GetNavigator extends Navigator { |
6 | GetNavigator.onGenerateRoute({ | 6 | GetNavigator.onGenerateRoute({ |
7 | - GlobalKey<NavigatorState>? key, | 7 | + GlobalKey<NavigatorState>? super.key, |
8 | bool Function(Route<dynamic>, dynamic)? onPopPage, | 8 | bool Function(Route<dynamic>, dynamic)? onPopPage, |
9 | - required List<GetPage> pages, | 9 | + required List<GetPage> super.pages, |
10 | List<NavigatorObserver>? observers, | 10 | List<NavigatorObserver>? observers, |
11 | - bool reportsRouteUpdateToEngine = false, | 11 | + super.reportsRouteUpdateToEngine, |
12 | TransitionDelegate? transitionDelegate, | 12 | TransitionDelegate? transitionDelegate, |
13 | - String? initialRoute, | ||
14 | - String? restorationScopeId, | 13 | + super.initialRoute, |
14 | + super.restorationScopeId, | ||
15 | }) : super( | 15 | }) : super( |
16 | //keys should be optional | 16 | //keys should be optional |
17 | - key: key, | ||
18 | - initialRoute: initialRoute, | ||
19 | onPopPage: onPopPage ?? | 17 | onPopPage: onPopPage ?? |
20 | (route, result) { | 18 | (route, result) { |
21 | final didPop = route.didPop(result); | 19 | final didPop = route.didPop(result); |
@@ -36,9 +34,6 @@ class GetNavigator extends Navigator { | @@ -36,9 +34,6 @@ class GetNavigator extends Navigator { | ||
36 | } | 34 | } |
37 | return null; | 35 | return null; |
38 | }, | 36 | }, |
39 | - reportsRouteUpdateToEngine: reportsRouteUpdateToEngine, | ||
40 | - restorationScopeId: restorationScopeId, | ||
41 | - pages: pages, | ||
42 | observers: [ | 37 | observers: [ |
43 | // GetObserver(), | 38 | // GetObserver(), |
44 | ...?observers, | 39 | ...?observers, |
@@ -48,18 +43,16 @@ class GetNavigator extends Navigator { | @@ -48,18 +43,16 @@ class GetNavigator extends Navigator { | ||
48 | ); | 43 | ); |
49 | 44 | ||
50 | GetNavigator({ | 45 | GetNavigator({ |
51 | - Key? key, | 46 | + super.key, |
52 | bool Function(Route<dynamic>, dynamic)? onPopPage, | 47 | bool Function(Route<dynamic>, dynamic)? onPopPage, |
53 | - required List<GetPage> pages, | 48 | + required List<GetPage> super.pages, |
54 | List<NavigatorObserver>? observers, | 49 | List<NavigatorObserver>? observers, |
55 | - bool reportsRouteUpdateToEngine = false, | 50 | + super.reportsRouteUpdateToEngine, |
56 | TransitionDelegate? transitionDelegate, | 51 | TransitionDelegate? transitionDelegate, |
57 | - String? initialRoute, | ||
58 | - String? restorationScopeId, | 52 | + super.initialRoute, |
53 | + super.restorationScopeId, | ||
59 | }) : super( | 54 | }) : super( |
60 | //keys should be optional | 55 | //keys should be optional |
61 | - key: key, | ||
62 | - initialRoute: initialRoute, | ||
63 | onPopPage: onPopPage ?? | 56 | onPopPage: onPopPage ?? |
64 | (route, result) { | 57 | (route, result) { |
65 | final didPop = route.didPop(result); | 58 | final didPop = route.didPop(result); |
@@ -68,9 +61,6 @@ class GetNavigator extends Navigator { | @@ -68,9 +61,6 @@ class GetNavigator extends Navigator { | ||
68 | } | 61 | } |
69 | return true; | 62 | return true; |
70 | }, | 63 | }, |
71 | - reportsRouteUpdateToEngine: reportsRouteUpdateToEngine, | ||
72 | - restorationScopeId: restorationScopeId, | ||
73 | - pages: pages, | ||
74 | observers: [ | 64 | observers: [ |
75 | // GetObserver(null, Get.routing), | 65 | // GetObserver(null, Get.routing), |
76 | HeroController(), | 66 | HeroController(), |
@@ -23,14 +23,14 @@ const int _kMaxPageBackAnimationTime = 300; // Milliseconds. | @@ -23,14 +23,14 @@ const int _kMaxPageBackAnimationTime = 300; // Milliseconds. | ||
23 | 23 | ||
24 | class GetBackGestureDetector<T> extends StatefulWidget { | 24 | class GetBackGestureDetector<T> extends StatefulWidget { |
25 | const GetBackGestureDetector({ | 25 | const GetBackGestureDetector({ |
26 | - Key? key, | 26 | + super.key, |
27 | required this.limitedSwipe, | 27 | required this.limitedSwipe, |
28 | required this.gestureWidth, | 28 | required this.gestureWidth, |
29 | required this.initialOffset, | 29 | required this.initialOffset, |
30 | required this.popGestureEnable, | 30 | required this.popGestureEnable, |
31 | required this.onStartPopGesture, | 31 | required this.onStartPopGesture, |
32 | required this.child, | 32 | required this.child, |
33 | - }) : super(key: key); | 33 | + }); |
34 | 34 | ||
35 | final bool limitedSwipe; | 35 | final bool limitedSwipe; |
36 | final double gestureWidth; | 36 | final double gestureWidth; |
@@ -370,8 +370,7 @@ Cannot read the previousTitle for a route that has not yet been installed''', | @@ -370,8 +370,7 @@ Cannot read the previousTitle for a route that has not yet been installed''', | ||
370 | // In the middle of a back gesture drag, let the transition be linear to | 370 | // In the middle of a back gesture drag, let the transition be linear to |
371 | // match finger motions. | 371 | // match finger motions. |
372 | final route = rawRoute as GetPageRoute<T>; | 372 | final route = rawRoute as GetPageRoute<T>; |
373 | - final linearTransition = | ||
374 | - CupertinoRouteTransitionMixin.isPopGestureInProgress(route); | 373 | + final linearTransition = route.popGestureInProgress; |
375 | final finalCurve = route.curve ?? Get.defaultTransitionCurve; | 374 | final finalCurve = route.curve ?? Get.defaultTransitionCurve; |
376 | final hasCurve = route.curve != null; | 375 | final hasCurve = route.curve != null; |
377 | if (route.fullscreenDialog && route.transition == null) { | 376 | if (route.fullscreenDialog && route.transition == null) { |
@@ -777,9 +776,6 @@ Cannot read the previousTitle for a route that has not yet been installed''', | @@ -777,9 +776,6 @@ Cannot read the previousTitle for a route that has not yet been installed''', | ||
777 | // would be really confusing (or would skip internal routes), | 776 | // would be really confusing (or would skip internal routes), |
778 | // so disallow it. | 777 | // so disallow it. |
779 | if (route.willHandlePopInternally) return false; | 778 | if (route.willHandlePopInternally) return false; |
780 | - // If attempts to dismiss this route might be vetoed such as in a page | ||
781 | - // with forms, then do not allow the user to dismiss the route with a swipe. | ||
782 | - if (route.hasScopedWillPopCallback) return false; | ||
783 | // support [PopScope] | 779 | // support [PopScope] |
784 | if (route.popDisposition == RoutePopDisposition.doNotPop) return false; | 780 | if (route.popDisposition == RoutePopDisposition.doNotPop) return false; |
785 | // Fullscreen dialogs aren't dismissible by back swipe. | 781 | // Fullscreen dialogs aren't dismissible by back swipe. |
@@ -826,8 +822,8 @@ class _DirectionalityDragGestureRecognizer | @@ -826,8 +822,8 @@ class _DirectionalityDragGestureRecognizer | ||
826 | required this.isLTR, | 822 | required this.isLTR, |
827 | required this.popGestureEnable, | 823 | required this.popGestureEnable, |
828 | required this.hasbackGestureController, | 824 | required this.hasbackGestureController, |
829 | - Object? debugOwner, | ||
830 | - }) : super(debugOwner: debugOwner); | 825 | + super.debugOwner, |
826 | + }); | ||
831 | 827 | ||
832 | @override | 828 | @override |
833 | void handleEvent(PointerEvent event) { | 829 | void handleEvent(PointerEvent event) { |
@@ -57,7 +57,7 @@ class Dependencies { | @@ -57,7 +57,7 @@ class Dependencies { | ||
57 | } | 57 | } |
58 | 58 | ||
59 | abstract class Module extends StatefulWidget { | 59 | abstract class Module extends StatefulWidget { |
60 | - const Module({Key? key}) : super(key: key); | 60 | + const Module({super.key}); |
61 | 61 | ||
62 | Widget view(BuildContext context); | 62 | Widget view(BuildContext context); |
63 | 63 |
@@ -4,7 +4,7 @@ import '../router_report.dart'; | @@ -4,7 +4,7 @@ import '../router_report.dart'; | ||
4 | import 'default_route.dart'; | 4 | import 'default_route.dart'; |
5 | 5 | ||
6 | class RouteReport extends StatefulWidget { | 6 | class RouteReport extends StatefulWidget { |
7 | - const RouteReport({Key? key, required this.builder}) : super(key: key); | 7 | + const RouteReport({super.key, required this.builder}); |
8 | final WidgetBuilder builder; | 8 | final WidgetBuilder builder; |
9 | 9 | ||
10 | @override | 10 | @override |
@@ -114,7 +114,7 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> { | @@ -114,7 +114,7 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> { | ||
114 | super.key, | 114 | super.key, |
115 | Widget Function(GetDelegate delegate)? emptyWidget, | 115 | Widget Function(GetDelegate delegate)? emptyWidget, |
116 | GetPage Function(GetDelegate delegate)? emptyPage, | 116 | GetPage Function(GetDelegate delegate)? emptyPage, |
117 | - required Iterable<GetPage> Function(RouteDecoder currentNavStack) pickPages, | 117 | + required super.pickPages, |
118 | bool Function(Route<dynamic>, dynamic)? onPopPage, | 118 | bool Function(Route<dynamic>, dynamic)? onPopPage, |
119 | String? restorationScopeId, | 119 | String? restorationScopeId, |
120 | GlobalKey<NavigatorState>? navigatorKey, | 120 | GlobalKey<NavigatorState>? navigatorKey, |
@@ -147,19 +147,15 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> { | @@ -147,19 +147,15 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> { | ||
147 | } | 147 | } |
148 | return (emptyWidget?.call(rDelegate) ?? const SizedBox.shrink()); | 148 | return (emptyWidget?.call(rDelegate) ?? const SizedBox.shrink()); |
149 | }, | 149 | }, |
150 | - pickPages: pickPages, | ||
151 | delegate: delegate ?? Get.rootController.rootDelegate, | 150 | delegate: delegate ?? Get.rootController.rootDelegate, |
152 | ); | 151 | ); |
153 | 152 | ||
154 | GetRouterOutlet.builder({ | 153 | GetRouterOutlet.builder({ |
155 | super.key, | 154 | super.key, |
156 | - required Widget Function( | ||
157 | - BuildContext context, | ||
158 | - ) builder, | 155 | + required super.builder, |
159 | String? route, | 156 | String? route, |
160 | GetDelegate? routerDelegate, | 157 | GetDelegate? routerDelegate, |
161 | }) : super.builder( | 158 | }) : super.builder( |
162 | - builder: builder, | ||
163 | delegate: routerDelegate ?? | 159 | delegate: routerDelegate ?? |
164 | (route != null | 160 | (route != null |
165 | ? Get.nestedKey(route) | 161 | ? Get.nestedKey(route) |
@@ -213,10 +209,10 @@ typedef NavigatorItemBuilderBuilder = Widget Function( | @@ -213,10 +209,10 @@ typedef NavigatorItemBuilderBuilder = Widget Function( | ||
213 | 209 | ||
214 | class IndexedRouteBuilder<T> extends StatelessWidget { | 210 | class IndexedRouteBuilder<T> extends StatelessWidget { |
215 | const IndexedRouteBuilder({ | 211 | const IndexedRouteBuilder({ |
216 | - Key? key, | 212 | + super.key, |
217 | required this.builder, | 213 | required this.builder, |
218 | required this.routes, | 214 | required this.routes, |
219 | - }) : super(key: key); | 215 | + }); |
220 | final List<String> routes; | 216 | final List<String> routes; |
221 | final NavigatorItemBuilderBuilder builder; | 217 | final NavigatorItemBuilderBuilder builder; |
222 | 218 | ||
@@ -269,8 +265,8 @@ mixin RouterListenerMixin<T extends StatefulWidget> on State<T> { | @@ -269,8 +265,8 @@ mixin RouterListenerMixin<T extends StatefulWidget> on State<T> { | ||
269 | class RouterListenerInherited extends InheritedWidget { | 265 | class RouterListenerInherited extends InheritedWidget { |
270 | const RouterListenerInherited({ | 266 | const RouterListenerInherited({ |
271 | super.key, | 267 | super.key, |
272 | - required Widget child, | ||
273 | - }) : super(child: child); | 268 | + required super.child, |
269 | + }); | ||
274 | 270 | ||
275 | static RouterListenerInherited? of(BuildContext context) { | 271 | static RouterListenerInherited? of(BuildContext context) { |
276 | return context | 272 | return context |
@@ -285,9 +281,9 @@ class RouterListenerInherited extends InheritedWidget { | @@ -285,9 +281,9 @@ class RouterListenerInherited extends InheritedWidget { | ||
285 | 281 | ||
286 | class RouterListener extends StatefulWidget { | 282 | class RouterListener extends StatefulWidget { |
287 | const RouterListener({ | 283 | const RouterListener({ |
288 | - Key? key, | 284 | + super.key, |
289 | required this.builder, | 285 | required this.builder, |
290 | - }) : super(key: key); | 286 | + }); |
291 | final WidgetBuilder builder; | 287 | final WidgetBuilder builder; |
292 | 288 | ||
293 | @override | 289 | @override |
@@ -303,7 +299,7 @@ class RouteListenerState extends State<RouterListener> | @@ -303,7 +299,7 @@ class RouteListenerState extends State<RouterListener> | ||
303 | } | 299 | } |
304 | 300 | ||
305 | class BackButtonCallback extends StatefulWidget { | 301 | class BackButtonCallback extends StatefulWidget { |
306 | - const BackButtonCallback({Key? key, required this.builder}) : super(key: key); | 302 | + const BackButtonCallback({super.key, required this.builder}); |
307 | final WidgetBuilder builder; | 303 | final WidgetBuilder builder; |
308 | 304 | ||
309 | @override | 305 | @override |
@@ -173,7 +173,7 @@ class GetSnackBar extends StatefulWidget { | @@ -173,7 +173,7 @@ class GetSnackBar extends StatefulWidget { | ||
173 | final Form? userInputForm; | 173 | final Form? userInputForm; |
174 | 174 | ||
175 | const GetSnackBar({ | 175 | const GetSnackBar({ |
176 | - Key? key, | 176 | + super.key, |
177 | this.title, | 177 | this.title, |
178 | this.message, | 178 | this.message, |
179 | this.titleText, | 179 | this.titleText, |
@@ -211,7 +211,7 @@ class GetSnackBar extends StatefulWidget { | @@ -211,7 +211,7 @@ class GetSnackBar extends StatefulWidget { | ||
211 | this.userInputForm, | 211 | this.userInputForm, |
212 | this.snackbarStatus, | 212 | this.snackbarStatus, |
213 | this.hitTestBehavior, | 213 | this.hitTestBehavior, |
214 | - }) : super(key: key); | 214 | + }); |
215 | 215 | ||
216 | @override | 216 | @override |
217 | State createState() => GetSnackBarState(); | 217 | State createState() => GetSnackBarState(); |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | /// global object that registers against `GetX` and `Obx`, and allows the | 3 | /// global object that registers against `GetX` and `Obx`, and allows the |
4 | /// reactivity | 4 | /// reactivity |
@@ -139,7 +139,7 @@ mixin RxObjectMixin<T> on GetListenable<T> { | @@ -139,7 +139,7 @@ mixin RxObjectMixin<T> on GetListenable<T> { | ||
139 | 139 | ||
140 | /// Base Rx class that manages all the stream logic for any Type. | 140 | /// Base Rx class that manages all the stream logic for any Type. |
141 | abstract class _RxImpl<T> extends GetListenable<T> with RxObjectMixin<T> { | 141 | abstract class _RxImpl<T> extends GetListenable<T> with RxObjectMixin<T> { |
142 | - _RxImpl(T initial) : super(initial); | 142 | + _RxImpl(super.initial); |
143 | 143 | ||
144 | void addError(Object error, [StackTrace? stackTrace]) { | 144 | void addError(Object error, [StackTrace? stackTrace]) { |
145 | subject.addError(error, stackTrace); | 145 | subject.addError(error, stackTrace); |
@@ -209,7 +209,7 @@ abstract class _RxImpl<T> extends GetListenable<T> with RxObjectMixin<T> { | @@ -209,7 +209,7 @@ abstract class _RxImpl<T> extends GetListenable<T> with RxObjectMixin<T> { | ||
209 | } | 209 | } |
210 | 210 | ||
211 | class RxBool extends Rx<bool> { | 211 | class RxBool extends Rx<bool> { |
212 | - RxBool(bool initial) : super(initial); | 212 | + RxBool(super.initial); |
213 | @override | 213 | @override |
214 | String toString() { | 214 | String toString() { |
215 | return value ? "true" : "false"; | 215 | return value ? "true" : "false"; |
@@ -217,7 +217,7 @@ class RxBool extends Rx<bool> { | @@ -217,7 +217,7 @@ class RxBool extends Rx<bool> { | ||
217 | } | 217 | } |
218 | 218 | ||
219 | class RxnBool extends Rx<bool?> { | 219 | class RxnBool extends Rx<bool?> { |
220 | - RxnBool([bool? initial]) : super(initial); | 220 | + RxnBool([super.initial]); |
221 | @override | 221 | @override |
222 | String toString() { | 222 | String toString() { |
223 | return "$value"; | 223 | return "$value"; |
@@ -282,7 +282,7 @@ extension RxnBoolExt on Rx<bool?> { | @@ -282,7 +282,7 @@ extension RxnBoolExt on Rx<bool?> { | ||
282 | /// For example, any custom "Model" class, like User().obs will use `Rx` as | 282 | /// For example, any custom "Model" class, like User().obs will use `Rx` as |
283 | /// wrapper. | 283 | /// wrapper. |
284 | class Rx<T> extends _RxImpl<T> { | 284 | class Rx<T> extends _RxImpl<T> { |
285 | - Rx(T initial) : super(initial); | 285 | + Rx(super.initial); |
286 | 286 | ||
287 | @override | 287 | @override |
288 | dynamic toJson() { | 288 | dynamic toJson() { |
@@ -295,7 +295,7 @@ class Rx<T> extends _RxImpl<T> { | @@ -295,7 +295,7 @@ class Rx<T> extends _RxImpl<T> { | ||
295 | } | 295 | } |
296 | 296 | ||
297 | class Rxn<T> extends Rx<T?> { | 297 | class Rxn<T> extends Rx<T?> { |
298 | - Rxn([T? initial]) : super(initial); | 298 | + Rxn([super.initial]); |
299 | 299 | ||
300 | @override | 300 | @override |
301 | dynamic toJson() { | 301 | dynamic toJson() { |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | extension RxNumExt<T extends num> on Rx<T> { | 3 | extension RxNumExt<T extends num> on Rx<T> { |
4 | /// Multiplication operator. | 4 | /// Multiplication operator. |
@@ -572,7 +572,7 @@ extension RxnNumExt<T extends num> on Rx<T?> { | @@ -572,7 +572,7 @@ extension RxnNumExt<T extends num> on Rx<T?> { | ||
572 | } | 572 | } |
573 | 573 | ||
574 | class RxNum extends Rx<num> { | 574 | class RxNum extends Rx<num> { |
575 | - RxNum(num initial) : super(initial); | 575 | + RxNum(super.initial); |
576 | 576 | ||
577 | num operator +(num other) { | 577 | num operator +(num other) { |
578 | value += other; | 578 | value += other; |
@@ -587,7 +587,7 @@ class RxNum extends Rx<num> { | @@ -587,7 +587,7 @@ class RxNum extends Rx<num> { | ||
587 | } | 587 | } |
588 | 588 | ||
589 | class RxnNum extends Rx<num?> { | 589 | class RxnNum extends Rx<num?> { |
590 | - RxnNum([num? initial]) : super(initial); | 590 | + RxnNum([super.initial]); |
591 | 591 | ||
592 | num? operator +(num other) { | 592 | num? operator +(num other) { |
593 | if (value != null) { | 593 | if (value != null) { |
@@ -857,15 +857,15 @@ extension RxnDoubleExt on Rx<double?> { | @@ -857,15 +857,15 @@ extension RxnDoubleExt on Rx<double?> { | ||
857 | } | 857 | } |
858 | 858 | ||
859 | class RxDouble extends Rx<double> { | 859 | class RxDouble extends Rx<double> { |
860 | - RxDouble(double initial) : super(initial); | 860 | + RxDouble(super.initial); |
861 | } | 861 | } |
862 | 862 | ||
863 | class RxnDouble extends Rx<double?> { | 863 | class RxnDouble extends Rx<double?> { |
864 | - RxnDouble([double? initial]) : super(initial); | 864 | + RxnDouble([super.initial]); |
865 | } | 865 | } |
866 | 866 | ||
867 | class RxInt extends Rx<int> { | 867 | class RxInt extends Rx<int> { |
868 | - RxInt(int initial) : super(initial); | 868 | + RxInt(super.initial); |
869 | 869 | ||
870 | /// Addition operator. | 870 | /// Addition operator. |
871 | RxInt operator +(int other) { | 871 | RxInt operator +(int other) { |
@@ -881,7 +881,7 @@ class RxInt extends Rx<int> { | @@ -881,7 +881,7 @@ class RxInt extends Rx<int> { | ||
881 | } | 881 | } |
882 | 882 | ||
883 | class RxnInt extends Rx<int?> { | 883 | class RxnInt extends Rx<int?> { |
884 | - RxnInt([int? initial]) : super(initial); | 884 | + RxnInt([super.initial]); |
885 | 885 | ||
886 | /// Addition operator. | 886 | /// Addition operator. |
887 | RxnInt operator +(int other) { | 887 | RxnInt operator +(int other) { |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | extension RxStringExt on Rx<String> { | 3 | extension RxStringExt on Rx<String> { |
4 | String operator +(String val) => value + val; | 4 | String operator +(String val) => value + val; |
@@ -250,7 +250,7 @@ extension RxnStringExt on Rx<String?> { | @@ -250,7 +250,7 @@ extension RxnStringExt on Rx<String?> { | ||
250 | 250 | ||
251 | /// Rx class for `String` Type. | 251 | /// Rx class for `String` Type. |
252 | class RxString extends Rx<String> implements Comparable<String>, Pattern { | 252 | class RxString extends Rx<String> implements Comparable<String>, Pattern { |
253 | - RxString(String initial) : super(initial); | 253 | + RxString(super.initial); |
254 | 254 | ||
255 | @override | 255 | @override |
256 | Iterable<Match> allMatches(String string, [int start = 0]) { | 256 | Iterable<Match> allMatches(String string, [int start = 0]) { |
@@ -270,7 +270,7 @@ class RxString extends Rx<String> implements Comparable<String>, Pattern { | @@ -270,7 +270,7 @@ class RxString extends Rx<String> implements Comparable<String>, Pattern { | ||
270 | 270 | ||
271 | /// Rx class for `String` Type. | 271 | /// Rx class for `String` Type. |
272 | class RxnString extends Rx<String?> implements Comparable<String>, Pattern { | 272 | class RxnString extends Rx<String?> implements Comparable<String>, Pattern { |
273 | - RxnString([String? initial]) : super(initial); | 273 | + RxnString([super.initial]); |
274 | 274 | ||
275 | @override | 275 | @override |
276 | Iterable<Match> allMatches(String string, [int start = 0]) { | 276 | Iterable<Match> allMatches(String string, [int start = 0]) { |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | /// Create a list similar to `List<T>` | 3 | /// Create a list similar to `List<T>` |
4 | class RxList<E> extends GetListenable<List<E>> | 4 | class RxList<E> extends GetListenable<List<E>> |
5 | with ListMixin<E>, RxObjectMixin<List<E>> { | 5 | with ListMixin<E>, RxObjectMixin<List<E>> { |
6 | - RxList([List<E> initial = const []]) : super(initial); | 6 | + RxList([super.initial = const []]); |
7 | 7 | ||
8 | factory RxList.filled(int length, E fill, {bool growable = false}) { | 8 | factory RxList.filled(int length, E fill, {bool growable = false}) { |
9 | return RxList(List.filled(length, fill, growable: growable)); | 9 | return RxList(List.filled(length, fill, growable: growable)); |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | class RxMap<K, V> extends GetListenable<Map<K, V>> | 3 | class RxMap<K, V> extends GetListenable<Map<K, V>> |
4 | with MapMixin<K, V>, RxObjectMixin<Map<K, V>> { | 4 | with MapMixin<K, V>, RxObjectMixin<Map<K, V>> { |
5 | - RxMap([Map<K, V> initial = const {}]) : super(initial); | 5 | + RxMap([super.initial = const {}]); |
6 | 6 | ||
7 | factory RxMap.from(Map<K, V> other) { | 7 | factory RxMap.from(Map<K, V> other) { |
8 | return RxMap(Map.from(other)); | 8 | return RxMap(Map.from(other)); |
1 | -part of rx_types; | 1 | +part of '../rx_types.dart'; |
2 | 2 | ||
3 | class RxSet<E> extends GetListenable<Set<E>> | 3 | class RxSet<E> extends GetListenable<Set<E>> |
4 | with SetMixin<E>, RxObjectMixin<Set<E>> { | 4 | with SetMixin<E>, RxObjectMixin<Set<E>> { |
5 | - RxSet([Set<E> initial = const {}]) : super(initial); | 5 | + RxSet([super.initial = const {}]); |
6 | 6 | ||
7 | /// Special override to push() element(s) in a reactive way | 7 | /// Special override to push() element(s) in a reactive way |
8 | /// inside the List, | 8 | /// inside the List, |
@@ -211,7 +211,7 @@ class Value<T> extends ListNotifier | @@ -211,7 +211,7 @@ class Value<T> extends ListNotifier | ||
211 | /// GetNotifier has a native status and state implementation, with the | 211 | /// GetNotifier has a native status and state implementation, with the |
212 | /// Get Lifecycle | 212 | /// Get Lifecycle |
213 | abstract class GetNotifier<T> extends Value<T> with GetLifeCycleMixin { | 213 | abstract class GetNotifier<T> extends Value<T> with GetLifeCycleMixin { |
214 | - GetNotifier(T initial) : super(initial); | 214 | + GetNotifier(super.initial); |
215 | } | 215 | } |
216 | 216 | ||
217 | extension StateExt<T> on StateMixin<T> { | 217 | extension StateExt<T> on StateMixin<T> { |
@@ -11,7 +11,7 @@ typedef WidgetCallback = Widget Function(); | @@ -11,7 +11,7 @@ typedef WidgetCallback = Widget Function(); | ||
11 | /// - [Obx] | 11 | /// - [Obx] |
12 | /// - [ObxValue] | 12 | /// - [ObxValue] |
13 | abstract class ObxWidget extends ObxStatelessWidget { | 13 | abstract class ObxWidget extends ObxStatelessWidget { |
14 | - const ObxWidget({Key? key}) : super(key: key); | 14 | + const ObxWidget({super.key}); |
15 | } | 15 | } |
16 | 16 | ||
17 | /// The simplest reactive widget in GetX. | 17 | /// The simplest reactive widget in GetX. |
@@ -47,7 +47,7 @@ class ObxValue<T extends RxInterface> extends ObxWidget { | @@ -47,7 +47,7 @@ class ObxValue<T extends RxInterface> extends ObxWidget { | ||
47 | final Widget Function(T) builder; | 47 | final Widget Function(T) builder; |
48 | final T data; | 48 | final T data; |
49 | 49 | ||
50 | - const ObxValue(this.builder, this.data, {Key? key}) : super(key: key); | 50 | + const ObxValue(this.builder, this.data, {super.key}); |
51 | 51 | ||
52 | @override | 52 | @override |
53 | Widget build(BuildContext context) => builder(data); | 53 | Widget build(BuildContext context) => builder(data); |
@@ -165,8 +165,7 @@ mixin GetTickerProviderStateMixin on GetxController implements TickerProvider { | @@ -165,8 +165,7 @@ mixin GetTickerProviderStateMixin on GetxController implements TickerProvider { | ||
165 | } | 165 | } |
166 | 166 | ||
167 | class _WidgetTicker extends Ticker { | 167 | class _WidgetTicker extends Ticker { |
168 | - _WidgetTicker(TickerCallback onTick, this._creator, {String? debugLabel}) | ||
169 | - : super(onTick, debugLabel: debugLabel); | 168 | + _WidgetTicker(super.onTick, this._creator, {super.debugLabel}); |
170 | 169 | ||
171 | final GetTickerProviderStateMixin _creator; | 170 | final GetTickerProviderStateMixin _creator; |
172 | 171 |
@@ -62,9 +62,8 @@ class GetResponsiveView<T> extends GetView<T> with GetResponsiveMixin { | @@ -62,9 +62,8 @@ class GetResponsiveView<T> extends GetView<T> with GetResponsiveMixin { | ||
62 | GetResponsiveView({ | 62 | GetResponsiveView({ |
63 | this.alwaysUseBuilder = false, | 63 | this.alwaysUseBuilder = false, |
64 | ResponsiveScreenSettings settings = const ResponsiveScreenSettings(), | 64 | ResponsiveScreenSettings settings = const ResponsiveScreenSettings(), |
65 | - Key? key, | ||
66 | - }) : screen = ResponsiveScreen(settings), | ||
67 | - super(key: key); | 65 | + super.key, |
66 | + }) : screen = ResponsiveScreen(settings); | ||
68 | } | 67 | } |
69 | 68 | ||
70 | class GetResponsiveWidget<T extends GetLifeCycleMixin> extends GetWidget<T> | 69 | class GetResponsiveWidget<T extends GetLifeCycleMixin> extends GetWidget<T> |
@@ -78,9 +77,8 @@ class GetResponsiveWidget<T extends GetLifeCycleMixin> extends GetWidget<T> | @@ -78,9 +77,8 @@ class GetResponsiveWidget<T extends GetLifeCycleMixin> extends GetWidget<T> | ||
78 | GetResponsiveWidget({ | 77 | GetResponsiveWidget({ |
79 | this.alwaysUseBuilder = false, | 78 | this.alwaysUseBuilder = false, |
80 | ResponsiveScreenSettings settings = const ResponsiveScreenSettings(), | 79 | ResponsiveScreenSettings settings = const ResponsiveScreenSettings(), |
81 | - Key? key, | ||
82 | - }) : screen = ResponsiveScreen(settings), | ||
83 | - super(key: key); | 80 | + super.key, |
81 | + }) : screen = ResponsiveScreen(settings); | ||
84 | } | 82 | } |
85 | 83 | ||
86 | class ResponsiveScreenSettings { | 84 | class ResponsiveScreenSettings { |
@@ -47,7 +47,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | @@ -47,7 +47,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | ||
47 | final T? init; | 47 | final T? init; |
48 | 48 | ||
49 | const GetBuilder({ | 49 | const GetBuilder({ |
50 | - Key? key, | 50 | + super.key, |
51 | this.init, | 51 | this.init, |
52 | this.global = true, | 52 | this.global = true, |
53 | required this.builder, | 53 | required this.builder, |
@@ -60,7 +60,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | @@ -60,7 +60,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | ||
60 | this.id, | 60 | this.id, |
61 | this.didChangeDependencies, | 61 | this.didChangeDependencies, |
62 | this.didUpdateWidget, | 62 | this.didUpdateWidget, |
63 | - }) : super(key: key); | 63 | + }); |
64 | 64 | ||
65 | @override | 65 | @override |
66 | Widget build(BuildContext context) { | 66 | Widget build(BuildContext context) { |
@@ -88,7 +88,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | @@ -88,7 +88,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget { | ||
88 | 88 | ||
89 | abstract class Bind<T> extends StatelessWidget { | 89 | abstract class Bind<T> extends StatelessWidget { |
90 | const Bind({ | 90 | const Bind({ |
91 | - Key? key, | 91 | + super.key, |
92 | required this.child, | 92 | required this.child, |
93 | this.init, | 93 | this.init, |
94 | this.global = true, | 94 | this.global = true, |
@@ -101,7 +101,7 @@ abstract class Bind<T> extends StatelessWidget { | @@ -101,7 +101,7 @@ abstract class Bind<T> extends StatelessWidget { | ||
101 | this.id, | 101 | this.id, |
102 | this.didChangeDependencies, | 102 | this.didChangeDependencies, |
103 | this.didUpdateWidget, | 103 | this.didUpdateWidget, |
104 | - }) : super(key: key); | 104 | + }); |
105 | 105 | ||
106 | final InitBuilder<T>? init; | 106 | final InitBuilder<T>? init; |
107 | 107 | ||
@@ -296,7 +296,7 @@ class _FactoryBind<T> extends Bind<T> { | @@ -296,7 +296,7 @@ class _FactoryBind<T> extends Bind<T> { | ||
296 | final Widget? child; | 296 | final Widget? child; |
297 | 297 | ||
298 | const _FactoryBind({ | 298 | const _FactoryBind({ |
299 | - Key? key, | 299 | + super.key, |
300 | this.child, | 300 | this.child, |
301 | this.init, | 301 | this.init, |
302 | this.create, | 302 | this.create, |
@@ -310,7 +310,7 @@ class _FactoryBind<T> extends Bind<T> { | @@ -310,7 +310,7 @@ class _FactoryBind<T> extends Bind<T> { | ||
310 | this.id, | 310 | this.id, |
311 | this.didChangeDependencies, | 311 | this.didChangeDependencies, |
312 | this.didUpdateWidget, | 312 | this.didUpdateWidget, |
313 | - }) : super(key: key, child: child); | 313 | + }) : super(child: child); |
314 | 314 | ||
315 | @override | 315 | @override |
316 | Bind<T> _copyWithChild(Widget child) { | 316 | Bind<T> _copyWithChild(Widget child) { |
@@ -355,11 +355,10 @@ class Binds extends StatelessWidget { | @@ -355,11 +355,10 @@ class Binds extends StatelessWidget { | ||
355 | final Widget child; | 355 | final Widget child; |
356 | 356 | ||
357 | Binds({ | 357 | Binds({ |
358 | - Key? key, | 358 | + super.key, |
359 | required this.binds, | 359 | required this.binds, |
360 | required this.child, | 360 | required this.child, |
361 | - }) : assert(binds.isNotEmpty), | ||
362 | - super(key: key); | 361 | + }) : assert(binds.isNotEmpty); |
363 | 362 | ||
364 | @override | 363 | @override |
365 | Widget build(BuildContext context) => | 364 | Widget build(BuildContext context) => |
@@ -372,8 +371,8 @@ class Binder<T> extends InheritedWidget { | @@ -372,8 +371,8 @@ class Binder<T> extends InheritedWidget { | ||
372 | /// | 371 | /// |
373 | /// The [child] argument is required | 372 | /// The [child] argument is required |
374 | const Binder({ | 373 | const Binder({ |
375 | - Key? key, | ||
376 | - required Widget child, | 374 | + super.key, |
375 | + required super.child, | ||
377 | this.init, | 376 | this.init, |
378 | this.global = true, | 377 | this.global = true, |
379 | this.autoRemove = true, | 378 | this.autoRemove = true, |
@@ -387,7 +386,7 @@ class Binder<T> extends InheritedWidget { | @@ -387,7 +386,7 @@ class Binder<T> extends InheritedWidget { | ||
387 | this.didChangeDependencies, | 386 | this.didChangeDependencies, |
388 | this.didUpdateWidget, | 387 | this.didUpdateWidget, |
389 | this.create, | 388 | this.create, |
390 | - }) : super(key: key, child: child); | 389 | + }); |
391 | 390 | ||
392 | final InitBuilder<T>? init; | 391 | final InitBuilder<T>? init; |
393 | final InstanceCreateBuilderCallback? create; | 392 | final InstanceCreateBuilderCallback? create; |
@@ -419,7 +418,7 @@ class Binder<T> extends InheritedWidget { | @@ -419,7 +418,7 @@ class Binder<T> extends InheritedWidget { | ||
419 | /// The BindElement is responsible for injecting dependencies into the widget | 418 | /// The BindElement is responsible for injecting dependencies into the widget |
420 | /// tree so that they can be observed | 419 | /// tree so that they can be observed |
421 | class BindElement<T> extends InheritedElement { | 420 | class BindElement<T> extends InheritedElement { |
422 | - BindElement(Binder<T> widget) : super(widget) { | 421 | + BindElement(Binder<T> super.widget) { |
423 | initState(); | 422 | initState(); |
424 | } | 423 | } |
425 | 424 |
@@ -32,7 +32,7 @@ import 'get_widget_cache.dart'; | @@ -32,7 +32,7 @@ import 'get_widget_cache.dart'; | ||
32 | /// } | 32 | /// } |
33 | ///`` | 33 | ///`` |
34 | abstract class GetView<T> extends StatelessWidget { | 34 | abstract class GetView<T> extends StatelessWidget { |
35 | - const GetView({Key? key}) : super(key: key); | 35 | + const GetView({super.key}); |
36 | 36 | ||
37 | final String? tag = null; | 37 | final String? tag = null; |
38 | 38 | ||
@@ -49,7 +49,7 @@ abstract class GetView<T> extends StatelessWidget { | @@ -49,7 +49,7 @@ abstract class GetView<T> extends StatelessWidget { | ||
49 | /// GetWidget will have your own controller, and will be call events as `onInit` | 49 | /// GetWidget will have your own controller, and will be call events as `onInit` |
50 | /// and `onClose` when the controller get in/get out on memory. | 50 | /// and `onClose` when the controller get in/get out on memory. |
51 | abstract class GetWidget<S extends GetLifeCycleMixin> extends GetWidgetCache { | 51 | abstract class GetWidget<S extends GetLifeCycleMixin> extends GetWidgetCache { |
52 | - const GetWidget({Key? key}) : super(key: key); | 52 | + const GetWidget({super.key}); |
53 | 53 | ||
54 | @protected | 54 | @protected |
55 | final String? tag = null; | 55 | final String? tag = null; |
1 | import 'package:flutter/widgets.dart'; | 1 | import 'package:flutter/widgets.dart'; |
2 | 2 | ||
3 | abstract class GetWidgetCache extends Widget { | 3 | abstract class GetWidgetCache extends Widget { |
4 | - const GetWidgetCache({Key? key}) : super(key: key); | 4 | + const GetWidgetCache({super.key}); |
5 | 5 | ||
6 | @override | 6 | @override |
7 | GetWidgetCacheElement createElement() => GetWidgetCacheElement(this); | 7 | GetWidgetCacheElement createElement() => GetWidgetCacheElement(this); |
@@ -18,7 +18,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget { | @@ -18,7 +18,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget { | ||
18 | final T? init; | 18 | final T? init; |
19 | 19 | ||
20 | const MixinBuilder({ | 20 | const MixinBuilder({ |
21 | - Key? key, | 21 | + super.key, |
22 | this.init, | 22 | this.init, |
23 | this.global = true, | 23 | this.global = true, |
24 | required this.builder, | 24 | required this.builder, |
@@ -28,7 +28,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget { | @@ -28,7 +28,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget { | ||
28 | this.id, | 28 | this.id, |
29 | this.didChangeDependencies, | 29 | this.didChangeDependencies, |
30 | this.didUpdateWidget, | 30 | this.didUpdateWidget, |
31 | - }) : super(key: key); | 31 | + }); |
32 | 32 | ||
33 | @override | 33 | @override |
34 | Widget build(BuildContext context) { | 34 | Widget build(BuildContext context) { |
@@ -30,12 +30,12 @@ class ValueBuilder<T> extends StatefulWidget { | @@ -30,12 +30,12 @@ class ValueBuilder<T> extends StatefulWidget { | ||
30 | final void Function(T)? onUpdate; | 30 | final void Function(T)? onUpdate; |
31 | 31 | ||
32 | const ValueBuilder({ | 32 | const ValueBuilder({ |
33 | - Key? key, | 33 | + super.key, |
34 | required this.initialValue, | 34 | required this.initialValue, |
35 | this.onDispose, | 35 | this.onDispose, |
36 | this.onUpdate, | 36 | this.onUpdate, |
37 | required this.builder, | 37 | required this.builder, |
38 | - }) : super(key: key); | 38 | + }); |
39 | 39 | ||
40 | @override | 40 | @override |
41 | ValueBuilderState<T> createState() => ValueBuilderState<T>(); | 41 | ValueBuilderState<T> createState() => ValueBuilderState<T>(); |
@@ -79,7 +79,7 @@ class ObxElement = StatelessElement with StatelessObserverComponent; | @@ -79,7 +79,7 @@ class ObxElement = StatelessElement with StatelessObserverComponent; | ||
79 | class Observer extends ObxStatelessWidget { | 79 | class Observer extends ObxStatelessWidget { |
80 | final WidgetBuilder builder; | 80 | final WidgetBuilder builder; |
81 | 81 | ||
82 | - const Observer({Key? key, required this.builder}) : super(key: key); | 82 | + const Observer({super.key, required this.builder}); |
83 | 83 | ||
84 | @override | 84 | @override |
85 | Widget build(BuildContext context) => builder(context); | 85 | Widget build(BuildContext context) => builder(context); |
@@ -88,7 +88,7 @@ class Observer extends ObxStatelessWidget { | @@ -88,7 +88,7 @@ class Observer extends ObxStatelessWidget { | ||
88 | /// A StatelessWidget than can listen reactive changes. | 88 | /// A StatelessWidget than can listen reactive changes. |
89 | abstract class ObxStatelessWidget extends StatelessWidget { | 89 | abstract class ObxStatelessWidget extends StatelessWidget { |
90 | /// Initializes [key] for subclasses. | 90 | /// Initializes [key] for subclasses. |
91 | - const ObxStatelessWidget({Key? key}) : super(key: key); | 91 | + const ObxStatelessWidget({super.key}); |
92 | @override | 92 | @override |
93 | StatelessElement createElement() => ObxElement(this); | 93 | StatelessElement createElement() => ObxElement(this); |
94 | } | 94 | } |
@@ -273,9 +273,7 @@ class IterableEquality<E> implements IEquality<Iterable<E>> { | @@ -273,9 +273,7 @@ class IterableEquality<E> implements IEquality<Iterable<E>> { | ||
273 | /// and the elements of one set can be paired with the elements | 273 | /// and the elements of one set can be paired with the elements |
274 | /// of the other set, so that each pair are equal. | 274 | /// of the other set, so that each pair are equal. |
275 | class SetEquality<E> extends _UnorderedEquality<E, Set<E>> { | 275 | class SetEquality<E> extends _UnorderedEquality<E, Set<E>> { |
276 | - const SetEquality( | ||
277 | - [IEquality<E> elementEquality = const DefaultEquality<Never>()]) | ||
278 | - : super(elementEquality); | 276 | + const SetEquality([super.elementEquality = const DefaultEquality<Never>()]); |
279 | 277 | ||
280 | @override | 278 | @override |
281 | bool isValidKey(Object? o) => o is Set<E>; | 279 | bool isValidKey(Object? o) => o is Set<E>; |
@@ -332,8 +330,7 @@ abstract class _UnorderedEquality<E, T extends Iterable<E>> | @@ -332,8 +330,7 @@ abstract class _UnorderedEquality<E, T extends Iterable<E>> | ||
332 | /// of the other iterable, so that each pair are equal. | 330 | /// of the other iterable, so that each pair are equal. |
333 | class UnorderedIterableEquality<E> extends _UnorderedEquality<E, Iterable<E>> { | 331 | class UnorderedIterableEquality<E> extends _UnorderedEquality<E, Iterable<E>> { |
334 | const UnorderedIterableEquality( | 332 | const UnorderedIterableEquality( |
335 | - [IEquality<E> elementEquality = const DefaultEquality<Never>()]) | ||
336 | - : super(elementEquality); | 333 | + [super.elementEquality = const DefaultEquality<Never>()]); |
337 | 334 | ||
338 | @override | 335 | @override |
339 | bool isValidKey(Object? o) => o is Iterable<E>; | 336 | bool isValidKey(Object? o) => o is Iterable<E>; |
@@ -90,7 +90,7 @@ extension ContextExt on BuildContext { | @@ -90,7 +90,7 @@ extension ContextExt on BuildContext { | ||
90 | double get devicePixelRatio => MediaQuery.devicePixelRatioOf(this); | 90 | double get devicePixelRatio => MediaQuery.devicePixelRatioOf(this); |
91 | 91 | ||
92 | /// similar to [MediaQuery.textScaleFactorOf(context)] | 92 | /// similar to [MediaQuery.textScaleFactorOf(context)] |
93 | - double get textScaleFactor => MediaQuery.textScaleFactorOf(this); | 93 | + TextScaler get textScaleFactor => MediaQuery.textScalerOf(this); |
94 | 94 | ||
95 | /// get the shortestSide from screen | 95 | /// get the shortestSide from screen |
96 | double get mediaQueryShortestSide => mediaQuerySize.shortestSide; | 96 | double get mediaQueryShortestSide => mediaQuerySize.shortestSide; |
lib/get_utils/src/widgets/otimized_listview.dart
→
lib/get_utils/src/widgets/optimized_listview.dart
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | 2 | ||
3 | -class OtimizedListView<T> extends StatelessWidget { | 3 | +class OptimizedListView<T> extends StatelessWidget { |
4 | final List<T> list; | 4 | final List<T> list; |
5 | final Axis scrollDirection; | 5 | final Axis scrollDirection; |
6 | final bool reverse; | 6 | final bool reverse; |
@@ -11,8 +11,8 @@ class OtimizedListView<T> extends StatelessWidget { | @@ -11,8 +11,8 @@ class OtimizedListView<T> extends StatelessWidget { | ||
11 | final Widget onEmpty; | 11 | final Widget onEmpty; |
12 | final int length; | 12 | final int length; |
13 | final Widget Function(BuildContext context, ValueKey key, T item) builder; | 13 | final Widget Function(BuildContext context, ValueKey key, T item) builder; |
14 | - const OtimizedListView({ | ||
15 | - Key? key, | 14 | + const OptimizedListView({ |
15 | + super.key, | ||
16 | required this.list, | 16 | required this.list, |
17 | required this.builder, | 17 | required this.builder, |
18 | this.scrollDirection = Axis.vertical, | 18 | this.scrollDirection = Axis.vertical, |
@@ -22,8 +22,7 @@ class OtimizedListView<T> extends StatelessWidget { | @@ -22,8 +22,7 @@ class OtimizedListView<T> extends StatelessWidget { | ||
22 | this.physics, | 22 | this.physics, |
23 | this.onEmpty = const SizedBox.shrink(), | 23 | this.onEmpty = const SizedBox.shrink(), |
24 | this.shrinkWrap = false, | 24 | this.shrinkWrap = false, |
25 | - }) : length = list.length, | ||
26 | - super(key: key); | 25 | + }) : length = list.length; |
27 | @override | 26 | @override |
28 | Widget build(BuildContext context) { | 27 | Widget build(BuildContext context) { |
29 | if (list.isEmpty) return onEmpty; | 28 | if (list.isEmpty) return onEmpty; |
@@ -4,17 +4,18 @@ version: 5.0.0-release-candidate-5 | @@ -4,17 +4,18 @@ version: 5.0.0-release-candidate-5 | ||
4 | homepage: https://github.com/jonataslaw/getx | 4 | homepage: https://github.com/jonataslaw/getx |
5 | 5 | ||
6 | environment: | 6 | environment: |
7 | - sdk: ">=3.0.0 <4.0.0" | 7 | + sdk: ">=3.4.0 <4.0.0" |
8 | + flutter: ">=3.22.0" | ||
8 | 9 | ||
9 | dependencies: | 10 | dependencies: |
10 | flutter: | 11 | flutter: |
11 | sdk: flutter | 12 | sdk: flutter |
12 | flutter_web_plugins: | 13 | flutter_web_plugins: |
13 | sdk: flutter | 14 | sdk: flutter |
14 | - web: any | 15 | + web: ">=0.4.0 <0.6.0" |
15 | 16 | ||
16 | dev_dependencies: | 17 | dev_dependencies: |
17 | - flutter_lints: ^2.0.3 | 18 | + flutter_lints: ^4.0.0 |
18 | flutter_test: | 19 | flutter_test: |
19 | sdk: flutter | 20 | sdk: flutter |
20 | 21 |
@@ -57,7 +57,7 @@ void main() { | @@ -57,7 +57,7 @@ void main() { | ||
57 | } | 57 | } |
58 | 58 | ||
59 | class YourDialogWidget extends StatelessWidget { | 59 | class YourDialogWidget extends StatelessWidget { |
60 | - const YourDialogWidget({Key? key}) : super(key: key); | 60 | + const YourDialogWidget({super.key}); |
61 | 61 | ||
62 | @override | 62 | @override |
63 | Widget build(BuildContext context) { | 63 | Widget build(BuildContext context) { |
@@ -570,7 +570,7 @@ void main() { | @@ -570,7 +570,7 @@ void main() { | ||
570 | } | 570 | } |
571 | 571 | ||
572 | class FirstScreen extends StatelessWidget { | 572 | class FirstScreen extends StatelessWidget { |
573 | - const FirstScreen({Key? key}) : super(key: key); | 573 | + const FirstScreen({super.key}); |
574 | 574 | ||
575 | @override | 575 | @override |
576 | Widget build(BuildContext context) { | 576 | Widget build(BuildContext context) { |
@@ -580,7 +580,7 @@ class FirstScreen extends StatelessWidget { | @@ -580,7 +580,7 @@ class FirstScreen extends StatelessWidget { | ||
580 | } | 580 | } |
581 | 581 | ||
582 | class SecondScreen extends StatelessWidget { | 582 | class SecondScreen extends StatelessWidget { |
583 | - const SecondScreen({Key? key}) : super(key: key); | 583 | + const SecondScreen({super.key}); |
584 | 584 | ||
585 | @override | 585 | @override |
586 | Widget build(BuildContext context) { | 586 | Widget build(BuildContext context) { |
@@ -589,7 +589,7 @@ class SecondScreen extends StatelessWidget { | @@ -589,7 +589,7 @@ class SecondScreen extends StatelessWidget { | ||
589 | } | 589 | } |
590 | 590 | ||
591 | class ThirdScreen extends StatelessWidget { | 591 | class ThirdScreen extends StatelessWidget { |
592 | - const ThirdScreen({Key? key}) : super(key: key); | 592 | + const ThirdScreen({super.key}); |
593 | 593 | ||
594 | @override | 594 | @override |
595 | Widget build(BuildContext context) { | 595 | Widget build(BuildContext context) { |
@@ -8,12 +8,12 @@ class Wrapper extends StatelessWidget { | @@ -8,12 +8,12 @@ class Wrapper extends StatelessWidget { | ||
8 | final Transition? defaultTransition; | 8 | final Transition? defaultTransition; |
9 | 9 | ||
10 | const Wrapper({ | 10 | const Wrapper({ |
11 | - Key? key, | 11 | + super.key, |
12 | this.child, | 12 | this.child, |
13 | this.namedRoutes, | 13 | this.namedRoutes, |
14 | this.initialRoute, | 14 | this.initialRoute, |
15 | this.defaultTransition, | 15 | this.defaultTransition, |
16 | - }) : super(key: key); | 16 | + }); |
17 | 17 | ||
18 | @override | 18 | @override |
19 | Widget build(BuildContext context) { | 19 | Widget build(BuildContext context) { |
@@ -39,12 +39,12 @@ class WrapperNamed extends StatelessWidget { | @@ -39,12 +39,12 @@ class WrapperNamed extends StatelessWidget { | ||
39 | final Transition? defaultTransition; | 39 | final Transition? defaultTransition; |
40 | 40 | ||
41 | const WrapperNamed({ | 41 | const WrapperNamed({ |
42 | - Key? key, | 42 | + super.key, |
43 | this.child, | 43 | this.child, |
44 | this.namedRoutes, | 44 | this.namedRoutes, |
45 | this.initialRoute, | 45 | this.initialRoute, |
46 | this.defaultTransition, | 46 | this.defaultTransition, |
47 | - }) : super(key: key); | 47 | + }); |
48 | 48 | ||
49 | @override | 49 | @override |
50 | Widget build(BuildContext context) { | 50 | Widget build(BuildContext context) { |
@@ -7,8 +7,8 @@ void main() { | @@ -7,8 +7,8 @@ void main() { | ||
7 | test('once', () async { | 7 | test('once', () async { |
8 | final count = 0.obs; | 8 | final count = 0.obs; |
9 | var result = -1; | 9 | var result = -1; |
10 | - once(count, (dynamic _) { | ||
11 | - result = _ as int; | 10 | + once(count, (dynamic val) { |
11 | + result = val as int; | ||
12 | }); | 12 | }); |
13 | count.value++; | 13 | count.value++; |
14 | await Future.delayed(Duration.zero); | 14 | await Future.delayed(Duration.zero); |
@@ -41,9 +41,9 @@ void main() { | @@ -41,9 +41,9 @@ void main() { | ||
41 | test('debounce', () async { | 41 | test('debounce', () async { |
42 | final count = 0.obs; | 42 | final count = 0.obs; |
43 | int? result = -1; | 43 | int? result = -1; |
44 | - debounce(count, (dynamic _) { | 44 | + debounce(count, (dynamic val) { |
45 | // print(_); | 45 | // print(_); |
46 | - result = _ as int?; | 46 | + result = val as int?; |
47 | }, time: const Duration(milliseconds: 100)); | 47 | }, time: const Duration(milliseconds: 100)); |
48 | 48 | ||
49 | count.value++; | 49 | count.value++; |
@@ -63,7 +63,7 @@ void main() { | @@ -63,7 +63,7 @@ void main() { | ||
63 | 63 | ||
64 | var showNavbar = (width > 800); | 64 | var showNavbar = (width > 800); |
65 | expect(showNavbar, context.showNavbar); | 65 | expect(showNavbar, context.showNavbar); |
66 | - var textScaleFactor = mediaQuery.textScaleFactor; | 66 | + var textScaleFactor = mediaQuery.textScaler; |
67 | expect(textScaleFactor, context.textScaleFactor); | 67 | expect(textScaleFactor, context.textScaleFactor); |
68 | }); | 68 | }); |
69 | } | 69 | } |
-
Please register or login to post a comment