Files
rasadyar_application/lib/presentation/widget/buttons/elevated.dart
mr.mojtaba 50cc84461e feat : button , outlined button
fab button , fab outlined button ,
input , pagination widget's
2025-04-06 15:39:00 +03:30

59 lines
1.6 KiB
Dart

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<RElevated> createState() => _RElevatedState();
}
class _RElevatedState extends State<RElevated> {
@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),
);
}
}