buildChildWithIC function

Widget buildChildWithIC(
  1. BuildContext context,
  2. String? text,
  3. Icon? icon,
  4. double gap,
  5. TextStyle textStyle,
)

Implementation

Widget buildChildWithIC(BuildContext context, String? text, Icon? icon,
    double gap, TextStyle textStyle) {
  icon = Icon(
    icon?.icon,
    color: Theme.of(context).brightness == Brightness.light
        ? Colors.white
        : Colors.black,
  );
  var children = <Widget>[];
  if (text != null) {
    children.add(buildText(text, textStyle));
    children.add(Padding(padding: EdgeInsets.all(gap)));
  }
  children.add(icon);

  return Wrap(
    direction: Axis.horizontal,
    crossAxisAlignment: WrapCrossAlignment.center,
    children: children,
  );
}