在iOS键盘上方的Flutter显示吐司

问题描述

我正在使用Fluttertoast 7.0.4程序包在我的App中显示吐司,但是在IOS上,打开键盘时未显示吐司“它实际上出现在键盘后面”这是我的代码

  Fluttertoast.showToast(
        msg: message,toastLength: Toast.LENGTH_SHORT,gravity: ToastGravity.BottOM,timeInSecForIosWeb: 1,backgroundColor: AppColors.strongOrange,textColor: Colors.white,fontSize: 16.0
);

有什么方法可以改变z-index并使它在颤动中大于键盘的z-index

解决方法

您无法在ios中的键盘上方显示Fluttertoast。

有两种选择:

1。将烤面包的重心更改为中心

   Fluttertoast.showToast(
          msg: message,toastLength: Toast.LENGTH_SHORT,gravity: ToastGravity.CENTER,backgroundColor: Colors.red,textColor: Colors.white,fontSize: 16.0
      );
  1. 在底部显示吐司时隐藏键盘。

           FocusManager.instance.primaryFocus.unfocus();