SBBListItemStyle class

Defines the visual properties of SBBListItem.

Use this class in combination with SBBListItemThemeData to customize the appearance of list items throughout your app or for specific widget subtrees.

Sample code

SBBListItem(
  titleText: 'Title',
  subtitleText: 'Subtitle',
  onTap: () {},
  style: SBBListItemStyle(
    backgroundColor: WidgetStateProperty.all(Colors.white),
    titleForegroundColor: WidgetStateProperty.all(Colors.black),
  ),
)

See also:

Constructors

SBBListItemStyle({TextStyle? titleTextStyle, int? titleTextMaxLines, TextStyle? subtitleTextStyle, int? subtitleTextMaxLines, WidgetStateProperty<Color?>? titleForegroundColor, WidgetStateProperty<Color?>? subtitleForegroundColor, WidgetStateProperty<Color?>? leadingForegroundColor, WidgetStateProperty<Color?>? trailingForegroundColor, WidgetStateProperty<Color?>? backgroundColor, WidgetStateProperty<Color?>? overlayColor, EdgeInsetsGeometry? padding, double? leadingHorizontalGapWidth, double? subtitleVerticalGapHeight, double? trailingHorizontalGapWidth})
const

Properties

backgroundColor → WidgetStateProperty<Color?>?
The background color of the list item.
final
hashCode → int
The hash code for this object.
no setteroverride
leadingForegroundColor → WidgetStateProperty<Color?>?
The color of the leading widget content.
final
leadingHorizontalGapWidth → double?
The horizontal gap width between the leading widget and the title/subtitle.
final
overlayColor → WidgetStateProperty<Color?>?
The overlay color shown on interaction.
final
padding → EdgeInsetsGeometry?
The padding around the list item's content.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subtitleForegroundColor → WidgetStateProperty<Color?>?
The color of the subtitle text.
final
subtitleTextMaxLines → int?
An optional maximum number of lines for the subtitle text to span, wrapping if necessary.
final
subtitleTextStyle → TextStyle?
The text style for the list item subtitle.
final
subtitleVerticalGapHeight → double?
The vertical gap height between the title and subtitle.
final
titleForegroundColor → WidgetStateProperty<Color?>?
The color of the title text.
final
titleTextMaxLines → int?
An optional maximum number of lines for the title text to span, wrapping if necessary.
final
titleTextStyle → TextStyle?
The text style for the list item title.
final
trailingForegroundColor → WidgetStateProperty<Color?>?
The color of the trailing widget content.
final
trailingHorizontalGapWidth → double?
The horizontal gap height between the title and trailing.
final

Methods

copyWith({TextStyle? titleTextStyle, int? titleTextMaxLines, TextStyle? subtitleTextStyle, int? subtitleTextMaxLines, WidgetStateProperty<Color?>? titleForegroundColor, WidgetStateProperty<Color?>? subtitleForegroundColor, WidgetStateProperty<Color?>? leadingForegroundColor, WidgetStateProperty<Color?>? trailingForegroundColor, WidgetStateProperty<Color?>? overlayColor, WidgetStateProperty<Color?>? backgroundColor, EdgeInsetsGeometry? padding, double? trailingHorizontalGapWidth, double? leadingHorizontalGapWidth, double? subtitleVerticalGapHeight}) → SBBListItemStyle
merge(SBBListItemStyle? other) → SBBListItemStyle
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

defaultPadding → const EdgeInsets
The default padding of the list item.
minInnerHeight → const double
The minimum vertical height of a list item without SBBListItem.padding applied.