makeTextEx method

Widget makeTextEx(
  1. Widget? child,
  2. String text,
  3. Widget? postfix,
  4. Widget? suffix,
  5. bool isSel,
)

Implementation

Widget makeTextEx(
    Widget? child, String text, Widget? postfix, Widget? suffix, bool isSel) {
  List<Widget> items = [];
  if (postfix != null) items.add(postfix);
  items.add(
      child ?? Text(text, style: (isSel ? picker!.selectedTextStyle : null)));
  if (suffix != null) items.add(suffix);
  final theme = picker!.textStyle != null || picker!.state?.context == null
      ? null
      : material.Theme.of(picker!.state!.context);
  Color? txtColor = theme?.brightness == Brightness.dark
      ? material.Colors.white
      : material.Colors.black87;
  double? txtSize = Picker.defaultTextSize;
  if (isSel && picker!.selectedTextStyle != null) {
    if (picker!.selectedTextStyle!.color != null) {
      txtColor = picker!.selectedTextStyle!.color;
    }
    if (picker!.selectedTextStyle!.fontSize != null) {
      txtSize = picker!.selectedTextStyle!.fontSize;
    }
  }

  return Center(
      child: DefaultTextStyle(
          overflow: TextOverflow.ellipsis,
          maxLines: 1,
          textAlign: picker!.textAlign,
          style: picker!.textStyle ??
              TextStyle(
                  color: txtColor,
                  fontSize: txtSize,
                  fontFamily: theme == null
                      ? ""
                      : theme.textTheme.titleLarge?.fontFamily),
          child: Wrap(
            children: items,
          )));
}