Skip to content
Snippets Groups Projects
Select Git revision
  • f6f8c68a05e0ab8853fd1fddf7a43ea257380917
  • dev default protected
  • integrating-verify-otp-screen
  • language-selection
  • ECAP1-24-verify_otp
5 results

app_text.dart

Blame
  • app_text.dart 1.46 KiB
    import 'package:exide_crr/res/app_color_text_size.dart';
    import 'package:flutter/material.dart';
    import 'package:google_fonts/google_fonts.dart';
    import '../constants/font_constants.dart';
    
    class AppText extends StatelessWidget {
       String text;
       Color textColor,underlineColor;
       double fontSize;
       FontWeight fontWeight;
       FontStyle fontStyle;
       // double lineHeight;
       TextAlign textAlign;
       int maxLine;
       bool softWrap,  underLine,isCurrency;
    
       AppText(
          {Key? key,
          required this.text,
          required this.textColor,
          required this.fontSize,
          this.fontWeight = FontWeight.w600,
           this.textAlign=TextAlign.start,
          this.softWrap=true,
          // required this.lineHeight,
          this.maxLine=1,
          this.fontStyle = FontStyle.normal,
          this.underLine = false,this.underlineColor=AppColor.blackColor,
          this.isCurrency = false})
          : super(key: key);
    
      @override
      Widget build(BuildContext context) {
        return Text(
          isCurrency ? '\u{20B9}$text' : text,
          textAlign: textAlign,
          overflow: TextOverflow.ellipsis,
          maxLines: maxLine,
          style: GoogleFonts.getFont(FontConstants.fontFamilyName,
              fontSize: fontSize,
              fontWeight: fontWeight,
              fontStyle: fontStyle,
              // height: lineHeight,
              color: textColor,decorationColor:underlineColor,
              decoration:
                  underLine ? TextDecoration.underline : TextDecoration.none),
          softWrap: softWrap,
        );
      }
    }