fx_image_button

Using

import 'package:fx_image_button/fx_image_button.dart';

enum ImageTextAlignment {
  imageTopTextBottom, //图在上文字在下
  imageBottomTextTop, //图在下文字在上
  imageLeftTextRight, //图在左文字在右
  imageRightTextLeft, //图在右文字在左
}

// image and text
FXImageButton.image(
  onPressed: () {
    print("点击");
  }, 
  image: Image.network('src'), 
  title: Text("搜索"),
  imageTextAlignment: ImageTextAlignment.imageBottomTextTop
)

// icon and text
FXImageButton.icon(
  onPressed: () {
  print("点击");
  },
  icon: Icon(Icons.search), 
  title: Text("搜索"), 
  imageTextAlignment: ImageTextAlignment.imageLeftTextRight
)

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Libraries

fx_image_button