image_button

image button utilities.

Image button needs two asset image: one is normal(neccesary) , one is hover(not neccesary).

Normal image is for normal displaying, hover image is shown when mouse hover the button area.

When taping the button, shrink animation plays.


e.g. demo app


use independent image

WidgetImageButton(
  imageNormal:
      WidgetAssetImage(assetPath: 'assets/images/icon_normal.png'),
  imageHover:
      WidgetAssetImage(assetPath: 'assets/images/icon_hover.png'),
  onTap: () {
    print('independent icon image button');
  },
),

crop image from one whole image

WidgetImageButton(
  imageNormal: WidgetAssetImage(
      assetPath: 'assets/images/icons.png',
      cropRect: Rect.fromLTWH(58, 165, 95, 95)),
  imageHover: WidgetAssetImage(
      assetPath: 'assets/images/icons.png',
      cropRect: Rect.fromLTWH(170, 164, 95, 95)),
  onTap: () {
    print('image button icon crop from one image');
  },
)

resource:

resourceimage
icon hovericon hover
icon normalicon normal
one whole imageone whole image
backgroundbackground

Libraries

asset_button
image_loader
widget_asset_image