flutter - 导航到 Fluttter 中的新小部件时如何不处理以前的小部件?
问题描述
我目前在做什么
Navigator.push(context,
RouteAnimationFadeIn(NewWidget(someValue), true));
路线动画淡入:
class RouteAnimationFadeIn extends PageRouteBuilder {
final Widget widget;
final bool shouldMaintainState;
RouteAnimationFadeIn(this.widget, this.shouldMaintainState)
: super(pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return widget;
}, transitionsBuilder: (BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child) {
return FadeTransition(
opacity: animation,
child: child,
);
});
@override
bool get maintainState {
return shouldMaintainState;
}
}
这将处理前一个小部件,从而处理其中所有表单字段的数据。我想要的是一个片段添加类似 Android 的功能,以便新的小部件在旧小部件的水龙头上打开,这样,当我使用时,我可以Navigator.pop(context);
看到其中的旧数据。
我试过这个,但它不起作用。
解决方案
推荐阅读
- python - TypeError:“产品”对象在 Flask 中不可下标
- java - 如何找到一列值相同的多行并添加到一行并设置为vaadin网格
- java - java.lang.NoClassDefFoundError 在 Eclipse 中运行脚本以进行移动应用程序测试
- associations - 类图中关联的多重性
- angular - 如何在构造函数1中访问constructor2对象的对象值
- laravel - 未定义变量:刀片视图中的产品
- android - 尽管将值分配给它,但我仍然收到空值
- javascript - 我如何提供保护和保密?
- javascript - ajax从下拉列表中更改内容不起作用
- elasticsearch - 如何在 Elasticsearch 上搜索带或不带撇号的单词?并处理拼写错误?