renderLabels method

Widget renderLabels(
  1. List labels, {
  2. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
})

Implementation

Widget renderLabels(List<dynamic> labels,
    {MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start}) {
  return Row(
    mainAxisSize: MainAxisSize.max,
    mainAxisAlignment: mainAxisAlignment,
    children: [
      ...(labels).map((tL) {
        if (parser(tL['text'] ?? "")?.trim()?.isEmpty) {
          // ignore the pills that doesn't have a text content
          return const SizedBox();
        }

        return itemLabel(
            localizedText(parser(tL['text'] ?? "")),
            tL['icon'] ?? "",
            tL['color'] ?? "",
            tL['fontSize'] ?? "",
            tL['type'] == 'pill' ? tL['backgroundColor'] : null,
            tL["conditions"]);
      }).expand((e) => [e, const SizedBox(width: 3)])
    ],
  );
}