You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

56 lines
1.5 KiB

4 years ago
import 'package:aku_ui/common_widgets/aku_cupertino_button.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:aku_ui/mixins/aku_mixins.dart';
import 'package:flutter/material.dart';
///按钮
class AkuButton extends StatefulWidget {
@required
final Widget child;
final double height;
final double radius;
final EdgeInsets padding;
@required
final VoidCallback onPressed;
4 years ago
final Color color;
4 years ago
final double width;
4 years ago
AkuButton({
Key key,
this.child,
this.height = 0,
this.radius = 0,
this.onPressed,
this.padding = EdgeInsets.zero,
4 years ago
this.color = Colors.transparent,
4 years ago
this.width = 0,
4 years ago
}) : super(key: key);
@override
_AkuButtonState createState() => _AkuButtonState();
}
class _AkuButtonState extends State<AkuButton> with PlatformMixin {
@override
Widget build(BuildContext context) {
return isIOS
? AkuCupertinoButton(
onPressed: widget.onPressed,
child: widget.child,
radius: widget.radius,
minHeight: widget.height,
padding: widget.padding,
4 years ago
color: widget.color,
4 years ago
minWidth: widget.width,
4 years ago
)
: AkuMaterialButton(
onPressed: widget.onPressed,
child: widget.child,
radius: widget.radius,
height: widget.height,
padding: widget.padding,
4 years ago
color: widget.color,
4 years ago
minWidth: widget.width,
4 years ago
);
}
}