Q: Convert 'key' to a super parameter warning -- how to change existing super calls to use super named parameters? class FooPage extends StatefulWidget {
  const FooPage(Key? key) : super(key: key);

  @override
  State<FooPage> createState() => _FooPageState();
}

Is there any dart fix xyz command I can use to convert all the super(key:key) calls to super.key?
In other words:
Before:
const FooPage({Key? key}) : super(key: key);

After:
const FooPage({super.key});


A: Add this linter rule to your analysis_options.yaml file:
linter:
  rules:
    use_super_parameters: true

Now run
dart fix --apply --code use_super_parameters 

