mirror of
https://github.com/flutter/packages.git
synced 2025-07-04 09:38:17 +08:00
[go_router] Exposes package-level privates (#4380)
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 9.0.2
|
||||||
|
|
||||||
|
- Exposes package-level privates.
|
||||||
|
|
||||||
## 9.0.1
|
## 9.0.1
|
||||||
|
|
||||||
- Allows redirect only GoRoute to be part of RouteMatchList.
|
- Allows redirect only GoRoute to be part of RouteMatchList.
|
||||||
@ -5,8 +9,7 @@
|
|||||||
## 9.0.0
|
## 9.0.0
|
||||||
|
|
||||||
- **BREAKING CHANGE**:
|
- **BREAKING CHANGE**:
|
||||||
- Removes GoRouter.location and GoRouter.canPop. Use GoRouterState.of().location and
|
- Removes GoRouter.location. Use GoRouterState.of().location instead.
|
||||||
Navigator.of().canPop instead.
|
|
||||||
- GoRouter does not `extends` ChangeNotifier.
|
- GoRouter does not `extends` ChangeNotifier.
|
||||||
- [Migration guide](https://flutter.dev/go/go-router-v9-breaking-changes)
|
- [Migration guide](https://flutter.dev/go/go-router-v9-breaking-changes)
|
||||||
- Reduces excessive rebuilds due to inherited look up.
|
- Reduces excessive rebuilds due to inherited look up.
|
||||||
|
@ -6,35 +6,17 @@
|
|||||||
/// deep linking, data-driven routes and more.
|
/// deep linking, data-driven routes and more.
|
||||||
library go_router;
|
library go_router;
|
||||||
|
|
||||||
export 'src/configuration.dart'
|
export 'src/builder.dart';
|
||||||
show
|
export 'src/configuration.dart';
|
||||||
GoRoute,
|
export 'src/delegate.dart';
|
||||||
GoRouterState,
|
export 'src/information_provider.dart';
|
||||||
RouteBase,
|
export 'src/match.dart' hide RouteMatchListCodec;
|
||||||
ShellRoute,
|
export 'src/misc/errors.dart';
|
||||||
ShellNavigationContainerBuilder,
|
|
||||||
StatefulNavigationShell,
|
|
||||||
StatefulNavigationShellState,
|
|
||||||
StatefulShellBranch,
|
|
||||||
StatefulShellRoute;
|
|
||||||
export 'src/misc/extensions.dart';
|
export 'src/misc/extensions.dart';
|
||||||
export 'src/misc/inherited_router.dart';
|
export 'src/misc/inherited_router.dart';
|
||||||
export 'src/pages/custom_transition_page.dart';
|
export 'src/pages/custom_transition_page.dart';
|
||||||
export 'src/route_data.dart'
|
export 'src/parser.dart';
|
||||||
show
|
export 'src/route.dart';
|
||||||
RouteData,
|
export 'src/route_data.dart' hide NoOpPage;
|
||||||
GoRouteData,
|
|
||||||
ShellRouteData,
|
|
||||||
TypedRoute,
|
|
||||||
TypedGoRoute,
|
|
||||||
TypedShellRoute;
|
|
||||||
export 'src/router.dart';
|
export 'src/router.dart';
|
||||||
export 'src/typedefs.dart'
|
export 'src/state.dart' hide GoRouterStateRegistry, GoRouterStateRegistryScope;
|
||||||
show
|
|
||||||
GoRouterPageBuilder,
|
|
||||||
GoRouterRedirect,
|
|
||||||
GoRouterWidgetBuilder,
|
|
||||||
ShellRouteBuilder,
|
|
||||||
ShellRoutePageBuilder,
|
|
||||||
StatefulShellRouteBuilder,
|
|
||||||
StatefulShellRoutePageBuilder;
|
|
||||||
|
@ -5,16 +5,23 @@
|
|||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import '../go_router.dart';
|
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'logging.dart';
|
import 'logging.dart';
|
||||||
import 'match.dart';
|
import 'match.dart';
|
||||||
import 'misc/error_screen.dart';
|
import 'misc/error_screen.dart';
|
||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
import 'pages/cupertino.dart';
|
import 'pages/cupertino.dart';
|
||||||
|
import 'pages/custom_transition_page.dart';
|
||||||
import 'pages/material.dart';
|
import 'pages/material.dart';
|
||||||
|
import 'route.dart';
|
||||||
import 'route_data.dart';
|
import 'route_data.dart';
|
||||||
import 'typedefs.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
|
/// Signature of a go router builder function with navigator.
|
||||||
|
typedef GoRouterBuilderWithNav = Widget Function(
|
||||||
|
BuildContext context,
|
||||||
|
Widget child,
|
||||||
|
);
|
||||||
|
|
||||||
/// Signature for a function that takes in a `route` to be popped with
|
/// Signature for a function that takes in a `route` to be popped with
|
||||||
/// the `result` and returns a boolean decision on whether the pop
|
/// the `result` and returns a boolean decision on whether the pop
|
||||||
|
@ -6,14 +6,16 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'configuration.dart';
|
|
||||||
import 'logging.dart';
|
import 'logging.dart';
|
||||||
import 'match.dart';
|
import 'match.dart';
|
||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
import 'path_utils.dart';
|
import 'path_utils.dart';
|
||||||
import 'typedefs.dart';
|
import 'route.dart';
|
||||||
export 'route.dart';
|
import 'state.dart';
|
||||||
export 'state.dart';
|
|
||||||
|
/// The signature of the redirect callback.
|
||||||
|
typedef GoRouterRedirect = FutureOr<String?> Function(
|
||||||
|
BuildContext context, GoRouterState state);
|
||||||
|
|
||||||
/// The route configuration for GoRouter configured by the app.
|
/// The route configuration for GoRouter configured by the app.
|
||||||
class RouteConfiguration {
|
class RouteConfiguration {
|
||||||
|
@ -7,12 +7,11 @@ import 'dart:async';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import '../go_router.dart';
|
|
||||||
import 'builder.dart';
|
import 'builder.dart';
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'match.dart';
|
import 'match.dart';
|
||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
import 'typedefs.dart';
|
import 'route.dart';
|
||||||
|
|
||||||
/// GoRouter implementation of [RouterDelegate].
|
/// GoRouter implementation of [RouterDelegate].
|
||||||
class GoRouterDelegate extends RouterDelegate<RouteMatchList>
|
class GoRouterDelegate extends RouterDelegate<RouteMatchList>
|
||||||
@ -26,7 +25,6 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
|
|||||||
required GoRouterWidgetBuilder? errorBuilder,
|
required GoRouterWidgetBuilder? errorBuilder,
|
||||||
required List<NavigatorObserver> observers,
|
required List<NavigatorObserver> observers,
|
||||||
required this.routerNeglect,
|
required this.routerNeglect,
|
||||||
required this.onException,
|
|
||||||
String? restorationScopeId,
|
String? restorationScopeId,
|
||||||
}) : _configuration = configuration {
|
}) : _configuration = configuration {
|
||||||
builder = RouteBuilder(
|
builder = RouteBuilder(
|
||||||
@ -47,13 +45,6 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
|
|||||||
/// Set to true to disable creating history entries on the web.
|
/// Set to true to disable creating history entries on the web.
|
||||||
final bool routerNeglect;
|
final bool routerNeglect;
|
||||||
|
|
||||||
/// The exception handler that is called when parser can't handle the incoming
|
|
||||||
/// uri.
|
|
||||||
///
|
|
||||||
/// If this is null, the exception is handled in the
|
|
||||||
/// [RouteBuilder.errorPageBuilder] or [RouteBuilder.errorBuilder].
|
|
||||||
final GoExceptionHandler? onException;
|
|
||||||
|
|
||||||
final RouteConfiguration _configuration;
|
final RouteConfiguration _configuration;
|
||||||
|
|
||||||
_NavigatorStateIterator _createNavigatorStateIterator() =>
|
_NavigatorStateIterator _createNavigatorStateIterator() =>
|
||||||
|
@ -8,10 +8,12 @@ import 'dart:convert';
|
|||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
import 'path_utils.dart';
|
import 'path_utils.dart';
|
||||||
|
import 'route.dart';
|
||||||
|
|
||||||
/// An matched result by matching a [RouteBase] against a location.
|
/// An matched result by matching a [RouteBase] against a location.
|
||||||
///
|
///
|
||||||
@ -355,6 +357,7 @@ class RouteMatchList {
|
|||||||
/// suitable for using with [StandardMessageCodec].
|
/// suitable for using with [StandardMessageCodec].
|
||||||
///
|
///
|
||||||
/// The primary use of this class is for state restoration.
|
/// The primary use of this class is for state restoration.
|
||||||
|
@internal
|
||||||
class RouteMatchListCodec extends Codec<RouteMatchList, Map<Object?, Object?>> {
|
class RouteMatchListCodec extends Codec<RouteMatchList, Map<Object?, Object?>> {
|
||||||
/// Creates a new [RouteMatchListCodec] object.
|
/// Creates a new [RouteMatchListCodec] object.
|
||||||
RouteMatchListCodec(RouteConfiguration configuration)
|
RouteMatchListCodec(RouteConfiguration configuration)
|
||||||
|
@ -8,11 +8,12 @@ import 'dart:math';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import '../go_router.dart';
|
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'information_provider.dart';
|
import 'information_provider.dart';
|
||||||
import 'logging.dart';
|
import 'logging.dart';
|
||||||
import 'match.dart';
|
import 'match.dart';
|
||||||
|
import 'route.dart';
|
||||||
|
import 'router.dart';
|
||||||
|
|
||||||
/// The function signature of [GoRouteInformationParser.onParserException].
|
/// The function signature of [GoRouteInformationParser.onParserException].
|
||||||
///
|
///
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import '../go_router.dart';
|
import 'route.dart';
|
||||||
|
|
||||||
final RegExp _parameterRegExp = RegExp(r':(\w+)(\((?:\\.|[^\\()])+\))?');
|
final RegExp _parameterRegExp = RegExp(r':(\w+)(\((?:\\.|[^\\()])+\))?');
|
||||||
|
|
||||||
|
@ -7,11 +7,55 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
import '../go_router.dart';
|
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'match.dart';
|
import 'match.dart';
|
||||||
import 'path_utils.dart';
|
import 'path_utils.dart';
|
||||||
import 'typedefs.dart';
|
import 'router.dart';
|
||||||
|
import 'state.dart';
|
||||||
|
|
||||||
|
/// The page builder for [GoRoute].
|
||||||
|
typedef GoRouterPageBuilder = Page<dynamic> Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The widget builder for [GoRoute].
|
||||||
|
typedef GoRouterWidgetBuilder = Widget Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The widget builder for [ShellRoute].
|
||||||
|
typedef ShellRouteBuilder = Widget Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
Widget child,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The page builder for [ShellRoute].
|
||||||
|
typedef ShellRoutePageBuilder = Page<dynamic> Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
Widget child,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The widget builder for [StatefulShellRoute].
|
||||||
|
typedef StatefulShellRouteBuilder = Widget Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
StatefulNavigationShell navigationShell,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The page builder for [StatefulShellRoute].
|
||||||
|
typedef StatefulShellRoutePageBuilder = Page<dynamic> Function(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
StatefulNavigationShell navigationShell,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Signature for functions used to build Navigators
|
||||||
|
typedef NavigatorBuilder = Widget Function(
|
||||||
|
List<NavigatorObserver>? observers, String? restorationScopeId);
|
||||||
|
|
||||||
/// The base class for [GoRoute] and [ShellRoute].
|
/// The base class for [GoRoute] and [ShellRoute].
|
||||||
///
|
///
|
||||||
|
@ -11,13 +11,14 @@ import 'package:meta/meta_meta.dart';
|
|||||||
import 'route.dart';
|
import 'route.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
/// A superclass for each route data
|
/// Baseclass for supporting
|
||||||
|
/// [Type-safe routing](https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html).
|
||||||
abstract class RouteData {
|
abstract class RouteData {
|
||||||
/// Default const constructor
|
/// Allows subclasses to have `const` constructors.
|
||||||
const RouteData();
|
const RouteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Baseclass for supporting
|
/// A class to represent a [GoRoute] in
|
||||||
/// [Type-safe routing](https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html).
|
/// [Type-safe routing](https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html).
|
||||||
///
|
///
|
||||||
/// Subclasses must override one of [build], [buildPage], or
|
/// Subclasses must override one of [build], [buildPage], or
|
||||||
@ -123,10 +124,12 @@ abstract class GoRouteData extends RouteData {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Base class for supporting
|
/// A class to represent a [ShellRoute] in
|
||||||
/// [nested navigation](https://pub.dev/packages/go_router#nested-navigation)
|
/// [Type-safe routing](https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html).
|
||||||
abstract class ShellRouteData extends RouteData {
|
abstract class ShellRouteData extends RouteData {
|
||||||
/// Default const constructor
|
/// Allows subclasses to have `const` constructors.
|
||||||
|
///
|
||||||
|
/// [ShellRouteData] is abstract and cannot be instantiated directly.
|
||||||
const ShellRouteData();
|
const ShellRouteData();
|
||||||
|
|
||||||
/// [pageBuilder] is used to build the page
|
/// [pageBuilder] is used to build the page
|
||||||
|
@ -12,7 +12,8 @@ import 'match.dart';
|
|||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
import 'misc/inherited_router.dart';
|
import 'misc/inherited_router.dart';
|
||||||
import 'parser.dart';
|
import 'parser.dart';
|
||||||
import 'typedefs.dart';
|
import 'route.dart';
|
||||||
|
import 'state.dart';
|
||||||
|
|
||||||
/// The function signature of [GoRouter.onException].
|
/// The function signature of [GoRouter.onException].
|
||||||
///
|
///
|
||||||
@ -139,7 +140,6 @@ class GoRouter implements RouterConfig<RouteMatchList> {
|
|||||||
|
|
||||||
routerDelegate = GoRouterDelegate(
|
routerDelegate = GoRouterDelegate(
|
||||||
configuration: configuration,
|
configuration: configuration,
|
||||||
onException: onException,
|
|
||||||
errorPageBuilder: errorPageBuilder,
|
errorPageBuilder: errorPageBuilder,
|
||||||
errorBuilder: errorBuilder,
|
errorBuilder: errorBuilder,
|
||||||
routerNeglect: routerNeglect,
|
routerNeglect: routerNeglect,
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
import 'configuration.dart';
|
import 'configuration.dart';
|
||||||
import 'misc/errors.dart';
|
import 'misc/errors.dart';
|
||||||
@ -181,6 +182,7 @@ class GoRouterState {
|
|||||||
///
|
///
|
||||||
/// Should not be used directly, consider using [GoRouterState.of] to access
|
/// Should not be used directly, consider using [GoRouterState.of] to access
|
||||||
/// [GoRouterState] from the context.
|
/// [GoRouterState] from the context.
|
||||||
|
@internal
|
||||||
class GoRouterStateRegistryScope
|
class GoRouterStateRegistryScope
|
||||||
extends InheritedNotifier<GoRouterStateRegistry> {
|
extends InheritedNotifier<GoRouterStateRegistry> {
|
||||||
/// Creates a GoRouterStateRegistryScope.
|
/// Creates a GoRouterStateRegistryScope.
|
||||||
@ -195,6 +197,7 @@ class GoRouterStateRegistryScope
|
|||||||
///
|
///
|
||||||
/// Should not be used directly, consider using [GoRouterState.of] to access
|
/// Should not be used directly, consider using [GoRouterState.of] to access
|
||||||
/// [GoRouterState] from the context.
|
/// [GoRouterState] from the context.
|
||||||
|
@internal
|
||||||
class GoRouterStateRegistry extends ChangeNotifier {
|
class GoRouterStateRegistry extends ChangeNotifier {
|
||||||
/// creates a [GoRouterStateRegistry].
|
/// creates a [GoRouterStateRegistry].
|
||||||
GoRouterStateRegistry();
|
GoRouterStateRegistry();
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:async' show FutureOr;
|
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
|
|
||||||
import 'configuration.dart';
|
|
||||||
|
|
||||||
/// The widget builder for [GoRoute].
|
|
||||||
typedef GoRouterWidgetBuilder = Widget Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The page builder for [GoRoute].
|
|
||||||
typedef GoRouterPageBuilder = Page<dynamic> Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The widget builder for [ShellRoute].
|
|
||||||
typedef ShellRouteBuilder = Widget Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
Widget child,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The page builder for [ShellRoute].
|
|
||||||
typedef ShellRoutePageBuilder = Page<dynamic> Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
Widget child,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The widget builder for [StatefulShellRoute].
|
|
||||||
typedef StatefulShellRouteBuilder = Widget Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
StatefulNavigationShell navigationShell,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The page builder for [StatefulShellRoute].
|
|
||||||
typedef StatefulShellRoutePageBuilder = Page<dynamic> Function(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
StatefulNavigationShell navigationShell,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Signature of a go router builder function with navigator.
|
|
||||||
typedef GoRouterBuilderWithNav = Widget Function(
|
|
||||||
BuildContext context,
|
|
||||||
Widget child,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// The signature of the redirect callback.
|
|
||||||
typedef GoRouterRedirect = FutureOr<String?> Function(
|
|
||||||
BuildContext context, GoRouterState state);
|
|
||||||
|
|
||||||
/// Signature for functions used to build Navigators
|
|
||||||
typedef NavigatorBuilder = Widget Function(
|
|
||||||
List<NavigatorObserver>? observers, String? restorationScopeId);
|
|
@ -1,7 +1,7 @@
|
|||||||
name: go_router
|
name: go_router
|
||||||
description: A declarative router for Flutter based on Navigation 2 supporting
|
description: A declarative router for Flutter based on Navigation 2 supporting
|
||||||
deep linking, data-driven routes and more
|
deep linking, data-driven routes and more
|
||||||
version: 9.0.1
|
version: 9.0.2
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/go_router
|
repository: https://github.com/flutter/packages/tree/main/packages/go_router
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22
|
||||||
|
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/src/builder.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/configuration.dart';
|
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
import 'package:go_router/src/router.dart';
|
|
||||||
|
|
||||||
import 'test_helpers.dart';
|
import 'test_helpers.dart';
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/src/configuration.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/misc/errors.dart';
|
|
||||||
|
|
||||||
import 'test_helpers.dart';
|
import 'test_helpers.dart';
|
||||||
|
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
import 'package:go_router/src/misc/error_screen.dart';
|
import 'package:go_router/src/misc/error_screen.dart';
|
||||||
import 'package:go_router/src/misc/errors.dart';
|
|
||||||
|
|
||||||
import 'test_helpers.dart';
|
import 'test_helpers.dart';
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('replaceNamed', () {
|
group('replaceNamed', () {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/configuration.dart';
|
import 'package:go_router/src/state.dart';
|
||||||
|
|
||||||
import 'test_helpers.dart';
|
import 'test_helpers.dart';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/src/information_provider.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
const String initialRoute = '/';
|
const String initialRoute = '/';
|
||||||
const String newRoute = '/new';
|
const String newRoute = '/new';
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('RouteMatch', () {
|
group('RouteMatch', () {
|
||||||
|
@ -6,9 +6,8 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/src/configuration.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/match.dart';
|
import 'package:go_router/src/match.dart';
|
||||||
import 'package:go_router/src/router.dart';
|
|
||||||
|
|
||||||
import 'test_helpers.dart';
|
import 'test_helpers.dart';
|
||||||
|
|
||||||
|
@ -5,10 +5,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/configuration.dart';
|
|
||||||
import 'package:go_router/src/information_provider.dart';
|
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
import 'package:go_router/src/parser.dart';
|
|
||||||
|
|
||||||
RouteInformation createRouteInformation(String location, [Object? extra]) {
|
RouteInformation createRouteInformation(String location, [Object? extra]) {
|
||||||
return RouteInformation(
|
return RouteInformation(
|
||||||
|
@ -8,7 +8,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:go_router/src/match.dart';
|
|
||||||
|
|
||||||
Future<GoRouter> createGoRouter(WidgetTester tester) async {
|
Future<GoRouter> createGoRouter(WidgetTester tester) async {
|
||||||
final GoRouter goRouter = GoRouter(
|
final GoRouter goRouter = GoRouter(
|
||||||
|
Reference in New Issue
Block a user