EasySplitScope class
根部适配容器:包在你的列表页(栈底)上
MaterialApp(
home: EasySplitScope(child: RootPage()),
onGenerateRoute: EasySplit.routeAdapter({...}),
)
宽↔窄切换时路由栈完全不动,仅表现层自动切换:
- 窄屏(折叠态):child 全屏 = 正常路由模式
- 宽屏(展开态):叠加布局——child(首页)全屏铺底, 右栏区域叠加在顶层:无路由时显示占位页, 有路由时被 pane 路由内容原生覆盖。 两栏各自的 Scaffold 独立消费安全区,AppBar 顶点自然对齐
- 分栏布局支持自定义:
EasySplit.config.layoutBuilder(左右 widget 组合)/EasySplit.config.layoutDelegate(左右矩形,路由内容落点跟随)
展开/折叠只改布局参数(Positioned 的 rect、MediaQuery 的 padding), 不改变 child 在树中的位置,因此首页的 State(TabController 当前页、 滚动位置、输入内容…)在切换时原样保留。
注意:不要在 EasySplitScope 外面再包 SafeArea。 安全区由页面自身 Scaffold 与右栏内容分层处理, 外层再包会导致 MediaQuery.padding 被清零/双倍消费,破坏 AppBar 避让。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EasySplitScope
Constructors
- EasySplitScope({Key? key, required Widget child, WidgetBuilder? placeholderBuilder})
-
const
Properties
- child → Widget
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- placeholderBuilder → WidgetBuilder?
-
右栏空态占位页(优先于
EasySplit.config.placeholderBuilder)final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< EasySplitScope> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited