DataDisplayBuilder<T> class sealed

A sealed class that defines how a piece of data should be displayed.

You can either use a pre-defined string builder or a custom widget builder.

See DataDisplayBuilderString for a pre-defined string builder, or DataDisplayBuilderWidget for a custom widget builder.

Available extensions
Annotations
  • @freezed

Constructors

DataDisplayBuilder.custom({required Widget builder(BuildContext context, T data, void delete())})
A custom widget builder that can be used to display a piece of data.
const
factory
DataDisplayBuilder.string({required String labelBuilder(T data), Color? backgroundColor, TextStyle? labelStyle, OutlinedBorder? shape, Color? deleteIconColor, Widget? deleteIcon, Widget? avatar, BoxConstraints? avatarBoxConstraints, EdgeInsetsGeometry? labelPadding, @Default.new(BorderSide.none) BorderSide side})
A pre-defined string builder that can be used to display a piece of data.
const
factory

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(DataDisplayBuilderString<T> value), required TResult custom(DataDisplayBuilderWidget<T> value)}) → TResult

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? string(DataDisplayBuilderString<T> value)?, TResult? custom(DataDisplayBuilderWidget<T> value)?}) → TResult?

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult string(DataDisplayBuilderString<T> value)?, TResult custom(DataDisplayBuilderWidget<T> value)?, required TResult orElse()}) → TResult

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult string(String labelBuilder(T data), Color? backgroundColor, TextStyle? labelStyle, OutlinedBorder? shape, Color? deleteIconColor, Widget? deleteIcon, Widget? avatar, BoxConstraints? avatarBoxConstraints, EdgeInsetsGeometry? labelPadding, BorderSide side)?, TResult custom(Widget builder(BuildContext context, T data, void delete()))?, required TResult orElse()}) → TResult

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A variant of when that fallback to an orElse callback.
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), Color? backgroundColor, TextStyle? labelStyle, OutlinedBorder? shape, Color? deleteIconColor, Widget? deleteIcon, Widget? avatar, BoxConstraints? avatarBoxConstraints, EdgeInsetsGeometry? labelPadding, BorderSide side), required TResult custom(Widget builder(BuildContext context, T data, void delete()))}) → TResult

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? string(String labelBuilder(T data), Color? backgroundColor, TextStyle? labelStyle, OutlinedBorder? shape, Color? deleteIconColor, Widget? deleteIcon, Widget? avatar, BoxConstraints? avatarBoxConstraints, EdgeInsetsGeometry? labelPadding, BorderSide side)?, TResult? custom(Widget builder(BuildContext context, T data, void delete()))?}) → TResult?

Available on DataDisplayBuilder<T>, provided by the DataDisplayBuilderPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited