flutter_Toast

首先引入依赖

fluttertoast: ^2.1.1

packages get

建立Toast.dart文件,写入如下内容

import 'package:fluttertoast/fluttertoast.dart';

class Toast {
  static show(String msg) {
    Fluttertoast.showToast(msg: msg);
  }
}

使用时先导入创建的dart文件,就可以愉快的使用啦!

Toast.show('hello world');

你可能感兴趣的:(flutter_Toast)