flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Use super params in macro-generated code

Open goderbauer opened this issue 3 years ago • 1 comments

The stless and friends macros should generate code that uses the new super param feature if it is available. Super parameters are available when the lower SDK bound of the package is at least 2.17.0-0.

The stless macro should for example generate the following code:

class Foo extends StatelessWidget {
  const Foo({super.key});

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

More about super parameters: https://github.com/dart-lang/language/issues/1855 Tracking issue for the flutter framework: https://github.com/flutter/flutter/issues/100575 Same request for Dart Code: https://github.com/Dart-Code/Dart-Code/issues/3899

goderbauer avatar Apr 01 '22 17:04 goderbauer

We're going to see about moving support for this into the analyzer.

stevemessick avatar Apr 28 '22 17:04 stevemessick