master
小赖 4 years ago
parent a225184921
commit 2b1ac75fc1

@ -12,6 +12,7 @@ class AkuButton extends StatefulWidget {
final EdgeInsets padding;
@required
final VoidCallback onPressed;
final Color color;
AkuButton({
Key key,
this.child,
@ -19,6 +20,7 @@ class AkuButton extends StatefulWidget {
this.radius = 0,
this.onPressed,
this.padding = EdgeInsets.zero,
this.color = Colors.transparent,
}) : super(key: key);
@override
@ -35,6 +37,7 @@ class _AkuButtonState extends State<AkuButton> with PlatformMixin {
radius: widget.radius,
minHeight: widget.height,
padding: widget.padding,
color: widget.color,
)
: AkuMaterialButton(
onPressed: widget.onPressed,
@ -42,6 +45,7 @@ class _AkuButtonState extends State<AkuButton> with PlatformMixin {
radius: widget.radius,
height: widget.height,
padding: widget.padding,
color: widget.color,
);
}
}

@ -11,6 +11,7 @@ class AkuMaterialButton extends MaterialButton {
final double minWidth;
final double radius;
final EdgeInsets padding;
final Color color;
final Widget child;
AkuMaterialButton({
@ -26,6 +27,7 @@ class AkuMaterialButton extends MaterialButton {
this.radius = 0,
this.padding = EdgeInsets.zero,
@required this.child,
this.color = Colors.transparent,
}) : super(
key: key,
onPressed: onPressed,
@ -41,5 +43,6 @@ class AkuMaterialButton extends MaterialButton {
borderRadius: BorderRadius.circular(radius),
),
child: child,
color: color,
);
}

@ -7,12 +7,14 @@ class AkuRoundButton extends AkuButton {
final VoidCallback onPressed;
final Widget child;
final EdgeInsets padding;
final Color color;
AkuRoundButton({
Key key,
this.height,
@required this.child,
@required this.onPressed,
this.padding = EdgeInsets.zero,
this.color = Colors.transparent,
}) : super(
key: key,
height: height,
@ -20,5 +22,6 @@ class AkuRoundButton extends AkuButton {
onPressed: onPressed,
child: child,
padding: padding,
color: color,
);
}