Prepare more of dev for use_super_parameters (#101073)

This commit is contained in:
Michael Goderbauer
2022-03-30 14:05:05 -07:00
committed by GitHub
parent 75baed585e
commit ca2d60e8e2
109 changed files with 215 additions and 253 deletions

View File

@@ -14,7 +14,7 @@ void main() {
enum ScrollMode { complex, tile }
class ComplexLayoutApp extends StatefulWidget {
const ComplexLayoutApp({Key? key}) : super(key: key);
const ComplexLayoutApp({super.key});
@override
ComplexLayoutAppState createState() => ComplexLayoutAppState();
@@ -55,7 +55,7 @@ class ComplexLayoutAppState extends State<ComplexLayoutApp> {
}
class TileScrollLayout extends StatelessWidget {
const TileScrollLayout({ Key? key }) : super(key: key);
const TileScrollLayout({ super.key });
@override
Widget build(BuildContext context) {
@@ -81,7 +81,7 @@ class TileScrollLayout extends StatelessWidget {
}
class ComplexLayout extends StatefulWidget {
const ComplexLayout({ Key? key }) : super(key: key);
const ComplexLayout({ super.key });
@override
ComplexLayoutState createState() => ComplexLayoutState();
@@ -129,7 +129,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
}
class TopBarMenu extends StatelessWidget {
const TopBarMenu({Key? key}) : super(key: key);
const TopBarMenu({super.key});
@override
Widget build(BuildContext context) {
@@ -182,7 +182,7 @@ class TopBarMenu extends StatelessWidget {
}
class MenuItemWithIcon extends StatelessWidget {
const MenuItemWithIcon(this.icon, this.title, this.subtitle, {Key? key}) : super(key: key);
const MenuItemWithIcon(this.icon, this.title, this.subtitle, {super.key});
final IconData icon;
final String title;
@@ -204,7 +204,7 @@ class MenuItemWithIcon extends StatelessWidget {
}
class FancyImageItem extends StatelessWidget {
const FancyImageItem(this.index, {Key? key}) : super(key: key);
const FancyImageItem(this.index, {super.key});
final int index;
@@ -228,7 +228,7 @@ class FancyImageItem extends StatelessWidget {
}
class FancyGalleryItem extends StatelessWidget {
const FancyGalleryItem(this.index, {Key? key}) : super(key: key);
const FancyGalleryItem(this.index, {super.key});
final int index;
@override
@@ -250,7 +250,7 @@ class FancyGalleryItem extends StatelessWidget {
}
class InfoBar extends StatelessWidget {
const InfoBar({Key? key}) : super(key: key);
const InfoBar({super.key});
@override
Widget build(BuildContext context) {
@@ -268,7 +268,7 @@ class InfoBar extends StatelessWidget {
}
class IconBar extends StatelessWidget {
const IconBar({Key? key}) : super(key: key);
const IconBar({super.key});
@override
Widget build(BuildContext context) {
@@ -287,7 +287,7 @@ class IconBar extends StatelessWidget {
}
class IconWithText extends StatelessWidget {
const IconWithText(this.icon, this.title, {Key? key}) : super(key: key);
const IconWithText(this.icon, this.title, {super.key});
final IconData icon;
final String title;
@@ -308,7 +308,7 @@ class IconWithText extends StatelessWidget {
}
class MiniIconWithText extends StatelessWidget {
const MiniIconWithText(this.icon, this.title, {Key? key}) : super(key: key);
const MiniIconWithText(this.icon, this.title, {super.key});
final IconData icon;
final String title;
@@ -337,7 +337,7 @@ class MiniIconWithText extends StatelessWidget {
}
class FatDivider extends StatelessWidget {
const FatDivider({Key? key}) : super(key: key);
const FatDivider({super.key});
@override
Widget build(BuildContext context) {
@@ -349,7 +349,7 @@ class FatDivider extends StatelessWidget {
}
class UserHeader extends StatelessWidget {
const UserHeader(this.userName, {Key? key}) : super(key: key);
const UserHeader(this.userName, {super.key});
final String userName;
@@ -397,7 +397,7 @@ class UserHeader extends StatelessWidget {
}
class ItemDescription extends StatelessWidget {
const ItemDescription({Key? key}) : super(key: key);
const ItemDescription({super.key});
@override
Widget build(BuildContext context) {
@@ -409,7 +409,7 @@ class ItemDescription extends StatelessWidget {
}
class ItemImageBox extends StatelessWidget {
const ItemImageBox({Key? key}) : super(key: key);
const ItemImageBox({super.key});
@override
Widget build(BuildContext context) {
@@ -490,7 +490,7 @@ class ItemImageBox extends StatelessWidget {
}
class ItemGalleryBox extends StatelessWidget {
const ItemGalleryBox(this.index, {Key? key}) : super(key: key);
const ItemGalleryBox(this.index, {super.key});
final int index;
@@ -559,7 +559,7 @@ class ItemGalleryBox extends StatelessWidget {
}
class BottomBar extends StatelessWidget {
const BottomBar({Key? key}) : super(key: key);
const BottomBar({super.key});
@override
Widget build(BuildContext context) {
@@ -586,7 +586,7 @@ class BottomBar extends StatelessWidget {
}
class BottomBarButton extends StatelessWidget {
const BottomBarButton(this.icon, this.title, {Key? key}) : super(key: key);
const BottomBarButton(this.icon, this.title, {super.key});
final IconData icon;
final String title;
@@ -609,7 +609,7 @@ class BottomBarButton extends StatelessWidget {
}
class GalleryDrawer extends StatelessWidget {
const GalleryDrawer({ Key? key }) : super(key: key);
const GalleryDrawer({ super.key });
void _changeTheme(BuildContext context, bool value) {
ComplexLayoutApp.of(context)?.lightTheme = value;
@@ -680,7 +680,7 @@ class GalleryDrawer extends StatelessWidget {
}
class FancyDrawerHeader extends StatelessWidget {
const FancyDrawerHeader({Key? key}) : super(key: key);
const FancyDrawerHeader({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -35,7 +35,7 @@ const String kMacrobenchmarks = 'Macrobenchmarks';
void main() => runApp(const MacrobenchmarksApp());
class MacrobenchmarksApp extends StatelessWidget {
const MacrobenchmarksApp({Key? key, this.initialRoute = '/'}) : super(key: key);
const MacrobenchmarksApp({super.key, this.initialRoute = '/'});
@override
Widget build(BuildContext context) {
@@ -77,7 +77,7 @@ class MacrobenchmarksApp extends StatelessWidget {
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
const HomePage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AnimatedImagePage extends StatelessWidget {
const AnimatedImagePage({Key? key, this.onFrame}) : super(key: key);
const AnimatedImagePage({super.key, this.onFrame});
final ValueChanged<int>? onFrame;

View File

@@ -24,7 +24,7 @@ const String kBlueSquare = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAASEl'
/// A 10x10 grid of animated looping placeholder gifts that fade into a
/// blue square.
class AnimatedPlaceholderPage extends StatelessWidget {
const AnimatedPlaceholderPage({Key? key}) : super(key: key);
const AnimatedPlaceholderPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AnimationWithMicrotasks extends StatefulWidget {
const AnimationWithMicrotasks({Key? key}) : super(key: key);
const AnimationWithMicrotasks({super.key});
@override
State<AnimationWithMicrotasks> createState() => _AnimationWithMicrotasksState();

View File

@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
class BackdropFilterPage extends StatefulWidget {
const BackdropFilterPage({Key? key}) : super(key: key);
const BackdropFilterPage({super.key});
@override
State<BackdropFilterPage> createState() => _BackdropFilterPageState();

View File

@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
// This tests whether the Opacity layer raster cache works with color filters.
// See https://github.com/flutter/flutter/issues/51975.
class ColorFilterAndFadePage extends StatefulWidget {
const ColorFilterAndFadePage({Key? key}) : super(key: key);
const ColorFilterAndFadePage({super.key});
@override
State<ColorFilterAndFadePage> createState() => _ColorFilterAndFadePageState();

View File

@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
class ColorFilterCachePage extends StatefulWidget {
const ColorFilterCachePage({Key? key}) : super(key: key);
const ColorFilterCachePage({super.key});
@override
State<ColorFilterCachePage> createState() => _ColorFilterCachePageState();
}

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
// Based on https://github.com/eseidelGoogle/bezier_perf/blob/master/lib/main.dart
class CubicBezierPage extends StatelessWidget {
const CubicBezierPage({Key? key}) : super(key: key);
const CubicBezierPage({super.key});
@override
Widget build(BuildContext context) {
@@ -24,7 +24,7 @@ class CubicBezierPage extends StatelessWidget {
}
class Bezier extends StatelessWidget {
const Bezier(this.color, this.scale, {Key? key, this.blur = 0.0, this.delay = 0.0}) : super(key: key);
const Bezier(this.color, this.scale, {super.key, this.blur = 0.0, this.delay = 0.0});
final Color color;
final double scale;
@@ -93,7 +93,7 @@ class PathDetail {
}
class AnimatedBezier extends StatefulWidget {
const AnimatedBezier(this.color, this.scale, {Key? key, this.blur = 0.0}) : super(key: key);
const AnimatedBezier(this.color, this.scale, {super.key, this.blur = 0.0});
final Color color;
final double scale;

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class CullOpacityPage extends StatefulWidget {
const CullOpacityPage({Key? key}) : super(key: key);
const CullOpacityPage({super.key});
@override
State<StatefulWidget> createState() => _CullOpacityPageState();

View File

@@ -13,10 +13,10 @@ enum FilterType {
class FilteredChildAnimationPage extends StatefulWidget {
const FilteredChildAnimationPage(this.initialFilterType, {
Key? key,
super.key,
this.initialComplexChild = true,
this.initialUseRepaintBoundary = true,
}) : super(key: key);
});
final FilterType initialFilterType;
final bool initialComplexChild;

View File

@@ -48,7 +48,7 @@ const String textLotsOfText = 'Lorem ipsum dolor sit amet, consectetur '
'🦻 👃 🫀 🫁 🧠 🦷 🦴 👀 👁 👅 👄 💋 🩸';
class TextFieldPage extends StatelessWidget {
const TextFieldPage({Key? key}) : super(key: key);
const TextFieldPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class HeavyGridViewPage extends StatelessWidget {
const HeavyGridViewPage({Key? key}) : super(key: key);
const HeavyGridViewPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
/// Displays a new (from image cache's perspective) large image every 500ms.
class LargeImageChangerPage extends StatefulWidget {
const LargeImageChangerPage({Key? key}) : super(key: key);
const LargeImageChangerPage({super.key});
@override
State<LargeImageChangerPage> createState() => _LargeImageChangerState();

View File

@@ -7,7 +7,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
class LargeImagesPage extends StatelessWidget {
const LargeImagesPage({Key? key}) : super(key: key);
const LargeImagesPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -5,8 +5,7 @@
import 'package:flutter/material.dart';
class MultiWidgetConstructTable extends StatefulWidget {
const MultiWidgetConstructTable(this.columnCount, this.rowCount, {Key? key})
: super(key: key);
const MultiWidgetConstructTable(this.columnCount, this.rowCount, {super.key});
final int columnCount;
final int rowCount;
@@ -98,8 +97,7 @@ class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable>
// This class is intended to break the original Widget tree
class MyContainer extends StatelessWidget {
const MyContainer({required this.color, required this.child, required this.constraints, Key? key})
: super(key: key);
const MyContainer({required this.color, required this.child, required this.constraints, super.key});
final Color color;
final Widget child;
final BoxConstraints constraints;

View File

@@ -12,7 +12,7 @@ import '../common.dart';
// combinations of children that can apply it themselves.
// See https://github.com/flutter/flutter/issues/75697
class OpacityPeepholePage extends StatelessWidget {
const OpacityPeepholePage({Key? key}) : super(key: key);
const OpacityPeepholePage({super.key});
@override
Widget build(BuildContext context) {
@@ -419,7 +419,7 @@ Map<String, WidgetBuilder> opacityPeepholeRoutes = <String, WidgetBuilder>{
};
class VariantPage extends StatefulWidget {
const VariantPage({Key? key, required this.variant}) : super(key: key);
const VariantPage({super.key, required this.variant});
final OpacityPeepholeCase variant;

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class PictureCachePage extends StatelessWidget {
const PictureCachePage({Key? key}) : super(key: key);
const PictureCachePage({super.key});
static const List<String> kTabNames = <String>['1', '2', '3', '4', '5'];
@@ -45,8 +45,7 @@ class PictureCachePage extends StatelessWidget {
}
class ListItem extends StatelessWidget {
const ListItem({Key? key, required this.index})
: super(key: key);
const ListItem({super.key, required this.index});
final int index;

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class PictureCacheComplexityScoringPage extends StatelessWidget {
const PictureCacheComplexityScoringPage({Key? key}) : super(key: key);
const PictureCacheComplexityScoringPage({super.key});
static const List<String> kTabNames = <String>['1', '2'];

View File

@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
class PostBackdropFilterPage extends StatefulWidget {
const PostBackdropFilterPage({Key? key}) : super(key: key);
const PostBackdropFilterPage({super.key});
@override
State<PostBackdropFilterPage> createState() => _PostBackdropFilterPageState();

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'picture_cache.dart';
class ShaderMaskCachePage extends StatefulWidget {
const ShaderMaskCachePage({Key? key}) : super(key: key);
const ShaderMaskCachePage({super.key});
@override
State<ShaderMaskCachePage> createState() => _ShaderMaskCachePageState();
}

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class SimpleAnimationPage extends StatelessWidget {
const SimpleAnimationPage({Key? key}) : super(key: key);
const SimpleAnimationPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class SimpleScroll extends StatelessWidget {
const SimpleScroll({Key? key}) : super(key: key);
const SimpleScroll({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -81,7 +81,7 @@ final GetStackPointerCallback getStackPointer = () {
}();
class StackSizePage extends StatelessWidget {
const StackSizePage({Key? key}) : super(key: key);
const StackSizePage({super.key});
@override
Widget build(BuildContext context) {
@@ -100,7 +100,7 @@ class StackSizePage extends StatelessWidget {
}
class ParentWidget extends StatelessWidget {
const ParentWidget({Key? key}) : super(key: key);
const ParentWidget({super.key});
@override
Widget build(BuildContext context) {
@@ -110,7 +110,7 @@ class ParentWidget extends StatelessWidget {
}
class ChildWidget extends StatelessWidget {
const ChildWidget({required this.parentStackSize, Key? key}) : super(key: key);
const ChildWidget({required this.parentStackSize, super.key});
final int parentStackSize;
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class TextPage extends StatelessWidget {
const TextPage({Key? key}) : super(key: key);
const TextPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -52,7 +52,7 @@ class BenchBuildImage extends WidgetRecorder {
}
class _RotatingWidget extends StatefulWidget {
const _RotatingWidget({required this.child, Key? key}) : super(key: key);
const _RotatingWidget({required this.child});
final Widget child;

View File

@@ -35,7 +35,7 @@ class BenchCardInfiniteScroll extends WidgetRecorder {
}
class _InfiniteScrollCards extends StatefulWidget {
const _InfiniteScrollCards(this.initialOffset, this.finalOffset, {Key? key}) : super(key: key);
const _InfiniteScrollCards(this.initialOffset, this.finalOffset);
final double initialOffset;
final double finalOffset;

View File

@@ -36,7 +36,7 @@ class BenchLinkInfiniteScroll extends WidgetRecorder {
}
class _InfiniteScrollLinks extends StatefulWidget {
const _InfiniteScrollLinks(this.initialOffset, this.finalOffset, {Key? key}) : super(key: key);
const _InfiniteScrollLinks(this.initialOffset, this.finalOffset);
final double initialOffset;
final double finalOffset;

View File

@@ -26,7 +26,7 @@ class BenchPageViewScrollLineThrough extends WidgetRecorder {
}
class _MyScrollContainer extends StatefulWidget {
const _MyScrollContainer({Key? key}) : super(key: key);
const _MyScrollContainer();
@override
State<_MyScrollContainer> createState() => _MyScrollContainerState();

View File

@@ -336,14 +336,13 @@ final List<Palette> allPalettes = <Palette>[
class ColorItem extends StatelessWidget {
const ColorItem({
Key? key,
super.key,
required this.index,
required this.color,
this.prefix = '',
}) : assert(index != null),
assert(color != null),
assert(prefix != null),
super(key: key);
assert(prefix != null);
final int index;
final Color color;
@@ -378,9 +377,9 @@ class ColorItem extends StatelessWidget {
class PaletteTabView extends StatelessWidget {
const PaletteTabView({
Key? key,
super.key,
required this.colors,
}) : super(key: key);
});
final Palette colors;
@@ -431,7 +430,7 @@ class PaletteTabView extends StatelessWidget {
}
class ColorsDemo extends StatelessWidget {
const ColorsDemo({Key? key}) : super(key: key);
const ColorsDemo({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -29,7 +29,7 @@ class BenchWrapBoxScroll extends WidgetRecorder {
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
@@ -82,7 +82,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
class ProductPreview extends StatelessWidget {
const ProductPreview(this.previewIndex, {Key? key}) : super(key: key);
const ProductPreview(this.previewIndex, {super.key});
final int previewIndex;
@@ -141,9 +141,9 @@ class ProductPreview extends StatelessWidget {
class ProductOption extends StatelessWidget {
const ProductOption({
Key? key,
super.key,
required this.optionText,
}) : super(key: key);
});
final String optionText;

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class ButtonMatrixApp extends StatefulWidget {
const ButtonMatrixApp({Key? key}) : super(key: key);
const ButtonMatrixApp({super.key});
@override
ButtonMatrixAppState createState() => ButtonMatrixAppState();

View File

@@ -15,7 +15,7 @@ void topMain() => runApp(const MyApp(Colors.green));
void bottomMain() => runApp(const MyApp(Colors.purple));
class MyApp extends StatelessWidget {
const MyApp(this.color, {Key? key}) : super(key: key);
const MyApp(this.color, {super.key});
final Color color;
@@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, this.title}) : super(key: key);
const MyHomePage({super.key, this.title});
final String? title;
@override

View File

@@ -275,7 +275,7 @@ Future<void> _runTests() async {
}
class _BenchmarkWidget extends StatefulWidget {
const _BenchmarkWidget(this.tests, {Key? key}) : super(key: key);
const _BenchmarkWidget(this.tests);
final Future<void> Function() tests;

View File

@@ -10,7 +10,7 @@ import 'stock_strings.dart';
/// The translations for English (`en`).
class StockStringsEn extends StockStrings {
StockStringsEn([String locale = 'en']) : super(locale);
StockStringsEn([super.locale = 'en']);
@override
String get title => 'Stocks';

View File

@@ -10,7 +10,7 @@ import 'stock_strings.dart';
/// The translations for Spanish Castilian (`es`).
class StockStringsEs extends StockStrings {
StockStringsEs([String locale = 'es']) : super(locale);
StockStringsEs([super.locale = 'es']);
@override
String get title => 'Acciones';

View File

@@ -20,7 +20,7 @@ import 'stock_symbol_viewer.dart';
import 'stock_types.dart';
class StocksApp extends StatefulWidget {
const StocksApp({Key? key}) : super(key: key);
const StocksApp({super.key});
@override
StocksAppState createState() => StocksAppState();

View File

@@ -56,7 +56,7 @@ class StockArrowPainter extends CustomPainter {
}
class StockArrow extends StatelessWidget {
const StockArrow({ Key? key, required this.percentChange }) : super(key: key);
const StockArrow({ super.key, required this.percentChange });
final double percentChange;

View File

@@ -52,7 +52,7 @@ class _NotImplementedDialog extends StatelessWidget {
}
class StockHome extends StatefulWidget {
const StockHome(this.stocks, this.configuration, this.updater, {Key? key}) : super(key: key);
const StockHome(this.stocks, this.configuration, this.updater, {super.key});
final StockData stocks;
final StockConfiguration configuration;

View File

@@ -9,12 +9,12 @@ import 'stock_row.dart';
class StockList extends StatelessWidget {
const StockList({
Key? key,
super.key,
required this.stocks,
required this.onOpen,
required this.onShow,
required this.onAction,
}) : super(key: key);
});
final List<Stock> stocks;
final StockRowActionCallback onOpen;

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'stock_types.dart';
class StockSettings extends StatefulWidget {
const StockSettings(this.configuration, this.updater, {Key? key}) : super(key: key);
const StockSettings(this.configuration, this.updater, {super.key});
final StockConfiguration configuration;
final ValueChanged<StockConfiguration> updater;

View File

@@ -69,10 +69,10 @@ class _StockSymbolView extends StatelessWidget {
class StockSymbolPage extends StatelessWidget {
const StockSymbolPage({
Key? key,
super.key,
required this.symbol,
required this.stocks,
}) : super(key: key);
});
final String symbol;
final StockData stocks;
@@ -121,9 +121,9 @@ class StockSymbolPage extends StatelessWidget {
class StockSymbolBottomSheet extends StatelessWidget {
const StockSymbolBottomSheet({
Key? key,
super.key,
required this.stock,
}) : super(key: key);
});
final Stock stock;