티스토리 뷰

반응형

For IOS

 

SystemNavigator.pop(): Does not work 

 

exit(0): Works, but Apple may suspend your app because its against Apple Human interface guidelines to exit the app programmatically. 

 

--> IOS에서는 apple human interface guidelines 정책에 따라 어플리케이션을 프로그래밍적으로 종료시키는 것을 금지함으로 앱을 강제종료 시킬 수 없습니다. 

 

For Android

SystemNavigator.pop(): Works and is the RECOMMENDED way of exiting the app.

exit(0): Also works but it’s NOT RECOMMENDED as it terminates the Dart VM process immediately and the user may think that the app just got crashed.

 

--> 안드로이드에서는 systemnavigator.pop() 이라는 코드를 사용하여 앱을 종료시킬 수 있습니다. 밑에는 코드예제입니다. 

 

코드 예제:

 

buttonType: CustomButtonType.OK,
    ),
  ).then((val) {
    if (val != null) {
      Future.delayed(Duration(seconds: 1), () async {
        SystemNavigator.pop();
      });
    } else {}
  });
}
반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함