0

I am developing an app with Flutter/Dart and GetX. I have a boolean variable named "obscureText". When this variable is true, specific text fields' inputs are all visible. When this variable is false, specific text field's inputs are all obscured. (like '*****'). What I want is that when user exits from app via home button or task mode, app is running on background right? When app enters background mode, i want "obscureText" variable to be false automaticly. How can i achieve that?

1 Answers1

0

You could use WidgetsBindingObserver to detect a change of AppLifecycleState and update your value when the state is paused.

Stefan Galler
  • 781
  • 4
  • 12