1
0
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:
Brett Morgan
2022-05-13 12:31:56 -07:00
committed by GitHub
parent 52ef797b9a
commit 58bc5d7a58
244 changed files with 449 additions and 500 deletions

View File

@@ -9,7 +9,7 @@ import 'routing.dart';
import 'screens/navigator.dart';
class Bookstore extends StatefulWidget {
const Bookstore({Key? key}) : super(key: key);
const Bookstore({super.key});
@override
State<Bookstore> createState() => _BookstoreState();

View File

@@ -36,10 +36,10 @@ class BookstoreAuth extends ChangeNotifier {
class BookstoreAuthScope extends InheritedNotifier<BookstoreAuth> {
const BookstoreAuthScope({
required BookstoreAuth notifier,
required Widget child,
Key? key,
}) : super(key: key, notifier: notifier, child: child);
required super.notifier,
required super.child,
super.key,
});
static BookstoreAuth of(BuildContext context) => context
.dependOnInheritedWidgetOfExactType<BookstoreAuthScope>()!

View File

@@ -38,10 +38,10 @@ class RouteState extends ChangeNotifier {
/// Provides the current [RouteState] to descendant widgets in the tree.
class RouteStateScope extends InheritedNotifier<RouteState> {
const RouteStateScope({
required RouteState notifier,
required Widget child,
Key? key,
}) : super(key: key, notifier: notifier, child: child);
required super.notifier,
required super.child,
super.key,
});
static RouteState of(BuildContext context) =>
context.dependOnInheritedWidgetOfExactType<RouteStateScope>()!.notifier!;

View File

@@ -12,9 +12,9 @@ class AuthorDetailsScreen extends StatelessWidget {
final Author author;
const AuthorDetailsScreen({
Key? key,
super.key,
required this.author,
}) : super(key: key);
});
@override
Widget build(BuildContext context) => Scaffold(

View File

@@ -11,7 +11,7 @@ import '../widgets/author_list.dart';
class AuthorsScreen extends StatelessWidget {
final String title = 'Authors';
const AuthorsScreen({Key? key}) : super(key: key);
const AuthorsScreen({super.key});
@override
Widget build(BuildContext context) => Scaffold(

View File

@@ -12,9 +12,9 @@ class BookDetailsScreen extends StatelessWidget {
final Book? book;
const BookDetailsScreen({
Key? key,
super.key,
this.book,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -10,8 +10,8 @@ import '../widgets/book_list.dart';
class BooksScreen extends StatefulWidget {
const BooksScreen({
Key? key,
}) : super(key: key);
super.key,
});
@override
State<BooksScreen> createState() => _BooksScreenState();

View File

@@ -21,8 +21,8 @@ class BookstoreNavigator extends StatefulWidget {
const BookstoreNavigator({
required this.navigatorKey,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<BookstoreNavigator> createState() => _BookstoreNavigatorState();

View File

@@ -10,8 +10,8 @@ import 'scaffold_body.dart';
class BookstoreScaffold extends StatelessWidget {
const BookstoreScaffold({
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -16,8 +16,8 @@ class BookstoreScaffoldBody extends StatelessWidget {
static GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
const BookstoreScaffoldBody({
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -9,7 +9,7 @@ import '../auth.dart';
import '../routing.dart';
class SettingsScreen extends StatefulWidget {
const SettingsScreen({Key? key}) : super(key: key);
const SettingsScreen({super.key});
@override
State<SettingsScreen> createState() => _SettingsScreenState();
@@ -39,8 +39,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
class SettingsContent extends StatelessWidget {
const SettingsContent({
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) => Column(

View File

@@ -16,8 +16,8 @@ class SignInScreen extends StatefulWidget {
const SignInScreen({
required this.onSignIn,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<SignInScreen> createState() => _SignInScreenState();

View File

@@ -13,8 +13,8 @@ class AuthorList extends StatelessWidget {
const AuthorList({
required this.authors,
this.onTap,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) => ListView.builder(

View File

@@ -13,8 +13,8 @@ class BookList extends StatelessWidget {
const BookList({
required this.books,
this.onTap,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) => ListView.builder(