fluttertoast 弹出toast吐司

fluttertoast官方package

如何使用:

  1. 添加依赖库:
    fluttertoast: ^2.1.1
  2. 导入:
    import 'package:fluttertoast/fluttertoast.dart';
  3. 示例:
Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIos: 1,
        bgcolor: "#e74c3c",
        textcolor: '#ffffff'
    );
  Fluttertoast.showToast(
      msg: "网络连接错误",
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      timeInSecForIos: 1,
      bgcolor: "#9E9E9E",
      textcolor: '#ffffff');
}

你可能感兴趣的:(fluttertoast 弹出toast吐司)