Select Git revision
app_text.dart
-
Rakshitha Salian authoredRakshitha Salian authored
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,
);
}
}