YButton function
Widget
YButton({
- required Widget child,
- double? width,
- double? height,
- Color? color,
- Decoration? decoration,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- required dynamic onTap(),
- bool enable = true,
- bool isInk = false,
- int? tapTime,
- BorderRadius borderRadius = BorderRadius.zero,
按钮
Implementation
Widget YButton({required Widget child, double? width, double? height, Color? color, Decoration? decoration, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, required Function() onTap, bool enable = true, bool isInk = false, int? tapTime, BorderRadius borderRadius = BorderRadius.zero}) {
return Container(
width: width,
height: height,
margin: margin,
child: ClipRRect(
borderRadius: borderRadius,
child: Container(
color: decoration == null ? color : null,
decoration: decoration,
child: isInk
? YInkButton(
Padding(padding: padding ?? EdgeInsets.zero, child: child),
onTap: onTap,
enable: enable,
tapTime: tapTime,
)
: _YFlatButton(
Padding(padding: padding ?? EdgeInsets.zero, child: child),
onClick: onTap,
enable: enable,
tapTime: tapTime,
),
),
),
);
}