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.
ansu_ui/lib/buttons/as_material_button.dart

44 lines
1015 B

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/extension/num_extension.dart';
class ASMaterialButton extends StatelessWidget {
final VoidCallback onPressed;
final double height;
final Widget icon;
final double radius;
final Widget child;
const ASMaterialButton(
{Key key,
this.onPressed,
this.height,
this.icon,
this.child,
this.radius})
: super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: onPressed,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: 0.edge,
minWidth: 0,
height: height ?? 46.w,
child: icon == null
? child
: Row(
children: [
child,
4.wb,
icon,
],
),
shape: RoundedRectangleBorder(
borderRadius: radius.radius,
),
);
}
}