Jelajahi Sumber

nnbd first pass

lukepighetti 4 tahun lalu
induk
melakukan
c88a532aa0

+ 1 - 1
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -2,6 +2,6 @@
 <Workspace
    version = "1.0">
    <FileRef
-      location = "group:Runner.xcodeproj">
+      location = "self:">
    </FileRef>
 </Workspace>

+ 20 - 20
example/pubspec.lock

@@ -7,42 +7,42 @@ packages:
       name: async
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.5.0-nullsafety.1"
+    version: "2.5.0-nullsafety.3"
   boolean_selector:
     dependency: transitive
     description:
       name: boolean_selector
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.1"
+    version: "2.1.0-nullsafety.3"
   characters:
     dependency: transitive
     description:
       name: characters
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.3"
+    version: "1.1.0-nullsafety.5"
   charcode:
     dependency: transitive
     description:
       name: charcode
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   clock:
     dependency: transitive
     description:
       name: clock
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.1"
+    version: "1.1.0-nullsafety.3"
   collection:
     dependency: transitive
     description:
       name: collection
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.15.0-nullsafety.3"
+    version: "1.15.0-nullsafety.5"
   cupertino_icons:
     dependency: "direct main"
     description:
@@ -56,7 +56,7 @@ packages:
       name: fake_async
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   fluro:
     dependency: "direct main"
     description:
@@ -80,21 +80,21 @@ packages:
       name: matcher
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.12.10-nullsafety.1"
+    version: "0.12.10-nullsafety.3"
   meta:
     dependency: transitive
     description:
       name: meta
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.3.0-nullsafety.4"
+    version: "1.3.0-nullsafety.6"
   path:
     dependency: transitive
     description:
       name: path
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0-nullsafety.1"
+    version: "1.8.0-nullsafety.3"
   sky_engine:
     dependency: transitive
     description: flutter
@@ -106,56 +106,56 @@ packages:
       name: source_span
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0-nullsafety.2"
+    version: "1.8.0-nullsafety.4"
   stack_trace:
     dependency: transitive
     description:
       name: stack_trace
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.10.0-nullsafety.2"
+    version: "1.10.0-nullsafety.6"
   stream_channel:
     dependency: transitive
     description:
       name: stream_channel
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.1"
+    version: "2.1.0-nullsafety.3"
   string_scanner:
     dependency: transitive
     description:
       name: string_scanner
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.1"
+    version: "1.1.0-nullsafety.3"
   term_glyph:
     dependency: transitive
     description:
       name: term_glyph
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   test_api:
     dependency: transitive
     description:
       name: test_api
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.2.19-nullsafety.2"
+    version: "0.2.19-nullsafety.6"
   typed_data:
     dependency: transitive
     description:
       name: typed_data
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.3.0-nullsafety.3"
+    version: "1.3.0-nullsafety.5"
   vector_math:
     dependency: transitive
     description:
       name: vector_math
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.3"
+    version: "2.1.0-nullsafety.5"
 sdks:
-  dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
-  flutter: ">=1.17.0 <2.0.0"
+  dart: ">=2.12.0-0.0 <3.0.0"
+  flutter: ">=1.17.0"

+ 14 - 14
lib/src/common.dart

@@ -19,27 +19,27 @@ enum HandlerType {
 /// The handler to register with [FluroRouter.define]
 class Handler {
   Handler({this.type = HandlerType.route, this.handlerFunc});
-  final HandlerType type;
-  final HandlerFunc handlerFunc;
+  final HandlerType? type;
+  final HandlerFunc? handlerFunc;
 }
 
 /// A function that creates new routes.
 typedef Route<T> RouteCreator<T>(
-    RouteSettings route, Map<String, List<String>> parameters);
+    RouteSettings? route, Map<String, List<String>>? parameters);
 
 /// Builds out a screen based on string path [parameters] and context.
 ///
 /// Note: you can access [RouteSettings] with the [context.settings] extension
 typedef Widget HandlerFunc(
-    BuildContext context, Map<String, List<String>> parameters);
+    BuildContext? context, Map<String, List<String>>? parameters);
 
 /// A route that is added to the router tree.
 class AppRoute {
-  String route;
-  dynamic handler;
-  TransitionType transitionType;
-  Duration transitionDuration;
-  RouteTransitionsBuilder transitionBuilder;
+  String? route;
+  dynamic? handler;
+  TransitionType? transitionType;
+  Duration? transitionDuration;
+  RouteTransitionsBuilder? transitionBuilder;
   AppRoute(this.route, this.handler,
       {this.transitionType, this.transitionDuration, this.transitionBuilder});
 }
@@ -76,15 +76,15 @@ class RouteMatch {
       {this.matchType = RouteMatchType.noMatch,
       this.route,
       this.errorMessage = "Unable to match route. Please check the logs."});
-  final Route<dynamic> route;
-  final RouteMatchType matchType;
-  final String errorMessage;
+  final Route<dynamic>? route;
+  final RouteMatchType? matchType;
+  final String? errorMessage;
 }
 
 /// When the route is not found.
 class RouteNotFoundException implements Exception {
-  final String message;
-  final String path;
+  final String? message;
+  final String? path;
   RouteNotFoundException(this.message, this.path);
 
   @override

+ 2 - 2
lib/src/extensions.dart

@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
 extension FluroBuildContextX on BuildContext {
   /// Convenience method to retreive [RouteSettings] via
   /// `ModalRoute.of(context).settings`
-  RouteSettings get settings => ModalRoute.of(this).settings;
+  RouteSettings? get settings => ModalRoute.of(this)!.settings;
 
   /// Helper to get [RouteSettings.arguments] via
   /// `ModalRoute.of(context).settings.arguments`
-  Object get arguments => ModalRoute.of(this).settings.arguments;
+  Object? get arguments => ModalRoute.of(this)!.settings.arguments;
 }

+ 41 - 42
lib/src/fluro_router.dart

@@ -33,14 +33,14 @@ class FluroRouter {
   final RouteTree _routeTree = RouteTree();
 
   /// Generic handler for when a route has not been defined
-  Handler notFoundHandler;
+  Handler? notFoundHandler;
 
   /// Creates a [PageRoute] definition for the passed [RouteHandler]. You can optionally provide a default transition type.
   void define(String routePath,
-      {@required Handler handler,
-      TransitionType transitionType,
-      Duration transitionDuration = const Duration(milliseconds: 250),
-      RouteTransitionsBuilder transitionBuilder}) {
+      {required Handler? handler,
+      TransitionType? transitionType,
+      Duration? transitionDuration = const Duration(milliseconds: 250),
+      RouteTransitionsBuilder? transitionBuilder}) {
     _routeTree.addRoute(
       AppRoute(routePath, handler,
           transitionType: transitionType,
@@ -51,12 +51,12 @@ class FluroRouter {
 
   /// Finds a defined [AppRoute] for the path value. If no [AppRoute] definition was found
   /// then function will return null.
-  AppRouteMatch match(String path) {
+  AppRouteMatch? match(String path) {
     return _routeTree.matchRoute(path);
   }
 
   /// Similar to [Navigator.pop]
-  void pop<T>(BuildContext context, [T result]) =>
+  void pop<T>(BuildContext context, [T? result]) =>
       Navigator.of(context).pop(result);
 
   /// Similar to [Navigator.push] but with a few extra features.
@@ -65,17 +65,17 @@ class FluroRouter {
       bool clearStack = false,
       bool maintainState = true,
       bool rootNavigator = false,
-      TransitionType transition,
-      Duration transitionDuration,
-      RouteTransitionsBuilder transitionBuilder,
-      RouteSettings routeSettings}) {
+      TransitionType? transition,
+      Duration? transitionDuration,
+      RouteTransitionsBuilder? transitionBuilder,
+      RouteSettings? routeSettings}) {
     RouteMatch routeMatch = matchRoute(context, path,
         transitionType: transition,
         transitionsBuilder: transitionBuilder,
         transitionDuration: transitionDuration,
         maintainState: maintainState,
         routeSettings: routeSettings);
-    Route<dynamic> route = routeMatch.route;
+    Route<dynamic>? route = routeMatch.route;
     Completer completer = Completer();
     Future future = completer.future;
     if (routeMatch.matchType == RouteMatchType.nonVisual) {
@@ -85,8 +85,7 @@ class FluroRouter {
         route = _notFoundRoute(context, path, maintainState: maintainState);
       }
       if (route != null) {
-        final navigator =
-            Navigator.of(context, rootNavigator: rootNavigator);
+        final navigator = Navigator.of(context, rootNavigator: rootNavigator);
         if (clearStack) {
           future = navigator.pushAndRemoveUntil(route, (check) => false);
         } else {
@@ -106,45 +105,45 @@ class FluroRouter {
   }
 
   Route<Null> _notFoundRoute(BuildContext context, String path,
-      {bool maintainState}) {
+      {bool? maintainState}) {
     RouteCreator<Null> creator =
-        (RouteSettings routeSettings, Map<String, List<String>> parameters) {
+        (RouteSettings? routeSettings, Map<String, List<String>>? parameters) {
       return MaterialPageRoute<Null>(
           settings: routeSettings,
-          maintainState: maintainState,
+          maintainState: maintainState ?? true,
           builder: (BuildContext context) {
-            return notFoundHandler.handlerFunc(context, parameters);
+            return notFoundHandler!.handlerFunc!(context, parameters);
           });
     };
     return creator(RouteSettings(name: path), null);
   }
 
   /// Attempt to match a route to the provided [path].
-  RouteMatch matchRoute(BuildContext buildContext, String path,
-      {RouteSettings routeSettings,
-      TransitionType transitionType,
-      Duration transitionDuration,
-      RouteTransitionsBuilder transitionsBuilder,
+  RouteMatch matchRoute(BuildContext? buildContext, String? path,
+      {RouteSettings? routeSettings,
+      TransitionType? transitionType,
+      Duration? transitionDuration,
+      RouteTransitionsBuilder? transitionsBuilder,
       bool maintainState = true}) {
-    RouteSettings settingsToUse = routeSettings;
+    RouteSettings? settingsToUse = routeSettings;
     if (routeSettings == null) {
       settingsToUse = RouteSettings(name: path);
     }
-    if (settingsToUse.name == null) {
+    if (settingsToUse!.name == null) {
       settingsToUse = settingsToUse.copyWith(name: path);
     }
-    AppRouteMatch match = _routeTree.matchRoute(path);
-    AppRoute route = match?.route;
+    AppRouteMatch? match = _routeTree.matchRoute(path!);
+    AppRoute? route = match?.route;
 
     if (route?.transitionDuration != null) {
       transitionDuration = route?.transitionDuration;
     }
 
-    Handler handler = (route != null ? route?.handler : notFoundHandler);
-    var transition = transitionType;
+    Handler handler = (route != null ? route.handler : notFoundHandler);
+    TransitionType? transition = transitionType;
     if (transitionType == null) {
       transition =
-          route != null ? route?.transitionType : TransitionType.native;
+          route != null ? route.transitionType : TransitionType.native;
     }
     if (route == null && notFoundHandler == null) {
       return RouteMatch(
@@ -154,12 +153,12 @@ class FluroRouter {
     Map<String, List<String>> parameters =
         match?.parameters ?? <String, List<String>>{};
     if (handler.type == HandlerType.function) {
-      handler.handlerFunc(buildContext, parameters);
+      handler.handlerFunc!(buildContext, parameters);
       return RouteMatch(matchType: RouteMatchType.nonVisual);
     }
 
     RouteCreator creator =
-        (RouteSettings routeSettings, Map<String, List<String>> parameters) {
+        (RouteSettings? routeSettings, Map<String, List<String>>? parameters) {
       bool isNativeTransition = (transition == TransitionType.native ||
           transition == TransitionType.nativeModal);
       if (isNativeTransition) {
@@ -168,7 +167,7 @@ class FluroRouter {
             fullscreenDialog: transition == TransitionType.nativeModal,
             maintainState: maintainState,
             builder: (BuildContext context) {
-              return handler.handlerFunc(context, parameters);
+              return handler.handlerFunc!(context, parameters);
             });
       } else if (transition == TransitionType.material ||
           transition == TransitionType.materialFullScreenDialog) {
@@ -178,7 +177,7 @@ class FluroRouter {
                 transition == TransitionType.materialFullScreenDialog,
             maintainState: maintainState,
             builder: (BuildContext context) {
-              return handler.handlerFunc(context, parameters);
+              return handler.handlerFunc!(context, parameters);
             });
       } else if (transition == TransitionType.cupertino ||
           transition == TransitionType.cupertinoFullScreenDialog) {
@@ -188,10 +187,10 @@ class FluroRouter {
                 transition == TransitionType.cupertinoFullScreenDialog,
             maintainState: maintainState,
             builder: (BuildContext context) {
-              return handler.handlerFunc(context, parameters);
+              return handler.handlerFunc!(context, parameters);
             });
       } else {
-        var routeTransitionsBuilder;
+        RouteTransitionsBuilder? routeTransitionsBuilder;
 
         if (transition == TransitionType.custom) {
           routeTransitionsBuilder =
@@ -205,17 +204,17 @@ class FluroRouter {
           maintainState: maintainState,
           pageBuilder: (BuildContext context, Animation<double> animation,
               Animation<double> secondaryAnimation) {
-            return handler.handlerFunc(context, parameters);
+            return handler.handlerFunc!(context, parameters);
           },
           transitionDuration: transition == TransitionType.none
               ? Duration.zero
-              : transitionDuration ?? route?.transitionDuration,
+              : (transitionDuration ?? route?.transitionDuration)!,
           reverseTransitionDuration: transition == TransitionType.none
               ? Duration.zero
-              : transitionDuration ?? route?.transitionDuration,
+              : (transitionDuration ?? route?.transitionDuration)!,
           transitionsBuilder: transition == TransitionType.none
               ? (_, __, ___, child) => child
-              : routeTransitionsBuilder,
+              : routeTransitionsBuilder!,
         );
       }
     };
@@ -226,7 +225,7 @@ class FluroRouter {
   }
 
   RouteTransitionsBuilder _standardTransitionsBuilder(
-      TransitionType transitionType) {
+      TransitionType? transitionType) {
     return (BuildContext context, Animation<double> animation,
         Animation<double> secondaryAnimation, Widget child) {
       if (transitionType == TransitionType.fadeIn) {
@@ -266,7 +265,7 @@ class FluroRouter {
   /// Route generation method. This function can be used as a way to create routes on-the-fly
   /// if any defined handler is found. It can also be used with the [MaterialApp.onGenerateRoute]
   /// property as callback to create routes that can be used with the [Navigator] class.
-  Route<dynamic> generator(RouteSettings routeSettings) {
+  Route<dynamic>? generator(RouteSettings routeSettings) {
     RouteMatch match =
         matchRoute(null, routeSettings.name, routeSettings: routeSettings);
     return match.route;

+ 33 - 33
lib/src/tree.dart

@@ -22,8 +22,8 @@ class AppRouteMatch {
   AppRouteMatch(this.route);
 
   // properties
-  AppRoute route;
-  Map<String, List<String>> parameters = <String, List<String>>{};
+  AppRoute? route;
+  Map<String, List<String>>? parameters = <String, List<String>>{};
 }
 
 /// A matched [RouteTreeNode]
@@ -31,7 +31,7 @@ class RouteTreeNodeMatch {
   // constructors
   RouteTreeNodeMatch(this.node);
 
-  RouteTreeNodeMatch.fromMatch(RouteTreeNodeMatch match, this.node) {
+  RouteTreeNodeMatch.fromMatch(RouteTreeNodeMatch? match, this.node) {
     parameters = <String, List<String>>{};
     if (match != null) {
       parameters.addAll(match.parameters);
@@ -39,7 +39,7 @@ class RouteTreeNodeMatch {
   }
 
   // properties
-  RouteTreeNode node;
+  RouteTreeNode? node;
   Map<String, List<String>> parameters = <String, List<String>>{};
 }
 
@@ -49,11 +49,11 @@ class RouteTreeNode {
   RouteTreeNode(this.part, this.type);
 
   // properties
-  String part;
-  RouteTreeNodeType type;
-  List<AppRoute> routes = <AppRoute>[];
-  List<RouteTreeNode> nodes = <RouteTreeNode>[];
-  RouteTreeNode parent;
+  String? part;
+  RouteTreeNodeType? type;
+  List<AppRoute>? routes = <AppRoute>[];
+  List<RouteTreeNode>? nodes = <RouteTreeNode>[];
+  RouteTreeNode? parent;
 
   bool isParameter() {
     return type == RouteTreeNodeType.parameter;
@@ -68,7 +68,7 @@ class RouteTree {
 
   // addRoute - add a route to the route tree
   void addRoute(AppRoute route) {
-    String path = route.route;
+    String path = route.route!;
     // is root/default route, just add it
     if (path == Navigator.defaultRouteName) {
       if (_hasDefaultRoute) {
@@ -86,10 +86,10 @@ class RouteTree {
       path = path.substring(1);
     }
     List<String> pathComponents = path.split('/');
-    RouteTreeNode parent;
+    RouteTreeNode? parent;
     for (int i = 0; i < pathComponents.length; i++) {
-      String component = pathComponents[i];
-      RouteTreeNode node = _nodeForComponent(component, parent);
+      String? component = pathComponents[i];
+      RouteTreeNode? node = _nodeForComponent(component, parent);
       if (node == null) {
         RouteTreeNodeType type = _typeForComponent(component);
         node = RouteTreeNode(component, type);
@@ -97,21 +97,21 @@ class RouteTree {
         if (parent == null) {
           _nodes.add(node);
         } else {
-          parent.nodes.add(node);
+          parent.nodes!.add(node);
         }
       }
       if (i == pathComponents.length - 1) {
         if (node.routes == null) {
           node.routes = [route];
         } else {
-          node.routes.add(route);
+          node.routes!.add(route);
         }
       }
       parent = node;
     }
   }
 
-  AppRouteMatch matchRoute(String path) {
+  AppRouteMatch? matchRoute(String path) {
     String usePath = path;
     if (usePath.startsWith("/")) {
       usePath = path.substring(1);
@@ -129,7 +129,7 @@ class RouteTree {
           <RouteTreeNode, RouteTreeNodeMatch>{};
       List<RouteTreeNode> nextNodes = <RouteTreeNode>[];
       String pathPart = checkComponent;
-      Map<String, List<String>> queryMap;
+      Map<String, List<String>>? queryMap;
       if (checkComponent.contains("?")) {
         var splitParam = checkComponent.split("?");
         pathPart = splitParam[0];
@@ -138,11 +138,11 @@ class RouteTree {
       for (RouteTreeNode node in nodesToCheck) {
         bool isMatch = (node.part == pathPart || node.isParameter());
         if (isMatch) {
-          RouteTreeNodeMatch parentMatch = nodeMatches[node.parent];
+          RouteTreeNodeMatch? parentMatch = nodeMatches[node.parent];
           RouteTreeNodeMatch match =
               RouteTreeNodeMatch.fromMatch(parentMatch, node);
           if (node.isParameter()) {
-            String paramKey = node.part.substring(1);
+            String paramKey = node.part!.substring(1);
             match.parameters[paramKey] = [pathPart];
           }
           if (queryMap != null) {
@@ -151,7 +151,7 @@ class RouteTree {
 //          print("matched: ${node.part}, isParam: ${node.isParameter()}, params: ${match.parameters}");
           currentMatches[node] = match;
           if (node.nodes != null) {
-            nextNodes.addAll(node.nodes);
+            nextNodes.addAll(node.nodes!);
           }
         }
       }
@@ -164,12 +164,12 @@ class RouteTree {
     List<RouteTreeNodeMatch> matches = nodeMatches.values.toList();
     if (matches.length > 0) {
       RouteTreeNodeMatch match = matches.first;
-      RouteTreeNode nodeToUse = match.node;
+      RouteTreeNode? nodeToUse = match.node;
 //			print("using match: ${match}, ${nodeToUse?.part}, ${match?.parameters}");
       if (nodeToUse != null &&
           nodeToUse.routes != null &&
-          nodeToUse.routes.length > 0) {
-        List<AppRoute> routes = nodeToUse.routes;
+          nodeToUse.routes!.length > 0) {
+        List<AppRoute> routes = nodeToUse.routes!;
         AppRouteMatch routeMatch = AppRouteMatch(routes[0]);
         routeMatch.parameters = match.parameters;
         return routeMatch;
@@ -182,25 +182,25 @@ class RouteTree {
     _printSubTree();
   }
 
-  void _printSubTree({RouteTreeNode parent, int level = 0}) {
-    List<RouteTreeNode> nodes = parent != null ? parent.nodes : _nodes;
-    for (RouteTreeNode node in nodes) {
+  void _printSubTree({RouteTreeNode? parent, int level = 0}) {
+    List<RouteTreeNode>? nodes = parent != null ? parent.nodes : _nodes;
+    for (RouteTreeNode node in nodes!) {
       String indent = "";
       for (int i = 0; i < level; i++) {
         indent += "    ";
       }
-      print("$indent${node.part}: total routes=${node.routes.length}");
-      if (node.nodes != null && node.nodes.length > 0) {
+      print("$indent${node.part}: total routes=${node.routes!.length}");
+      if (node.nodes != null && node.nodes!.length > 0) {
         _printSubTree(parent: node, level: level + 1);
       }
     }
   }
 
-  RouteTreeNode _nodeForComponent(String component, RouteTreeNode parent) {
+  RouteTreeNode? _nodeForComponent(String? component, RouteTreeNode? parent) {
     List<RouteTreeNode> nodes = _nodes;
     if (parent != null) {
       // search parent for sub-node matches
-      nodes = parent.nodes;
+      nodes = parent.nodes!;
     }
     for (RouteTreeNode node in nodes) {
       if (node.part == component) {
@@ -229,10 +229,10 @@ class RouteTree {
     if (query.startsWith('?')) query = query.substring(1);
     decode(String s) => Uri.decodeComponent(s.replaceAll('+', ' '));
     for (Match match in search.allMatches(query)) {
-      String key = decode(match.group(1));
-      String value = decode(match.group(2));
+      String key = decode(match.group(1)!);
+      String value = decode(match.group(2)!);
       if (params.containsKey(key)) {
-        params[key].add(value);
+        params[key]!.add(value);
       } else {
         params[key] = [value];
       }

+ 20 - 20
pubspec.lock

@@ -7,49 +7,49 @@ packages:
       name: async
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.5.0-nullsafety.1"
+    version: "2.5.0-nullsafety.3"
   boolean_selector:
     dependency: transitive
     description:
       name: boolean_selector
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.1"
+    version: "2.1.0-nullsafety.3"
   characters:
     dependency: transitive
     description:
       name: characters
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.3"
+    version: "1.1.0-nullsafety.5"
   charcode:
     dependency: transitive
     description:
       name: charcode
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   clock:
     dependency: transitive
     description:
       name: clock
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.1"
+    version: "1.1.0-nullsafety.3"
   collection:
     dependency: transitive
     description:
       name: collection
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.15.0-nullsafety.3"
+    version: "1.15.0-nullsafety.5"
   fake_async:
     dependency: transitive
     description:
       name: fake_async
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   flutter:
     dependency: "direct main"
     description: flutter
@@ -66,21 +66,21 @@ packages:
       name: matcher
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.12.10-nullsafety.1"
+    version: "0.12.10-nullsafety.3"
   meta:
     dependency: transitive
     description:
       name: meta
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.3.0-nullsafety.4"
+    version: "1.3.0-nullsafety.6"
   path:
     dependency: transitive
     description:
       name: path
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0-nullsafety.1"
+    version: "1.8.0-nullsafety.3"
   sky_engine:
     dependency: transitive
     description: flutter
@@ -92,56 +92,56 @@ packages:
       name: source_span
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0-nullsafety.2"
+    version: "1.8.0-nullsafety.4"
   stack_trace:
     dependency: transitive
     description:
       name: stack_trace
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.10.0-nullsafety.2"
+    version: "1.10.0-nullsafety.6"
   stream_channel:
     dependency: transitive
     description:
       name: stream_channel
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.1"
+    version: "2.1.0-nullsafety.3"
   string_scanner:
     dependency: transitive
     description:
       name: string_scanner
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0-nullsafety.1"
+    version: "1.1.0-nullsafety.3"
   term_glyph:
     dependency: transitive
     description:
       name: term_glyph
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.2.0-nullsafety.1"
+    version: "1.2.0-nullsafety.3"
   test_api:
     dependency: transitive
     description:
       name: test_api
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.2.19-nullsafety.2"
+    version: "0.2.19-nullsafety.6"
   typed_data:
     dependency: transitive
     description:
       name: typed_data
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.3.0-nullsafety.3"
+    version: "1.3.0-nullsafety.5"
   vector_math:
     dependency: transitive
     description:
       name: vector_math
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.0-nullsafety.3"
+    version: "2.1.0-nullsafety.5"
 sdks:
-  dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
-  flutter: ">=1.17.0 <2.0.0"
+  dart: ">=2.12.0-0.0 <3.0.0"
+  flutter: ">=1.17.0"

+ 1 - 1
pubspec.yaml

@@ -4,7 +4,7 @@ version: 1.7.8
 homepage: https://github.com/lukepighetti/fluro
 
 environment:
-  sdk: ">=2.7.0 <3.0.0"
+  sdk: ">=2.12.0-0 <3.0.0"
   flutter: ">=1.17.0 <2.0.0"
 
 dependencies:

+ 6 - 6
test/parser_test.dart

@@ -17,7 +17,7 @@ void main() {
     String route = "/users/:id";
     FluroRouter router = FluroRouter();
     router.define(route, handler: null);
-    AppRouteMatch match = router.match(path);
+    AppRouteMatch? match = router.match(path);
     expect(
         match?.parameters,
         equals(<String, List<String>>{
@@ -31,7 +31,7 @@ void main() {
     String route = "/users/:id";
     FluroRouter router = FluroRouter();
     router.define(route, handler: null);
-    AppRouteMatch match = router.match(path);
+    AppRouteMatch? match = router.match(path);
     expect(
         match?.parameters,
         equals(<String, List<String>>{
@@ -46,7 +46,7 @@ void main() {
     String route = "/users/create";
     FluroRouter router = FluroRouter();
     router.define(route, handler: null);
-    AppRouteMatch match = router.match(path);
+    AppRouteMatch? match = router.match(path);
     expect(
         match?.parameters,
         equals(<String, List<String>>{
@@ -63,7 +63,7 @@ void main() {
     String route = "/users/create";
     FluroRouter router = FluroRouter();
     router.define(route, handler: null);
-    AppRouteMatch match = router.match(path);
+    AppRouteMatch? match = router.match(path);
     expect(
         match?.parameters,
         equals(<String, List<String>>{
@@ -79,7 +79,7 @@ void main() {
     FluroRouter router = FluroRouter();
     router.define(route,
         handler: null, transitionType: TransitionType.inFromRight);
-    AppRouteMatch match = router.match(path);
-    expect(TransitionType.inFromRight, match.route.transitionType);
+    AppRouteMatch? match = router.match(path);
+    expect(TransitionType.inFromRight, match?.route?.transitionType);
   });
 }