From 1fb96257af2d991a39390b05dc61a20992c31678 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 27 Aug 2021 09:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20asbutton=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/buttons/as_button.dart | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/buttons/as_button.dart b/lib/buttons/as_button.dart index 2415a63..764bf05 100644 --- a/lib/buttons/as_button.dart +++ b/lib/buttons/as_button.dart @@ -44,6 +44,9 @@ class ASButton extends StatelessWidget { final Color? splashColor; + ///高度 + final double? height; + ASButton({ Key? key, this.bgcolor, @@ -59,6 +62,7 @@ class ASButton extends StatelessWidget { this.disableColor, this.disableTextColor, this.splashColor, + this.height, }) : super(key: key); ASButton.danger({ @@ -72,6 +76,7 @@ class ASButton extends StatelessWidget { this.width, this.disableColor, this.disableTextColor, + this.height, }) : outline = true, outlineColor = kDangerColor, textColor = kDangerColor, @@ -89,7 +94,8 @@ class ASButton extends StatelessWidget { this.width, this.disableColor, this.disableTextColor, - this.splashColor}) + this.splashColor, + this.height}) : outline = true, outlineColor = kDarkColor, textColor = kTextColor, @@ -106,6 +112,7 @@ class ASButton extends StatelessWidget { this.width, this.disableColor, this.disableTextColor, + this.height, }) : bgcolor = kLightPrimaryColor, textColor = kLightTextColor, outline = false, @@ -123,7 +130,8 @@ class ASButton extends StatelessWidget { this.width, this.disableColor, this.disableTextColor, - this.splashColor}) + this.splashColor, + this.height}) : bgcolor = Color(0xFFF2F2F2), textColor = kTextColor, outline = false, @@ -136,6 +144,7 @@ class ASButton extends StatelessWidget { this.outlineColor, this.width, this.splashColor, + this.height, }) : bgcolor = kLightPrimaryColor, textColor = kTextColor, textStyle = TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold), @@ -155,7 +164,8 @@ class ASButton extends StatelessWidget { this.onPressed, this.width, this.disableColor, - this.splashColor}) + this.splashColor, + this.height}) : outline = true, outlineColor = kPrimaryColor, bgcolor = Colors.white, @@ -170,6 +180,7 @@ class ASButton extends StatelessWidget { disabledTextColor: disableTextColor, textColor: textColor ?? kLightPrimaryColor, minWidth: width, + height: height, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onPressed: onPressed, child: title is String