mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Beta (#1234)
This commit is contained in:
@@ -6,6 +6,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:window_size/window_size.dart';
|
||||
|
||||
import 'src/basics/01_animated_container.dart';
|
||||
|
||||
@@ -15,7 +15,7 @@ class AnimatedContainerDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/01_animated_container';
|
||||
|
||||
@override
|
||||
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
|
||||
State<AnimatedContainerDemo> createState() => _AnimatedContainerDemoState();
|
||||
}
|
||||
|
||||
class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
|
||||
|
||||
@@ -9,7 +9,7 @@ class AnimationControllerDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/animation_controller';
|
||||
|
||||
@override
|
||||
_AnimationControllerDemoState createState() =>
|
||||
State<AnimationControllerDemo> createState() =>
|
||||
_AnimationControllerDemoState();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class TweenDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/tweens';
|
||||
|
||||
@override
|
||||
_TweenDemoState createState() => _TweenDemoState();
|
||||
State<TweenDemo> createState() => _TweenDemoState();
|
||||
}
|
||||
|
||||
class _TweenDemoState extends State<TweenDemo>
|
||||
|
||||
@@ -9,7 +9,7 @@ class AnimatedBuilderDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/animated_builder';
|
||||
|
||||
@override
|
||||
_AnimatedBuilderDemoState createState() => _AnimatedBuilderDemoState();
|
||||
State<AnimatedBuilderDemo> createState() => _AnimatedBuilderDemoState();
|
||||
}
|
||||
|
||||
class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
|
||||
|
||||
@@ -20,7 +20,7 @@ class CustomTweenDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/custom_tweens';
|
||||
|
||||
@override
|
||||
_CustomTweenDemoState createState() => _CustomTweenDemoState();
|
||||
State<CustomTweenDemo> createState() => _CustomTweenDemoState();
|
||||
}
|
||||
|
||||
class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
@@ -51,11 +51,6 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
title: const Text('Custom Tween'),
|
||||
actions: [
|
||||
MaterialButton(
|
||||
child: Text(
|
||||
controller.status == AnimationStatus.completed
|
||||
? 'Delete Essay'
|
||||
: 'Write Essay',
|
||||
),
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
if (controller.status == AnimationStatus.completed) {
|
||||
@@ -68,6 +63,11 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
controller.status == AnimationStatus.completed
|
||||
? 'Delete Essay'
|
||||
: 'Write Essay',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -9,7 +9,7 @@ class TweenSequenceDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/chaining_tweens';
|
||||
|
||||
@override
|
||||
_TweenSequenceDemoState createState() => _TweenSequenceDemoState();
|
||||
State<TweenSequenceDemo> createState() => _TweenSequenceDemoState();
|
||||
}
|
||||
|
||||
class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
|
||||
@@ -11,7 +11,7 @@ class FadeTransitionDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/fade_transition';
|
||||
|
||||
@override
|
||||
_FadeTransitionDemoState createState() => _FadeTransitionDemoState();
|
||||
State<FadeTransitionDemo> createState() => _FadeTransitionDemoState();
|
||||
}
|
||||
|
||||
class _FadeTransitionDemoState extends State<FadeTransitionDemo>
|
||||
|
||||
@@ -9,7 +9,7 @@ class AnimatedListDemo extends StatefulWidget {
|
||||
static String routeName = '/misc/animated_list';
|
||||
|
||||
@override
|
||||
_AnimatedListDemoState createState() => _AnimatedListDemoState();
|
||||
State<AnimatedListDemo> createState() => _AnimatedListDemoState();
|
||||
}
|
||||
|
||||
class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
|
||||
@@ -11,7 +11,7 @@ class AnimatedPositionedDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/09_animated_positioned';
|
||||
|
||||
@override
|
||||
_AnimatedPositionedDemoState createState() => _AnimatedPositionedDemoState();
|
||||
State<AnimatedPositionedDemo> createState() => _AnimatedPositionedDemoState();
|
||||
}
|
||||
|
||||
class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
@@ -62,6 +62,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
alignment: Alignment.center,
|
||||
width: 150,
|
||||
height: 50,
|
||||
color: Theme.of(context).primaryColor,
|
||||
child: Text(
|
||||
'Click Me',
|
||||
style: TextStyle(
|
||||
@@ -69,7 +70,6 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
Theme.of(context).buttonTheme.colorScheme!.onPrimary,
|
||||
),
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -27,7 +27,7 @@ class AnimatedSwitcherDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/10_animated_switcher';
|
||||
|
||||
@override
|
||||
_AnimatedSwitcherDemoState createState() => _AnimatedSwitcherDemoState();
|
||||
State<AnimatedSwitcherDemo> createState() => _AnimatedSwitcherDemoState();
|
||||
}
|
||||
|
||||
class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
@@ -67,8 +67,8 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
duration: const Duration(seconds: 1),
|
||||
child: container,
|
||||
transitionBuilder: (child, animation) => ScaleTransition(
|
||||
child: child,
|
||||
scale: animation,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,7 +10,7 @@ class CardSwipeDemo extends StatefulWidget {
|
||||
static String routeName = '/misc/card_swipe';
|
||||
|
||||
@override
|
||||
_CardSwipeDemoState createState() => _CardSwipeDemoState();
|
||||
State<CardSwipeDemo> createState() => _CardSwipeDemoState();
|
||||
}
|
||||
|
||||
class _CardSwipeDemoState extends State<CardSwipeDemo> {
|
||||
@@ -105,7 +105,7 @@ class SwipeableCard extends StatefulWidget {
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_SwipeableCardState createState() => _SwipeableCardState();
|
||||
State<SwipeableCard> createState() => _SwipeableCardState();
|
||||
}
|
||||
|
||||
class _SwipeableCardState extends State<SwipeableCard>
|
||||
|
||||
@@ -49,7 +49,7 @@ class Carousel extends StatefulWidget {
|
||||
const Carousel({Key? key, required this.itemBuilder}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CarouselState createState() => _CarouselState();
|
||||
State<Carousel> createState() => _CarouselState();
|
||||
}
|
||||
|
||||
class _CarouselState extends State<Carousel> {
|
||||
|
||||
@@ -10,7 +10,7 @@ class CurvedAnimationDemo extends StatefulWidget {
|
||||
static const String routeName = '/misc/curved_animation';
|
||||
|
||||
@override
|
||||
_CurvedAnimationDemoState createState() => _CurvedAnimationDemoState();
|
||||
State<CurvedAnimationDemo> createState() => _CurvedAnimationDemoState();
|
||||
}
|
||||
|
||||
class CurveChoice {
|
||||
|
||||
@@ -24,7 +24,7 @@ class ExpandCardDemo extends StatelessWidget {
|
||||
class ExpandCard extends StatefulWidget {
|
||||
const ExpandCard({Key? key}) : super(key: key);
|
||||
@override
|
||||
_ExpandCardState createState() => _ExpandCardState();
|
||||
State<ExpandCard> createState() => _ExpandCardState();
|
||||
}
|
||||
|
||||
class _ExpandCardState extends State<ExpandCard>
|
||||
|
||||
@@ -31,7 +31,7 @@ class DraggableCard extends StatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
_DraggableCardState createState() => _DraggableCardState();
|
||||
State<DraggableCard> createState() => _DraggableCardState();
|
||||
}
|
||||
|
||||
class _DraggableCardState extends State<DraggableCard>
|
||||
|
||||
@@ -9,10 +9,10 @@ class RepeatingAnimationDemo extends StatefulWidget {
|
||||
static String routeName = '/misc/repeating_animation';
|
||||
|
||||
@override
|
||||
RepeatingAnimationDemoState createState() => RepeatingAnimationDemoState();
|
||||
State<RepeatingAnimationDemo> createState() => _RepeatingAnimationDemoState();
|
||||
}
|
||||
|
||||
class RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
|
||||
class _RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _controller;
|
||||
late final Animation<BorderRadius?> _borderRadius;
|
||||
|
||||
Reference in New Issue
Block a user