CaypoH23
CaypoH23

Reputation: 65

How to automatically restore focus to the previously focused TextField when bringing application from background to foreground in Flutter

Currently, when I focus on the input (keyboard is activated) and send my app to the background and then bring it back to the foreground, the focus becomes unfocused (keyboard is deactivated).

I've tried something like:

if (state == AppLifecycleState.resumed) { focusNode.requestFocus(); }

However, it focuses every time I reopen the app not when it was previously focused.

Upvotes: 1

Views: 142

Answers (0)

Related Questions