import 'package:flutter/cupertino.dart'; Future< bool > showYesNoDialog( BuildContext context, { String close = 'Close', String accept = 'Accept', String title = '', String message = '', VoidCallback? actionClose, VoidCallback? actionOk, }) async { final result = await showCupertinoDialog< bool >( context: context, builder: ( BuildContext context, ) { return CupertinoAlertDialog( title: Text( title, ), content: Text( message, ), actions: [ CupertinoDialogAction( isDefaultAction: true, onPressed: () => Navigator.pop( context, false, ), child: Text( close, ), ), CupertinoDialogAction( isDestructiveAction: true, onPressed: () => Navigator.pop( context, true, ), child: Text( accept, ), ), ], ); }, ); return result ?? false; // false if dismissed }