1
votes

I'm using fluttertoast 7.0.4 package to show toasts in my App but on IOS that toast isn't showed when the key board is opened "it actually appears behind the keyboard" this is my code

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

is there any way to change the z-index and making it bigger than keyboard's z-index in flutter

1

1 Answers

1
votes

You cannot show Fluttertoast above the keyboard in ios.

There are two options:

1.Change the gravity of toast to center

   Fluttertoast.showToast(
          msg: message,
          toastLength: Toast.LENGTH_SHORT,
          gravity: ToastGravity.CENTER,
          backgroundColor: Colors.red,
          textColor: Colors.white,
          fontSize: 16.0
      );
  1. Hide keyboard when showing toast at the bottom.

           FocusManager.instance.primaryFocus.unfocus();