> For the complete documentation index, see [llms.txt](https://triyono.gitbook.io/fluttercheatsheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triyono.gitbook.io/fluttercheatsheet/my-note/willpopscope.md).

# WillPopScope

```dart

...
return WillPopScope(  
  onWillPop: () async {
    return await Get.defaultDialog(
      title: 'Keluar aplikasi',
      content: Text('Anda yakin?'),
      confirm: ElevatedButton(
          onPressed: () {
            Get.back(result: true);
          },
          child: Text('Keluar')),
      cancel: ElevatedButton(
          style: ElevatedButton.styleFrom(
            primary: Colors.grey,
          ),
          onPressed: () {
            Get.back(result: false);
          },
          child: Text('Batal')),
    );
  },
  child:  // your child
```
