Refactor route focus node creation (#147390)
## Description This fixes an issue in the creation of the `FocusScope` in a route: the route should be creating the `FocusScope` widget it has with `withExternalFocusNode`, since it is modifying the node attributes in a builder. Also modified some `AnimatedBuilder`s to be `ListenableBuilder`s, since they're not using animations (no functionality change there, since the implementation of the two is identical). ## Related Issues - #147256 - Fixes #146844 ## Tests - Updated example test.
This commit is contained in:
@@ -10,7 +10,7 @@ void main() {
|
||||
testWidgets('Tapping FAB increments counter', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.ListenableBuilderExample());
|
||||
|
||||
String getCount() => (tester.widget(find.descendant(of: find.byType(ListenableBuilder), matching: find.byType(Text))) as Text).data!;
|
||||
String getCount() => (tester.widget(find.descendant(of: find.byType(ListenableBuilder).last, matching: find.byType(Text))) as Text).data!;
|
||||
|
||||
expect(find.text('Current counter value:'), findsOneWidget);
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user