Sendkeys is failing for password text field while testing a sample flutter app i made.I'm getting error response status:12 Invalid Element state

Error message-Error response status: 12, InvalidElementState - An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element). Selenium error: Cannot set the element to ‘new’. Did you interact with the correct element?
I’m getting this error when i try to send keys to password text field in my flutter app.

sometimes apps preventing send/set text for secured fields. try use instead tap on input and send text with appeared keyboard (= reproducing 100% actual user behaviour).

I have tried that but whatever i type does not get entered into the login and password field.

If you are using android, You can also use adb command - “adb shell input text ABCD”