VCollpasiblePanel class
A collapsible panel widget that displays a header and expandable content.
VCollpasiblePanel is a reusable component that combines a VCard container with an FAccordion widget to provide a collapsible UI element. This is useful for organizing information in a compact manner, allowing users to expand/collapse sections as needed.
The panel can be initialized in either expanded or collapsed state via the isExpanded parameter. The header is always visible and clickable to toggle the content visibility. Content is displayed below the header when expanded.
Visual Structure
- Header: The clickable title area that remains visible
- Content: The expandable section below the header
- Container: Wrapped in a VCard with standard padding
Parameters
- header: The widget displayed as the collapsible panel's title/header
- content: The widget displayed when the panel is expanded
- isExpanded: Whether the panel is initially expanded (defaults to
false) - key: Optional widget key
Example
VCollpasiblePanel(
header: Text('Settings'),
content: Column(
children: [
CheckboxListTile(title: Text('Option 1')),
CheckboxListTile(title: Text('Option 2')),
],
),
isExpanded: false,
)
See also:
- VCard, the underlying card container
- FAccordion, the accordion widget from Forui package
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- VCollpasiblePanel
Constructors
- VCollpasiblePanel({Key? key, required Widget header, required Widget content, bool isExpanded = false})
-
const
Properties
- content → Widget
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget
-
final
- isExpanded → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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