Skip to main content

Module indexed_stack

Module indexed_stack 

Source
Expand description

IndexedStack — 多子叠加,但只显示 index 指定的一个;其余保留尺寸与状态

语义(对齐 Flutter IndexedStack):

  • 所有 child 都挂载 + 用 constraints.loosen() 布局(尺寸/状态保留)
  • 仅 children[index] 参与 paint 与 hit_test
  • 自身尺寸 = 所有 child 尺寸的最大值(Stack loose 行为)

被隐藏分支的 RepaintBoundary layer 由框架可见性剔除机制处理: IndexedStackWidget::visible_children() 返回 Some(vec![i == index]), paint_layer_recursive 据此剔除隐藏子树的 layer。

Structs§

IndexedStackRenderObject
IndexedStack RenderObject
IndexedStackWidget
IndexedStack(只显示一个 child)