button add width

master
小赖 4 years ago
parent 2b1ac75fc1
commit e57b6920e4

@ -13,6 +13,7 @@ class AkuButton extends StatefulWidget {
@required
final VoidCallback onPressed;
final Color color;
final double width;
AkuButton({
Key key,
this.child,
@ -21,6 +22,7 @@ class AkuButton extends StatefulWidget {
this.onPressed,
this.padding = EdgeInsets.zero,
this.color = Colors.transparent,
this.width = 0,
}) : super(key: key);
@override
@ -38,6 +40,7 @@ class _AkuButtonState extends State<AkuButton> with PlatformMixin {
minHeight: widget.height,
padding: widget.padding,
color: widget.color,
minWidth: widget.width,
)
: AkuMaterialButton(
onPressed: widget.onPressed,
@ -46,6 +49,7 @@ class _AkuButtonState extends State<AkuButton> with PlatformMixin {
height: widget.height,
padding: widget.padding,
color: widget.color,
minWidth: widget.width,
);
}
}

@ -9,6 +9,7 @@ class AkuCupertinoButton extends CupertinoButton {
final double radius;
final double minHeight;
final Color nullColor;
final double minWidth;
AkuCupertinoButton({
Key key,
@ -19,9 +20,14 @@ class AkuCupertinoButton extends CupertinoButton {
this.radius = 0,
this.minHeight = 0,
this.nullColor,
this.minWidth,
}) : super(
key: key,
child: child,
child: Container(
alignment: Alignment.center,
constraints: BoxConstraints(minWidth: minWidth),
child: child,
),
color: color,
onPressed: onPressed,
padding: padding,

@ -44,5 +44,6 @@ class AkuMaterialButton extends MaterialButton {
),
child: child,
color: color,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
);
}