1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Replace MaterialButton in the AnimatedBuilder sample (#1729)

This commit is contained in:
Taha Tesser
2023-04-08 05:39:28 +03:00
committed by GitHub
parent 31a3d14618
commit 974aaf12b9
2 changed files with 68 additions and 5 deletions

View File

@@ -23,7 +23,6 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
@override
void initState() {
super.initState();
controller = AnimationController(vsync: this, duration: duration);
animation =
ColorTween(begin: beginColor, end: endColor).animate(controller);
@@ -49,10 +48,10 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
child: AnimatedBuilder(
animation: animation,
builder: (context, child) {
return MaterialButton(
color: animation.value,
height: 50,
minWidth: 100,
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: animation.value,
),
child: child,
onPressed: () {
if (controller.status == AnimationStatus.completed) {