import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'app_texts_widget.dart'; class AppButton extends StatefulWidget { final GestureTapCallback onPressed; final String title; final IconData icon; final Color color; final double fontSize; final double padding; AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2.5, this.padding = 15}); _AppButtonState createState() => _AppButtonState(); } class _AppButtonState extends State{ @override Widget build(BuildContext context) { return RawMaterialButton( fillColor: widget.color, splashColor: widget.color, child: Padding( padding: EdgeInsets.only( top: 10, bottom: 10, right: SizeConfig.widthMultiplier * widget.padding, left: SizeConfig.widthMultiplier * widget.padding ), child: Row( mainAxisSize: MainAxisSize.min, children: [ /*Icon( widget.icon, color: Colors.white, ), SizedBox( width: 10.0, ),*/ AppText( widget.title, color: Colors.white, fontSize: SizeConfig.textMultiplier * widget.fontSize , fontWeight: FontWeight.bold, ), ], ), ), onPressed: widget.onPressed, shape: const StadiumBorder(), ); } }