[Flutter] 플러터 GetX 포그라운드, 백그라운드 체크


[Flutter] 플러터 GetX 포그라운드, 백그라운드 체크

라이프사이클 포그라운드 -> 백그라운드 - inactive -> pause 백그라운드 -> 포그라운드 - resumed Back 키를 통한 앱 종료 - inactive -> pause -> detached 플러터 수정 controller.dart GetX에서는 "controller"에서 "WidgetsBindingObserver" 상속시켜준다. GetX가 아닌 경우에는 "UI"단에서 "Statefulwidget" 상태에서 진행해주면 된다. class TestController extends GetxController with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: Logger().d("app in resumed"); break; case AppLifecycleState....


#background #flutter #foreground #ground #백그라운드 #포그라운드 #포어그라운드 #플러터

원문링크 : [Flutter] 플러터 GetX 포그라운드, 백그라운드 체크