Unverified Commit 0f568298 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

enable use_key_in_widget_constructors lint (#77032)

parent 6ec90142
...@@ -168,8 +168,8 @@ linter: ...@@ -168,8 +168,8 @@ linter:
- prefer_if_null_operators - prefer_if_null_operators
- prefer_initializing_formals - prefer_initializing_formals
- prefer_inlined_adds - prefer_inlined_adds
# - prefer_int_literals # not yet tested # - prefer_int_literals # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-double-literals-for-double-constants
# - prefer_interpolation_to_compose_strings # not yet tested # - prefer_interpolation_to_compose_strings # doesn't work with raw strings, see https://github.com/dart-lang/linter/issues/2490
- prefer_is_empty - prefer_is_empty
- prefer_is_not_empty - prefer_is_not_empty
- prefer_is_not_operator - prefer_is_not_operator
...@@ -220,7 +220,7 @@ linter: ...@@ -220,7 +220,7 @@ linter:
# - use_function_type_syntax_for_parameters # not yet tested # - use_function_type_syntax_for_parameters # not yet tested
# - use_if_null_to_convert_nulls_to_bools # not yet tested # - use_if_null_to_convert_nulls_to_bools # not yet tested
- use_is_even_rather_than_modulo - use_is_even_rather_than_modulo
# - use_key_in_widget_constructors # not yet tested - use_key_in_widget_constructors
- use_late_for_private_fields_and_variables - use_late_for_private_fields_and_variables
# - use_named_constants # not yet yested # - use_named_constants # not yet yested
- use_raw_strings - use_raw_strings
......
...@@ -7,13 +7,15 @@ import 'package:flutter/scheduler.dart' show timeDilation; ...@@ -7,13 +7,15 @@ import 'package:flutter/scheduler.dart' show timeDilation;
void main() { void main() {
runApp( runApp(
ComplexLayoutApp() const ComplexLayoutApp()
); );
} }
enum ScrollMode { complex, tile } enum ScrollMode { complex, tile }
class ComplexLayoutApp extends StatefulWidget { class ComplexLayoutApp extends StatefulWidget {
const ComplexLayoutApp({Key key}) : super(key: key);
@override @override
ComplexLayoutAppState createState() => ComplexLayoutAppState(); ComplexLayoutAppState createState() => ComplexLayoutAppState();
...@@ -68,7 +70,7 @@ class TileScrollLayout extends StatelessWidget { ...@@ -68,7 +70,7 @@ class TileScrollLayout extends StatelessWidget {
child: Material( child: Material(
elevation: (index % 5 + 1).toDouble(), elevation: (index % 5 + 1).toDouble(),
color: Colors.white, color: Colors.white,
child: IconBar(), child: const IconBar(),
), ),
); );
}, },
...@@ -101,7 +103,7 @@ class ComplexLayoutState extends State<ComplexLayout> { ...@@ -101,7 +103,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
print('Pressed search'); print('Pressed search');
}, },
), ),
TopBarMenu(), const TopBarMenu(),
], ],
), ),
body: Column( body: Column(
...@@ -118,7 +120,7 @@ class ComplexLayoutState extends State<ComplexLayout> { ...@@ -118,7 +120,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
}, },
), ),
), ),
BottomBar(), const BottomBar(),
], ],
), ),
drawer: const GalleryDrawer(), drawer: const GalleryDrawer(),
...@@ -127,6 +129,8 @@ class ComplexLayoutState extends State<ComplexLayout> { ...@@ -127,6 +129,8 @@ class ComplexLayoutState extends State<ComplexLayout> {
} }
class TopBarMenu extends StatelessWidget { class TopBarMenu extends StatelessWidget {
const TopBarMenu({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return PopupMenuButton<String>( return PopupMenuButton<String>(
...@@ -178,7 +182,7 @@ class TopBarMenu extends StatelessWidget { ...@@ -178,7 +182,7 @@ class TopBarMenu extends StatelessWidget {
} }
class MenuItemWithIcon extends StatelessWidget { class MenuItemWithIcon extends StatelessWidget {
const MenuItemWithIcon(this.icon, this.title, this.subtitle); const MenuItemWithIcon(this.icon, this.title, this.subtitle, {Key key}) : super(key: key);
final IconData icon; final IconData icon;
final String title; final String title;
...@@ -209,15 +213,15 @@ class FancyImageItem extends StatelessWidget { ...@@ -209,15 +213,15 @@ class FancyImageItem extends StatelessWidget {
return ListBody( return ListBody(
children: <Widget>[ children: <Widget>[
UserHeader('Ali Connors $index'), UserHeader('Ali Connors $index'),
ItemDescription(), const ItemDescription(),
ItemImageBox(), const ItemImageBox(),
InfoBar(), const InfoBar(),
const Padding( const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0), padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider(), child: Divider(),
), ),
IconBar(), const IconBar(),
FatDivider(), const FatDivider(),
], ],
); );
} }
...@@ -233,19 +237,21 @@ class FancyGalleryItem extends StatelessWidget { ...@@ -233,19 +237,21 @@ class FancyGalleryItem extends StatelessWidget {
children: <Widget>[ children: <Widget>[
const UserHeader('Ali Connors'), const UserHeader('Ali Connors'),
ItemGalleryBox(index), ItemGalleryBox(index),
InfoBar(), const InfoBar(),
const Padding( const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0), padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider(), child: Divider(),
), ),
IconBar(), const IconBar(),
FatDivider(), const FatDivider(),
], ],
); );
} }
} }
class InfoBar extends StatelessWidget { class InfoBar extends StatelessWidget {
const InfoBar({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
...@@ -262,6 +268,8 @@ class InfoBar extends StatelessWidget { ...@@ -262,6 +268,8 @@ class InfoBar extends StatelessWidget {
} }
class IconBar extends StatelessWidget { class IconBar extends StatelessWidget {
const IconBar({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
...@@ -279,7 +287,7 @@ class IconBar extends StatelessWidget { ...@@ -279,7 +287,7 @@ class IconBar extends StatelessWidget {
} }
class IconWithText extends StatelessWidget { class IconWithText extends StatelessWidget {
const IconWithText(this.icon, this.title); const IconWithText(this.icon, this.title, {Key key}) : super(key: key);
final IconData icon; final IconData icon;
final String title; final String title;
...@@ -300,7 +308,7 @@ class IconWithText extends StatelessWidget { ...@@ -300,7 +308,7 @@ class IconWithText extends StatelessWidget {
} }
class MiniIconWithText extends StatelessWidget { class MiniIconWithText extends StatelessWidget {
const MiniIconWithText(this.icon, this.title); const MiniIconWithText(this.icon, this.title, {Key key}) : super(key: key);
final IconData icon; final IconData icon;
final String title; final String title;
...@@ -329,6 +337,8 @@ class MiniIconWithText extends StatelessWidget { ...@@ -329,6 +337,8 @@ class MiniIconWithText extends StatelessWidget {
} }
class FatDivider extends StatelessWidget { class FatDivider extends StatelessWidget {
const FatDivider({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
...@@ -339,7 +349,7 @@ class FatDivider extends StatelessWidget { ...@@ -339,7 +349,7 @@ class FatDivider extends StatelessWidget {
} }
class UserHeader extends StatelessWidget { class UserHeader extends StatelessWidget {
const UserHeader(this.userName); const UserHeader(this.userName, {Key key}) : super(key: key);
final String userName; final String userName;
...@@ -380,7 +390,7 @@ class UserHeader extends StatelessWidget { ...@@ -380,7 +390,7 @@ class UserHeader extends StatelessWidget {
], ],
), ),
), ),
TopBarMenu(), const TopBarMenu(),
], ],
), ),
); );
...@@ -388,6 +398,8 @@ class UserHeader extends StatelessWidget { ...@@ -388,6 +398,8 @@ class UserHeader extends StatelessWidget {
} }
class ItemDescription extends StatelessWidget { class ItemDescription extends StatelessWidget {
const ItemDescription({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Padding( return const Padding(
...@@ -398,6 +410,8 @@ class ItemDescription extends StatelessWidget { ...@@ -398,6 +410,8 @@ class ItemDescription extends StatelessWidget {
} }
class ItemImageBox extends StatelessWidget { class ItemImageBox extends StatelessWidget {
const ItemImageBox({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
...@@ -477,7 +491,7 @@ class ItemImageBox extends StatelessWidget { ...@@ -477,7 +491,7 @@ class ItemImageBox extends StatelessWidget {
} }
class ItemGalleryBox extends StatelessWidget { class ItemGalleryBox extends StatelessWidget {
const ItemGalleryBox(this.index); const ItemGalleryBox(this.index, {Key key}) : super(key: key);
final int index; final int index;
...@@ -548,6 +562,8 @@ class ItemGalleryBox extends StatelessWidget { ...@@ -548,6 +562,8 @@ class ItemGalleryBox extends StatelessWidget {
} }
class BottomBar extends StatelessWidget { class BottomBar extends StatelessWidget {
const BottomBar({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
...@@ -574,7 +590,7 @@ class BottomBar extends StatelessWidget { ...@@ -574,7 +590,7 @@ class BottomBar extends StatelessWidget {
} }
class BottomBarButton extends StatelessWidget { class BottomBarButton extends StatelessWidget {
const BottomBarButton(this.icon, this.title); const BottomBarButton(this.icon, this.title, {Key key}) : super(key: key);
final IconData icon; final IconData icon;
final String title; final String title;
...@@ -618,7 +634,7 @@ class GalleryDrawer extends StatelessWidget { ...@@ -618,7 +634,7 @@ class GalleryDrawer extends StatelessWidget {
key: const PageStorageKey<String>('gallery-drawer'), key: const PageStorageKey<String>('gallery-drawer'),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: <Widget>[ children: <Widget>[
FancyDrawerHeader(), const FancyDrawerHeader(),
ListTile( ListTile(
key: const Key('scroll-switcher'), key: const Key('scroll-switcher'),
title: const Text('Scroll Mode'), title: const Text('Scroll Mode'),
...@@ -668,6 +684,8 @@ class GalleryDrawer extends StatelessWidget { ...@@ -668,6 +684,8 @@ class GalleryDrawer extends StatelessWidget {
} }
class FancyDrawerHeader extends StatelessWidget { class FancyDrawerHeader extends StatelessWidget {
const FancyDrawerHeader({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
......
...@@ -27,7 +27,7 @@ Future<void> main() async { ...@@ -27,7 +27,7 @@ Future<void> main() async {
ready.complete(); ready.complete();
}, },
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: IgnorePointer( child: const IgnorePointer(
ignoring: true, ignoring: true,
child: ComplexLayoutApp(), child: ComplexLayoutApp(),
), ),
...@@ -45,7 +45,7 @@ Future<void> main() async { ...@@ -45,7 +45,7 @@ Future<void> main() async {
// remove onTap handler, enable pointer events for app // remove onTap handler, enable pointer events for app
runApp(GestureDetector( runApp(GestureDetector(
child: IgnorePointer( child: const IgnorePointer(
ignoring: false, ignoring: false,
child: ComplexLayoutApp(), child: ComplexLayoutApp(),
), ),
......
...@@ -29,7 +29,7 @@ const String kMacrobenchmarks = 'Macrobenchmarks'; ...@@ -29,7 +29,7 @@ const String kMacrobenchmarks = 'Macrobenchmarks';
void main() => runApp(const MacrobenchmarksApp()); void main() => runApp(const MacrobenchmarksApp());
class MacrobenchmarksApp extends StatelessWidget { class MacrobenchmarksApp extends StatelessWidget {
const MacrobenchmarksApp({this.initialRoute = '/'}); const MacrobenchmarksApp({Key key, this.initialRoute = '/'}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -37,25 +37,25 @@ class MacrobenchmarksApp extends StatelessWidget { ...@@ -37,25 +37,25 @@ class MacrobenchmarksApp extends StatelessWidget {
title: kMacrobenchmarks, title: kMacrobenchmarks,
initialRoute: initialRoute, initialRoute: initialRoute,
routes: <String, WidgetBuilder>{ routes: <String, WidgetBuilder>{
'/': (BuildContext context) => HomePage(), '/': (BuildContext context) => const HomePage(),
kCullOpacityRouteName: (BuildContext context) => CullOpacityPage(), kCullOpacityRouteName: (BuildContext context) => const CullOpacityPage(),
kCubicBezierRouteName: (BuildContext context) => CubicBezierPage(), kCubicBezierRouteName: (BuildContext context) => const CubicBezierPage(),
kBackdropFilterRouteName: (BuildContext context) => BackdropFilterPage(), kBackdropFilterRouteName: (BuildContext context) => const BackdropFilterPage(),
kPostBackdropFilterRouteName: (BuildContext context) => PostBackdropFilterPage(), kPostBackdropFilterRouteName: (BuildContext context) => const PostBackdropFilterPage(),
kSimpleAnimationRouteName: (BuildContext context) => SimpleAnimationPage(), kSimpleAnimationRouteName: (BuildContext context) => const SimpleAnimationPage(),
kPictureCacheRouteName: (BuildContext context) => PictureCachePage(), kPictureCacheRouteName: (BuildContext context) => const PictureCachePage(),
kLargeImageChangerRouteName: (BuildContext context) => LargeImageChangerPage(), kLargeImageChangerRouteName: (BuildContext context) => const LargeImageChangerPage(),
kLargeImagesRouteName: (BuildContext context) => LargeImagesPage(), kLargeImagesRouteName: (BuildContext context) => const LargeImagesPage(),
kTextRouteName: (BuildContext context) => TextPage(), kTextRouteName: (BuildContext context) => const TextPage(),
kFullscreenTextRouteName: (BuildContext context) => TextFieldPage(), kFullscreenTextRouteName: (BuildContext context) => const TextFieldPage(),
kAnimatedPlaceholderRouteName: (BuildContext context) => AnimatedPlaceholderPage(), kAnimatedPlaceholderRouteName: (BuildContext context) => const AnimatedPlaceholderPage(),
kColorFilterAndFadeRouteName: (BuildContext context) => ColorFilterAndFadePage(), kColorFilterAndFadeRouteName: (BuildContext context) => const ColorFilterAndFadePage(),
kFadingChildAnimationRouteName: (BuildContext context) => const FilteredChildAnimationPage(FilterType.opacity), kFadingChildAnimationRouteName: (BuildContext context) => const FilteredChildAnimationPage(FilterType.opacity),
kImageFilteredTransformAnimationRouteName: (BuildContext context) => const FilteredChildAnimationPage(FilterType.rotateFilter), kImageFilteredTransformAnimationRouteName: (BuildContext context) => const FilteredChildAnimationPage(FilterType.rotateFilter),
kMultiWidgetConstructionRouteName: (BuildContext context) => const MultiWidgetConstructTable(10, 20), kMultiWidgetConstructionRouteName: (BuildContext context) => const MultiWidgetConstructTable(10, 20),
kHeavyGridViewRouteName: (BuildContext context) => HeavyGridViewPage(), kHeavyGridViewRouteName: (BuildContext context) => const HeavyGridViewPage(),
kSimpleScrollRouteName: (BuildContext context) => SimpleScroll(), kSimpleScrollRouteName: (BuildContext context) => const SimpleScroll(),
kStackSizeRouteName: (BuildContext context) => StackSizePage(), kStackSizeRouteName: (BuildContext context) => const StackSizePage(),
}, },
); );
} }
...@@ -64,6 +64,8 @@ class MacrobenchmarksApp extends StatelessWidget { ...@@ -64,6 +64,8 @@ class MacrobenchmarksApp extends StatelessWidget {
} }
class HomePage extends StatelessWidget { class HomePage extends StatelessWidget {
const HomePage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
......
...@@ -24,6 +24,8 @@ const String kBlueSquare = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAASEl' ...@@ -24,6 +24,8 @@ const String kBlueSquare = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAASEl'
/// A 10x10 grid of animated looping placeholder gifts that fade into a /// A 10x10 grid of animated looping placeholder gifts that fade into a
/// blue square. /// blue square.
class AnimatedPlaceholderPage extends StatelessWidget { class AnimatedPlaceholderPage extends StatelessWidget {
const AnimatedPlaceholderPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GridView.builder( return GridView.builder(
......
...@@ -7,6 +7,8 @@ import 'dart:ui'; ...@@ -7,6 +7,8 @@ import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BackdropFilterPage extends StatefulWidget { class BackdropFilterPage extends StatefulWidget {
const BackdropFilterPage({Key key}) : super(key: key);
@override @override
_BackdropFilterPageState createState() => _BackdropFilterPageState(); _BackdropFilterPageState createState() => _BackdropFilterPageState();
} }
......
...@@ -9,6 +9,8 @@ import 'package:flutter/material.dart'; ...@@ -9,6 +9,8 @@ import 'package:flutter/material.dart';
// This tests whether the Opacity layer raster cache works with color filters. // This tests whether the Opacity layer raster cache works with color filters.
// See https://github.com/flutter/flutter/issues/51975. // See https://github.com/flutter/flutter/issues/51975.
class ColorFilterAndFadePage extends StatefulWidget { class ColorFilterAndFadePage extends StatefulWidget {
const ColorFilterAndFadePage({Key key}) : super(key: key);
@override @override
_ColorFilterAndFadePageState createState() => _ColorFilterAndFadePageState(); _ColorFilterAndFadePageState createState() => _ColorFilterAndFadePageState();
} }
......
...@@ -8,6 +8,8 @@ import 'package:flutter/material.dart'; ...@@ -8,6 +8,8 @@ import 'package:flutter/material.dart';
// Based on https://github.com/eseidelGoogle/bezier_perf/blob/master/lib/main.dart // Based on https://github.com/eseidelGoogle/bezier_perf/blob/master/lib/main.dart
class CubicBezierPage extends StatelessWidget { class CubicBezierPage extends StatelessWidget {
const CubicBezierPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Center(
...@@ -22,7 +24,7 @@ class CubicBezierPage extends StatelessWidget { ...@@ -22,7 +24,7 @@ class CubicBezierPage extends StatelessWidget {
} }
class Bezier extends StatelessWidget { class Bezier extends StatelessWidget {
const Bezier(this.color, this.scale, {this.blur = 0.0, this.delay = 0.0}); const Bezier(this.color, this.scale, {Key key, this.blur = 0.0, this.delay = 0.0}) : super(key: key);
final Color color; final Color color;
final double scale; final double scale;
...@@ -91,7 +93,7 @@ class PathDetail { ...@@ -91,7 +93,7 @@ class PathDetail {
} }
class AnimatedBezier extends StatefulWidget { class AnimatedBezier extends StatefulWidget {
const AnimatedBezier(this.color, this.scale, {this.blur = 0.0, this.delay}); const AnimatedBezier(this.color, this.scale, {Key key, this.blur = 0.0, this.delay}) : super(key: key);
final Color color; final Color color;
final double scale; final double scale;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CullOpacityPage extends StatefulWidget { class CullOpacityPage extends StatefulWidget {
const CullOpacityPage({Key key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => _CullOpacityPageState(); State<StatefulWidget> createState() => _CullOpacityPageState();
} }
......
...@@ -12,10 +12,11 @@ enum FilterType { ...@@ -12,10 +12,11 @@ enum FilterType {
} }
class FilteredChildAnimationPage extends StatefulWidget { class FilteredChildAnimationPage extends StatefulWidget {
const FilteredChildAnimationPage(this.initialFilterType, [ const FilteredChildAnimationPage(this.initialFilterType, {
Key key,
this.initialComplexChild = true, this.initialComplexChild = true,
this.initialUseRepaintBoundary = true, this.initialUseRepaintBoundary = true,
]); }) : super(key: key);
final FilterType initialFilterType; final FilterType initialFilterType;
final bool initialComplexChild; final bool initialComplexChild;
......
...@@ -48,6 +48,8 @@ const String textLotsOfText = 'Lorem ipsum dolor sit amet, consectetur ' ...@@ -48,6 +48,8 @@ const String textLotsOfText = 'Lorem ipsum dolor sit amet, consectetur '
'🦻 👃 🫀 🫁 🧠 🦷 🦴 👀 👁 👅 👄 💋 🩸'; '🦻 👃 🫀 🫁 🧠 🦷 🦴 👀 👁 👅 👄 💋 🩸';
class TextFieldPage extends StatelessWidget { class TextFieldPage extends StatelessWidget {
const TextFieldPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HeavyGridViewPage extends StatelessWidget { class HeavyGridViewPage extends StatelessWidget {
const HeavyGridViewPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GridView.builder( return GridView.builder(
......
...@@ -8,6 +8,8 @@ import 'package:flutter/material.dart'; ...@@ -8,6 +8,8 @@ import 'package:flutter/material.dart';
/// Displays a new (from image cache's perspective) large image every 500ms. /// Displays a new (from image cache's perspective) large image every 500ms.
class LargeImageChangerPage extends StatefulWidget { class LargeImageChangerPage extends StatefulWidget {
const LargeImageChangerPage({Key key}) : super(key: key);
@override @override
_LargeImageChangerState createState() => _LargeImageChangerState(); _LargeImageChangerState createState() => _LargeImageChangerState();
} }
......
...@@ -7,6 +7,8 @@ import 'dart:typed_data'; ...@@ -7,6 +7,8 @@ import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LargeImagesPage extends StatelessWidget { class LargeImagesPage extends StatelessWidget {
const LargeImagesPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ImageCache imageCache = PaintingBinding.instance.imageCache; final ImageCache imageCache = PaintingBinding.instance.imageCache;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PictureCachePage extends StatelessWidget { class PictureCachePage extends StatelessWidget {
const PictureCachePage({Key key}) : super(key: key);
static const List<String> kTabNames = <String>['1', '2', '3', '4', '5']; static const List<String> kTabNames = <String>['1', '2', '3', '4', '5'];
@override @override
......
...@@ -7,6 +7,8 @@ import 'dart:ui'; ...@@ -7,6 +7,8 @@ import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PostBackdropFilterPage extends StatefulWidget { class PostBackdropFilterPage extends StatefulWidget {
const PostBackdropFilterPage({Key key}) : super(key: key);
@override @override
_PostBackdropFilterPageState createState() => _PostBackdropFilterPageState(); _PostBackdropFilterPageState createState() => _PostBackdropFilterPageState();
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SimpleAnimationPage extends StatelessWidget { class SimpleAnimationPage extends StatelessWidget {
const SimpleAnimationPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Center(child: LinearProgressIndicator()); return const Center(child: LinearProgressIndicator());
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SimpleScroll extends StatelessWidget { class SimpleScroll extends StatelessWidget {
const SimpleScroll({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView( return ListView(
......
...@@ -81,6 +81,8 @@ final GetStackPointerCallback getStackPointer = () { ...@@ -81,6 +81,8 @@ final GetStackPointerCallback getStackPointer = () {
}(); }();
class StackSizePage extends StatelessWidget { class StackSizePage extends StatelessWidget {
const StackSizePage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
...@@ -89,7 +91,7 @@ class StackSizePage extends StatelessWidget { ...@@ -89,7 +91,7 @@ class StackSizePage extends StatelessWidget {
Container( Container(
width: 200, width: 200,
height: 100, height: 100,
child: ParentWidget(), child: const ParentWidget(),
), ),
], ],
), ),
...@@ -98,6 +100,8 @@ class StackSizePage extends StatelessWidget { ...@@ -98,6 +100,8 @@ class StackSizePage extends StatelessWidget {
} }
class ParentWidget extends StatelessWidget { class ParentWidget extends StatelessWidget {
const ParentWidget({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final int myStackSize = getStackPointer(); final int myStackSize = getStackPointer();
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TextPage extends StatelessWidget { class TextPage extends StatelessWidget {
const TextPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
......
...@@ -271,7 +271,7 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder { ...@@ -271,7 +271,7 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder {
@override @override
Widget createWidget() { Widget createWidget() {
_counter++; _counter++;
return MaterialApp(home: ColorsDemo()); return const MaterialApp(home: ColorsDemo());
} }
} }
...@@ -469,6 +469,8 @@ class PaletteTabView extends StatelessWidget { ...@@ -469,6 +469,8 @@ class PaletteTabView extends StatelessWidget {
} }
class ColorsDemo extends StatelessWidget { class ColorsDemo extends StatelessWidget {
const ColorsDemo({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DefaultTabController( return DefaultTabController(
......
...@@ -84,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -84,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> {
} }
class ProductPreview extends StatelessWidget { class ProductPreview extends StatelessWidget {
const ProductPreview(this.previewIndex); const ProductPreview(this.previewIndex, {Key key}) : super(key: key);
final int previewIndex; final int previewIndex;
......
...@@ -17,7 +17,7 @@ void main() { ...@@ -17,7 +17,7 @@ void main() {
testWidgets( testWidgets(
'Frame Counter and Input Delay for benchmarkLive', 'Frame Counter and Input Delay for benchmarkLive',
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: Scaffold(body: SimpleScroll()))); await tester.pumpWidget(const MaterialApp(home: Scaffold(body: SimpleScroll())));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final Offset location = tester.getCenter(find.byType(ListView)); final Offset location = tester.getCenter(find.byType(ListView));
int frameCount = 0; int frameCount = 0;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ButtonMatrixApp extends StatefulWidget { class ButtonMatrixApp extends StatefulWidget {
const ButtonMatrixApp({Key key}) : super(key: key);
@override @override
ButtonMatrixAppState createState() => ButtonMatrixAppState(); ButtonMatrixAppState createState() => ButtonMatrixAppState();
} }
...@@ -48,5 +50,5 @@ class ButtonMatrixAppState extends State<ButtonMatrixApp> { ...@@ -48,5 +50,5 @@ class ButtonMatrixAppState extends State<ButtonMatrixApp> {
} }
void main() { void main() {
runApp(ButtonMatrixApp()); runApp(const ButtonMatrixApp());
} }
...@@ -13,7 +13,7 @@ void topMain() => runApp(const MyApp(Colors.green)); ...@@ -13,7 +13,7 @@ void topMain() => runApp(const MyApp(Colors.green));
void bottomMain() => runApp(const MyApp(Colors.purple)); void bottomMain() => runApp(const MyApp(Colors.purple));
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp(this.color); const MyApp(this.color, {Key key}) : super(key: key);
final Color color; final Color color;
......
...@@ -20,6 +20,8 @@ import 'stock_symbol_viewer.dart'; ...@@ -20,6 +20,8 @@ import 'stock_symbol_viewer.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StocksApp extends StatefulWidget { class StocksApp extends StatefulWidget {
const StocksApp({Key key}) : super(key: key);
@override @override
StocksAppState createState() => StocksAppState(); StocksAppState createState() => StocksAppState();
} }
...@@ -109,5 +111,5 @@ class StocksAppState extends State<StocksApp> { ...@@ -109,5 +111,5 @@ class StocksAppState extends State<StocksApp> {
} }
void main() { void main() {
runApp(StocksApp()); runApp(const StocksApp());
} }
...@@ -52,7 +52,7 @@ class _NotImplementedDialog extends StatelessWidget { ...@@ -52,7 +52,7 @@ class _NotImplementedDialog extends StatelessWidget {
} }
class StockHome extends StatefulWidget { class StockHome extends StatefulWidget {
const StockHome(this.stocks, this.configuration, this.updater); const StockHome(this.stocks, this.configuration, this.updater, {Key key}) : super(key: key);
final StockData stocks; final StockData stocks;
final StockConfiguration configuration; final StockConfiguration configuration;
......
...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StockSettings extends StatefulWidget { class StockSettings extends StatefulWidget {
const StockSettings(this.configuration, this.updater); const StockSettings(this.configuration, this.updater, {Key key}) : super(key: key);
final StockConfiguration configuration; final StockConfiguration configuration;
final ValueChanged<StockConfiguration> updater; final ValueChanged<StockConfiguration> updater;
......
...@@ -65,7 +65,7 @@ class _StockSymbolView extends StatelessWidget { ...@@ -65,7 +65,7 @@ class _StockSymbolView extends StatelessWidget {
} }
class StockSymbolPage extends StatelessWidget { class StockSymbolPage extends StatelessWidget {
const StockSymbolPage({ this.symbol, this.stocks }); const StockSymbolPage({ Key key, this.symbol, this.stocks }) : super(key: key);
final String symbol; final String symbol;
final StockData stocks; final StockData stocks;
...@@ -113,7 +113,7 @@ class StockSymbolPage extends StatelessWidget { ...@@ -113,7 +113,7 @@ class StockSymbolPage extends StatelessWidget {
} }
class StockSymbolBottomSheet extends StatelessWidget { class StockSymbolBottomSheet extends StatelessWidget {
const StockSymbolBottomSheet({ this.stock }); const StockSymbolBottomSheet({ Key key, this.stock }) : super(key: key);
final Stock stock; final Stock stock;
......
...@@ -9,11 +9,13 @@ Future<void> main() async { ...@@ -9,11 +9,13 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
const MethodChannel channel = MethodChannel('com.example.abstract_method_smoke_test'); const MethodChannel channel = MethodChannel('com.example.abstract_method_smoke_test');
await channel.invokeMethod<void>('show_keyboard'); await channel.invokeMethod<void>('show_keyboard');
runApp(MyApp()); runApp(const MyApp());
print('Test suceeded'); print('Test suceeded');
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
...@@ -21,12 +23,14 @@ class MyApp extends StatelessWidget { ...@@ -21,12 +23,14 @@ class MyApp extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
), ),
home: HomePage(), home: const HomePage(),
); );
} }
} }
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
const HomePage({Key key}) : super(key: key);
@override @override
_HomePage createState() => _HomePage(); _HomePage createState() => _HomePage();
} }
...@@ -40,7 +44,7 @@ class _HomePage extends State<HomePage> { ...@@ -40,7 +44,7 @@ class _HomePage extends State<HomePage> {
// https://github.com/flutter/flutter/issues/40126 // https://github.com/flutter/flutter/issues/40126
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute<void>(builder: (_) => SecondPage())); MaterialPageRoute<void>(builder: (_) => const SecondPage()));
}); });
} }
...@@ -51,6 +55,8 @@ class _HomePage extends State<HomePage> { ...@@ -51,6 +55,8 @@ class _HomePage extends State<HomePage> {
} }
class SecondPage extends StatelessWidget { class SecondPage extends StatelessWidget {
const SecondPage({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
......
...@@ -43,14 +43,14 @@ Future<String> dataHandler(String message) async { ...@@ -43,14 +43,14 @@ Future<String> dataHandler(String message) async {
} }
Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
selectionControlsRoute : (BuildContext context) => SelectionControlsPage(), selectionControlsRoute : (BuildContext context) => const SelectionControlsPage(),
popupControlsRoute : (BuildContext context) => PopupControlsPage(), popupControlsRoute : (BuildContext context) => const PopupControlsPage(),
textFieldRoute : (BuildContext context) => TextFieldPage(), textFieldRoute : (BuildContext context) => const TextFieldPage(),
headingsRoute: (BuildContext context) => HeadingsPage(), headingsRoute: (BuildContext context) => const HeadingsPage(),
}; };
class TestApp extends StatelessWidget { class TestApp extends StatelessWidget {
const TestApp(); const TestApp({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -9,6 +9,8 @@ export 'controls_constants.dart'; ...@@ -9,6 +9,8 @@ export 'controls_constants.dart';
/// A test page with a checkbox, three radio buttons, and a switch. /// A test page with a checkbox, three radio buttons, and a switch.
class SelectionControlsPage extends StatefulWidget { class SelectionControlsPage extends StatefulWidget {
const SelectionControlsPage({Key key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => _SelectionControlsPageState(); State<StatefulWidget> createState() => _SelectionControlsPageState();
} }
......
...@@ -9,6 +9,8 @@ export 'headings_constants.dart'; ...@@ -9,6 +9,8 @@ export 'headings_constants.dart';
/// A test page with an app bar and some body text for testing heading flags. /// A test page with an app bar and some body text for testing heading flags.
class HeadingsPage extends StatelessWidget { class HeadingsPage extends StatelessWidget {
const HeadingsPage({Key key}) : super(key: key);
static const ValueKey<String> _appBarTitleKey = ValueKey<String>(appBarTitleKeyValue); static const ValueKey<String> _appBarTitleKey = ValueKey<String>(appBarTitleKeyValue);
static const ValueKey<String> _bodyTextKey = ValueKey<String>(bodyTextKeyValue); static const ValueKey<String> _bodyTextKey = ValueKey<String>(bodyTextKeyValue);
......
...@@ -10,6 +10,8 @@ export 'popup_constants.dart'; ...@@ -10,6 +10,8 @@ export 'popup_constants.dart';
/// A page with a popup menu, a dropdown menu, and a modal alert. /// A page with a popup menu, a dropdown menu, and a modal alert.
class PopupControlsPage extends StatefulWidget { class PopupControlsPage extends StatefulWidget {
const PopupControlsPage({Key key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => _PopupControlsPageState(); State<StatefulWidget> createState() => _PopupControlsPageState();
} }
......
...@@ -10,6 +10,8 @@ export 'text_field_constants.dart'; ...@@ -10,6 +10,8 @@ export 'text_field_constants.dart';
/// A page with a normal text field and a password field. /// A page with a normal text field and a password field.
class TextFieldPage extends StatefulWidget { class TextFieldPage extends StatefulWidget {
const TextFieldPage({Key key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => _TextFieldPageState(); State<StatefulWidget> createState() => _TextFieldPageState();
} }
......
...@@ -16,10 +16,12 @@ final List<PageWidget> _allPages = <PageWidget>[ ...@@ -16,10 +16,12 @@ final List<PageWidget> _allPages = <PageWidget>[
void main() { void main() {
enableFlutterDriverExtension(handler: driverDataHandler.handleMessage); enableFlutterDriverExtension(handler: driverDataHandler.handleMessage);
runApp(MaterialApp(home: Home())); runApp(const MaterialApp(home: Home()));
} }
class Home extends StatelessWidget { class Home extends StatelessWidget {
const Home({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
......
...@@ -18,12 +18,12 @@ MethodChannel channel = const MethodChannel('android_views_integration'); ...@@ -18,12 +18,12 @@ MethodChannel channel = const MethodChannel('android_views_integration');
const String kEventsFileName = 'touchEvents'; const String kEventsFileName = 'touchEvents';
class MotionEventsPage extends PageWidget { class MotionEventsPage extends PageWidget {
const MotionEventsPage() const MotionEventsPage({Key key})
: super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile')); : super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile'), key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MotionEventsBody(); return const MotionEventsBody();
} }
} }
...@@ -44,6 +44,8 @@ class FutureDataHandler { ...@@ -44,6 +44,8 @@ class FutureDataHandler {
FutureDataHandler driverDataHandler = FutureDataHandler(); FutureDataHandler driverDataHandler = FutureDataHandler();
class MotionEventsBody extends StatefulWidget { class MotionEventsBody extends StatefulWidget {
const MotionEventsBody({Key key}) : super(key: key);
@override @override
State createState() => MotionEventsBodyState(); State createState() => MotionEventsBodyState();
} }
...@@ -251,7 +253,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> { ...@@ -251,7 +253,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
} }
class TouchEventDiff extends StatelessWidget { class TouchEventDiff extends StatelessWidget {
const TouchEventDiff(this.originalEvent, this.synthesizedEvent); const TouchEventDiff(this.originalEvent, this.synthesizedEvent, {Key key}) : super(key: key);
final Map<String, dynamic> originalEvent; final Map<String, dynamic> originalEvent;
final Map<String, dynamic> synthesizedEvent; final Map<String, dynamic> synthesizedEvent;
......
...@@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; ...@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
// //
/// A testing page has to override this in order to be put as one of the items in the main page. /// A testing page has to override this in order to be put as one of the items in the main page.
abstract class PageWidget extends StatelessWidget { abstract class PageWidget extends StatelessWidget {
const PageWidget(this.title, this.tileKey); const PageWidget(this.title, this.tileKey, {Key key}) : super(key: key);
/// The title of the testing page /// The title of the testing page
/// ///
......
...@@ -10,14 +10,16 @@ import 'package:flutter/services.dart'; ...@@ -10,14 +10,16 @@ import 'package:flutter/services.dart';
import 'page.dart'; import 'page.dart';
class WindowManagerIntegrationsPage extends PageWidget { class WindowManagerIntegrationsPage extends PageWidget {
const WindowManagerIntegrationsPage() const WindowManagerIntegrationsPage({Key key})
: super('Window Manager Integrations Tests', const ValueKey<String>('WmIntegrationsListTile')); : super('Window Manager Integrations Tests', const ValueKey<String>('WmIntegrationsListTile'), key: key);
@override @override
Widget build(BuildContext context) => WindowManagerBody(); Widget build(BuildContext context) => const WindowManagerBody();
} }
class WindowManagerBody extends StatefulWidget { class WindowManagerBody extends StatefulWidget {
const WindowManagerBody({Key key}) : super(key: key);
@override @override
State<WindowManagerBody> createState() => WindowManagerBodyState(); State<WindowManagerBody> createState() => WindowManagerBodyState();
} }
......
...@@ -15,10 +15,12 @@ import 'src/test_step.dart'; ...@@ -15,10 +15,12 @@ import 'src/test_step.dart';
void main() { void main() {
enableFlutterDriverExtension(); enableFlutterDriverExtension();
runApp(TestApp()); runApp(const TestApp());
} }
class TestApp extends StatefulWidget { class TestApp extends StatefulWidget {
const TestApp({Key key}) : super(key: key);
@override @override
_TestAppState createState() => _TestAppState(); _TestAppState createState() => _TestAppState();
} }
......
...@@ -11,10 +11,12 @@ import 'package:flutter_driver/driver_extension.dart'; ...@@ -11,10 +11,12 @@ import 'package:flutter_driver/driver_extension.dart';
void main() { void main() {
enableFlutterDriverExtension(); enableFlutterDriverExtension();
debugPrint('Application starting...'); debugPrint('Application starting...');
runApp(MyApp()); runApp(const MyApp());
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
const MyApp({Key key}) : super(key: key);
@override @override
State createState() => MyAppState(); State createState() => MyAppState();
} }
......
...@@ -8,10 +8,12 @@ import 'package:flutter_driver/driver_extension.dart'; ...@@ -8,10 +8,12 @@ import 'package:flutter_driver/driver_extension.dart';
void main() { void main() {
enableFlutterDriverExtension(); enableFlutterDriverExtension();
runApp(Center(child: Flavor())); runApp(const Center(child: Flavor()));
} }
class Flavor extends StatefulWidget { class Flavor extends StatefulWidget {
const Flavor({Key key}) : super(key: key);
@override @override
_FlavorState createState() => _FlavorState(); _FlavorState createState() => _FlavorState();
} }
......
...@@ -138,7 +138,7 @@ class _CalculatorState extends State<Calculator> { ...@@ -138,7 +138,7 @@ class _CalculatorState extends State<Calculator> {
} }
class CalcDisplay extends StatelessWidget { class CalcDisplay extends StatelessWidget {
const CalcDisplay({ this.content }); const CalcDisplay({ Key? key, this.content}) : super(key: key);
final String? content; final String? content;
...@@ -154,7 +154,7 @@ class CalcDisplay extends StatelessWidget { ...@@ -154,7 +154,7 @@ class CalcDisplay extends StatelessWidget {
} }
class KeyPad extends StatelessWidget { class KeyPad extends StatelessWidget {
const KeyPad({ this.calcState }); const KeyPad({ Key? key, this.calcState }) : super(key: key);
final _CalculatorState? calcState; final _CalculatorState? calcState;
...@@ -222,7 +222,7 @@ class KeyPad extends StatelessWidget { ...@@ -222,7 +222,7 @@ class KeyPad extends StatelessWidget {
} }
class KeyRow extends StatelessWidget { class KeyRow extends StatelessWidget {
const KeyRow(this.keys); const KeyRow(this.keys, {Key? key}) : super(key: key);
final List<Widget> keys; final List<Widget> keys;
...@@ -238,7 +238,7 @@ class KeyRow extends StatelessWidget { ...@@ -238,7 +238,7 @@ class KeyRow extends StatelessWidget {
} }
class CalcKey extends StatelessWidget { class CalcKey extends StatelessWidget {
const CalcKey(this.text, this.onTap); const CalcKey(this.text, this.onTap, {Key? key}) : super(key: key);
final String text; final String text;
final GestureTapCallback onTap; final GestureTapCallback onTap;
...@@ -265,8 +265,8 @@ class CalcKey extends StatelessWidget { ...@@ -265,8 +265,8 @@ class CalcKey extends StatelessWidget {
} }
class NumberKey extends CalcKey { class NumberKey extends CalcKey {
NumberKey(int value, _CalculatorState? calcState) NumberKey(int value, _CalculatorState? calcState, {Key? key})
: super('$value', () { : super('$value', () {
calcState!.handleNumberTap(value); calcState!.handleNumberTap(value);
}); }, key: key);
} }
...@@ -120,6 +120,8 @@ class PaletteTabView extends StatelessWidget { ...@@ -120,6 +120,8 @@ class PaletteTabView extends StatelessWidget {
} }
class ColorsDemo extends StatelessWidget { class ColorsDemo extends StatelessWidget {
const ColorsDemo({Key? key}) : super(key: key);
static const String routeName = '/colors'; static const String routeName = '/colors';
@override @override
......
...@@ -86,6 +86,8 @@ class _ContactItem extends StatelessWidget { ...@@ -86,6 +86,8 @@ class _ContactItem extends StatelessWidget {
} }
class ContactsDemo extends StatefulWidget { class ContactsDemo extends StatefulWidget {
const ContactsDemo({Key? key}) : super(key: key);
static const String routeName = '/contacts'; static const String routeName = '/contacts';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoProgressIndicatorDemo extends StatelessWidget { class CupertinoProgressIndicatorDemo extends StatelessWidget {
const CupertinoProgressIndicatorDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/progress_indicator'; static const String routeName = '/cupertino/progress_indicator';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoAlertDemo extends StatefulWidget { class CupertinoAlertDemo extends StatefulWidget {
const CupertinoAlertDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/alert'; static const String routeName = '/cupertino/alert';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoButtonsDemo extends StatefulWidget { class CupertinoButtonsDemo extends StatefulWidget {
const CupertinoButtonsDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/buttons'; static const String routeName = '/cupertino/buttons';
@override @override
......
...@@ -32,13 +32,14 @@ const List<String> coolColorNames = <String>[ ...@@ -32,13 +32,14 @@ const List<String> coolColorNames = <String>[
const int _kChildCount = 50; const int _kChildCount = 50;
class CupertinoNavigationDemo extends StatelessWidget { class CupertinoNavigationDemo extends StatelessWidget {
CupertinoNavigationDemo({ this.randomSeed }) CupertinoNavigationDemo({ Key? key, this.randomSeed })
: colorItems = List<Color>.generate(_kChildCount, (int index) { : colorItems = List<Color>.generate(_kChildCount, (int index) {
return coolColors[math.Random(randomSeed).nextInt(coolColors.length)]; return coolColors[math.Random(randomSeed).nextInt(coolColors.length)];
}) , }) ,
colorNameItems = List<String>.generate(_kChildCount, (int index) { colorNameItems = List<String>.generate(_kChildCount, (int index) {
return coolColorNames[math.Random(randomSeed).nextInt(coolColorNames.length)]; return coolColorNames[math.Random(randomSeed).nextInt(coolColorNames.length)];
}); }),
super(key: key);
static const String routeName = '/cupertino/navigation'; static const String routeName = '/cupertino/navigation';
...@@ -85,12 +86,12 @@ class CupertinoNavigationDemo extends StatelessWidget { ...@@ -85,12 +86,12 @@ class CupertinoNavigationDemo extends StatelessWidget {
); );
case 1: case 1:
return CupertinoTabView( return CupertinoTabView(
builder: (BuildContext context) => CupertinoDemoTab2(), builder: (BuildContext context) => const CupertinoDemoTab2(),
defaultTitle: 'Support Chat', defaultTitle: 'Support Chat',
); );
case 2: case 2:
return CupertinoTabView( return CupertinoTabView(
builder: (BuildContext context) => CupertinoDemoTab3(), builder: (BuildContext context) => const CupertinoDemoTab3(),
defaultTitle: 'Account', defaultTitle: 'Account',
); );
} }
...@@ -104,7 +105,7 @@ class CupertinoNavigationDemo extends StatelessWidget { ...@@ -104,7 +105,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
} }
class ExitButton extends StatelessWidget { class ExitButton extends StatelessWidget {
const ExitButton(); const ExitButton({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -134,10 +135,11 @@ final Widget trailingButtons = Row( ...@@ -134,10 +135,11 @@ final Widget trailingButtons = Row(
class CupertinoDemoTab1 extends StatelessWidget { class CupertinoDemoTab1 extends StatelessWidget {
const CupertinoDemoTab1({ const CupertinoDemoTab1({
Key? key,
this.colorItems, this.colorItems,
this.colorNameItems, this.colorNameItems,
this.randomSeed, this.randomSeed,
}); }) : super(key: key);
final List<Color>? colorItems; final List<Color>? colorItems;
final List<String>? colorNameItems; final List<String>? colorNameItems;
...@@ -184,12 +186,13 @@ class CupertinoDemoTab1 extends StatelessWidget { ...@@ -184,12 +186,13 @@ class CupertinoDemoTab1 extends StatelessWidget {
class Tab1RowItem extends StatelessWidget { class Tab1RowItem extends StatelessWidget {
const Tab1RowItem({ const Tab1RowItem({
Key? key,
this.index, this.index,
this.lastItem, this.lastItem,
this.color, this.color,
this.colorName, this.colorName,
this.randomSeed, this.randomSeed,
}); }) : super(key: key);
final int? index; final int? index;
final bool? lastItem; final bool? lastItem;
...@@ -287,7 +290,7 @@ class Tab1RowItem extends StatelessWidget { ...@@ -287,7 +290,7 @@ class Tab1RowItem extends StatelessWidget {
} }
class Tab1ItemPage extends StatefulWidget { class Tab1ItemPage extends StatefulWidget {
const Tab1ItemPage({this.color, this.colorName, this.index, this.randomSeed}); const Tab1ItemPage({Key? key, this.color, this.colorName, this.index, this.randomSeed}) : super(key: key);
final Color? color; final Color? color;
final String? colorName; final String? colorName;
...@@ -441,6 +444,8 @@ class Tab1ItemPageState extends State<Tab1ItemPage> { ...@@ -441,6 +444,8 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
} }
class CupertinoDemoTab2 extends StatelessWidget { class CupertinoDemoTab2 extends StatelessWidget {
const CupertinoDemoTab2({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CupertinoPageScaffold( return CupertinoPageScaffold(
...@@ -450,7 +455,7 @@ class CupertinoDemoTab2 extends StatelessWidget { ...@@ -450,7 +455,7 @@ class CupertinoDemoTab2 extends StatelessWidget {
child: CupertinoScrollbar( child: CupertinoScrollbar(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
CupertinoUserInterfaceLevel( const CupertinoUserInterfaceLevel(
data: CupertinoUserInterfaceLevelData.elevated, data: CupertinoUserInterfaceLevelData.elevated,
child: Tab2Header(), child: Tab2Header(),
), ),
...@@ -463,6 +468,8 @@ class CupertinoDemoTab2 extends StatelessWidget { ...@@ -463,6 +468,8 @@ class CupertinoDemoTab2 extends StatelessWidget {
} }
class Tab2Header extends StatelessWidget { class Tab2Header extends StatelessWidget {
const Tab2Header({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
...@@ -589,7 +596,7 @@ enum Tab2ConversationBubbleColor { ...@@ -589,7 +596,7 @@ enum Tab2ConversationBubbleColor {
} }
class Tab2ConversationBubble extends StatelessWidget { class Tab2ConversationBubble extends StatelessWidget {
const Tab2ConversationBubble({this.text, this.color}); const Tab2ConversationBubble({Key? key, this.text, this.color}) : super(key: key);
final String? text; final String? text;
final Tab2ConversationBubbleColor? color; final Tab2ConversationBubbleColor? color;
...@@ -633,7 +640,7 @@ class Tab2ConversationBubble extends StatelessWidget { ...@@ -633,7 +640,7 @@ class Tab2ConversationBubble extends StatelessWidget {
} }
class Tab2ConversationAvatar extends StatelessWidget { class Tab2ConversationAvatar extends StatelessWidget {
const Tab2ConversationAvatar({this.text, this.color}); const Tab2ConversationAvatar({Key? key, this.text, this.color}) : super(key: key);
final String? text; final String? text;
final Color? color; final Color? color;
...@@ -672,7 +679,7 @@ class Tab2ConversationAvatar extends StatelessWidget { ...@@ -672,7 +679,7 @@ class Tab2ConversationAvatar extends StatelessWidget {
} }
class Tab2ConversationRow extends StatelessWidget { class Tab2ConversationRow extends StatelessWidget {
const Tab2ConversationRow({this.avatar, this.text}); const Tab2ConversationRow({Key? key, this.avatar, this.text}) : super(key: key);
final Tab2ConversationAvatar? avatar; final Tab2ConversationAvatar? avatar;
final String? text; final String? text;
...@@ -742,6 +749,8 @@ List<Widget> buildTab2Conversation() { ...@@ -742,6 +749,8 @@ List<Widget> buildTab2Conversation() {
} }
class CupertinoDemoTab3 extends StatelessWidget { class CupertinoDemoTab3 extends StatelessWidget {
const CupertinoDemoTab3({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CupertinoPageScaffold( return CupertinoPageScaffold(
...@@ -755,7 +764,7 @@ class CupertinoDemoTab3 extends StatelessWidget { ...@@ -755,7 +764,7 @@ class CupertinoDemoTab3 extends StatelessWidget {
Navigator.of(context, rootNavigator: true).push( Navigator.of(context, rootNavigator: true).push(
CupertinoPageRoute<bool>( CupertinoPageRoute<bool>(
fullscreenDialog: true, fullscreenDialog: true,
builder: (BuildContext context) => Tab3Dialog(), builder: (BuildContext context) => const Tab3Dialog(),
), ),
); );
}, },
...@@ -792,6 +801,8 @@ class CupertinoDemoTab3 extends StatelessWidget { ...@@ -792,6 +801,8 @@ class CupertinoDemoTab3 extends StatelessWidget {
} }
class Tab3Dialog extends StatelessWidget { class Tab3Dialog extends StatelessWidget {
const Tab3Dialog({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CupertinoPageScaffold( return CupertinoPageScaffold(
......
...@@ -12,6 +12,8 @@ const double _kPickerSheetHeight = 216.0; ...@@ -12,6 +12,8 @@ const double _kPickerSheetHeight = 216.0;
const double _kPickerItemHeight = 32.0; const double _kPickerItemHeight = 32.0;
class CupertinoPickerDemo extends StatefulWidget { class CupertinoPickerDemo extends StatefulWidget {
const CupertinoPickerDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/picker'; static const String routeName = '/cupertino/picker';
@override @override
......
...@@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoRefreshControlDemo extends StatefulWidget { class CupertinoRefreshControlDemo extends StatefulWidget {
const CupertinoRefreshControlDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/refresh'; static const String routeName = '/cupertino/refresh';
@override @override
......
...@@ -12,6 +12,8 @@ const Color _kKeyPenumbraOpacity = Color(0x24000000); // alpha = 0.14 ...@@ -12,6 +12,8 @@ const Color _kKeyPenumbraOpacity = Color(0x24000000); // alpha = 0.14
const Color _kAmbientShadowOpacity = Color(0x1F000000); // alpha = 0.12 const Color _kAmbientShadowOpacity = Color(0x1F000000); // alpha = 0.12
class CupertinoSegmentedControlDemo extends StatefulWidget { class CupertinoSegmentedControlDemo extends StatefulWidget {
const CupertinoSegmentedControlDemo({Key? key}) : super(key: key);
static const String routeName = 'cupertino/segmented_control'; static const String routeName = 'cupertino/segmented_control';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoSliderDemo extends StatefulWidget { class CupertinoSliderDemo extends StatefulWidget {
const CupertinoSliderDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/slider'; static const String routeName = '/cupertino/slider';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class CupertinoSwitchDemo extends StatefulWidget { class CupertinoSwitchDemo extends StatefulWidget {
const CupertinoSwitchDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/switch'; static const String routeName = '/cupertino/switch';
@override @override
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class CupertinoTextFieldDemo extends StatefulWidget { class CupertinoTextFieldDemo extends StatefulWidget {
const CupertinoTextFieldDemo({Key? key}) : super(key: key);
static const String routeName = '/cupertino/text_fields'; static const String routeName = '/cupertino/text_fields';
@override @override
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class FortnightlyDemo extends StatelessWidget { class FortnightlyDemo extends StatelessWidget {
const FortnightlyDemo({Key? key}) : super(key: key);
static const String routeName = '/fortnightly'; static const String routeName = '/fortnightly';
@override @override
...@@ -15,7 +17,7 @@ class FortnightlyDemo extends StatelessWidget { ...@@ -15,7 +17,7 @@ class FortnightlyDemo extends StatelessWidget {
home: Scaffold( home: Scaffold(
body: Stack( body: Stack(
children: <Widget>[ children: <Widget>[
FruitPage(), const FruitPage(),
SafeArea( SafeArea(
child: ShortAppBar( child: ShortAppBar(
onBackPressed: () { onBackPressed: () {
...@@ -31,7 +33,7 @@ class FortnightlyDemo extends StatelessWidget { ...@@ -31,7 +33,7 @@ class FortnightlyDemo extends StatelessWidget {
} }
class ShortAppBar extends StatelessWidget { class ShortAppBar extends StatelessWidget {
const ShortAppBar({ this.onBackPressed }); const ShortAppBar({ Key? key, this.onBackPressed }) : super(key: key);
final VoidCallback? onBackPressed; final VoidCallback? onBackPressed;
...@@ -66,6 +68,8 @@ class ShortAppBar extends StatelessWidget { ...@@ -66,6 +68,8 @@ class ShortAppBar extends StatelessWidget {
} }
class FruitPage extends StatelessWidget { class FruitPage extends StatelessWidget {
const FruitPage({Key? key}) : super(key: key);
static final String paragraph1 = ''' static final String paragraph1 = '''
Have you ever held a quince? It's strange; Have you ever held a quince? It's strange;
covered in a fuzz somewhere between peach skin and a spider web. And it's covered in a fuzz somewhere between peach skin and a spider web. And it's
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../gallery/demo.dart'; import '../gallery/demo.dart';
class ImagesDemo extends StatelessWidget { class ImagesDemo extends StatelessWidget {
const ImagesDemo({Key? key}) : super(key: key);
static const String routeName = '/images'; static const String routeName = '/images';
@override @override
......
...@@ -239,6 +239,8 @@ class BackdropTitle extends AnimatedWidget { ...@@ -239,6 +239,8 @@ class BackdropTitle extends AnimatedWidget {
// This widget is essentially the backdrop itself. // This widget is essentially the backdrop itself.
class BackdropDemo extends StatefulWidget { class BackdropDemo extends StatefulWidget {
const BackdropDemo({Key? key}) : super(key: key);
static const String routeName = '/material/backdrop'; static const String routeName = '/material/backdrop';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class BottomAppBarDemo extends StatefulWidget { class BottomAppBarDemo extends StatefulWidget {
const BottomAppBarDemo({Key? key}) : super(key: key);
static const String routeName = '/material/bottom_app_bar'; static const String routeName = '/material/bottom_app_bar';
@override @override
......
...@@ -74,6 +74,8 @@ class NavigationIconView { ...@@ -74,6 +74,8 @@ class NavigationIconView {
} }
class CustomIcon extends StatelessWidget { class CustomIcon extends StatelessWidget {
const CustomIcon({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final IconThemeData iconTheme = IconTheme.of(context); final IconThemeData iconTheme = IconTheme.of(context);
...@@ -87,6 +89,8 @@ class CustomIcon extends StatelessWidget { ...@@ -87,6 +89,8 @@ class CustomIcon extends StatelessWidget {
} }
class CustomInactiveIcon extends StatelessWidget { class CustomInactiveIcon extends StatelessWidget {
const CustomInactiveIcon({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final IconThemeData iconTheme = IconTheme.of(context); final IconThemeData iconTheme = IconTheme.of(context);
...@@ -102,6 +106,8 @@ class CustomInactiveIcon extends StatelessWidget { ...@@ -102,6 +106,8 @@ class CustomInactiveIcon extends StatelessWidget {
} }
class BottomNavigationDemo extends StatefulWidget { class BottomNavigationDemo extends StatefulWidget {
const BottomNavigationDemo({Key? key}) : super(key: key);
static const String routeName = '/material/bottom_navigation'; static const String routeName = '/material/bottom_navigation';
@override @override
...@@ -125,8 +131,8 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> ...@@ -125,8 +131,8 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
vsync: this, vsync: this,
), ),
NavigationIconView( NavigationIconView(
activeIcon: CustomIcon(), activeIcon: const CustomIcon(),
icon: CustomInactiveIcon(), icon: const CustomInactiveIcon(),
title: 'Box', title: 'Box',
color: Colors.deepOrange, color: Colors.deepOrange,
vsync: this, vsync: this,
......
...@@ -46,6 +46,8 @@ const String _actionText = ...@@ -46,6 +46,8 @@ const String _actionText =
const String _actionCode = 'buttons_action'; const String _actionCode = 'buttons_action';
class ButtonsDemo extends StatefulWidget { class ButtonsDemo extends StatefulWidget {
const ButtonsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/buttons'; static const String routeName = '/material/buttons';
@override @override
......
...@@ -335,6 +335,8 @@ class TravelDestinationContent extends StatelessWidget { ...@@ -335,6 +335,8 @@ class TravelDestinationContent extends StatelessWidget {
} }
class CardsDemo extends StatefulWidget { class CardsDemo extends StatefulWidget {
const CardsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/cards'; static const String routeName = '/material/cards';
@override @override
......
...@@ -135,6 +135,8 @@ class _ChipsTile extends StatelessWidget { ...@@ -135,6 +135,8 @@ class _ChipsTile extends StatelessWidget {
} }
class ChipDemo extends StatefulWidget { class ChipDemo extends StatefulWidget {
const ChipDemo({Key? key}) : super(key: key);
static const String routeName = '/material/chip'; static const String routeName = '/material/chip';
@override @override
......
...@@ -142,6 +142,8 @@ class DessertDataSource extends DataTableSource { ...@@ -142,6 +142,8 @@ class DessertDataSource extends DataTableSource {
} }
class DataTableDemo extends StatefulWidget { class DataTableDemo extends StatefulWidget {
const DataTableDemo({Key? key}) : super(key: key);
static const String routeName = '/material/data-table'; static const String routeName = '/material/data-table';
@override @override
......
...@@ -113,6 +113,8 @@ class _DateTimePicker extends StatelessWidget { ...@@ -113,6 +113,8 @@ class _DateTimePicker extends StatelessWidget {
} }
class DateAndTimePickerDemo extends StatefulWidget { class DateAndTimePickerDemo extends StatefulWidget {
const DateAndTimePickerDemo({Key? key}) : super(key: key);
static const String routeName = '/material/date-and-time-pickers'; static const String routeName = '/material/date-and-time-pickers';
@override @override
......
...@@ -48,6 +48,8 @@ class DialogDemoItem extends StatelessWidget { ...@@ -48,6 +48,8 @@ class DialogDemoItem extends StatelessWidget {
} }
class DialogDemo extends StatefulWidget { class DialogDemo extends StatefulWidget {
const DialogDemo({Key? key}) : super(key: key);
static const String routeName = '/material/dialog'; static const String routeName = '/material/dialog';
@override @override
...@@ -192,7 +194,7 @@ class DialogDemoState extends State<DialogDemo> { ...@@ -192,7 +194,7 @@ class DialogDemoState extends State<DialogDemo> {
child: const Text('FULLSCREEN'), child: const Text('FULLSCREEN'),
onPressed: () { onPressed: () {
Navigator.push(context, MaterialPageRoute<DismissDialogAction>( Navigator.push(context, MaterialPageRoute<DismissDialogAction>(
builder: (BuildContext context) => FullScreenDialogDemo(), builder: (BuildContext context) => const FullScreenDialogDemo(),
fullscreenDialog: true, fullscreenDialog: true,
)); ));
}, },
......
...@@ -13,6 +13,8 @@ const String _kAsset2 = 'people/square/sandra.png'; ...@@ -13,6 +13,8 @@ const String _kAsset2 = 'people/square/sandra.png';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets'; const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
class DrawerDemo extends StatefulWidget { class DrawerDemo extends StatefulWidget {
const DrawerDemo({Key? key}) : super(key: key);
static const String routeName = '/material/drawer'; static const String routeName = '/material/drawer';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class ElevationDemo extends StatefulWidget { class ElevationDemo extends StatefulWidget {
const ElevationDemo({Key? key}) : super(key: key);
static const String routeName = '/material/elevation'; static const String routeName = '/material/elevation';
@override @override
......
...@@ -18,11 +18,12 @@ typedef ValueToString<T> = String? Function(T value); ...@@ -18,11 +18,12 @@ typedef ValueToString<T> = String? Function(T value);
class DualHeaderWithHint extends StatelessWidget { class DualHeaderWithHint extends StatelessWidget {
const DualHeaderWithHint({ const DualHeaderWithHint({
Key? key,
this.name, this.name,
this.value, this.value,
this.hint, this.hint,
this.showHint, this.showHint,
}); }) : super(key: key);
final String? name; final String? name;
final String? value; final String? value;
...@@ -80,11 +81,12 @@ class DualHeaderWithHint extends StatelessWidget { ...@@ -80,11 +81,12 @@ class DualHeaderWithHint extends StatelessWidget {
class CollapsibleBody extends StatelessWidget { class CollapsibleBody extends StatelessWidget {
const CollapsibleBody({ const CollapsibleBody({
Key? key,
this.margin = EdgeInsets.zero, this.margin = EdgeInsets.zero,
this.child, this.child,
this.onSave, this.onSave,
this.onCancel, this.onCancel,
}); }) : super(key: key);
final EdgeInsets margin; final EdgeInsets margin;
final Widget? child; final Widget? child;
...@@ -175,6 +177,8 @@ class DemoItem<T> { ...@@ -175,6 +177,8 @@ class DemoItem<T> {
} }
class ExpansionPanelsDemo extends StatefulWidget { class ExpansionPanelsDemo extends StatefulWidget {
const ExpansionPanelsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/expansion_panels'; static const String routeName = '/material/expansion_panels';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class ExpansionTileListDemo extends StatelessWidget { class ExpansionTileListDemo extends StatelessWidget {
const ExpansionTileListDemo({Key? key}) : super(key: key);
static const String routeName = '/material/expansion-tile-list'; static const String routeName = '/material/expansion-tile-list';
@override @override
......
...@@ -93,6 +93,8 @@ class DateTimeItem extends StatelessWidget { ...@@ -93,6 +93,8 @@ class DateTimeItem extends StatelessWidget {
} }
class FullScreenDialogDemo extends StatefulWidget { class FullScreenDialogDemo extends StatefulWidget {
const FullScreenDialogDemo({Key? key}) : super(key: key);
@override @override
FullScreenDialogDemoState createState() => FullScreenDialogDemoState(); FullScreenDialogDemoState createState() => FullScreenDialogDemoState();
} }
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class IconsDemo extends StatefulWidget { class IconsDemo extends StatefulWidget {
const IconsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/icons'; static const String routeName = '/material/icons';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class ModalBottomSheetDemo extends StatelessWidget { class ModalBottomSheetDemo extends StatelessWidget {
const ModalBottomSheetDemo({Key? key}) : super(key: key);
static const String routeName = '/material/modal-bottom-sheet'; static const String routeName = '/material/modal-bottom-sheet';
@override @override
......
...@@ -74,6 +74,8 @@ class _PageSelector extends StatelessWidget { ...@@ -74,6 +74,8 @@ class _PageSelector extends StatelessWidget {
} }
class PageSelectorDemo extends StatelessWidget { class PageSelectorDemo extends StatelessWidget {
const PageSelectorDemo({Key? key}) : super(key: key);
static const String routeName = '/material/page-selector'; static const String routeName = '/material/page-selector';
static final List<Icon> icons = <Icon>[ static final List<Icon> icons = <Icon>[
const Icon(Icons.event, semanticLabel: 'Event'), const Icon(Icons.event, semanticLabel: 'Event'),
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class PersistentBottomSheetDemo extends StatefulWidget { class PersistentBottomSheetDemo extends StatefulWidget {
const PersistentBottomSheetDemo({Key? key}) : super(key: key);
static const String routeName = '/material/persistent-bottom-sheet'; static const String routeName = '/material/persistent-bottom-sheet';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class ProgressIndicatorDemo extends StatefulWidget { class ProgressIndicatorDemo extends StatefulWidget {
const ProgressIndicatorDemo({Key? key}) : super(key: key);
static const String routeName = '/material/progress-indicator'; static const String routeName = '/material/progress-indicator';
@override @override
......
...@@ -36,6 +36,8 @@ const List<_Page> _allPages = <_Page>[ ...@@ -36,6 +36,8 @@ const List<_Page> _allPages = <_Page>[
]; ];
class ScrollableTabsDemo extends StatefulWidget { class ScrollableTabsDemo extends StatefulWidget {
const ScrollableTabsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/scrollable-tabs'; static const String routeName = '/material/scrollable-tabs';
@override @override
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class SearchDemo extends StatefulWidget { class SearchDemo extends StatefulWidget {
const SearchDemo({Key? key}) : super(key: key);
static const String routeName = '/material/search'; static const String routeName = '/material/search';
@override @override
......
...@@ -28,6 +28,8 @@ const String _switchText = ...@@ -28,6 +28,8 @@ const String _switchText =
const String _switchCode = 'selectioncontrols_switch'; const String _switchCode = 'selectioncontrols_switch';
class SelectionControlsDemo extends StatefulWidget { class SelectionControlsDemo extends StatefulWidget {
const SelectionControlsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/selection-controls'; static const String routeName = '/material/selection-controls';
@override @override
......
...@@ -9,6 +9,8 @@ import 'package:flutter/material.dart'; ...@@ -9,6 +9,8 @@ import 'package:flutter/material.dart';
import '../../gallery/demo.dart'; import '../../gallery/demo.dart';
class SliderDemo extends StatefulWidget { class SliderDemo extends StatefulWidget {
const SliderDemo({Key? key}) : super(key: key);
static const String routeName = '/material/slider'; static const String routeName = '/material/slider';
@override @override
......
...@@ -138,6 +138,8 @@ class _CardDataItem extends StatelessWidget { ...@@ -138,6 +138,8 @@ class _CardDataItem extends StatelessWidget {
} }
class TabsDemo extends StatelessWidget { class TabsDemo extends StatelessWidget {
const TabsDemo({Key? key}) : super(key: key);
static const String routeName = '/material/tabs'; static const String routeName = '/material/tabs';
@override @override
......
...@@ -35,6 +35,8 @@ final List<_Page> _allPages = <_Page>[ ...@@ -35,6 +35,8 @@ final List<_Page> _allPages = <_Page>[
]; ];
class TabsFabDemo extends StatefulWidget { class TabsFabDemo extends StatefulWidget {
const TabsFabDemo({Key? key}) : super(key: key);
static const String routeName = '/material/tabs-fab'; static const String routeName = '/material/tabs-fab';
@override @override
......
...@@ -26,6 +26,7 @@ class PersonData { ...@@ -26,6 +26,7 @@ class PersonData {
class PasswordField extends StatefulWidget { class PasswordField extends StatefulWidget {
const PasswordField({ const PasswordField({
Key? key,
this.fieldKey, this.fieldKey,
this.hintText, this.hintText,
this.labelText, this.labelText,
...@@ -33,7 +34,7 @@ class PasswordField extends StatefulWidget { ...@@ -33,7 +34,7 @@ class PasswordField extends StatefulWidget {
this.onSaved, this.onSaved,
this.validator, this.validator,
this.onFieldSubmitted, this.onFieldSubmitted,
}); }) : super(key: key);
final Key? fieldKey; final Key? fieldKey;
final String? hintText; final String? hintText;
......
...@@ -12,6 +12,7 @@ const String _introText = ...@@ -12,6 +12,7 @@ const String _introText =
'apps accessible, like screen readers.'; 'apps accessible, like screen readers.';
class TooltipDemo extends StatelessWidget { class TooltipDemo extends StatelessWidget {
const TooltipDemo({Key? key}) : super(key: key);
static const String routeName = '/material/tooltips'; static const String routeName = '/material/tooltips';
......
...@@ -10,7 +10,7 @@ class PestoDemo extends StatelessWidget { ...@@ -10,7 +10,7 @@ class PestoDemo extends StatelessWidget {
static const String routeName = '/pesto'; static const String routeName = '/pesto';
@override @override
Widget build(BuildContext context) => PestoHome(); Widget build(BuildContext context) => const PestoHome();
} }
...@@ -29,6 +29,8 @@ final ThemeData _kTheme = ThemeData( ...@@ -29,6 +29,8 @@ final ThemeData _kTheme = ThemeData(
); );
class PestoHome extends StatelessWidget { class PestoHome extends StatelessWidget {
const PestoHome({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const RecipeGridPage(recipes: kPestoRecipes); return const RecipeGridPage(recipes: kPestoRecipes);
...@@ -36,6 +38,8 @@ class PestoHome extends StatelessWidget { ...@@ -36,6 +38,8 @@ class PestoHome extends StatelessWidget {
} }
class PestoFavorites extends StatelessWidget { class PestoFavorites extends StatelessWidget {
const PestoFavorites({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RecipeGridPage(recipes: _favoriteRecipes.toList()); return RecipeGridPage(recipes: _favoriteRecipes.toList());
...@@ -167,7 +171,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> { ...@@ -167,7 +171,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
void showFavoritesPage(BuildContext context) { void showFavoritesPage(BuildContext context) {
Navigator.push(context, MaterialPageRoute<void>( Navigator.push(context, MaterialPageRoute<void>(
settings: const RouteSettings(name: '/pesto/favorites'), settings: const RouteSettings(name: '/pesto/favorites'),
builder: (BuildContext context) => PestoFavorites(), builder: (BuildContext context) => const PestoFavorites(),
)); ));
} }
...@@ -185,7 +189,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> { ...@@ -185,7 +189,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
} }
class PestoLogo extends StatefulWidget { class PestoLogo extends StatefulWidget {
const PestoLogo({this.height, this.t}); const PestoLogo({Key? key, this.height, this.t}) : super(key: key);
final double? height; final double? height;
final double? t; final double? t;
......
...@@ -13,6 +13,8 @@ import 'package:flutter_gallery/demo/shrine/login.dart'; ...@@ -13,6 +13,8 @@ import 'package:flutter_gallery/demo/shrine/login.dart';
import 'package:flutter_gallery/demo/shrine/supplemental/cut_corners_border.dart'; import 'package:flutter_gallery/demo/shrine/supplemental/cut_corners_border.dart';
class ShrineApp extends StatefulWidget { class ShrineApp extends StatefulWidget {
const ShrineApp({Key? key}) : super(key: key);
@override @override
_ShrineAppState createState() => _ShrineAppState(); _ShrineAppState createState() => _ShrineAppState();
} }
...@@ -62,7 +64,7 @@ Route<dynamic>? _getRoute(RouteSettings settings) { ...@@ -62,7 +64,7 @@ Route<dynamic>? _getRoute(RouteSettings settings) {
return MaterialPageRoute<void>( return MaterialPageRoute<void>(
settings: settings, settings: settings,
builder: (BuildContext context) => LoginPage(), builder: (BuildContext context) => const LoginPage(),
fullscreenDialog: true, fullscreenDialog: true,
); );
} }
......
...@@ -198,12 +198,13 @@ class _BackdropTitle extends AnimatedWidget { ...@@ -198,12 +198,13 @@ class _BackdropTitle extends AnimatedWidget {
/// front or back layer is showing. /// front or back layer is showing.
class Backdrop extends StatefulWidget { class Backdrop extends StatefulWidget {
const Backdrop({ const Backdrop({
Key? key,
required this.frontLayer, required this.frontLayer,
required this.backLayer, required this.backLayer,
required this.frontTitle, required this.frontTitle,
required this.backTitle, required this.backTitle,
required this.controller, required this.controller,
}); }) : super(key: key);
final Widget frontLayer; final Widget frontLayer;
final Widget backLayer; final Widget backLayer;
...@@ -355,7 +356,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -355,7 +356,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
onPressed: () { onPressed: () {
Navigator.push<void>( Navigator.push<void>(
context, context,
MaterialPageRoute<void>(builder: (BuildContext context) => LoginPage()), MaterialPageRoute<void>(builder: (BuildContext context) => const LoginPage()),
); );
}, },
), ),
...@@ -364,7 +365,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -364,7 +365,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
onPressed: () { onPressed: () {
Navigator.push<void>( Navigator.push<void>(
context, context,
MaterialPageRoute<void>(builder: (BuildContext context) => LoginPage()), MaterialPageRoute<void>(builder: (BuildContext context) => const LoginPage()),
); );
}, },
), ),
......
...@@ -286,9 +286,9 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker ...@@ -286,9 +286,9 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker
width: numProducts > 3 ? _width - 94.0 : _width - 64.0, width: numProducts > 3 ? _width - 94.0 : _width - 64.0,
height: _kCartHeight, height: _kCartHeight,
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: ProductThumbnailRow(), child: const ProductThumbnailRow(),
), ),
ExtraProductsNumber(), const ExtraProductsNumber(),
], ],
), ),
], ],
...@@ -300,7 +300,7 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker ...@@ -300,7 +300,7 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker
Widget _buildShoppingCartPage() { Widget _buildShoppingCartPage() {
return Opacity( return Opacity(
opacity: _cartOpacityAnimation.value, opacity: _cartOpacityAnimation.value,
child: ShoppingCartPage(), child: const ShoppingCartPage(),
); );
} }
...@@ -404,6 +404,8 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker ...@@ -404,6 +404,8 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet> with Ticker
} }
class ProductThumbnailRow extends StatefulWidget { class ProductThumbnailRow extends StatefulWidget {
const ProductThumbnailRow({Key? key}) : super(key: key);
@override @override
_ProductThumbnailRowState createState() => _ProductThumbnailRowState(); _ProductThumbnailRowState createState() => _ProductThumbnailRowState();
} }
...@@ -511,6 +513,8 @@ class _ProductThumbnailRowState extends State<ProductThumbnailRow> { ...@@ -511,6 +513,8 @@ class _ProductThumbnailRowState extends State<ProductThumbnailRow> {
} }
class ExtraProductsNumber extends StatelessWidget { class ExtraProductsNumber extends StatelessWidget {
const ExtraProductsNumber({Key? key}) : super(key: key);
// Calculates the number to be displayed at the end of the row if there are // Calculates the number to be displayed at the end of the row if there are
// more than three products in the cart. This calculates overflow products, // more than three products in the cart. This calculates overflow products,
// including their duplicates (but not duplicates of products shown as // including their duplicates (but not duplicates of products shown as
...@@ -554,7 +558,7 @@ class ExtraProductsNumber extends StatelessWidget { ...@@ -554,7 +558,7 @@ class ExtraProductsNumber extends StatelessWidget {
} }
class ProductThumbnail extends StatelessWidget { class ProductThumbnail extends StatelessWidget {
const ProductThumbnail(this.animation, this.opacityAnimation, this.product); const ProductThumbnail(this.animation, this.opacityAnimation, this.product, {Key? key}) : super(key: key);
final Animation<double> animation; final Animation<double> animation;
final Animation<double> opacityAnimation; final Animation<double> opacityAnimation;
......
...@@ -12,7 +12,7 @@ import 'package:flutter_gallery/demo/shrine/model/product.dart'; ...@@ -12,7 +12,7 @@ import 'package:flutter_gallery/demo/shrine/model/product.dart';
import 'package:flutter_gallery/demo/shrine/supplemental/asymmetric_view.dart'; import 'package:flutter_gallery/demo/shrine/supplemental/asymmetric_view.dart';
class ProductPage extends StatelessWidget { class ProductPage extends StatelessWidget {
const ProductPage({this.category = Category.all}); const ProductPage({Key? key, this.category = Category.all}) : super(key: key);
final Category category; final Category category;
......
...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_gallery/demo/shrine/colors.dart'; import 'package:flutter_gallery/demo/shrine/colors.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
const LoginPage({Key? key}) : super(key: key);
@override @override
_LoginPageState createState() => _LoginPageState(); _LoginPageState createState() => _LoginPageState();
} }
......
...@@ -14,6 +14,8 @@ import 'package:flutter_gallery/demo/shrine/model/product.dart'; ...@@ -14,6 +14,8 @@ import 'package:flutter_gallery/demo/shrine/model/product.dart';
const double _leftColumnWidth = 60.0; const double _leftColumnWidth = 60.0;
class ShoppingCartPage extends StatefulWidget { class ShoppingCartPage extends StatefulWidget {
const ShoppingCartPage({Key? key}) : super(key: key);
@override @override
_ShoppingCartPageState createState() => _ShoppingCartPageState(); _ShoppingCartPageState createState() => _ShoppingCartPageState();
} }
...@@ -103,7 +105,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> { ...@@ -103,7 +105,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
} }
class ShoppingCartSummary extends StatelessWidget { class ShoppingCartSummary extends StatelessWidget {
const ShoppingCartSummary({this.model}); const ShoppingCartSummary({Key? key, this.model}) : super(key: key);
final AppStateModel? model; final AppStateModel? model;
...@@ -183,10 +185,11 @@ class ShoppingCartSummary extends StatelessWidget { ...@@ -183,10 +185,11 @@ class ShoppingCartSummary extends StatelessWidget {
class ShoppingCartRow extends StatelessWidget { class ShoppingCartRow extends StatelessWidget {
const ShoppingCartRow({ const ShoppingCartRow({
Key? key,
required this.product, required this.product,
required this.quantity, required this.quantity,
this.onPressed, this.onPressed,
}); }) : super(key: key);
final Product product; final Product product;
final int? quantity; final int? quantity;
......
...@@ -10,8 +10,8 @@ import 'package:flutter_gallery/demo/shrine/model/app_state_model.dart'; ...@@ -10,8 +10,8 @@ import 'package:flutter_gallery/demo/shrine/model/app_state_model.dart';
import 'package:flutter_gallery/demo/shrine/model/product.dart'; import 'package:flutter_gallery/demo/shrine/model/product.dart';
class ProductCard extends StatelessWidget { class ProductCard extends StatelessWidget {
const ProductCard({ this.imageAspectRatio = 33 / 49, this.product }) const ProductCard({ Key? key, this.imageAspectRatio = 33 / 49, this.product })
: assert(imageAspectRatio > 0); : assert(imageAspectRatio > 0), super(key: key);
final double imageAspectRatio; final double imageAspectRatio;
final Product? product; final Product? product;
......
...@@ -9,9 +9,10 @@ import 'package:flutter_gallery/demo/shrine/supplemental/product_card.dart'; ...@@ -9,9 +9,10 @@ import 'package:flutter_gallery/demo/shrine/supplemental/product_card.dart';
class TwoProductCardColumn extends StatelessWidget { class TwoProductCardColumn extends StatelessWidget {
const TwoProductCardColumn({ const TwoProductCardColumn({
Key? key,
required this.bottom, required this.bottom,
this.top, this.top,
}); }) : super(key: key);
final Product? bottom, top; final Product? bottom, top;
...@@ -57,7 +58,7 @@ class TwoProductCardColumn extends StatelessWidget { ...@@ -57,7 +58,7 @@ class TwoProductCardColumn extends StatelessWidget {
} }
class OneProductCardColumn extends StatelessWidget { class OneProductCardColumn extends StatelessWidget {
const OneProductCardColumn({this.product}); const OneProductCardColumn({Key? key, this.product}) : super(key: key);
final Product? product; final Product? product;
......
...@@ -11,5 +11,5 @@ class ShrineDemo extends StatelessWidget { ...@@ -11,5 +11,5 @@ class ShrineDemo extends StatelessWidget {
static const String routeName = '/shrine'; // Used by the Gallery app. static const String routeName = '/shrine'; // Used by the Gallery app.
@override @override
Widget build(BuildContext context) => ShrineApp(); Widget build(BuildContext context) => const ShrineApp();
} }
...@@ -8,10 +8,11 @@ import 'package:flutter/material.dart'; ...@@ -8,10 +8,11 @@ import 'package:flutter/material.dart';
@immutable @immutable
class ColorPicker extends StatelessWidget { class ColorPicker extends StatelessWidget {
const ColorPicker({ const ColorPicker({
Key? key,
required this.colors, required this.colors,
required this.selectedColor, required this.selectedColor,
this.onColorSelection, this.onColorSelection,
}); }) : super(key: key);
final Set<Color> colors; final Set<Color> colors;
final Color selectedColor; final Color selectedColor;
......
...@@ -39,6 +39,8 @@ class TextStyleItem extends StatelessWidget { ...@@ -39,6 +39,8 @@ class TextStyleItem extends StatelessWidget {
} }
class TypographyDemo extends StatelessWidget { class TypographyDemo extends StatelessWidget {
const TypographyDemo({Key? key}) : super(key: key);
static const String routeName = '/typography'; static const String routeName = '/typography';
@override @override
......
...@@ -92,7 +92,7 @@ class VideoCard extends StatelessWidget { ...@@ -92,7 +92,7 @@ class VideoCard extends StatelessWidget {
} }
class VideoPlayerLoading extends StatefulWidget { class VideoPlayerLoading extends StatefulWidget {
const VideoPlayerLoading(this.controller); const VideoPlayerLoading(this.controller, {Key? key}) : super(key: key);
final VideoPlayerController? controller; final VideoPlayerController? controller;
...@@ -136,7 +136,7 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> { ...@@ -136,7 +136,7 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
} }
class VideoPlayPause extends StatefulWidget { class VideoPlayPause extends StatefulWidget {
const VideoPlayPause(this.controller); const VideoPlayPause(this.controller, {Key? key}) : super(key: key);
final VideoPlayerController? controller; final VideoPlayerController? controller;
...@@ -202,9 +202,10 @@ class _VideoPlayPauseState extends State<VideoPlayPause> { ...@@ -202,9 +202,10 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
class FadeAnimation extends StatefulWidget { class FadeAnimation extends StatefulWidget {
const FadeAnimation({ const FadeAnimation({
Key? key,
this.child, this.child,
this.duration = const Duration(milliseconds: 500), this.duration = const Duration(milliseconds: 500),
}); }) : super(key: key);
final Widget? child; final Widget? child;
final Duration duration; final Duration duration;
...@@ -264,9 +265,10 @@ class _FadeAnimationState extends State<FadeAnimation> with SingleTickerProvider ...@@ -264,9 +265,10 @@ class _FadeAnimationState extends State<FadeAnimation> with SingleTickerProvider
class ConnectivityOverlay extends StatefulWidget { class ConnectivityOverlay extends StatefulWidget {
const ConnectivityOverlay({ const ConnectivityOverlay({
Key? key,
this.child, this.child,
this.connectedCompleter, this.connectedCompleter,
}); }) : super(key: key);
final Widget? child; final Widget? child;
final Completer<void>? connectedCompleter; final Completer<void>? connectedCompleter;
......
...@@ -179,13 +179,14 @@ class _BackAppBar extends StatelessWidget { ...@@ -179,13 +179,14 @@ class _BackAppBar extends StatelessWidget {
class Backdrop extends StatefulWidget { class Backdrop extends StatefulWidget {
const Backdrop({ const Backdrop({
Key? key,
this.frontAction, this.frontAction,
this.frontTitle, this.frontTitle,
this.frontHeading, this.frontHeading,
this.frontLayer, this.frontLayer,
this.backTitle, this.backTitle,
this.backLayer, this.backLayer,
}); }) : super(key: key);
final Widget? frontAction; final Widget? frontAction;
final Widget? frontTitle; final Widget? frontTitle;
......
...@@ -42,12 +42,13 @@ class ComponentDemoTabData { ...@@ -42,12 +42,13 @@ class ComponentDemoTabData {
class TabbedComponentDemoScaffold extends StatelessWidget { class TabbedComponentDemoScaffold extends StatelessWidget {
const TabbedComponentDemoScaffold({ const TabbedComponentDemoScaffold({
Key? key,
this.title, this.title,
this.demos, this.demos,
this.actions, this.actions,
this.isScrollable = true, this.isScrollable = true,
this.showExampleCodeAction = true, this.showExampleCodeAction = true,
}); }) : super(key: key);
final List<ComponentDemoTabData>? demos; final List<ComponentDemoTabData>? demos;
final String? title; final String? title;
...@@ -147,7 +148,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget { ...@@ -147,7 +148,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
} }
class FullScreenCodeDialog extends StatefulWidget { class FullScreenCodeDialog extends StatefulWidget {
const FullScreenCodeDialog({ this.exampleCodeTag }); const FullScreenCodeDialog({ Key? key, this.exampleCodeTag }) : super(key: key);
final String? exampleCodeTag; final String? exampleCodeTag;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment