57 lines
1.6 KiB
Dart
57 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: widget.onPressed,
|
|
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.yekan24,
|
|
),
|
|
child: Text(widget.text),
|
|
);
|
|
}
|
|
}
|