StacAppBar class
A Stac model representing Flutter's AppBar
widget.
Displays a Material Design app bar at the top of the app.
{@tool snippet} Dart Example:
StacAppBar(
title: StacText(data: 'Page Title'),
actions: [
StacIconButton(icon: StacIcon(icon: StacIcons.search)),
],
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "appBar",
"title": {"type": "text", "data": "Page Title"},
"actions": [
{"type": "iconButton", "icon": {"type": "icon", "icon": "search"}}
]
}
{@end-tool}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacAppBar
- Annotations
-
- @JsonSerializable()
Constructors
-
StacAppBar.new({StacWidget? leading, bool? automaticallyImplyLeading, StacWidget? title, List<
StacWidget> ? actions, StacWidget? flexibleSpace, StacWidget? bottom, double? elevation, double? scrolledUnderElevation, StacColor? shadowColor, StacColor? surfaceTintColor, StacColor? backgroundColor, StacColor? foregroundColor, bool? primary, bool? centerTitle, bool? excludeHeaderSemantics, double? titleSpacing, double? toolbarOpacity, double? bottomOpacity, double? toolbarHeight, double? leadingWidth, StacTextStyle? toolbarTextStyle, StacTextStyle? titleTextStyle, StacSystemUIOverlayStyle? systemOverlayStyle, bool? forceMaterialTransparency, bool? useDefaultSemanticsOrder, StacClip? clipBehavior, StacEdgeInsets? actionsPadding}) - Creates an app bar with the specified properties.
-
StacAppBar.fromJson(Map<
String, dynamic> json) -
Creates a StacAppBar from a JSON map.
factory
Properties
-
actions
→ List<
StacWidget> ? -
Widgets to display after the title, typically action buttons.
final
- actionsPadding → StacEdgeInsets?
-
Outer padding applied around the actions row.
final
- automaticallyImplyLeading → bool?
-
Whether to imply a leading widget (e.g., back button) if none is provided.
final
- backgroundColor → StacColor?
-
The background color of the app bar.
final
- bottom → StacWidget?
-
A widget displayed at the bottom of the app bar, typically a tab bar.
final
- bottomOpacity → double?
-
Opacity for the bottom widget of the app bar.
final
- centerTitle → bool?
-
Whether the title should be centered.
final
- clipBehavior → StacClip?
-
How to clip the content of the app bar.
final
- elevation → double?
-
The elevation of the app bar's material.
final
- excludeHeaderSemantics → bool?
-
Whether to exclude the app bar from the semantics tree header.
final
- flexibleSpace → StacWidget?
-
A widget stacked behind the toolbar and tab bar. Extends under the status bar.
final
- forceMaterialTransparency → bool?
-
Whether to remove background and elevation for a transparent Material effect.
final
- foregroundColor → StacColor?
-
The default color for text and icons within the app bar.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- leading → StacWidget?
-
A widget to display before the title, typically a navigation button.
final
- leadingWidth → double?
-
The width allocated for the leading widget.
final
- primary → bool?
-
Whether this app bar is part of the app's primary scaffold.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrolledUnderElevation → double?
-
The elevation to use when content is scrolled under the app bar.
final
- shadowColor → StacColor?
-
The color of the shadow cast by the app bar's elevation.
final
- surfaceTintColor → StacColor?
-
The color used for the app bar's surface tint overlay.
final
- systemOverlayStyle → StacSystemUIOverlayStyle?
-
The style to use for system overlays (status bar icons, etc.).
final
- title → StacWidget?
-
The primary widget displayed in the app bar, usually a StacText.
final
- titleSpacing → double?
-
Spacing around the title. When leading is null, spacing before the title.
final
- titleTextStyle → StacTextStyle?
-
The text style for the title widget.
final
- toolbarHeight → double?
-
The height of the toolbar portion of the app bar.
final
- toolbarOpacity → double?
-
Opacity for the toolbar portion of the app bar.
final
- toolbarTextStyle → StacTextStyle?
-
The text style for the toolbar widgets.
final
- type → String
-
The type of the widget
no setteroverride
- useDefaultSemanticsOrder → bool?
-
Whether to use the default semantics order for toolbar and bottom.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this widget to a JSON map
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited