Giter Site home page Giter Site logo

zhaolin2633 / jhtoast Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iotjin/jhtoast

0.0 1.0 0.0 86 KB

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

License: BSD 2-Clause "Simplified" License

Kotlin 2.61% Swift 2.57% Objective-C 0.24% Dart 94.59%

jhtoast's Introduction

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: ^0.5.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();
          });
        }

jhtoast's People

Contributors

iotjin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.