showToast static method

void showToast(
  1. String msg, {
  2. FToast toast = FToast.lengthShort,
  3. FToastGravity gravity = FToastGravity.bottom,
  4. Color? bgColor,
  5. Color? textColor,
  6. double? fontSize,
})

显示的Toast msg 显示的内容 toast 显示的时间 gravity 显示的位置 bgColor 背景色 textColor Text颜色 fontSize 字体大小

Implementation

static void showToast(
  String msg, {
  FToast toast = FToast.lengthShort,
  FToastGravity gravity = FToastGravity.bottom,
  Color? bgColor,
  Color? textColor,
  double? fontSize,
}) {
  Fluttertoast.showToast(
    msg: msg,
    toastLength: _getToastLength(toast),
    gravity: _getToastGravity(gravity),
    backgroundColor: bgColor ?? toastBgColor,
    textColor: textColor ?? toastTextColor,
    fontSize: fontSize ?? toastFontSize,
  );
}