Skip to content

Commit 4040570

Browse files
authored
Removed deprecated NavigatorState.focusScopeNode (#139260)
Part of flutter/flutter#139243 Deprecated in flutter/flutter#109702 The replacement for focusScopeNode is focusNode.enclosingScope
1 parent 12aa198 commit 4040570

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

‎packages/flutter/lib/fix_data/fix_widgets/fix_widgets.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
# * ListWheelScrollView: fix_list_wheel_scroll_view.yaml
2424
version: 1
2525
transforms:
26+
# Changes made in TBD
27+
- title: "Migrate to focusNode.enclosingScope!"
28+
date: 2023-11-29
29+
element:
30+
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
31+
getter: 'focusScopeNode'
32+
inClass: 'NavigatorState'
33+
changes:
34+
- kind: 'rename'
35+
newName: 'focusNode.enclosingScope!'
36+
2637
# Changes made in https://github.com/flutter/flutter/pull/138509
2738
- title: "Migrate to 'PlatformMenuBar.child'"
2839
date: 2023-11-15

‎packages/flutter/lib/src/widgets/navigator.dart‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,13 +3505,6 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
35053505
final Queue<_NavigatorObservation> _observedRouteAdditions = Queue<_NavigatorObservation>();
35063506
final Queue<_NavigatorObservation> _observedRouteDeletions = Queue<_NavigatorObservation>();
35073507

3508-
/// The [FocusScopeNode] for the [FocusScope] that encloses the topmost navigator.
3509-
@Deprecated(
3510-
'Use focusNode.enclosingScope! instead. '
3511-
'This feature was deprecated after v3.1.0-0.0.pre.'
3512-
)
3513-
FocusScopeNode get focusScopeNode => focusNode.enclosingScope!;
3514-
35153508
/// The [FocusNode] for the [Focus] that encloses the routes.
35163509
final FocusNode focusNode = FocusNode(debugLabel: 'Navigator');
35173510

‎packages/flutter/test_fixes/widgets/widgets.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,8 @@ void main() {
173173

174174
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox());
175175
final Widget bodyValue = platformMenuBar.body;
176+
177+
// Changes made in TBD
178+
final NavigatorState state = Navigator.of(context);
179+
state.focusScopeNode;
176180
}

‎packages/flutter/test_fixes/widgets/widgets.dart.expect‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,8 @@ void main() {
173173

174174
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox());
175175
final Widget bodyValue = platformMenuBar.child;
176+
177+
// Changes made in TBD
178+
final NavigatorState state = Navigator.of(context);
179+
state.focusNode.enclosingScope!;
176180
}

0 commit comments

Comments
 (0)