1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 14:28:51 +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

@@ -11,7 +11,7 @@ double generateMargin() => Random().nextDouble() * 64;
Color generateColor() => Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
class AnimatedContainerDemo extends StatefulWidget {
const AnimatedContainerDemo({Key? key}) : super(key: key);
const AnimatedContainerDemo({super.key});
static String routeName = '/basics/01_animated_container';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class PageRouteBuilderDemo extends StatelessWidget {
const PageRouteBuilderDemo({Key? key}) : super(key: key);
const PageRouteBuilderDemo({super.key});
static const String routeName = '/basics/page_route_builder';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AnimationControllerDemo extends StatefulWidget {
const AnimationControllerDemo({Key? key}) : super(key: key);
const AnimationControllerDemo({super.key});
static const String routeName = '/basics/animation_controller';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class TweenDemo extends StatefulWidget {
const TweenDemo({Key? key}) : super(key: key);
const TweenDemo({super.key});
static const String routeName = '/basics/tweens';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AnimatedBuilderDemo extends StatefulWidget {
const AnimatedBuilderDemo({Key? key}) : super(key: key);
const AnimatedBuilderDemo({super.key});
static const String routeName = '/basics/animated_builder';
@override

View File

@@ -16,7 +16,7 @@ class TypewriterTween extends Tween<String> {
}
class CustomTweenDemo extends StatefulWidget {
const CustomTweenDemo({Key? key}) : super(key: key);
const CustomTweenDemo({super.key});
static const String routeName = '/basics/custom_tweens';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class TweenSequenceDemo extends StatefulWidget {
const TweenSequenceDemo({Key? key}) : super(key: key);
const TweenSequenceDemo({super.key});
static const String routeName = '/basics/chaining_tweens';
@override

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
// Refer to the AnimatedWidget docs here - https://api.flutter.dev/flutter/widgets/AnimatedWidget-class.html
// for examples of other common animated widgets.
class FadeTransitionDemo extends StatefulWidget {
const FadeTransitionDemo({Key? key}) : super(key: key);
const FadeTransitionDemo({super.key});
static const String routeName = '/basics/fade_transition';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class AnimatedListDemo extends StatefulWidget {
const AnimatedListDemo({Key? key}) : super(key: key);
const AnimatedListDemo({super.key});
static String routeName = '/misc/animated_list';
@override

View File

@@ -7,7 +7,7 @@ import 'dart:math';
import 'package:flutter/material.dart';
class AnimatedPositionedDemo extends StatefulWidget {
const AnimatedPositionedDemo({Key? key}) : super(key: key);
const AnimatedPositionedDemo({super.key});
static String routeName = '/basics/09_animated_positioned';
@override

View File

@@ -23,7 +23,7 @@ Widget generateContainer(int keyCount) => Container(
);
class AnimatedSwitcherDemo extends StatefulWidget {
const AnimatedSwitcherDemo({Key? key}) : super(key: key);
const AnimatedSwitcherDemo({super.key});
static String routeName = '/basics/10_animated_switcher';
@override

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
class CardSwipeDemo extends StatefulWidget {
const CardSwipeDemo({Key? key}) : super(key: key);
const CardSwipeDemo({super.key});
static String routeName = '/misc/card_swipe';
@override
@@ -77,7 +77,7 @@ class _CardSwipeDemoState extends State<CardSwipeDemo> {
class Card extends StatelessWidget {
final String imageAssetName;
const Card({required this.imageAssetName, Key? key}) : super(key: key);
const Card({required this.imageAssetName, super.key});
@override
Widget build(BuildContext context) {
@@ -101,8 +101,7 @@ class SwipeableCard extends StatefulWidget {
final VoidCallback onSwiped;
const SwipeableCard(
{required this.onSwiped, required this.imageAssetName, Key? key})
: super(key: key);
{required this.onSwiped, required this.imageAssetName, super.key});
@override
State<SwipeableCard> createState() => _SwipeableCardState();

View File

@@ -6,7 +6,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
class CarouselDemo extends StatelessWidget {
CarouselDemo({Key? key}) : super(key: key);
CarouselDemo({super.key});
static String routeName = '/misc/carousel';
static const List<String> fileNames = [
@@ -46,7 +46,7 @@ typedef OnCurrentItemChangedCallback = void Function(int currentItem);
class Carousel extends StatefulWidget {
final IndexedWidgetBuilder itemBuilder;
const Carousel({Key? key, required this.itemBuilder}) : super(key: key);
const Carousel({super.key, required this.itemBuilder});
@override
State<Carousel> createState() => _CarouselState();

View File

@@ -6,7 +6,7 @@ import 'dart:math' as math;
import 'package:flutter/material.dart';
class CurvedAnimationDemo extends StatefulWidget {
const CurvedAnimationDemo({Key? key}) : super(key: key);
const CurvedAnimationDemo({super.key});
static const String routeName = '/misc/curved_animation';
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class ExpandCardDemo extends StatelessWidget {
const ExpandCardDemo({Key? key}) : super(key: key);
const ExpandCardDemo({super.key});
static const String routeName = '/misc/expand_card';
@override
@@ -22,7 +22,7 @@ class ExpandCardDemo extends StatelessWidget {
}
class ExpandCard extends StatefulWidget {
const ExpandCard({Key? key}) : super(key: key);
const ExpandCard({super.key});
@override
State<ExpandCard> createState() => _ExpandCardState();
}

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class FocusImageDemo extends StatelessWidget {
const FocusImageDemo({Key? key}) : super(key: key);
const FocusImageDemo({super.key});
static String routeName = '/misc/focus_image';
@override
@@ -18,7 +18,7 @@ class FocusImageDemo extends StatelessWidget {
}
class Grid extends StatelessWidget {
const Grid({Key? key}) : super(key: key);
const Grid({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -72,7 +72,7 @@ Tween<RelativeRect> _createTween(BuildContext context) {
}
class SmallCard extends StatelessWidget {
const SmallCard({required this.imageAssetName, Key? key}) : super(key: key);
const SmallCard({required this.imageAssetName, super.key});
final String imageAssetName;
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class HeroAnimationDemo extends StatelessWidget {
const HeroAnimationDemo({Key? key}) : super(key: key);
const HeroAnimationDemo({super.key});
static const String routeName = '/misc/hero_animation';
@override
@@ -30,7 +30,7 @@ class HeroAnimationDemo extends StatelessWidget {
}
class HeroPage extends StatelessWidget {
const HeroPage({Key? key}) : super(key: key);
const HeroPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
class PhysicsCardDragDemo extends StatelessWidget {
const PhysicsCardDragDemo({Key? key}) : super(key: key);
const PhysicsCardDragDemo({super.key});
static const String routeName = '/misc/physics_card';
@override
@@ -27,7 +27,7 @@ class PhysicsCardDragDemo extends StatelessWidget {
/// A draggable card that moves back to [Alignment.center] when it's
/// released.
class DraggableCard extends StatefulWidget {
const DraggableCard({required this.child, Key? key}) : super(key: key);
const DraggableCard({required this.child, super.key});
final Widget child;
@override

View File

@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
class RepeatingAnimationDemo extends StatefulWidget {
const RepeatingAnimationDemo({Key? key}) : super(key: key);
const RepeatingAnimationDemo({super.key});
static String routeName = '/misc/repeating_animation';
@override