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:
@@ -56,7 +56,7 @@ void setupWindow() {
|
||||
}
|
||||
|
||||
class UnsplashSearchApp extends StatelessWidget {
|
||||
const UnsplashSearchApp({Key? key}) : super(key: key);
|
||||
const UnsplashSearchApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -68,7 +68,7 @@ class UnsplashSearchApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class UnsplashHomePage extends StatelessWidget {
|
||||
const UnsplashHomePage({required this.title, Key? key}) : super(key: key);
|
||||
const UnsplashHomePage({required this.title, super.key});
|
||||
final String title;
|
||||
|
||||
@override
|
||||
|
||||
@@ -20,8 +20,8 @@ class PhotoDetails extends StatefulWidget {
|
||||
const PhotoDetails({
|
||||
required this.photo,
|
||||
required this.onPhotoSave,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
final Photo photo;
|
||||
final PhotoDetailsPhotoSaveCallback onPhotoSave;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:fluent_ui/fluent_ui.dart';
|
||||
typedef PhotoSearchDialogCallback = void Function(String searchQuery);
|
||||
|
||||
class PhotoSearchDialog extends StatefulWidget {
|
||||
const PhotoSearchDialog({required this.callback, Key? key}) : super(key: key);
|
||||
const PhotoSearchDialog({required this.callback, super.key});
|
||||
final PhotoSearchDialogCallback callback;
|
||||
@override
|
||||
State<PhotoSearchDialog> createState() => _PhotoSearchDialogState();
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/gestures.dart';
|
||||
import 'package:url_launcher/url_launcher.dart' as url_launcher;
|
||||
|
||||
class PolicyDialog extends StatelessWidget {
|
||||
const PolicyDialog({Key? key}) : super(key: key);
|
||||
const PolicyDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -24,13 +24,12 @@ import 'package:flutter/material.dart';
|
||||
class Split extends StatefulWidget {
|
||||
/// Builds a split oriented along [axis].
|
||||
const Split({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.axis,
|
||||
required this.firstChild,
|
||||
required this.secondChild,
|
||||
double? initialFirstFraction,
|
||||
}) : initialFirstFraction = initialFirstFraction ?? 0.5,
|
||||
super(key: key);
|
||||
}) : initialFirstFraction = initialFirstFraction ?? 0.5;
|
||||
|
||||
/// The main axis the children will lay out on.
|
||||
///
|
||||
|
||||
@@ -14,7 +14,7 @@ final _unsplashPrivacyPolicy = Uri.parse(
|
||||
'https://unsplash.com/privacy?utm_source=${Uri.encodeFull(unsplashAppName)}&utm_medium=referral');
|
||||
|
||||
class UnsplashNotice extends StatefulWidget {
|
||||
const UnsplashNotice({Key? key, required this.child}) : super(key: key);
|
||||
const UnsplashNotice({super.key, required this.child});
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
@@ -47,7 +47,7 @@ class _UnsplashNoticeState extends State<UnsplashNotice> {
|
||||
}
|
||||
|
||||
class _UnsplashDialog extends StatelessWidget {
|
||||
const _UnsplashDialog({Key? key, required this.accepted}) : super(key: key);
|
||||
const _UnsplashDialog({required this.accepted});
|
||||
final Function accepted;
|
||||
|
||||
@override
|
||||
|
||||
@@ -12,7 +12,7 @@ import '../widgets/photo_details.dart';
|
||||
import '../widgets/split.dart';
|
||||
|
||||
class UnsplashSearchContent extends StatefulWidget {
|
||||
const UnsplashSearchContent({Key? key}) : super(key: key);
|
||||
const UnsplashSearchContent({super.key});
|
||||
|
||||
@override
|
||||
State<UnsplashSearchContent> createState() => _UnsplashSearchContentState();
|
||||
|
||||
@@ -85,8 +85,7 @@ class FakeUnsplash implements Unsplash {
|
||||
const fabKey = Key('fab');
|
||||
|
||||
class PhotoSearchModelTester extends StatelessWidget {
|
||||
const PhotoSearchModelTester({required this.query, Key? key})
|
||||
: super(key: key);
|
||||
const PhotoSearchModelTester({required this.query, super.key});
|
||||
final String query;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -56,7 +56,7 @@ void setupWindow() {
|
||||
}
|
||||
|
||||
class UnsplashSearchApp extends StatelessWidget {
|
||||
const UnsplashSearchApp({Key? key}) : super(key: key);
|
||||
const UnsplashSearchApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -71,7 +71,7 @@ class UnsplashSearchApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class UnsplashHomePage extends StatelessWidget {
|
||||
const UnsplashHomePage({required this.title, Key? key}) : super(key: key);
|
||||
const UnsplashHomePage({required this.title, super.key});
|
||||
final String title;
|
||||
|
||||
@override
|
||||
|
||||
@@ -18,8 +18,8 @@ class PhotoDetails extends StatefulWidget {
|
||||
const PhotoDetails({
|
||||
required this.photo,
|
||||
required this.onPhotoSave,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
super.key,
|
||||
});
|
||||
final Photo photo;
|
||||
final PhotoDetailsPhotoSaveCallback onPhotoSave;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
|
||||
typedef PhotoSearchDialogCallback = void Function(String searchQuery);
|
||||
|
||||
class PhotoSearchDialog extends StatefulWidget {
|
||||
const PhotoSearchDialog({required this.callback, Key? key}) : super(key: key);
|
||||
const PhotoSearchDialog({required this.callback, super.key});
|
||||
final PhotoSearchDialogCallback callback;
|
||||
@override
|
||||
State<PhotoSearchDialog> createState() => _PhotoSearchDialogState();
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart' as url_launcher;
|
||||
|
||||
class PolicyDialog extends StatelessWidget {
|
||||
const PolicyDialog({Key? key}) : super(key: key);
|
||||
const PolicyDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -24,13 +24,12 @@ import 'package:flutter/material.dart';
|
||||
class Split extends StatefulWidget {
|
||||
/// Builds a split oriented along [axis].
|
||||
const Split({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.axis,
|
||||
required this.firstChild,
|
||||
required this.secondChild,
|
||||
double? initialFirstFraction,
|
||||
}) : initialFirstFraction = initialFirstFraction ?? 0.5,
|
||||
super(key: key);
|
||||
}) : initialFirstFraction = initialFirstFraction ?? 0.5;
|
||||
|
||||
/// The main axis the children will lay out on.
|
||||
///
|
||||
|
||||
@@ -14,7 +14,7 @@ final _unsplashPrivacyPolicy = Uri.parse(
|
||||
'https://unsplash.com/privacy?utm_source=${Uri.encodeFull(unsplashAppName)}&utm_medium=referral');
|
||||
|
||||
class UnsplashNotice extends StatefulWidget {
|
||||
const UnsplashNotice({Key? key, required this.child}) : super(key: key);
|
||||
const UnsplashNotice({super.key, required this.child});
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
@@ -48,7 +48,7 @@ class _UnsplashNoticeState extends State<UnsplashNotice> {
|
||||
}
|
||||
|
||||
class _UnsplashDialog extends StatelessWidget {
|
||||
const _UnsplashDialog({Key? key, required this.accepted}) : super(key: key);
|
||||
const _UnsplashDialog({required this.accepted});
|
||||
final Function accepted;
|
||||
|
||||
@override
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../widgets/photo_details.dart';
|
||||
import '../widgets/split.dart';
|
||||
|
||||
class UnsplashSearchContent extends StatefulWidget {
|
||||
const UnsplashSearchContent({Key? key}) : super(key: key);
|
||||
const UnsplashSearchContent({super.key});
|
||||
|
||||
@override
|
||||
State<UnsplashSearchContent> createState() => _UnsplashSearchContentState();
|
||||
|
||||
@@ -85,8 +85,7 @@ class FakeUnsplash implements Unsplash {
|
||||
const fabKey = Key('fab');
|
||||
|
||||
class PhotoSearchModelTester extends StatelessWidget {
|
||||
const PhotoSearchModelTester({required this.query, Key? key})
|
||||
: super(key: key);
|
||||
const PhotoSearchModelTester({required this.query, super.key});
|
||||
final String query;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user