getPrefixChild method

Widget? getPrefixChild()

Implementation

Widget? getPrefixChild() {
  if (widget.type == UFUInputBoxType.searchbar) {
    return Padding(
      padding: const EdgeInsets.only(left: 12, right: 6),
      child:
          widget.prefixChild ??
          UFUIcon(
            Icons.search,
            color: AppTheme.themeColors.dimGray,
            size: 25,
          ),
    );
  } else if (showChips) {
    return Padding(
      padding: const EdgeInsets.only(
        top: 12,
        left: 12,
        right: 42,
        bottom: 12,
      ),
      child: Wrap(
        runSpacing: 8,
        spacing: 8,
        children: List.generate(
          widget.chipsList!.length > 5 ? 6 : widget.chipsList!.length,
          (index) {
            if (index < 5) {
              return widget.chip!(widget.chipsList![index]);
            } else {
              return widget.moreChipsWidget ?? const SizedBox();
            }
          },
        ),
      ),
    );
  } else {
    return widget.prefixChild;
  }
}