AccentPanel class
A panel with a colored vertical accent stripe on one side.
This is a common TUI pattern for callouts, info panels, collapsible sections, and message annotations. The accent color can convey semantic meaning (e.g., green for success, red for error, blue for info).
Fully themeable via AccentPanelThemeData.
AccentPanel(
accentColor: theme.success,
child: Text('File saved successfully'),
)
- Inheritance
-
- Object
- Widget
- StatelessWidget
- AccentPanel
Constructors
-
AccentPanel({required Widget child, Color? accentColor, int? accentWidth, String? accentChar, AccentSide side = AccentSide.left, Color? background, Color? foreground, EdgeInsets? padding, String? title, Style? titleStyle, bool? expanded, ValueCmdCallback<
bool> ? onExpandChanged, Key? key})
Properties
- accentChar → String?
-
Character used for the accent stripe (default: '│').
final
- accentColor → Color?
-
Color of the accent stripe.
Defaults to AccentPanelThemeData.accentColor or Theme.primary.
final
- accentWidth → int?
-
Width of the accent stripe in columns (default: 1).
Defaults to AccentPanelThemeData.accentWidth or 1.
final
- background → Color?
-
Background color of the panel body.
Defaults to AccentPanelThemeData.background or transparent.
final
- child → Widget
-
The panel body content.
final
-
children
→ List<
Widget> -
Child widgets that receive forwarded messages.
no setterinherited
- debugRenderObjectPassthrough → bool
-
Whether this widget is intentionally transparent to render-object layouts.
no setterinherited
- expanded → bool?
-
If non-null, makes the panel collapsible with this expansion state.
final
- focusable → bool
-
Whether this widget can receive keyboard focus.
no setterinherited
- foreground → Color?
-
Text color in the panel body.
Defaults to AccentPanelThemeData.foreground or Theme.onSurface.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier for this widget.
no setterinherited
- key → Key?
-
Key for preserving widget identity.
finalinherited
-
onExpandChanged
→ ValueCmdCallback<
bool> ? -
Called when the expand/collapse toggle is tapped.
final
- padding → EdgeInsets?
-
Content padding inside the panel (excluding the accent stripe).
Defaults to AccentPanelThemeData.padding or left: 1.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- side → AccentSide
-
Which side the accent stripe is drawn on.
final
- theme → Theme
-
Access the current theme.
no setterinherited
- title → String?
-
Optional title shown on the first line.
final
- titleStyle → Style?
-
Style for the title text.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the UI represented by this widget.
override
-
buildCachedView<
T> (T builder(), Object? cacheKey) → T -
Returns a cached view if the cache key matches.
inherited
-
handleInit(
) → Cmd? -
Override this instead of init for widget-specific initialization.
inherited
-
handleIntercept(
Msg msg) → (Widget, Cmd?) -
Override this to handle messages before they reach children.
inherited
-
handleUpdate(
Msg msg) → (Widget, Cmd?) -
Override this to handle messages specific to this widget.
inherited
-
init(
) → Cmd? -
Called once when the widget is first mounted.
inherited
-
invalidateCachedView(
) → void -
Clears any cached view for this widget.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Msg msg) → (Model, Cmd?) -
Handles messages by forwarding to children then calling handleUpdate.
inherited
-
view(
) → Object -
Renders the widget to a string or View.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited