FItemGroup class
An item group that groups multiple FItemMixins together.
Items grouped together will be separated by a divider, specified by divider.
Using FItemGroup in a FPopover when wrapped in a FItemGroup
When a FPopover is used inside an FItemGroup, items & groups inside the popover will inherit styling from the
parent group. This happens because FPopover's content shares the same BuildContext
as its child, causing data
inheritance that may lead to unexpected rendering issues.
To prevent this styling inheritance, wrap the popover in a FInheritedItemData with null data to reset the inherited data:
FItemGroup(
children: [
FItem(title: Text('Item with popover')),
FPopoverWrapperItem(
popoverBuilder: (_, _) => FInheritedItemData(
child: FItemGroup(
children: [
FItem(title: Text('Popover Item 1')),
FItem(title: Text('Popover Item 2')),
],
),
),
child: FButton(child: Text('Open Popover')),
),
],
);
See:
- https://forui.dev/docs/data/item-group for working examples.
- FItemGroupStyle for customizing a item group's appearance.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- FItemGroup
- Mixed-in types
Constructors
-
FItemGroup.new({required List<
FItemMixin> children, FItemGroupStyle style(FItemGroupStyle)?, ScrollController? scrollController, double? cacheExtent, double maxHeight = double.infinity, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollPhysics physics = const ClampingScrollPhysics(), bool? enabled, FItemDivider divider = FItemDivider.none, String? semanticsLabel, Key? key}) - Creates a FItemGroup.
- FItemGroup.builder({required NullableIndexedWidgetBuilder itemBuilder, int? count, FItemGroupStyle style(FItemGroupStyle)?, ScrollController? scrollController, double? cacheExtent, double maxHeight = double.infinity, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollPhysics physics = const ClampingScrollPhysics(), bool? enabled, FItemDivider divider = FItemDivider.none, String? semanticsLabel, Key? key})
- Creates a FItemGroup that lazily builds its children.
-
FItemGroup.merge({required List<
FItemGroupMixin> children, FItemGroupStyle style(FItemGroupStyle)?, ScrollController? scrollController, double? cacheExtent, double maxHeight = double.infinity, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollPhysics physics = const ClampingScrollPhysics(), bool? enabled, FItemDivider divider = FItemDivider.full, String? semanticsLabel, Key? key}) - Creates a FItemGroup that merges multiple FItemGroupMixins together.
Properties
- cacheExtent → double?
-
The scrollable area's cache extent in logical pixels.
final
- divider → FItemDivider
-
The divider between items.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled. Defaults to DragStartBehavior.start.
final
- enabled → bool?
-
True if the group is enabled. Defaults to true.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxHeight → double
-
The max height, in logical pixels. Defaults to infinity.
final
- physics → ScrollPhysics
-
The scroll physics of the group. Defaults to ClampingScrollPhysics.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
The scroll controller used to control the position to which this group is scrolled.
final
- semanticsLabel → String?
-
The group's semantic label.
final
- style → FItemGroupStyle Function(FItemGroupStyle)?
-
The style.
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.
override
-
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