TermosExpandableSection class
Reusable expandable card with a header and an optional expanded body.
- header is always visible.
- contentBetween is optional content shown between the header and the expanded body (always visible).
- expandedChild animates open/closed when the card is tapped. When null, no expand arrow is shown and the card is not tappable.
Background uses ReactiveStarfieldPainter aligned to the surrounding dot-grid group (if any). When useOverlayTapTarget is true, an overlay TermosTapTarget provides dot-grid mesh feedback on tap. When false, the visible card content is still tappable, but nested controls can handle their own taps.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TermosExpandableSection
Constructors
- TermosExpandableSection({Key? key, required Widget header, Widget? expandedChild, Widget? contentBetween, Color? accentColor, bool? isExpanded, bool initialExpanded = false, VoidCallback? onToggle, bool useOverlayTapTarget = true, bool showExpandIcon = true, EdgeInsets padding = const EdgeInsets.fromLTRB(12, 10, 12, 12), EdgeInsets contentBetweenPadding = const EdgeInsets.symmetric(horizontal: 12), EdgeInsets expandedPadding = const EdgeInsets.fromLTRB(12, 8, 12, 12), double contentBetweenSpacing = 10, BorderRadius? borderRadius, Widget? expandIcon, Duration expandDuration = const Duration(milliseconds: 300), int? starfieldSeed})
-
const
Properties
- accentColor → Color?
-
Accent for tap mesh and starfield glow. Defaults to theme primary.
final
- borderRadius → BorderRadius?
-
Outer corner radius. Defaults to
theme.metrics.borderRadius * 1.75.final - contentBetween → Widget?
-
Always visible content between header and expandedChild.
final
- contentBetweenPadding → EdgeInsets
-
Padding around contentBetween.
final
- contentBetweenSpacing → double
-
Vertical spacing below contentBetween (above expandedChild).
final
- expandDuration → Duration
-
Duration of the open/close animation.
final
- expandedChild → Widget?
-
Animates open/closed. When null the card is not tappable and no arrow
is shown.
final
- expandedPadding → EdgeInsets
-
Padding around expandedChild.
final
- expandIcon → Widget?
-
Custom icon for the expand affordance. Defaults to Icons.expand_more.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget
-
Always visible. The expand arrow (if any) is appended on the right.
final
- initialExpanded → bool
-
Initial state when uncontrolled. Ignored if isExpanded is set.
final
- isExpanded → bool?
-
External expansion control. When set, onToggle should drive changes.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onToggle → VoidCallback?
-
Called when the user taps the card (controlled or uncontrolled mode).
final
- padding → EdgeInsets
-
Padding around the header row.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showExpandIcon → bool
-
Show the rotating arrow at the end of the header row.
final
- starfieldSeed → int?
-
Seed for the ReactiveStarfieldPainter background. Pass a stable value
(e.g.
'hand out'.hashCode) so each instance has a unique-but-stable star pattern tied to its content. Defaults to the state'shashCode.final - useOverlayTapTarget → bool
-
When true (default) places a TermosTapTarget above the content so the
dot-grid mesh feedback paints over the whole card. When false, taps are
captured by a GestureDetector around the content so nested controls can
still receive their own gestures.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TermosExpandableSection> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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