mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Deps update, utilize super.key (#1265)
* Deps update, utilize `super.key` * `flutter format`
This commit is contained in:
@@ -14,7 +14,7 @@ import 'widgets.dart';
|
||||
void main() => runApp(const MyAdaptingApp());
|
||||
|
||||
class MyAdaptingApp extends StatelessWidget {
|
||||
const MyAdaptingApp({Key? key}) : super(key: key);
|
||||
const MyAdaptingApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
@@ -49,7 +49,7 @@ class MyAdaptingApp extends StatelessWidget {
|
||||
// These differences are also subjective and have more than one 'right' answer
|
||||
// depending on the app and content.
|
||||
class PlatformAdaptingHomePage extends StatefulWidget {
|
||||
const PlatformAdaptingHomePage({Key? key}) : super(key: key);
|
||||
const PlatformAdaptingHomePage({super.key});
|
||||
|
||||
@override
|
||||
State<PlatformAdaptingHomePage> createState() =>
|
||||
|
||||
@@ -15,7 +15,7 @@ class NewsTab extends StatefulWidget {
|
||||
static const androidIcon = Icon(Icons.library_books);
|
||||
static const iosIcon = Icon(CupertinoIcons.news);
|
||||
|
||||
const NewsTab({Key? key}) : super(key: key);
|
||||
const NewsTab({super.key});
|
||||
|
||||
@override
|
||||
State<NewsTab> createState() => _NewsTabState();
|
||||
|
||||
@@ -13,7 +13,7 @@ class ProfileTab extends StatelessWidget {
|
||||
static const androidIcon = Icon(Icons.person);
|
||||
static const iosIcon = Icon(CupertinoIcons.profile_circled);
|
||||
|
||||
const ProfileTab({Key? key}) : super(key: key);
|
||||
const ProfileTab({super.key});
|
||||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
return SafeArea(
|
||||
@@ -115,8 +115,8 @@ class PreferenceCard extends StatelessWidget {
|
||||
required this.header,
|
||||
required this.content,
|
||||
required this.preferenceChoices,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String header;
|
||||
final String content;
|
||||
@@ -174,7 +174,7 @@ class LogOutButton extends StatelessWidget {
|
||||
static const _logoutMessage = Text(
|
||||
"You can't actually log out! This is just a demo of how alerts work.");
|
||||
|
||||
const LogOutButton({Key? key}) : super(key: key);
|
||||
const LogOutButton({super.key});
|
||||
|
||||
// ===========================================================================
|
||||
// Non-shared code below because this tab shows different interfaces. On
|
||||
|
||||
@@ -12,7 +12,7 @@ class SettingsTab extends StatefulWidget {
|
||||
static const androidIcon = Icon(Icons.settings);
|
||||
static const iosIcon = Icon(CupertinoIcons.gear);
|
||||
|
||||
const SettingsTab({Key? key}) : super(key: key);
|
||||
const SettingsTab({super.key});
|
||||
|
||||
@override
|
||||
State<SettingsTab> createState() => _SettingsTabState();
|
||||
|
||||
@@ -16,8 +16,8 @@ class SongDetailTab extends StatelessWidget {
|
||||
required this.id,
|
||||
required this.song,
|
||||
required this.color,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
|
||||
final int id;
|
||||
final String song;
|
||||
|
||||
@@ -15,7 +15,7 @@ class SongsTab extends StatefulWidget {
|
||||
static const androidIcon = Icon(Icons.music_note);
|
||||
static const iosIcon = Icon(CupertinoIcons.music_note);
|
||||
|
||||
const SongsTab({Key? key, this.androidDrawer}) : super(key: key);
|
||||
const SongsTab({super.key, this.androidDrawer});
|
||||
|
||||
final Widget? androidDrawer;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import 'package:flutter/material.dart';
|
||||
/// A simple widget that builds different things on different platforms.
|
||||
class PlatformWidget extends StatelessWidget {
|
||||
const PlatformWidget({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.androidBuilder,
|
||||
required this.iosBuilder,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final WidgetBuilder androidBuilder;
|
||||
final WidgetBuilder iosBuilder;
|
||||
@@ -41,8 +41,8 @@ class PressableCard extends StatefulWidget {
|
||||
required this.color,
|
||||
required this.flattenAnimation,
|
||||
this.child,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
|
||||
final VoidCallback? onPressed;
|
||||
final Color color;
|
||||
@@ -141,8 +141,8 @@ class HeroAnimatingSongCard extends StatelessWidget {
|
||||
required this.color,
|
||||
required this.heroAnimation,
|
||||
this.onPressed,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String song;
|
||||
final Color color;
|
||||
@@ -220,7 +220,7 @@ class HeroAnimatingSongCard extends StatelessWidget {
|
||||
/// This is an example of a custom widget that an app developer might create for
|
||||
/// use on both iOS and Android as part of their brand's unique design.
|
||||
class SongPlaceholderTile extends StatelessWidget {
|
||||
const SongPlaceholderTile({Key? key}) : super(key: key);
|
||||
const SongPlaceholderTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user