getView function

Widget getView(
  1. dynamic child,
  2. Color? textColor
)

Implementation

Widget getView(dynamic child, Color? textColor) {
  if (child is String) {
    if (textColor == null) {
      return Text(child);
    } else {
      return Text(child, style: TextStyle(color: textColor));
    }
  } else if (child is Widget) {
    return child;
  }
  return const SizedBox.shrink();
}