BaseMultiPage constructor

BaseMultiPage({
  1. Key? key,
  2. bool lazyCreate = false,
  3. bool isCanBackPressed = true,
  4. double appbarHeight = 56.0,
  5. bool isNeedAppBar = true,
  6. bool isNeedScaffold = true,
  7. Color bodyColor = ColorConfig.white_f2f2f2,
  8. bool extendBodyBehindAppBar = false,
  9. bool resizeToAvoidBottomInset = false,
})

具备loading、content、error、empty等多状态视图的页面基础类 lazyCreate 是否等第一帧绘制完成之后在走onCreate生命周期 isCanBackPressed 是否支持返回事件 appbarHeight appbar的高度,默认56 isNeedAppBar 是否需要appbar isNeedScaffold 是否需要脚手架,如果是false脚手架相关的内容均不可使用(例如appbar, drawer),一般用于viewpage的子页面 extendBodyBehindAppBar 如果您希望 body 的高度扩展到包含应用栏的高度并且 body 的顶部与应用栏的顶部对齐,则必须将Scaffold小部件的extendBodyBehindAppBar属性设置为true(默认值为false )。 resizeToAvoidBottomInset 在 Flutter 中 Scaffold 默认情况下 resizeToAvoidBottomInset 为 true,当 resizeToAvoidBottomInset 为 true 时,Scaffold 内部会将 mediaQuery.viewInsets.bottom 参与到 BoxConstraints 的大小计算,也就是键盘弹起时调整了内部的 bottom 位置来迎合键盘。这时候键盘已经收起,mediaQuery.viewInsets.bottom 应该更新为 0 ,

Implementation

BaseMultiPage({
  super.key,
  super.lazyCreate = false,
  super.isCanBackPressed = true,
  this.appbarHeight = 56.0,
  this.isNeedAppBar = true,
  this.isNeedScaffold = true,
  this.bodyColor = ColorConfig.white_f2f2f2,
  this.extendBodyBehindAppBar = false,
  this.resizeToAvoidBottomInset = false,
});