label method

Widget label(
  1. BuildContext context, {
  2. bool withoutAutoSize = false,
  3. double fontSize = CustomFontSize.f20,
  4. Color? color,
  5. int maxLines = 2,
  6. double? letterSpacing,
  7. FontWeight? fontWeight,
})

Implementation

Widget label(
  BuildContext context, {
  bool withoutAutoSize = false,
  double fontSize = CustomFontSize.f20,
  Color? color,
  int maxLines = 2,
  double? letterSpacing,
  FontWeight? fontWeight,
}) {
  if (withoutAutoSize == true) {
    return Text(
      this,
      style: Theme.of(context).textTheme.headline5!.copyWith(
            fontSize: fontSize,
            color: color,
            letterSpacing: letterSpacing,
            fontWeight: fontWeight,
          ),
    );
  }

  return AutoSizeText(
    this,
    maxLines: maxLines,
    style: Theme.of(context).textTheme.headline5!.copyWith(
          fontSize: fontSize,
          color: color,
          letterSpacing: letterSpacing,
          fontWeight: fontWeight,
        ),
  );
}