import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class DemoPage extends StatefulWidget { const DemoPage({Key? key}) : super(key: key); @override State createState() => _DemoPageState(); } class _DemoPageState extends State with SingleTickerProviderStateMixin{ AnimationController? controller0; Animation? widthAni; // late Animation alphaAnimation; // AnimationController controller1; double top = -30.0; double opacity1 = 0.0; @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); return Container( color: Colors.white, child: SizedBox(width: 100.0,height: 100.0,child: Container(color: Colors.orange,),), // child: Container(height: 100,width: 100,color: Colors.blue,), // child: Stack( // children: [ // // AnimatedPositioned( // // child: AnimatedOpacity(opacity: opacity1,child: Container(height: 50,width: widthAni!.value,color: Colors.red,),duration: const Duration(milliseconds: 200),), // // duration: const Duration(milliseconds: 200), // // top: top, // // ), // Container(height: widthAni!.value,width: widthAni!.value,color: Colors.blue,) // ], // ), ); } @override void initState() { super.initState(); // controller0 = AnimationController(vsync: this,duration: const Duration(milliseconds: 2000)); // controller0!.addStatusListener((status) { }); // widthAni = Tween(begin: 50.0, end: 200.0).animate(CurvedAnimation(parent: controller0!, curve: const Interval(0.0,1.0))); // controller0!.forward(); // alphaAnimation = // Timer(const Duration(seconds: 1), (){ // controller0!.forward(); // setState(() { // top = 60; // opacity1 =1; // }); // }); } }