VThemeSwitchTile class
============================================================ VThemeSwitchTile — 主题切换列表项(用于设置页)
一个完整的设置项,包含标题 + 当前状态 + 切换操作
用法:
ListView(
children: [
VThemeSwitchTile(
currentMode: VThemeController.instance.themeMode,
onModeChanged: (mode) => VThemeController.instance.setMode(mode),
),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- VThemeSwitchTile
Constructors
-
VThemeSwitchTile({Key? key, required ThemeMode currentMode, required ValueChanged<
ThemeMode> onModeChanged, String title = '显示模式', bool showSystemOption = true}) -
const
Properties
- currentMode → ThemeMode
-
当前主题模式
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onModeChanged
→ ValueChanged<
ThemeMode> -
模式变化回调
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showSystemOption → bool
-
是否显示"跟随系统"选项
final
- title → String
-
标题文字
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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