FTile class
A specialized FItem for touch devices.
Multiple tiles can be grouped together in a FTileGroup. Tiles grouped together will be separated by a divider, specified by a FItemDivider.
Using FTile in a FPopover when wrapped in a FTileGroup
When a FPopover is used inside an FTileGroup, tiles & 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:
FTileGroup(
children: [
FTile(title: Text('Tile with popover')),
FPopoverWrapperTile(
popoverBuilder: (_, _) => FInheritedItemData(
child: FTileGroup(
children: [
FTile(title: Text('Popover Tile 1')),
FTile(title: Text('Popover Tile 2')),
],
),
),
child: FButton(child: Text('Open Popover')),
),
],
);
See:
- https://forui.dev/docs/tile/tile for working examples.
- FItem for a more generic item that can be used in any context.
- FTileGroup for grouping tiles together.
- FTileStyle for customizing a tile's appearance.
- Inheritance
- Mixed-in types
Constructors
-
FTile.new({required Widget title, FItemStyle style(FItemStyle)?, bool? enabled, bool selected = false, String? semanticsLabel, bool autofocus = false, FocusNode? focusNode, ValueChanged<
bool> ? onFocusChange, ValueChanged<bool> ? onHoverChange, ValueChanged<FWidgetStatesDelta> ? onStateChange, VoidCallback? onPress, VoidCallback? onLongPress, VoidCallback? onSecondaryPress, VoidCallback? onSecondaryLongPress, Map<ShortcutActivator, Intent> ? shortcuts, Map<Type, Action< ? actions, Widget? prefix, Widget? subtitle, Widget? details, Widget? suffix, Key? key})Intent> > - Creates a FTile.
-
FTile.raw({required Widget child, FItemStyle style(FItemStyle)?, bool? enabled, bool selected = false, String? semanticsLabel, bool autofocus = false, FocusNode? focusNode, ValueChanged<
bool> ? onFocusChange, ValueChanged<bool> ? onHoverChange, ValueChanged<FWidgetStatesDelta> ? onStateChange, VoidCallback? onPress, VoidCallback? onLongPress, VoidCallback? onSecondaryPress, VoidCallback? onSecondaryLongPress, Map<ShortcutActivator, Intent> ? shortcuts, Map<Type, Action< ? actions, Widget? prefix, Key? key})Intent> > - Creates a FTile without custom layout behavior.
Properties
-
actions
→ Map<
Type, Action< ?Intent> > -
The actions. Defaults to calling onPress when ActivateIntent is invoked and onPress is not null.
final
- autofocus → bool
-
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
- enabled → bool?
-
Whether the tile is enabled. Defaults to true.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onFocusChange
→ ValueChanged<
bool> ? -
Handler called when the focus changes.
final
-
onHoverChange
→ ValueChanged<
bool> ? -
Handler called when the hover changes.
final
- onLongPress → VoidCallback?
-
A callback for when the tile is long pressed.
final
- onPress → VoidCallback?
-
A callback for when the tile is pressed.
final
- onSecondaryLongPress → VoidCallback?
-
A callback for when the widget is pressed with a secondary button (usually right-click on desktop).
final
- onSecondaryPress → VoidCallback?
-
A callback for when the widget is pressed with a secondary button (usually right-click on desktop).
final
-
onStateChange
→ ValueChanged<
FWidgetStatesDelta> ? -
Handler called when there are any changes to a tappable's WidgetStates.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool
-
True if this tile is currently selected. Defaults to false.
final
- semanticsLabel → String?
-
The semantic label used by accessibility frameworks.
final
-
shortcuts
→ Map<
ShortcutActivator, Intent> ? -
The shortcuts. Defaults to calling ActivateIntent if onPress is not null.
final
- style → FItemStyle Function(FItemStyle)?
-
The tile's style. Defaults to the ancestor tile group's style if present.
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