imageButton static method
Widget
imageButton({
- double width = 44,
- double height = 44,
- int tag = 0,
- required ImageProvider<
Object> normalImage, - ImageProvider<
Object> ? selectedImage, - bool? isSelected,
- dynamic onTap()?,
图片按钮(是否选中)
Implementation
static Widget imageButton({
double width = 44,
double height = 44,
int tag = 0,
required ImageProvider normalImage,
ImageProvider? selectedImage,
bool? isSelected,
Function()? onTap
}){
return JJCheckBox(
width: width,
height: height,
tag: tag,
tapSplashColor: Colors.transparent,
isSelected: isSelected ?? false,
cellDecoration: BoxDecoration(
image: DecorationImage(
image: normalImage,
fit: BoxFit.scaleDown
)),
cellSelectedDecoration: selectedImage != null ? BoxDecoration(
image: DecorationImage(
image: selectedImage,
fit: BoxFit.cover
)) : null,
onTap: onTap,
);
}