buildTextWithStyle method Null safety

Widget buildTextWithStyle(
  1. Widget widget,
  2. TextStyle textStyle
)

Implementation

Widget buildTextWithStyle(Widget widget, TextStyle textStyle) {
  if (widget is Text) {
    widget = AnimatedDefaultTextStyle(
      style: widget.style ?? textStyle,
      duration: kThemeChangeDuration,
      softWrap: widget.softWrap ?? true,
      overflow: TextOverflow.fade,
      child: widget,
    );
  }

  return widget;
  //return Expanded(child: widget);
}