JkAlert class
警告条:左侧类型图标或自定义 leading、标题与可选描述、可选关闭与右侧槽位。
语义色来自 JkThemePalette;显式传入 backgroundColor 时与 FirstUI 一致,不再套用 type 默认底色, 此时默认字色/图标色偏「浅底深字」,可用 titleColor / descColor / iconColor 覆盖。
- Inheritance
Constructors
- JkAlert({Key? key, JkAlertType type = JkAlertType.info, required String title, String? desc, Color? backgroundColor, Color? titleColor, Color? descColor, Color? iconColor, double iconSize = 22, TextStyle? titleStyle, TextStyle? descStyle, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12), EdgeInsetsGeometry margin = EdgeInsets.zero, double radius = 8, bool closable = false, VoidCallback? onClose, Color? closeIconColor, double closeIconSize = 22, Widget? leading, double leadingGap = 10, Widget? trailing, bool singleLineDesc = false, VoidCallback? onTap, VoidCallback? onLeadingTap})
-
const
Properties
- backgroundColor → Color?
-
非空时覆盖 type 对应默认背景色。
final
- closable → bool
-
final
- closeIconColor → Color?
-
final
- closeIconSize → double
-
final
- desc → String?
-
final
- descColor → Color?
-
final
- descStyle → TextStyle?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color?
-
final
- iconSize → double
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
非空时替换默认类型图标(对齐 FirstUI
isLeft+ 默认插槽)。final - leadingGap → double
-
leading 与正文之间的水平间距。
final
- margin → EdgeInsetsGeometry
-
final
- onClose → VoidCallback?
-
final
- onLeadingTap → VoidCallback?
-
点击左侧图标或 leading(对齐 FirstUI
@leftClick)。final - onTap → VoidCallback?
-
点击标题/描述区域(对齐 FirstUI
@click)。final - padding → EdgeInsetsGeometry
-
final
- radius → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- singleLineDesc → bool
-
为
true时 desc 单行省略。final - title → String
-
final
- titleColor → Color?
-
final
- titleStyle → TextStyle?
-
final
- trailing → Widget?
-
关闭按钮左侧的自定义区域(对齐 FirstUI
right插槽)。final - type → JkAlertType
-
默认语义与图标;backgroundColor 非空时仅作图标语义参考(底色以 backgroundColor 为准)。
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