Flutter封装一个通用的轻提示Toast

54次阅读
没有评论

fluttertoast | Flutter package

import 'package:fluttertoast/fluttertoast.dart';

class CommonToast {
  static showToast(String msg) {
    Fluttertoast.showToast(
      msg: msg,
      gravity: ToastGravity.CENTER,
    );
  }
}

使用:

CommonToast.showToast('用户名或密码不能为空!');

正文完
 0
wujingquan
版权声明:本站原创文章,由 wujingquan 于2025-05-03发表,共计221字。
转载说明:Unless otherwise specified, all articles are published by cc-4.0 protocol. Please indicate the source of reprint.
评论(没有评论)