jhtoast

Last updated:

0 purchases

jhtoast Image
jhtoast Images
Add to Cart

Description:

jhtoast

jhtoast #

jhtoast - Flutter toast package. 支持的效果:文字,图文,加载中,水平垂直两种布局

pub地址:https://pub.flutter-io.cn/packages/jhtoast






使用 #

Add this to your package's pubspec.yaml file:

dependencies:
jhtoast: ^1.1.0

copied to clipboard

Install it

flutter pub get

copied to clipboard

Import it

import 'package:jhtoast/jhtoast.dart';

copied to clipboard
Examples #

样式1 - 文字

JhToast.showText(context, msg: "这是一条提示文字信息",
// closeTime: 10
);

copied to clipboard

样式2 - 成功

JhToast.showSuccess(context, msg: "加载成功");
copied to clipboard

样式3 - 失败

JhToast.showError(context, msg: "上传失败。请重新上传数据");
copied to clipboard

样式4 - 警告

JhToast.showInfo(context, msg: "注意!注意!注意!");
copied to clipboard

样式5 - 加载中

var hide = JhToast.showLoadingText(context,
msg:"正在加载中..."
);
Future.delayed(Duration(seconds: 2),(){
hide();
});

copied to clipboard

样式6 - 水平加载中

var hide = JhToast.showHorizontalLoadingText(context,
msg:"正在加载中..."
);
Future.delayed(Duration(seconds: 2),(){
hide();
});

copied to clipboard

样式7 - 自定义图文


Widget img = Image.asset("assets/images/toast_error.png");
JhToast.showImageText(context,
msg: "自定义图文",
image: img);


copied to clipboard

样式8 - 水平自定义图文

Widget img = Image.asset("assets/images/toast_success.png");
JhToast.showHorizontalImageText(context,
msg: "水平自定义图文",
image: img);

copied to clipboard

样式9 - iOS样式加载中

var hide = JhToast.showIOSLoadingText(context,
msg:"正在加载中...",
);
Future.delayed(Duration(seconds: 2),(){
hide();
});
}

copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.