-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcancel_button.dart
74 lines (71 loc) · 2 KB
/
cancel_button.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import 'package:flutter/material.dart';
import 'package:futara/controller/resources/theme/colors_manager.dart';
import 'package:futara/view/widgets/my_text.dart';
class AppButton extends StatelessWidget {
const AppButton({
super.key,
this.text,
this.borderRadius,
this.color,
this.onTap,
this.contentColor,
this.width,
this.height,
this.borderColor,
this.loading,
this.hideIcon = false,
this.padding,
this.textDirection,
this.child,
this.iconSize,
this.fontSize,
this.fontWeight,
this.fontFamily,
this.margin,
});
final Color? color, borderColor, contentColor;
final BorderRadius? borderRadius;
final EdgeInsets? padding, margin;
final TextDirection? textDirection;
final Function? onTap;
final String? text, fontFamily;
final double? width, height, iconSize, fontSize;
final FontWeight? fontWeight;
final bool? loading, hideIcon;
final Widget? child;
@override
Widget build(BuildContext context) {
return Container(
width: width ?? double.infinity,
height: height,
padding: padding,
margin: margin,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 0.0,
backgroundColor: color ?? AppColors.blueColor,
shape: RoundedRectangleBorder(
borderRadius: borderRadius ?? BorderRadius.circular(12),
side:
BorderSide(color: borderColor ?? Colors.transparent, width: 2),
),
),
onPressed: () => onTap!(),
child: child ??
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MyText(
title: text!,
color: contentColor ?? Colors.white,
fontSize: fontSize,
fontFamily: fontFamily,
fontWeight: fontWeight,
),
],
),
),
);
}
}