customText function
Widget
customText(
- String msg, {
- Key? key,
- required TextStyle style,
- required BuildContext context,
- TextAlign textAlign = TextAlign.justify,
- TextOverflow overflow = TextOverflow.visible,
- bool softWrap = true,
Implementation
Widget customText(String msg,
{ Key? key,
required TextStyle style,
required BuildContext context,
TextAlign textAlign = TextAlign.justify,
TextOverflow overflow = TextOverflow.visible,
bool softWrap = true}) {
if (msg.isEmpty) {
return const SizedBox(
height: 0,
width: 0,
);
} else {
var fontSize = style.fontSize ?? Theme.of(context).textTheme.bodyMedium!.fontSize;
style = style.copyWith(
fontSize: fontSize! - (AppTheme.fullWidth(context) <= 375 ? 2 : 0),
);
return Text(
msg,
style: style,
textAlign: textAlign,
overflow: overflow,
softWrap: softWrap,
key: key,
);
}
}