下面这段代码:
Widget buildWidget() {
if (showBig) {
return BigWidget();
} else {
return SmallWidget();
}
}
我希望在 BigWidget
和 SmallWidget
切换的时候加上转场动画,请问如何实现?
1
en20 2021-04-22 17:42:39 +08:00
```
onPressed: () async { final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => Setting())); print('setting result: $result'); }, ``` |
2
en20 2021-04-22 17:43:57 +08:00
原来不是路由啊,这里看一下 https://flutter.cn/docs/development/ui/animations
|
3
debuggerx 2021-04-22 18:25:18 +08:00
|