DataDisplayBuilder<T>.string constructor

const DataDisplayBuilder<T>.string({
  1. required String labelBuilder(
    1. T data
    ),
  2. Color? backgroundColor,
  3. TextStyle? labelStyle,
  4. OutlinedBorder? shape,
  5. Color? deleteIconColor,
  6. Widget? deleteIcon,
  7. Widget? avatar,
  8. BoxConstraints? avatarBoxConstraints,
  9. EdgeInsetsGeometry? labelPadding,
  10. @Default.new(BorderSide.none) BorderSide side,
})

A pre-defined string builder that can be used to display a piece of data.

This builder will create a Chip widget with the following properties:

  • labelBuilder is used to generate the label of the chip.
  • backgroundColor is used to set the background color of the chip.
  • labelStyle is used to set the style of the label.
  • shape is used to set the shape of the chip.
  • deleteIconColor is used to set the color of the delete icon.
  • deleteIcon is used to set the delete icon.
  • avatar is used to set the avatar of the chip.
  • avatarBoxConstraints is used to set the box constraints of the avatar.
  • labelPadding is used to set the padding of the label.
  • side is used to set the side of the chip where the delete icon is placed.

See DataDisplayBuilderWidget for a custom widget builder.

Implementation

const factory DataDisplayBuilder.string({
  required String Function(T data) labelBuilder,
  Color? backgroundColor,
  TextStyle? labelStyle,
  OutlinedBorder? shape,
  Color? deleteIconColor,
  Widget? deleteIcon,
  Widget? avatar,
  BoxConstraints? avatarBoxConstraints,
  EdgeInsetsGeometry? labelPadding,
  @Default(BorderSide.none) BorderSide side,
}) = DataDisplayBuilderString;