ZetaAvatarRail class Components
A stateless widget that represents an avatar rail in the Zeta application.
The ZetaAvatarRail
widget is used to display a horizontal rail of avatars,
typically used for navigation or selection purposes within the application.
This widget does not maintain any state and relies on its parent and children widgets to provide the necessary data and handle interactions.
Example usage:
ZetaAvatarRail(
avatars: [
ZetaAvatar.initials(
key: Key('avatar1'),
initials: 'AZ',
onTap: () => print('Avatar tapped'),
label: 'Archie',
),
ZetaAvatar.initials(
key: Key('avatar2'),
initials: 'BY',
onTap: () => print('Avatar tapped'),
label: 'Beth',
),
ZetaAvatar.initials(
key: Key('avatar3'),
initials: 'CX',
onTap: () => print('Avatar tapped'),
label: 'Carla',
),
]
)
See also:
- StatelessWidget, which is the superclass of this widget.
- ZetaAvatar, which is used within this rail to represent individual avatars.
Widgetbook: https://design.zebra.com/flutter/widgetbook/index.html#/?path=components/avatar/avatar-rail
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ZetaAvatarRail
- Available extensions
Constructors
-
ZetaAvatarRail({Key? key, ZetaAvatarSize? size, required List<
ZetaAvatar> avatars, TextStyle? labelTextStyle, int labelMaxLines = 1, void onTap(Key)?, double? gap}) -
const
Properties
-
avatars
→ List<
ZetaAvatar> -
A list of
ZetaAvatar
objects representing the avatars to be displayed.final - gap → double?
-
The gap between the avatars.
Defaults to 'Zeta.of(context).spacing.small)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelMaxLines → int
-
The maximum number of lines to be displayed in the label of the ZetaAvatars.
final
- labelTextStyle → TextStyle?
-
The text style to be applied to the label of the ZetaAvatars.
final
- onTap → void Function(Key)?
-
A callback function to be executed when an ZetaAvatar is tapped.
The function receives the key of the tapped ZetaAvatar as a parameter.
If no key is provided, the index of the ZetaAvatar in the list is used.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ZetaAvatarSize?
-
The size of the ZetaAvatars
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
-
paddingAll(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Equal padding on all sides. -
paddingBottom(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Padding on bottom only. -
paddingEnd(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Padding on start edge only. Is affected by whether the device is LTR or RTL: -
paddingHorizontal(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Equal padding on start and end. -
paddingStart(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Padding on start edge only. Is affected by whether the device is LTR or RTL: -
paddingTop(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Padding on top only. -
paddingVertical(
double space) → Widget -
Available on Widget, provided by the SpacingWidget extension
Equal padding on top and bottom. -
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
Static Methods
-
pixelSize(
BuildContext context, ZetaAvatarSize size) → double - Returns pixel size for ZetaAvatarSize