mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -30,10 +30,7 @@ class _FadeTransitionDemoState extends State<FadeTransitionDemo>
|
||||
|
||||
_curve = CurvedAnimation(parent: _controller, curve: Curves.easeIn);
|
||||
|
||||
_animation = Tween(
|
||||
begin: 1.0,
|
||||
end: 0.0,
|
||||
).animate(_curve);
|
||||
_animation = Tween(begin: 1.0, end: 0.0).animate(_curve);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,29 +42,25 @@ class _FadeTransitionDemoState extends State<FadeTransitionDemo>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text(
|
||||
'Fade Transition',
|
||||
),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Fade Transition')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FadeTransition(
|
||||
opacity: _animation,
|
||||
child: const Icon(
|
||||
Icons.star,
|
||||
color: Colors.amber,
|
||||
size: 300,
|
||||
),
|
||||
child: const Icon(Icons.star, color: Colors.amber, size: 300),
|
||||
),
|
||||
ElevatedButton(
|
||||
child: const Text('animate'),
|
||||
onPressed: () => setState(() {
|
||||
_controller.animateTo(1.0).then<TickerFuture>(
|
||||
(value) => _controller.animateBack(0.0));
|
||||
}),
|
||||
onPressed:
|
||||
() => setState(() {
|
||||
_controller
|
||||
.animateTo(1.0)
|
||||
.then<TickerFuture>(
|
||||
(value) => _controller.animateBack(0.0),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user