buildText function

Widget buildText(
  1. String text,
  2. {TextStyle textStyle,
  3. int maxLines,
  4. double fontSize = 14,
  5. Color color,
  6. EdgeInsets margin,
  7. TextDecoration textDecoration,
  8. TextAlign textAlign,
  9. FontWeight fontWeight,
  10. TextOverflow overflow}
)

Implementation

Widget buildText(String text, {TextStyle textStyle, int maxLines,double fontSize = 14, Color color, EdgeInsets margin, TextDecoration textDecoration, TextAlign textAlign, FontWeight fontWeight, TextOverflow overflow}){
  return Container(
    margin: margin,
    child: Text(
      text??'',
      maxLines: maxLines,
      overflow: overflow,
      textAlign: textAlign,
      style: textStyle??TextStyle(
          decoration: textDecoration,
          fontSize: getSp(fontSize),
          fontWeight: fontWeight,
          color: color??Theme.of(context).textTheme.bodyText1.color
      ),
    ),
  );
}