小编Gal*_*ose的帖子

Flutter 中嵌套 Scaffold 是否正确?

我的应用程序主页中有一个 PageView,我想要:

  1. AppBar根据页面变化
  2. BottomAppBar 已修复

我想象的2个解决方案是:

  1. 难点:拥有一个带有 appBar、body 和 BottomNavigationBar 的 Scaffold;使用 PageView 的 PageController 为 AppBar 内容添加动画效果。
  2. 有 2 个嵌套的脚手架:主脚手架带有主体和底部导航栏,第二个脚手架位于每个 PageView 的页面中,带有 AppBar。

所以,我想知道,它是有效的,但是嵌套支架在语法上是否“正确”?

scaffold flutter flutter-scaffold flutter-pageview

8
推荐指数
1
解决办法
5313
查看次数

Flutter BLoC : how to update state with null values?

How do you deal with "accepted null values" when you update a state in BLoC ? I use the flutter_bloc package.

I have a form in which numeric variables are nullable so that I can check their validity before the form is submitted. But when I emit a new state, I use state.copyWith(var1?, var2?)... so when a null value is used to update a parameter, the value is not updated.

To face that I use a custom FieldStatus enum for …

null dart flutter bloc flutter-bloc

4
推荐指数
2
解决办法
3763
查看次数