VAppBar class

主题感知的 AppBar(替代 CommonAppbarUtil.getAppBar)

迁移方式: CommonAppbarUtil.getAppBar(context, title: '标题') → VAppBar(title: '标题')

区别:默认值从 Theme 取,不再硬编码色值。 传了参数就用参数的,没传就走主题。

Inheritance
Implemented types

Constructors

VAppBar({Key? key, String title = '', String? appBarBackgroundColor, Widget? leadingWidget, double? leadingWidth, Function? leadingAction, String? action1Txt, SystemUiOverlayStyle? systemOverlayStyle, Widget? titleView, String? backIconColor, double backIconSize = 20, PreferredSizeWidget? bottomWidget, bool isHideBottomLine = true, double? appbarTitleFontSize, String? titleColor, Widget? actionView, bool isLeading2WillPopScope = false, String bottomLineColor = '#dcdcdc', bool isHideMineLine = true})
const

Properties

action1Txt String?
右侧文字按钮文案(兼容旧接口)
final
actionView Widget?
右侧 action Widget(兼容旧接口)
final
appBarBackgroundColor String?
背景色(hex),null 时走 appBarTheme.backgroundColor
final
appbarTitleFontSize double?
标题字号,null 时走 textTheme.titleLarge.fontSize
final
backIconColor String?
返回箭头颜色(hex),null 时走 appBarTheme.foregroundColor
final
backIconSize double
返回箭头大小
final
bottomLineColor String
底部分割线颜色(hex),isHideMineLine=false 时生效
final
bottomWidget PreferredSizeWidget?
底部 Widget(如 TabBar)
final
hashCode int
The hash code for this object.
no setterinherited
isHideBottomLine bool
是否隐藏底部阴影,true=无阴影(elevation=0),false=有阴影(elevation=4)
final
isHideMineLine bool
是否隐藏底部分割线,false 时显示 0.5px 的底部线
final
isLeading2WillPopScope bool
为 true 时隐藏左侧 leading(用于 WillPopScope 场景)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leadingAction Function?
返回按钮点击回调,null 时默认 Navigator.pop
final
leadingWidget Widget?
左侧自定义 Widget,null 时自动显示返回箭头
final
leadingWidth double?
左侧区域宽度
final
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
systemOverlayStyle SystemUiOverlayStyle?
状态栏样式(控制顶部状态栏文字颜色)
final
title String
标题文字
final
titleColor String?
标题颜色(hex),null 时走 appBarTheme.foregroundColor
final
titleView Widget?
自定义标题 Widget,优先级高于 title
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