diff --git a/lib/common_widgets/aku_button.dart b/lib/common_widgets/aku_button.dart index 7b7fe34..782d58c 100644 --- a/lib/common_widgets/aku_button.dart +++ b/lib/common_widgets/aku_button.dart @@ -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 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 with PlatformMixin { height: widget.height, padding: widget.padding, color: widget.color, + minWidth: widget.width, ); } } diff --git a/lib/common_widgets/aku_cupertino_button.dart b/lib/common_widgets/aku_cupertino_button.dart index 27b2205..c038706 100644 --- a/lib/common_widgets/aku_cupertino_button.dart +++ b/lib/common_widgets/aku_cupertino_button.dart @@ -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, diff --git a/lib/common_widgets/aku_material_button.dart b/lib/common_widgets/aku_material_button.dart index 43deaae..6e36667 100644 --- a/lib/common_widgets/aku_material_button.dart +++ b/lib/common_widgets/aku_material_button.dart @@ -44,5 +44,6 @@ class AkuMaterialButton extends MaterialButton { ), child: child, color: color, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, ); }