JCImageButton constructor

JCImageButton({
  1. Color bgColor = Colors.blue,
  2. double cornerRadius = 2,
  3. String imageAssets = "",
  4. double imageSize = 16,
  5. String titleString = "",
  6. Color titleColor = Colors.white,
  7. double titleSize = 16,
  8. FontWeight fontweight = FontWeight.w400,
  9. double interval = 8,
  10. EdgeInsetsGeometry? padding,
  11. JCImagePossition possiton = JCImagePossition.left,
  12. VoidCallback? callBack,
})

Implementation

JCImageButton(
    {
    // 背景颜色  圆角
    this.bgColor = Colors.blue,
    this.cornerRadius = 2,

    // 图片路劲  大小
    this.imageAssets = "",
    this.imageSize = 16,

    // 字体
    this.titleString = "",
    this.titleColor = Colors.white,
    this.titleSize = 16,
    this.fontweight = FontWeight.w400,

    // 文字和图片间隔、 padding
    this.interval = 8,
    EdgeInsetsGeometry? padding,

    // 位置 回调
    this.possiton = JCImagePossition.left,
    VoidCallback? callBack, // 回调

    }) {
    this.padding = padding ?? EdgeInsets.fromLTRB(72, 8, 72, 8);
    this.callBack = callBack ??
      () {
        print("默认回调");
    };
}