Use super.key instead of manually passing the Key parameter to the parent class (#147621)
*Use `super.key` instead of manually passing the `Key` parameter using super(key: key) in the constructors.* Since if you create a widget the new default will use `super.key` instead of `Key? key : super(key: key)` this small change is to maintain the consistency, it has no semantic change also there are some other places that might need to be updated:  this file for example generate l10n project and it has all the dart code as String, it might have tests that validate the output somewhere that I might miss, also there are some other places like the `_Segment` class where it require `ValueKey` instead if `Key` so I didn't update them (even though it's possible)
This commit is contained in:
@@ -74,9 +74,9 @@ class _ListViewExampleState extends State<ListViewExample> {
|
||||
|
||||
class KeepAliveItem extends StatefulWidget {
|
||||
const KeepAliveItem({
|
||||
required Key key,
|
||||
required Key super.key,
|
||||
required this.data,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final String data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user