Skip to content
Snippets Groups Projects

Text field common component and common app colors added

Merged Rakshitha Salian requested to merge ECAP1-24-verify_otp into dev
3 files
+ 66
132
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 49
0
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;
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.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,
decoration:
underLine ? TextDecoration.underline : TextDecoration.none),
softWrap: softWrap,
);
}
}
Loading