ListDataBuilder<T> class
sealed
A sealed class that defines how a list of data should be displayed.
It contains two subclasses: ListDataBuilderString and ListDataBuilderCustom.
ListDataBuilderString is used to display a list of data as strings.
It takes a labelBuilder which is a function that takes a data and returns a
string label for the data.
ListDataBuilderCustom is used to display a list of data as custom widgets.
It takes a builder which is a function that takes a build context, a data, and
a ListTileMetadata object, and returns a widget for the data.
- Available extensions
- Annotations
-
- @freezed
Constructors
- ListDataBuilder.custom({required Widget builder(BuildContext context, T data, ListTileMetadata metadata)})
-
A factory to create a ListDataBuilder that displays a list of data as custom widgets.
constfactory
- ListDataBuilder.string({required String labelBuilder(T data), ListDataTileStyle? style})
-
A factory to create a ListDataBuilder that displays a list of data as strings.
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult string(ListDataBuilderString< T> value), required TResult custom(ListDataBuilderCustom<T> value)}) → TResult -
Available on ListDataBuilder<
AT> , provided by the ListDataBuilderPatterns extensionswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? string(ListDataBuilderString< T> value)?, TResult? custom(ListDataBuilderCustom<T> value)?}) → TResult? -
Available on ListDataBuilder<
A variant ofT> , provided by the ListDataBuilderPatterns extensionmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult string(ListDataBuilderString< T> value)?, TResult custom(ListDataBuilderCustom<T> value)?, required TResult orElse()}) → TResult -
Available on ListDataBuilder<
A variant ofT> , provided by the ListDataBuilderPatterns extensionmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> ({TResult string(String labelBuilder(T data), ListDataTileStyle? style)?, TResult custom(Widget builder(BuildContext context, T data, ListTileMetadata metadata))?, required TResult orElse()}) → TResult -
Available on ListDataBuilder<
A variant ofT> , provided by the ListDataBuilderPatterns extensionwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult string(String labelBuilder(T data), ListDataTileStyle? style), required TResult custom(Widget builder(BuildContext context, T data, ListTileMetadata metadata))}) → TResult -
Available on ListDataBuilder<
AT> , provided by the ListDataBuilderPatterns extensionswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> ({TResult? string(String labelBuilder(T data), ListDataTileStyle? style)?, TResult? custom(Widget builder(BuildContext context, T data, ListTileMetadata metadata))?}) → TResult? -
Available on ListDataBuilder<
A variant ofT> , provided by the ListDataBuilderPatterns extensionwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited