Fluttertoast.showToast-如何在烤面包中居中显示文本

时间:2020-04-27 11:41:43

标签: flutter toast

我正在使用Fluttertoast.showToast快速显示警告:

Fluttertoast.showToast(msg: 'text',
          toastLength: Toast.LENGTH_LONG,
          gravity: ToastGravity.CENTER,
          timeInSecForIos: 3,
          backgroundColor: Colors.orange,
          textColor: Colors.black,
      );

文本不会出现在框内居中。 有小费吗? enter image description here

1 个答案:

答案 0 :(得分:0)

您可以尝试使用以下参数:webPosition: "center"

Fluttertoast.showToast(msg: 'text',
          toastLength: Toast.LENGTH_LONG,
          gravity: ToastGravity.CENTER,
          timeInSecForIos: 3,
          backgroundColor: Colors.orange,
          textColor: Colors.black,
          webPosition: "center"
      );