import 'package:flutter/material.dart'; import 'package:rasadyar_app/presentation/common/app_color.dart'; import 'package:rasadyar_app/presentation/common/app_fonts.dart'; class RElevated extends StatefulWidget { RElevated({ super.key, required this.text, required this.onPressed, foregroundColor, backgroundColor, disabledBackgroundColor, disabledForegroundColor, radius, textStyle, this.width = 150.0, this.height = 56.0, }); final String text; final VoidCallback? onPressed; final double width; final double height; Color? foregroundColor; Color? backgroundColor; Color? disabledForegroundColor; Color? disabledBackgroundColor; double? radius; TextStyle? textStyle; @override State createState() => _RElevatedState(); } class _RElevatedState extends State { @override Widget build(BuildContext context) { return ElevatedButton( onPressed: () { setState(() {}); }, style: ElevatedButton.styleFrom( backgroundColor: widget.backgroundColor ?? AppColor.blueNormal, foregroundColor: widget.foregroundColor ?? Colors.white, disabledBackgroundColor: widget.disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), disabledForegroundColor: widget.disabledForegroundColor ?? Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(widget.radius ?? 8), ), fixedSize: Size(widget.width, widget.height), padding: EdgeInsets.zero, textStyle: widget.textStyle ?? AppFonts.yekan24Regular, ), child: Text(widget.text), ); } }