Fluttertoast.showToast-土司内部的文本居中位置

问题描述 投票:0回答:1

我正在使用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

flutter toast
1个回答
0
投票

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

Fluttertoast.showToast(msg: 'text',
          toastLength: Toast.LENGTH_LONG,
          gravity: ToastGravity.CENTER,
          timeInSecForIos: 3,
          backgroundColor: Colors.orange,
          textColor: Colors.black,
          webPosition: "center"
      );
© www.soinside.com 2019 - 2024. All rights reserved.