iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📝

[Flutter] Difference between super.key and Key key

に公開

super.key is a new syntax and is recommended because it allows for more concise code compared to (Key? key) : super(key: key).

super.key is the new syntax, made available in Dart 2.17, which first came with Flutter 3.0. Details are at the release notes: https://dart.dev/guides/whats-new#may-11-2022-217-release
The new syntax is much shorter and cleaner, but you'll need to understand both forms for years to come.

https://stackoverflow.com/a/73767149

Discussion