1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 14:28:51 +00:00

Migrate animations to go_router (#1521)

This commit is contained in:
Miguel Beltran
2022-12-13 09:26:09 +01:00
committed by GitHub
parent 69fa2c51a2
commit 4ef8daffb6
21 changed files with 45 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ Color generateColor() => Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
class AnimatedContainerDemo extends StatefulWidget {
const AnimatedContainerDemo({super.key});
static String routeName = '/basics/01_animated_container';
static String routeName = 'basics/01_animated_container';
@override
State<AnimatedContainerDemo> createState() => _AnimatedContainerDemoState();

View File

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

View File

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

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class TweenDemo extends StatefulWidget {
const TweenDemo({super.key});
static const String routeName = '/basics/tweens';
static const String routeName = 'basics/tweens';
@override
State<TweenDemo> createState() => _TweenDemoState();

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class AnimatedBuilderDemo extends StatefulWidget {
const AnimatedBuilderDemo({super.key});
static const String routeName = '/basics/animated_builder';
static const String routeName = 'basics/animated_builder';
@override
State<AnimatedBuilderDemo> createState() => _AnimatedBuilderDemoState();

View File

@@ -17,7 +17,7 @@ class TypewriterTween extends Tween<String> {
class CustomTweenDemo extends StatefulWidget {
const CustomTweenDemo({super.key});
static const String routeName = '/basics/custom_tweens';
static const String routeName = 'basics/custom_tweens';
@override
State<CustomTweenDemo> createState() => _CustomTweenDemoState();

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class TweenSequenceDemo extends StatefulWidget {
const TweenSequenceDemo({super.key});
static const String routeName = '/basics/chaining_tweens';
static const String routeName = 'basics/chaining_tweens';
@override
State<TweenSequenceDemo> createState() => _TweenSequenceDemoState();

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
// for examples of other common animated widgets.
class FadeTransitionDemo extends StatefulWidget {
const FadeTransitionDemo({super.key});
static const String routeName = '/basics/fade_transition';
static const String routeName = 'basics/fade_transition';
@override
State<FadeTransitionDemo> createState() => _FadeTransitionDemoState();

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class AnimatedListDemo extends StatefulWidget {
const AnimatedListDemo({super.key});
static String routeName = '/misc/animated_list';
static String routeName = 'misc/animated_list';
@override
State<AnimatedListDemo> createState() => _AnimatedListDemoState();

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
class AnimatedPositionedDemo extends StatefulWidget {
const AnimatedPositionedDemo({super.key});
static String routeName = '/basics/09_animated_positioned';
static String routeName = 'misc/animated_positioned';
@override
State<AnimatedPositionedDemo> createState() => _AnimatedPositionedDemoState();

View File

@@ -24,7 +24,7 @@ Widget generateContainer(int keyCount) => Container(
class AnimatedSwitcherDemo extends StatefulWidget {
const AnimatedSwitcherDemo({super.key});
static String routeName = '/basics/10_animated_switcher';
static String routeName = 'misc/animated_switcher';
@override
State<AnimatedSwitcherDemo> createState() => _AnimatedSwitcherDemoState();

View File

@@ -7,7 +7,7 @@ import 'package:flutter/physics.dart';
class CardSwipeDemo extends StatefulWidget {
const CardSwipeDemo({super.key});
static String routeName = '/misc/card_swipe';
static String routeName = 'misc/card_swipe';
@override
State<CardSwipeDemo> createState() => _CardSwipeDemoState();

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
class CarouselDemo extends StatelessWidget {
CarouselDemo({super.key});
static String routeName = '/misc/carousel';
static String routeName = 'misc/carousel';
static const List<String> fileNames = [
'assets/eat_cape_town_sm.jpg',

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
class CurvedAnimationDemo extends StatefulWidget {
const CurvedAnimationDemo({super.key});
static const String routeName = '/misc/curved_animation';
static const String routeName = 'misc/curved_animation';
@override
State<CurvedAnimationDemo> createState() => _CurvedAnimationDemoState();

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class ExpandCardDemo extends StatelessWidget {
const ExpandCardDemo({super.key});
static const String routeName = '/misc/expand_card';
static const String routeName = 'misc/expand_card';
@override
Widget build(BuildContext context) {

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class FocusImageDemo extends StatelessWidget {
const FocusImageDemo({super.key});
static String routeName = '/misc/focus_image';
static String routeName = 'misc/focus_image';
@override
Widget build(BuildContext context) {

View File

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

View File

@@ -7,7 +7,7 @@ import 'package:flutter/physics.dart';
class PhysicsCardDragDemo extends StatelessWidget {
const PhysicsCardDragDemo({super.key});
static const String routeName = '/misc/physics_card';
static const String routeName = 'misc/physics_card';
@override
Widget build(BuildContext context) {

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class RepeatingAnimationDemo extends StatefulWidget {
const RepeatingAnimationDemo({super.key});
static String routeName = '/misc/repeating_animation';
static String routeName = 'misc/repeating_animation';
@override
State<RepeatingAnimationDemo> createState() => _RepeatingAnimationDemoState();