I want to set the keyboard to be always opened in the chat page and should not be dismissable by the back button.
The WillPopScope() widget is only preventing the back button from navigating back to the previous page however is still dismissing the keyboard. I am getting the keyboard opened initially via by setting autofocus = true in the textformfield so the only issue I am facing is on preventing the dismissal of the keyboard.
I have looked upon multiple questions in Stack however could not find a suitable solution to this issue. I have been searching for the answer for over 2 months now and hope someone is able to assist me with this issue.
UPDATE:
I did the following change to my heightofdevice where I subtracted the MediaQuery.of(context).viewInsets.bottom and now the transition of the keyboard is better.
I realised the previous method of me trying to fix the keyboard and preventing it from being dismissed had too many fixes to be done on a native level using Java or Kotlin for Android. I initially wanted to fix the keyboard as the transition was poor but with the following method, the transition is better now but there are still room for improvement.
var heightStatusBar = MediaQuery.of(context).padding.top;
var bottom = MediaQuery.of(context).viewInsets.bottom;
widthofdevice = MediaQuery.of(context).size.width;
heightofdevice =(MediaQuery.of(context).size.height) -
heightStatusBar - bottom;