assetsImageButton static method
Widget
assetsImageButton(
- String name, {
- double? width,
- double? height,
- VoidCallback? onPressed,
- BoxFit? fit,
Implementation
static Widget assetsImageButton(
String name, {
double? width,
double? height,
VoidCallback? onPressed,
BoxFit? fit,
}) {
return ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
minimumSize: Size.zero,
padding: EdgeInsets.zero,
primary: Colors.transparent,
onPrimary: Colors.transparent,
onSurface: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
elevation: 0.0,
),
// style: ButtonStyle(
// maximumSize: MaterialStateProperty.all(const Size(double.infinity, double.infinity)),
// minimumSize: MaterialStateProperty.all(const Size(0, 0)),
// backgroundColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
// overlayColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
// elevation: ButtonStyleButton.allOrNull<double>(0),
// ),
child: ImageView.assetImage(name, width: width, height: height, fit: fit));
}