From 0f3bfa0bd49185ff38ab4d3a2de4032e3a15d1b8 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:49:34 -0700 Subject: [PATCH 01/16] 1 --- packages/go_router/example/lib/shell_route.dart | 2 +- packages/go_router/lib/src/builder.dart | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/go_router/example/lib/shell_route.dart b/packages/go_router/example/lib/shell_route.dart index 70878b886ed..452609178a9 100644 --- a/packages/go_router/example/lib/shell_route.dart +++ b/packages/go_router/example/lib/shell_route.dart @@ -31,7 +31,7 @@ class ShellRouteExampleApp extends StatelessWidget { final GoRouter _router = GoRouter( navigatorKey: _rootNavigatorKey, initialLocation: '/a', - debugLogDiagnostics: true, + debugLogDiagnostics: true, routes: [ /// Application shell ShellRoute( diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index 0cfdf5efa48..bcaed96a726 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -258,7 +258,10 @@ class RouteBuilder { // Build the Navigator for this shell route Widget buildShellNavigator( - List? observers, String? restorationScopeId) { + List? observers, + String? restorationScopeId, + bool? requestFocus, + ) { return _buildNavigator( pagePopContext.onPopPage, keyToPages[shellNavigatorKey]!, @@ -266,6 +269,7 @@ class RouteBuilder { observers: observers ?? const [], restorationScopeId: restorationScopeId, heroController: heroController, + requestFocus: requestFocus, ); } @@ -298,6 +302,7 @@ class RouteBuilder { List observers = const [], String? restorationScopeId, HeroController? heroController, + bool? requestFocus, }) { final Widget navigator = Navigator( key: navigatorKey, @@ -305,6 +310,7 @@ class RouteBuilder { pages: pages, observers: observers, onPopPage: onPopPage, + requestFocus: requestFocus, ); if (heroController != null) { return HeroControllerScope( From fd8b12d77282c36948956843481c11d9fdc85441 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:28:47 -0700 Subject: [PATCH 02/16] 2 --- packages/go_router/lib/src/builder.dart | 13 +++++++++---- packages/go_router/lib/src/delegate.dart | 2 ++ packages/go_router/lib/src/router.dart | 2 ++ packages/go_router/test/test_helpers.dart | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index bcaed96a726..c6b8da73bd5 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -45,6 +45,7 @@ class RouteBuilder { required this.restorationScopeId, required this.observers, required this.onPopPageWithRouteMatch, + required this.requestFocus, }); /// Builder function for a go router with Navigator. @@ -63,6 +64,9 @@ class RouteBuilder { /// its history. final String? restorationScopeId; + /// + final bool? requestFocus; + /// NavigatorObserver used to receive notifications when navigating in between routes. /// changes. final List observers; @@ -137,6 +141,7 @@ class RouteBuilder { navigatorKey, observers: observers, restorationScopeId: restorationScopeId, + requestFocus: requestFocus, ), ); } @@ -259,9 +264,9 @@ class RouteBuilder { // Build the Navigator for this shell route Widget buildShellNavigator( List? observers, - String? restorationScopeId, - bool? requestFocus, - ) { + String? restorationScopeId, { + bool requestFocus = true, + }) { return _buildNavigator( pagePopContext.onPopPage, keyToPages[shellNavigatorKey]!, @@ -310,7 +315,7 @@ class RouteBuilder { pages: pages, observers: observers, onPopPage: onPopPage, - requestFocus: requestFocus, + requestFocus: requestFocus ?? true, ); if (heroController != null) { return HeroControllerScope( diff --git a/packages/go_router/lib/src/delegate.dart b/packages/go_router/lib/src/delegate.dart index 6265bb67f9e..0f02e8bee0c 100644 --- a/packages/go_router/lib/src/delegate.dart +++ b/packages/go_router/lib/src/delegate.dart @@ -26,6 +26,7 @@ class GoRouterDelegate extends RouterDelegate required List observers, required this.routerNeglect, String? restorationScopeId, + bool? requestFocus, }) : _configuration = configuration { builder = RouteBuilder( configuration: configuration, @@ -35,6 +36,7 @@ class GoRouterDelegate extends RouterDelegate restorationScopeId: restorationScopeId, observers: observers, onPopPageWithRouteMatch: _handlePopPageWithRouteMatch, + requestFocus: requestFocus, ); } diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index 7de73207a22..b18878fe107 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -83,6 +83,7 @@ class GoRouter implements RouterConfig { bool debugLogDiagnostics = false, GlobalKey? navigatorKey, String? restorationScopeId, + bool? requestFocus, }) : backButtonDispatcher = RootBackButtonDispatcher(), assert( initialExtra == null || initialLocation != null, @@ -147,6 +148,7 @@ class GoRouter implements RouterConfig { ...observers ?? [], ], restorationScopeId: restorationScopeId, + requestFocus: requestFocus, // wrap the returned Navigator to enable GoRouter.of(context).go() et al, // allowing the caller to wrap the navigator themselves builderWithNav: (BuildContext context, Widget child) => diff --git a/packages/go_router/test/test_helpers.dart b/packages/go_router/test/test_helpers.dart index 71c89109f99..a028dd12ca0 100644 --- a/packages/go_router/test/test_helpers.dart +++ b/packages/go_router/test/test_helpers.dart @@ -149,6 +149,7 @@ Future createRouter( GoRouterWidgetBuilder? errorBuilder, String? restorationScopeId, GoExceptionHandler? onException, + bool? requestFocus, }) async { final GoRouter goRouter = GoRouter( routes: routes, @@ -160,6 +161,7 @@ Future createRouter( errorBuilder: errorBuilder, navigatorKey: navigatorKey, restorationScopeId: restorationScopeId, + requestFocus: requestFocus, ); await tester.pumpWidget( MaterialApp.router( From e67036a4ce9900a23fbdff92a9b74348726843e5 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:46:29 -0700 Subject: [PATCH 03/16] Update builder_test.dart --- packages/go_router/test/builder_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/go_router/test/builder_test.dart b/packages/go_router/test/builder_test.dart index d3bfb3d6bd2..4fe74eb4599 100644 --- a/packages/go_router/test/builder_test.dart +++ b/packages/go_router/test/builder_test.dart @@ -424,6 +424,7 @@ class _BuilderTestWidget extends StatelessWidget { restorationScopeId: null, observers: [], onPopPageWithRouteMatch: (_, __, ___) => false, + requestFocus: null, ); } From 30eae5677ceda7149eb990b0072816ae246d0ffe Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:57:15 -0700 Subject: [PATCH 04/16] Update shell_route.dart --- packages/go_router/example/lib/shell_route.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router/example/lib/shell_route.dart b/packages/go_router/example/lib/shell_route.dart index 452609178a9..70878b886ed 100644 --- a/packages/go_router/example/lib/shell_route.dart +++ b/packages/go_router/example/lib/shell_route.dart @@ -31,7 +31,7 @@ class ShellRouteExampleApp extends StatelessWidget { final GoRouter _router = GoRouter( navigatorKey: _rootNavigatorKey, initialLocation: '/a', - debugLogDiagnostics: true, + debugLogDiagnostics: true, routes: [ /// Application shell ShellRoute( From 68cd1a6ca0c9b006f09b51f8363207dfa0c31012 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:37:03 -0700 Subject: [PATCH 05/16] Create request_focus.dart --- packages/go_router/test/request_focus.dart | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 packages/go_router/test/request_focus.dart diff --git a/packages/go_router/test/request_focus.dart b/packages/go_router/test/request_focus.dart new file mode 100644 index 00000000000..f9ccc9681f3 --- /dev/null +++ b/packages/go_router/test/request_focus.dart @@ -0,0 +1,61 @@ +// 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 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:go_router/go_router.dart'; + +void main() { + testWidgets('GoRouter does not request focus if requestFocus is false', + (WidgetTester tester) async { + final GlobalKey innerKey = GlobalKey(); + final FocusScopeNode focusNode = FocusScopeNode(); + final GoRouter router = GoRouter( + initialLocation: '/', + routes: [ + GoRoute( + path: '/', + name: 'home', + builder: (_, __) => const Text('A'), + ), + GoRoute( + path: '/second', + name: 'second', + builder: (_, __) => Text('B', key: innerKey), + ), + ], + requestFocus: false, + ); + + await tester.pumpWidget(Column( + children: [ + FocusScope(node: focusNode, child: Container()), + Expanded( + child: MaterialApp.router( + routerConfig: router, + ), + ), + ], + )); + + expect(find.text('A'), findsOneWidget); + expect(find.text('B', skipOffstage: false), findsNothing); + expect(focusNode.hasFocus, false); + focusNode.requestFocus(); + await tester.pumpAndSettle(); + expect(focusNode.hasFocus, true); + + router.pushNamed('second'); + await tester.pumpAndSettle(); + expect(find.text('A', skipOffstage: false), findsOneWidget); + expect(find.text('B'), findsOneWidget); + expect(focusNode.hasFocus, true); + + router.pop(); + await tester.pumpAndSettle(); + expect(find.text('A'), findsOneWidget); + expect(find.text('B', skipOffstage: false), findsNothing); + expect(focusNode.hasFocus, true); + }); +} From 9b3a09889370de41082d23c4334c8ba13458ef82 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:43:11 -0700 Subject: [PATCH 06/16] bump verstion --- packages/go_router/CHANGELOG.md | 4 ++++ packages/go_router/lib/src/builder.dart | 3 ++- packages/go_router/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 2732955beb8..2eb1a7707c9 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## 10.1.0 + +- Supports setting `requestFocus`. + ## 10.0.0 - **BREAKING CHANGE**: diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index c6b8da73bd5..ff4c0035d72 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -64,7 +64,8 @@ class RouteBuilder { /// its history. final String? restorationScopeId; - /// + /// Whether or not the navigator and it's new topmost route should request focus + /// when the new route is pushed onto the navigator. final bool? requestFocus; /// NavigatorObserver used to receive notifications when navigating in between routes. diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index dafbfc4e604..10a04e047c2 100644 --- a/packages/go_router/pubspec.yaml +++ b/packages/go_router/pubspec.yaml @@ -1,7 +1,7 @@ name: go_router description: A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more -version: 10.0.0 +version: 10.0.1 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 From 28fe4845771f23d6067e910129834aa42a83799e Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:57:51 -0700 Subject: [PATCH 07/16] Update pubspec.yaml --- packages/go_router/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index 10a04e047c2..3ad93e7ee93 100644 --- a/packages/go_router/pubspec.yaml +++ b/packages/go_router/pubspec.yaml @@ -1,7 +1,7 @@ name: go_router description: A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more -version: 10.0.1 +version: 10.1.0 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 From 5e58db7444c28420fe66bd40125f7e3490338fb6 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:10:51 -0700 Subject: [PATCH 08/16] Update builder.dart --- packages/go_router/lib/src/builder.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index ff4c0035d72..19426d15b3c 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -45,7 +45,7 @@ class RouteBuilder { required this.restorationScopeId, required this.observers, required this.onPopPageWithRouteMatch, - required this.requestFocus, + this.requestFocus = true, }); /// Builder function for a go router with Navigator. @@ -66,7 +66,9 @@ class RouteBuilder { /// Whether or not the navigator and it's new topmost route should request focus /// when the new route is pushed onto the navigator. - final bool? requestFocus; + /// + /// Defaults to true. + final bool requestFocus; /// NavigatorObserver used to receive notifications when navigating in between routes. /// changes. @@ -308,7 +310,7 @@ class RouteBuilder { List observers = const [], String? restorationScopeId, HeroController? heroController, - bool? requestFocus, + bool requestFocus = true, }) { final Widget navigator = Navigator( key: navigatorKey, @@ -316,7 +318,7 @@ class RouteBuilder { pages: pages, observers: observers, onPopPage: onPopPage, - requestFocus: requestFocus ?? true, + requestFocus: requestFocus, ); if (heroController != null) { return HeroControllerScope( From b66dcfc68fcf40e7df487db01208c2a97905a8b3 Mon Sep 17 00:00:00 2001 From: hangyu Date: Mon, 7 Aug 2023 11:16:12 -0700 Subject: [PATCH 09/16] Update packages/go_router/lib/src/builder.dart Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com> --- packages/go_router/lib/src/builder.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index 19426d15b3c..03b82be002c 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -64,7 +64,7 @@ class RouteBuilder { /// its history. final String? restorationScopeId; - /// Whether or not the navigator and it's new topmost route should request focus + /// Whether or not the navigator created by this builder and it's new topmost route should request focus /// when the new route is pushed onto the navigator. /// /// Defaults to true. From 5576b2198c6c09efe2dec302b99ebad7bb416807 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:37:28 -0700 Subject: [PATCH 10/16] resolve comments --- packages/go_router/README.md | 3 ++- packages/go_router/lib/src/builder.dart | 2 ++ packages/go_router/lib/src/delegate.dart | 2 +- packages/go_router/test/builder_test.dart | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/go_router/README.md b/packages/go_router/README.md index 0a72dd18d20..0bdbe273e13 100644 --- a/packages/go_router/README.md +++ b/packages/go_router/README.md @@ -19,7 +19,8 @@ GoRouter has a number of features to make navigation straightforward: visible at the bottom of the screen - Support for both Material and Cupertino apps -- Backwards-compatibility with Navigator API +- Backwards-compatibility with Navigator API. Support Navigator API such as navigatorKey, + observers, restorationScopeId, requestFocus. ## Documentation See the API documentation for details on the following topics: diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index 03b82be002c..23910767344 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -68,6 +68,8 @@ class RouteBuilder { /// when the new route is pushed onto the navigator. /// /// Defaults to true. + /// + /// {@macro flutter.widgets.navigator.requestFocus} final bool requestFocus; /// NavigatorObserver used to receive notifications when navigating in between routes. diff --git a/packages/go_router/lib/src/delegate.dart b/packages/go_router/lib/src/delegate.dart index 0f02e8bee0c..3a341be7912 100644 --- a/packages/go_router/lib/src/delegate.dart +++ b/packages/go_router/lib/src/delegate.dart @@ -26,7 +26,7 @@ class GoRouterDelegate extends RouterDelegate required List observers, required this.routerNeglect, String? restorationScopeId, - bool? requestFocus, + bool requestFocus = true, }) : _configuration = configuration { builder = RouteBuilder( configuration: configuration, diff --git a/packages/go_router/test/builder_test.dart b/packages/go_router/test/builder_test.dart index 4fe74eb4599..d3bfb3d6bd2 100644 --- a/packages/go_router/test/builder_test.dart +++ b/packages/go_router/test/builder_test.dart @@ -424,7 +424,6 @@ class _BuilderTestWidget extends StatelessWidget { restorationScopeId: null, observers: [], onPopPageWithRouteMatch: (_, __, ___) => false, - requestFocus: null, ); } From 7e1026640cfaf78f0260e999ca4309fe98a8905a Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:40:48 -0700 Subject: [PATCH 11/16] 1 --- packages/go_router/README.md | 3 +-- packages/go_router/lib/src/router.dart | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/go_router/README.md b/packages/go_router/README.md index 0bdbe273e13..0a72dd18d20 100644 --- a/packages/go_router/README.md +++ b/packages/go_router/README.md @@ -19,8 +19,7 @@ GoRouter has a number of features to make navigation straightforward: visible at the bottom of the screen - Support for both Material and Cupertino apps -- Backwards-compatibility with Navigator API. Support Navigator API such as navigatorKey, - observers, restorationScopeId, requestFocus. +- Backwards-compatibility with Navigator API ## Documentation See the API documentation for details on the following topics: diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index b18878fe107..1057016bb09 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -83,7 +83,7 @@ class GoRouter implements RouterConfig { bool debugLogDiagnostics = false, GlobalKey? navigatorKey, String? restorationScopeId, - bool? requestFocus, + bool requestFocus = true, }) : backButtonDispatcher = RootBackButtonDispatcher(), assert( initialExtra == null || initialLocation != null, From 46d0169d6f59fa9551a5e47dbc62f627dcd38ff2 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:44:50 -0700 Subject: [PATCH 12/16] Update router.dart --- packages/go_router/lib/src/router.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index 1057016bb09..9c85f3ff135 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -48,6 +48,8 @@ typedef GoExceptionHandler = void Function( /// provided, go_router builds a default error screen to show the exception. /// See [Error handling](https://pub.dev/documentation/go_router/latest/topics/Error%20handling-topic.html) /// for more details. +/// +/// To disable automatically requesting focus when new routes are pushed to the navigator, set "requestFocus" to false. /// /// See also: /// * [Configuration](https://pub.dev/documentation/go_router/latest/topics/Configuration-topic.html) From fac1b2138c07af0cea3e448c30d17f823c3cfbb5 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:45:53 -0700 Subject: [PATCH 13/16] Update router.dart --- packages/go_router/lib/src/router.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index 9c85f3ff135..972f8516318 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -49,7 +49,7 @@ typedef GoExceptionHandler = void Function( /// See [Error handling](https://pub.dev/documentation/go_router/latest/topics/Error%20handling-topic.html) /// for more details. /// -/// To disable automatically requesting focus when new routes are pushed to the navigator, set "requestFocus" to false. +/// To disable automatically requesting focus when new routes are pushed to the navigator, set `requestFocus` to false. /// /// See also: /// * [Configuration](https://pub.dev/documentation/go_router/latest/topics/Configuration-topic.html) From 627d79ec7d9a390df7a8de70a994a5308726da9c Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:53:48 -0700 Subject: [PATCH 14/16] Update test_helpers.dart --- packages/go_router/test/test_helpers.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router/test/test_helpers.dart b/packages/go_router/test/test_helpers.dart index a028dd12ca0..38420cd2913 100644 --- a/packages/go_router/test/test_helpers.dart +++ b/packages/go_router/test/test_helpers.dart @@ -149,7 +149,7 @@ Future createRouter( GoRouterWidgetBuilder? errorBuilder, String? restorationScopeId, GoExceptionHandler? onException, - bool? requestFocus, + bool requestFocus = true, }) async { final GoRouter goRouter = GoRouter( routes: routes, From bb50ce6d58e532506a2a4dedc706470067011122 Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Mon, 7 Aug 2023 12:02:46 -0700 Subject: [PATCH 15/16] 1 --- packages/go_router/lib/src/builder.dart | 4 ++-- packages/go_router/lib/src/router.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index 23910767344..a4a323ef591 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -66,9 +66,9 @@ class RouteBuilder { /// Whether or not the navigator created by this builder and it's new topmost route should request focus /// when the new route is pushed onto the navigator. - /// + /// /// Defaults to true. - /// + /// /// {@macro flutter.widgets.navigator.requestFocus} final bool requestFocus; diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index 972f8516318..a5671e2fc9d 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -48,7 +48,7 @@ typedef GoExceptionHandler = void Function( /// provided, go_router builds a default error screen to show the exception. /// See [Error handling](https://pub.dev/documentation/go_router/latest/topics/Error%20handling-topic.html) /// for more details. -/// +/// /// To disable automatically requesting focus when new routes are pushed to the navigator, set `requestFocus` to false. /// /// See also: From 033a5fff940064a4e47110b04f3d6d7aa1f4a70d Mon Sep 17 00:00:00 2001 From: hangyu <108393416+hangyujin@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:41:13 -0700 Subject: [PATCH 16/16] Update builder.dart --- packages/go_router/lib/src/builder.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart index a4a323ef591..15c58a96da7 100644 --- a/packages/go_router/lib/src/builder.dart +++ b/packages/go_router/lib/src/builder.dart @@ -68,8 +68,6 @@ class RouteBuilder { /// when the new route is pushed onto the navigator. /// /// Defaults to true. - /// - /// {@macro flutter.widgets.navigator.requestFocus} final bool requestFocus; /// NavigatorObserver used to receive notifications when navigating in between routes.