BasePage class
基础页面壳体,统一封装页面的返回拦截、滚动控制与 EasyRefresh 集成逻辑。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BasePage
Constructors
-
BasePage({Key? key, required Widget child, String? lightBackgroundAsset, String? darkBackgroundAsset, PreferredSizeWidget? appBar, Widget? floatingActionButton, FloatingActionButtonLocation? floatingActionButtonLocation, Widget? bottomSheet, Widget? drawer, Widget? endDrawer, Color? backgroundColor, bool? resizeToAvoidBottomInset, bool extendBody = false, bool extendBodyBehindAppBar = false, bool useSafeArea = true, EdgeInsetsGeometry? contentPadding, bool fillChildMaxHeight = false, bool disableScroll = false, ScrollController? scrollController, ScrollPhysics? scrollPhysics, bool enableAutoScrollPhysics = true, bool canPop = true, FutureOr<
bool> onWillPop()?, EasyRefreshConfig? easyRefreshConfig}) -
const
Properties
- appBar → PreferredSizeWidget?
-
自定义 AppBar。
final
- backgroundColor → Color?
-
页面背景色。
final
-
底部导航栏。
final
- bottomSheet → Widget?
-
底部弹出层。
final
- canPop → bool
-
是否允许直接返回。
final
- child → Widget
-
页面主体内容。
final
- contentPadding → EdgeInsetsGeometry?
-
页面内容的统一内边距。
final
- darkBackgroundAsset → String?
-
深色主题下使用的背景图片资源(
assets路径)。final - disableScroll → bool
-
是否禁用内置的页面侧滚动(即不套一层
SingleChildScrollView)。final - drawer → Widget?
-
左侧抽屉。
final
- easyRefreshConfig → EasyRefreshConfig?
-
EasyRefresh 配置,不传则不会启用下拉刷新。
final
- enableAutoScrollPhysics → bool
-
是否根据内容高度自动禁用滚动。
final
- endDrawer → Widget?
-
右侧抽屉。
final
- extendBody → bool
-
是否扩展至底部区域。
final
- extendBodyBehindAppBar → bool
-
是否让内容延伸到 AppBar 之下。
final
- fillChildMaxHeight → bool
-
是否强制子组件在高度方向撑满可用区域(精确等于可用高度)。
final
- floatingActionButton → Widget?
-
悬浮按钮。
final
- floatingActionButtonLocation → FloatingActionButtonLocation?
-
悬浮按钮位置
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lightBackgroundAsset → String?
-
浅色主题下使用的背景图片资源(
assets路径)。final -
onWillPop
→ FutureOr<
bool> Function()? -
返回拦截回调,返回 true 表示允许退出。
final
- resizeToAvoidBottomInset → bool?
-
是否在键盘弹起时自动调整布局。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
外部自定义的 ScrollController。
final
- scrollPhysics → ScrollPhysics?
-
外部自定义的滚动物理。
final
- useSafeArea → bool
-
是否自动包裹 SafeArea。
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BasePage> -
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