Flutter动画全解(一)隐式动画——Animated系列
隐式动画——Animated系列 1.1 快速开始——AnimatedContainer //原始main.dart import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Container( //一个普普通通的Container width: 300, height: 300, color: Colors.blue, child: const Center( child: Text("Hi", style: TextStyle( fontSize: 72, )), ), ), )); } } //使用AnimatedContainer,并传入Duration,两行代码就可以动起来! import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: AnimatedContainer( //将Container换成AnimatedContainer duration: const Duration(seconds: 1), //同时加上duration参数即可 width: 300, height: 100, color: Colors....