|
|
@ -34,6 +34,12 @@ class ASButton extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
///宽度
|
|
|
|
///宽度
|
|
|
|
final double width;
|
|
|
|
final double width;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///不可点击颜色
|
|
|
|
|
|
|
|
final Color disableColor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///不可点击时文字颜色
|
|
|
|
|
|
|
|
final Color disableTextColor;
|
|
|
|
ASButton({
|
|
|
|
ASButton({
|
|
|
|
Key key,
|
|
|
|
Key key,
|
|
|
|
this.bgcolor,
|
|
|
|
this.bgcolor,
|
|
|
@ -46,6 +52,8 @@ class ASButton extends StatefulWidget {
|
|
|
|
@required this.title,
|
|
|
|
@required this.title,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressed,
|
|
|
|
this.width,
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
this.disableColor,
|
|
|
|
|
|
|
|
this.disableTextColor,
|
|
|
|
}) : super(key: key);
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
ASButton.warn(
|
|
|
|
ASButton.warn(
|
|
|
@ -56,7 +64,9 @@ class ASButton extends StatefulWidget {
|
|
|
|
this.bgcolor,
|
|
|
|
this.bgcolor,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressed,
|
|
|
|
@required this.title,
|
|
|
|
@required this.title,
|
|
|
|
this.width})
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
this.disableColor,
|
|
|
|
|
|
|
|
this.disableTextColor})
|
|
|
|
: outline = true,
|
|
|
|
: outline = true,
|
|
|
|
outlineColor = Color(0xFFE50112),
|
|
|
|
outlineColor = Color(0xFFE50112),
|
|
|
|
textColor = Color(0xFFE50112),
|
|
|
|
textColor = Color(0xFFE50112),
|
|
|
@ -70,7 +80,9 @@ class ASButton extends StatefulWidget {
|
|
|
|
this.padding,
|
|
|
|
this.padding,
|
|
|
|
@required this.title,
|
|
|
|
@required this.title,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressed,
|
|
|
|
this.width})
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
this.disableColor,
|
|
|
|
|
|
|
|
this.disableTextColor})
|
|
|
|
: outline = true,
|
|
|
|
: outline = true,
|
|
|
|
outlineColor = Color(0x73000000),
|
|
|
|
outlineColor = Color(0x73000000),
|
|
|
|
textColor = Color(0xD9000000),
|
|
|
|
textColor = Color(0xD9000000),
|
|
|
@ -84,7 +96,9 @@ class ASButton extends StatefulWidget {
|
|
|
|
this.padding,
|
|
|
|
this.padding,
|
|
|
|
@required this.title,
|
|
|
|
@required this.title,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressed,
|
|
|
|
this.width})
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
this.disableColor,
|
|
|
|
|
|
|
|
this.disableTextColor})
|
|
|
|
: bgcolor = Color(0xFFFFB600),
|
|
|
|
: bgcolor = Color(0xFFFFB600),
|
|
|
|
textColor = Color(0xD9FFFFFF),
|
|
|
|
textColor = Color(0xD9FFFFFF),
|
|
|
|
outline = false,
|
|
|
|
outline = false,
|
|
|
@ -97,11 +111,30 @@ class ASButton extends StatefulWidget {
|
|
|
|
this.padding,
|
|
|
|
this.padding,
|
|
|
|
@required this.title,
|
|
|
|
@required this.title,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressed,
|
|
|
|
this.width})
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
this.disableColor,
|
|
|
|
|
|
|
|
this.disableTextColor})
|
|
|
|
: bgcolor = Color(0xFFF2F2F2),
|
|
|
|
: bgcolor = Color(0xFFF2F2F2),
|
|
|
|
textColor = Color(0xD9000000),
|
|
|
|
textColor = Color(0xD9000000),
|
|
|
|
outline = false,
|
|
|
|
outline = false,
|
|
|
|
super(key: key);
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
ASButton.order({
|
|
|
|
|
|
|
|
Key key,
|
|
|
|
|
|
|
|
@required this.title,
|
|
|
|
|
|
|
|
this.onPressed,
|
|
|
|
|
|
|
|
this.outlineColor,
|
|
|
|
|
|
|
|
this.width,
|
|
|
|
|
|
|
|
}) : bgcolor = Color(0xFFFFBD32),
|
|
|
|
|
|
|
|
textColor=Color(0xFF0000000),
|
|
|
|
|
|
|
|
textStyle = TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14.sp,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
radius = 5.w,
|
|
|
|
|
|
|
|
outline = false,
|
|
|
|
|
|
|
|
disableColor = Color(0xFFFFDF9B),
|
|
|
|
|
|
|
|
disableTextColor = Color(0x73000000),
|
|
|
|
|
|
|
|
padding=EdgeInsets.symmetric(vertical: 8.w),
|
|
|
|
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_ASButtonState createState() => _ASButtonState();
|
|
|
|
_ASButtonState createState() => _ASButtonState();
|
|
|
@ -111,6 +144,9 @@ class _ASButtonState extends State<ASButton> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialButton(
|
|
|
|
return MaterialButton(
|
|
|
|
|
|
|
|
disabledColor: widget.disableColor ?? widget.bgcolor,
|
|
|
|
|
|
|
|
disabledTextColor: widget.disableTextColor ?? Color(0x73000000),
|
|
|
|
|
|
|
|
textColor: widget.textColor ?? Color(0xFFFFB600),
|
|
|
|
minWidth: widget.width ?? 75.w,
|
|
|
|
minWidth: widget.width ?? 75.w,
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
onPressed: widget.onPressed,
|
|
|
|
onPressed: widget.onPressed,
|
|
|
@ -118,7 +154,6 @@ class _ASButtonState extends State<ASButton> {
|
|
|
|
? Text(widget.title,
|
|
|
|
? Text(widget.title,
|
|
|
|
style: widget.textStyle ??
|
|
|
|
style: widget.textStyle ??
|
|
|
|
TextStyle(
|
|
|
|
TextStyle(
|
|
|
|
color: widget.textColor ?? Color(0xFFFFB600),
|
|
|
|
|
|
|
|
fontSize: 13.sp))
|
|
|
|
fontSize: 13.sp))
|
|
|
|
: widget.title,
|
|
|
|
: widget.title,
|
|
|
|
padding: widget.padding ?? EdgeInsets.symmetric(vertical: 6.w),
|
|
|
|
padding: widget.padding ?? EdgeInsets.symmetric(vertical: 6.w),
|
|
|
@ -129,6 +164,9 @@ class _ASButtonState extends State<ASButton> {
|
|
|
|
borderRadius: BorderRadius.circular(widget.radius ?? 15.5.w)),
|
|
|
|
borderRadius: BorderRadius.circular(widget.radius ?? 15.5.w)),
|
|
|
|
color: widget.bgcolor ?? Color(0xFFFFFFFF),
|
|
|
|
color: widget.bgcolor ?? Color(0xFFFFFFFF),
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|
|
|
|
|
focusElevation: 0,
|
|
|
|
|
|
|
|
highlightElevation: 0,
|
|
|
|
|
|
|
|
hoverElevation: 0,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|