Closed
Description
Step to reproduce:
- do a Flutter create
- in main.dart, use the following code
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(
MaterialApp.router(
routerConfig: GoRouter(
routes: [GoRoute(
name: 'home',
path: '/',
redirect: (context, state) {
print('named lcation ${state.queryParams['abc']}');
return null;
},
builder: (_, state) {
return Text('${state.fullPath}');
}
)]
),
),
);
}
- in pubspec.yaml, adds the following dependecies
go_router: ^7.0.0
- run dart fix --apply
expected result:
The state.queryParams['abc']
should be replaced with state.queryParameters['abc']
actual result:
nothing happens
The fix_data for this entry is in https://github.com/flutter/packages/blob/c3f4c46bbbf1d5d8ad980850aacc82955d187b64/packages/go_router/lib/fix_data.yaml#L109
Note: if in step 3 you replace go_router with path dependency and do a flutter pub get again, dart fix work as expected
go_router:
path: /Users/chtai/git/packages/packages/go_router/