textOnColor static method
Widget
textOnColor(
- BuildContext context, {
- required String text,
- TextStyle? style,
- Color? backgroundColor,
- TextAlign? textAlign,
Implementation
static Widget textOnColor(BuildContext context, {required String text, TextStyle? style, Color? backgroundColor, TextAlign? textAlign})
{
return Container(
decoration: BoxDecoration(
color: backgroundColor ?? Colors.grey.shade200,
borderRadius: BorderRadius.circular(6)
),
padding: const EdgeInsets.all(10),
child: Text(
text,
style: style ?? Theme.of(context).textTheme.titleMedium!.copyWith(color: Colors.black87),
textAlign: textAlign,
),
);
}