xs method

Widget xs(
  1. BuildContext context,
  2. String? text, {
  3. int? maxLines,
  4. TextAlign? textAlign,
  5. Color? color,
  6. double? height,
  7. bool? bold = false,
  8. TextDecoration? decoration,
})

Implementation

Widget xs(
  BuildContext context,
  String? text, {
  int? maxLines,
  TextAlign? textAlign,
  Color? color,
  double? height,
  bool? bold = false,
  TextDecoration? decoration,
}) {
  return Text(
    text ?? '',
    textAlign: textAlign ?? TextAlign.start,
    maxLines: maxLines,
    overflow: maxLines != null ? TextOverflow.ellipsis : null,
    style: TextStyle(
      fontFamily: Theme.of(context).textTheme.bodyMedium!.fontFamily,
      color: color ?? Theme.of(context).textTheme.bodySmall!.color!,
      fontSize: xsText,
      height: height ?? textHeight,
      fontWeight: bold! ? semiBoldWeight : regularWeight,
      decoration: decoration ?? TextDecoration.none,
    ),
  );
}