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

@@ -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;