jhtoast 1.2.0 copy "jhtoast: ^1.2.0" to clipboard
jhtoast: ^1.2.0 copied to clipboard

jhtoast - Flutter toast package. supported effects: text, imagetext, loading, horizontal and vertical layout. Supports iOS and Android.

jhtoast pub package #


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


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




使用 #

  1. Add this to your package's pubspec.yaml file:
dependencies:
  jhtoast: ^1.1.0

  1. Install it
flutter pub get

  1. Import it
import 'package:jhtoast/jhtoast.dart';

Examples #

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

  • 样式2 - 成功
  JhToast.showSuccess(context, msg: "加载成功");
  • 样式3 - 失败
 JhToast.showError(context, msg: "上传失败。请重新上传数据");
  • 样式4 - 警告
 JhToast.showInfo(context, msg: "注意!注意!注意!");
  • 样式5 - 加载中
    var hide =  JhToast.showLoadingText(context,
          msg:"正在加载中..."
      );
      Future.delayed(Duration(seconds: 2),(){
        hide();
      });

  • 样式6 - 水平加载中
    var hide =  JhToast.showHorizontalLoadingText(context,
          msg:"正在加载中..."
      );
      Future.delayed(Duration(seconds: 2),(){
        hide();
      });
          
  • 样式7 - 自定义图文

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

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

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

3
likes
130
pub points
77%
popularity

Publisher

unverified uploader

jhtoast - Flutter toast package. supported effects: text, imagetext, loading, horizontal and vertical layout. Supports iOS and Android.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

back_button_interceptor, flutter

More

Packages that depend on jhtoast