|
@@ -13,12 +13,19 @@ class GradientButton extends StatefulWidget {
|
|
// padding between the text and icon
|
|
// padding between the text and icon
|
|
final double paddingValue;
|
|
final double paddingValue;
|
|
|
|
|
|
|
|
+ final double fontSize;
|
|
|
|
+ final double borderRadius;
|
|
|
|
+ final double borderWidth;
|
|
|
|
+
|
|
const GradientButton({
|
|
const GradientButton({
|
|
super.key,
|
|
super.key,
|
|
this.onTap,
|
|
this.onTap,
|
|
this.text = '',
|
|
this.text = '',
|
|
this.iconData,
|
|
this.iconData,
|
|
this.paddingValue = 0.0,
|
|
this.paddingValue = 0.0,
|
|
|
|
+ this.fontSize = 18,
|
|
|
|
+ this.borderRadius = 4,
|
|
|
|
+ this.borderWidth = 1,
|
|
});
|
|
});
|
|
|
|
|
|
@override
|
|
@override
|
|
@@ -34,11 +41,11 @@ class _GradientButtonState extends State<GradientButton> {
|
|
if (widget.iconData == null) {
|
|
if (widget.iconData == null) {
|
|
buttonContent = Text(
|
|
buttonContent = Text(
|
|
widget.text,
|
|
widget.text,
|
|
- style: const TextStyle(
|
|
|
|
|
|
+ style: TextStyle(
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w600,
|
|
fontWeight: FontWeight.w600,
|
|
fontFamily: 'Inter-SemiBold',
|
|
fontFamily: 'Inter-SemiBold',
|
|
- fontSize: 18,
|
|
|
|
|
|
+ fontSize: widget.fontSize,
|
|
),
|
|
),
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
@@ -54,11 +61,11 @@ class _GradientButtonState extends State<GradientButton> {
|
|
const Padding(padding: EdgeInsets.symmetric(horizontal: 6)),
|
|
const Padding(padding: EdgeInsets.symmetric(horizontal: 6)),
|
|
Text(
|
|
Text(
|
|
widget.text,
|
|
widget.text,
|
|
- style: const TextStyle(
|
|
|
|
|
|
+ style: TextStyle(
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w600,
|
|
fontWeight: FontWeight.w600,
|
|
fontFamily: 'Inter-SemiBold',
|
|
fontFamily: 'Inter-SemiBold',
|
|
- fontSize: 18,
|
|
|
|
|
|
+ fontSize: widget.fontSize,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
@@ -80,7 +87,7 @@ class _GradientButtonState extends State<GradientButton> {
|
|
isTapped = false;
|
|
isTapped = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- borderRadius: BorderRadius.circular(16),
|
|
|
|
|
|
+ borderRadius: BorderRadius.circular(widget.borderRadius),
|
|
onTap: widget.onTap as void Function()?,
|
|
onTap: widget.onTap as void Function()?,
|
|
child: Stack(
|
|
child: Stack(
|
|
children: [
|
|
children: [
|
|
@@ -122,9 +129,9 @@ class _GradientButtonState extends State<GradientButton> {
|
|
],
|
|
],
|
|
),
|
|
),
|
|
backgroundBlendMode: isTapped ? null : BlendMode.overlay,
|
|
backgroundBlendMode: isTapped ? null : BlendMode.overlay,
|
|
- border: const GradientBoxBorder(
|
|
|
|
- width: 1,
|
|
|
|
- gradient: LinearGradient(
|
|
|
|
|
|
+ border: GradientBoxBorder(
|
|
|
|
+ width: widget.borderWidth,
|
|
|
|
+ gradient: const LinearGradient(
|
|
colors: [
|
|
colors: [
|
|
Color(0xFFB37FEB),
|
|
Color(0xFFB37FEB),
|
|
Color(0xFF22075E),
|
|
Color(0xFF22075E),
|
|
@@ -133,7 +140,7 @@ class _GradientButtonState extends State<GradientButton> {
|
|
end: Alignment.bottomRight,
|
|
end: Alignment.bottomRight,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- borderRadius: BorderRadius.circular(4),
|
|
|
|
|
|
+ borderRadius: BorderRadius.circular(widget.borderRadius),
|
|
),
|
|
),
|
|
child: Center(child: buttonContent),
|
|
child: Center(child: buttonContent),
|
|
),
|
|
),
|