mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Deps update, utilize super.key (#1265)
* Deps update, utilize `super.key` * `flutter format`
This commit is contained in:
@@ -8,7 +8,7 @@ const Widget divider = SizedBox(height: 10);
|
||||
const double narrowScreenWidthThreshold = 400;
|
||||
|
||||
class ColorPalettesScreen extends StatelessWidget {
|
||||
const ColorPalettesScreen({Key? key}) : super(key: key);
|
||||
const ColorPalettesScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -86,8 +86,7 @@ class ColorPalettesScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
class ColorSchemeView extends StatelessWidget {
|
||||
const ColorSchemeView({Key? key, required this.colorScheme})
|
||||
: super(key: key);
|
||||
const ColorSchemeView({super.key, required this.colorScheme});
|
||||
|
||||
final ColorScheme colorScheme;
|
||||
|
||||
@@ -239,7 +238,7 @@ class ColorSchemeView extends StatelessWidget {
|
||||
}
|
||||
|
||||
class ColorGroup extends StatelessWidget {
|
||||
const ColorGroup({Key? key, required this.children}) : super(key: key);
|
||||
const ColorGroup({super.key, required this.children});
|
||||
|
||||
final List<Widget> children;
|
||||
|
||||
@@ -256,11 +255,11 @@ class ColorGroup extends StatelessWidget {
|
||||
|
||||
class ColorChip extends StatelessWidget {
|
||||
const ColorChip({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.color,
|
||||
required this.label,
|
||||
this.onColor,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final Color color;
|
||||
final Color? onColor;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ComponentScreen extends StatelessWidget {
|
||||
const ComponentScreen({Key? key, required this.showNavBottomBar})
|
||||
: super(key: key);
|
||||
const ComponentScreen({super.key, required this.showNavBottomBar});
|
||||
|
||||
final bool showNavBottomBar;
|
||||
|
||||
@@ -70,7 +69,7 @@ void Function()? handlePressed(
|
||||
}
|
||||
|
||||
class Buttons extends StatefulWidget {
|
||||
const Buttons({Key? key}) : super(key: key);
|
||||
const Buttons({super.key});
|
||||
|
||||
@override
|
||||
State<Buttons> createState() => _ButtonsState();
|
||||
@@ -95,8 +94,7 @@ class _ButtonsState extends State<Buttons> {
|
||||
class ButtonsWithoutIcon extends StatelessWidget {
|
||||
final bool isDisabled;
|
||||
|
||||
const ButtonsWithoutIcon({Key? key, required this.isDisabled})
|
||||
: super(key: key);
|
||||
const ButtonsWithoutIcon({super.key, required this.isDisabled});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -146,7 +144,7 @@ class ButtonsWithoutIcon extends StatelessWidget {
|
||||
}
|
||||
|
||||
class ButtonsWithIcon extends StatelessWidget {
|
||||
const ButtonsWithIcon({Key? key}) : super(key: key);
|
||||
const ButtonsWithIcon({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -205,7 +203,7 @@ class ButtonsWithIcon extends StatelessWidget {
|
||||
}
|
||||
|
||||
class FloatingActionButtons extends StatelessWidget {
|
||||
const FloatingActionButtons({Key? key}) : super(key: key);
|
||||
const FloatingActionButtons({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -242,7 +240,7 @@ class FloatingActionButtons extends StatelessWidget {
|
||||
}
|
||||
|
||||
class Cards extends StatelessWidget {
|
||||
const Cards({Key? key}) : super(key: key);
|
||||
const Cards({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -330,7 +328,7 @@ class Cards extends StatelessWidget {
|
||||
}
|
||||
|
||||
class Dialogs extends StatefulWidget {
|
||||
const Dialogs({Key? key}) : super(key: key);
|
||||
const Dialogs({super.key});
|
||||
|
||||
@override
|
||||
State<Dialogs> createState() => _DialogsState();
|
||||
@@ -443,11 +441,10 @@ class NavigationBars extends StatefulWidget {
|
||||
final bool isExampleBar;
|
||||
|
||||
const NavigationBars(
|
||||
{Key? key,
|
||||
{super.key,
|
||||
this.onSelectItem,
|
||||
required this.selectedIndex,
|
||||
required this.isExampleBar})
|
||||
: super(key: key);
|
||||
required this.isExampleBar});
|
||||
|
||||
@override
|
||||
State<NavigationBars> createState() => _NavigationBarsState();
|
||||
@@ -483,8 +480,7 @@ class NavigationRailSection extends StatefulWidget {
|
||||
final int selectedIndex;
|
||||
|
||||
const NavigationRailSection(
|
||||
{Key? key, required this.onSelectItem, required this.selectedIndex})
|
||||
: super(key: key);
|
||||
{super.key, required this.onSelectItem, required this.selectedIndex});
|
||||
|
||||
@override
|
||||
State<NavigationRailSection> createState() => _NavigationRailSectionState();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ElevationScreen extends StatelessWidget {
|
||||
const ElevationScreen({Key? key}) : super(key: key);
|
||||
const ElevationScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -48,8 +48,7 @@ class ElevationScreen extends StatelessWidget {
|
||||
const double narrowScreenWidthThreshold = 450;
|
||||
|
||||
class ElevationGrid extends StatelessWidget {
|
||||
const ElevationGrid({Key? key, this.shadowColor, this.surfaceTintColor})
|
||||
: super(key: key);
|
||||
const ElevationGrid({super.key, this.shadowColor, this.surfaceTintColor});
|
||||
|
||||
final Color? shadowColor;
|
||||
final Color? surfaceTintColor;
|
||||
@@ -92,8 +91,7 @@ class ElevationGrid extends StatelessWidget {
|
||||
|
||||
class ElevationCard extends StatefulWidget {
|
||||
const ElevationCard(
|
||||
{Key? key, required this.info, this.shadowColor, this.surfaceTint})
|
||||
: super(key: key);
|
||||
{super.key, required this.info, this.shadowColor, this.surfaceTint});
|
||||
|
||||
final ElevationInfo info;
|
||||
final Color? shadowColor;
|
||||
|
||||
@@ -10,7 +10,7 @@ void main() {
|
||||
}
|
||||
|
||||
class Material3Demo extends StatefulWidget {
|
||||
const Material3Demo({Key? key}) : super(key: key);
|
||||
const Material3Demo({super.key});
|
||||
|
||||
@override
|
||||
State<Material3Demo> createState() => _Material3DemoState();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TypographyScreen extends StatelessWidget {
|
||||
const TypographyScreen({Key? key}) : super(key: key);
|
||||
const TypographyScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -41,10 +41,10 @@ class TypographyScreen extends StatelessWidget {
|
||||
|
||||
class TextStyleExample extends StatelessWidget {
|
||||
const TextStyleExample({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.name,
|
||||
required this.style,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final String name;
|
||||
final TextStyle style;
|
||||
|
||||
Reference in New Issue
Block a user