assetsImageButton static method

Widget assetsImageButton(
  1. String name, {
  2. double? width,
  3. double? height,
  4. VoidCallback? onPressed,
  5. 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));
}