fromStrings static method

List<TChip> fromStrings(
  1. List<String> strings, {
  2. Color? color,
  3. dynamic icon,
  4. TVariant? type,
  5. TSize size = TChipSize.sm,
  6. VoidCallback? onTap,
})

Creates a list of TChips from a list of string labels.

Implementation

static List<TChip> fromStrings(
  List<String> strings, {
  Color? color,
  dynamic icon,
  TVariant? type,
  TSize size = TChipSize.sm,
  VoidCallback? onTap,
}) {
  return strings
      .map((s) => TChip(
            text: s,
            color: color,
            icon: icon,
            type: type,
            size: size,
            onTap: onTap,
          ))
      .toList();
}