import 'package:flutter/material.dart'; import '../../app_style/sizing.dart'; class AFlatButton extends StatelessWidget { final String text; final Color? textColor; final TextStyle? style; final EdgeInsets? padding; final VoidCallback? onPressed; const AFlatButton({Key? key, required this.text, this.textColor,this.style ,this.onPressed, this.padding}) : super(key: key); @override Widget build(BuildContext context) { return TextButton( style: TextButton.styleFrom( foregroundColor: this.textColor ?? Colors.black, padding: padding, ), onPressed: onPressed, child: Text( text??"", style: style ?? Theme.of(context).textTheme.bodyText1, textScaleFactor: AppStyle.getScaleFactor(context), ) ); } }