| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- APP
- mfc
- subpixel
- digitalRead
- Pointer
- Class
- Binary
- Encapusulation
- Read
- wpf
- c++
- Unity
- aduino
- file access
- Gaussian
- stream
- flutter
- memory
- Gradient
- atmega328
- UNO
- Android
- public
- Contour
- SERIAL
- Filtering
- parameter
- edge
- compare
- sensor
Archives
- Today
- Total
폴크(FOLC)
Flutter App 종료 확인 메시지 본문
728x90
반응형
# 생성 페이지에 옵션 추가
# WillPopScope 함수 이용
> 기본 생성 방식
@override
Widget build(BuildContext context)
{
return Scaffold(appBar: AppBar(), body: XXXFunction());
}
> 옵션 생성 방식 ( 종료 확인 메시지 표시 )
@override
Widget build(BuildContext context)
{
return WillPopScope(
child: Scaffold(appBar: AppBar(), body: XXXFunction()),
onWillPop: _onWillPop);
}
Future<bool> _onWillPop()
{
return showDialog(context:context,
builder: (context) => AlertDialog(title: Text("Do you want exit?"),
actions: <Widget>[
FlatButton( child: Text("Yes"), onPressed: () => Navigator.pop(context, true), ),
FlatButton( child: Text("No!"), onPressed: () => Navigator.pop(context, false), ),
])) ?? false;
}
728x90
반응형
사업자 정보 표시
사업자 등록번호 : -- | TEL : --
'Flutter, Android > Flutter 사용법' 카테고리의 다른 글
| Flutter App - Webview (0) | 2021.07.13 |
|---|---|
| Flutter App - Gradle 이란? (0) | 2021.07.13 |
| Flutter App 페이지 관련 (0) | 2021.07.10 |
| Flutter App - first work (0) | 2021.07.09 |
| Flutter 샘플 프로젝트 실행 테스트 (0) | 2021.06.23 |