warnLogOff method

Future<bool> warnLogOff(
  1. BuildContext context
)

Implementation

Future<bool> warnLogOff(BuildContext context) async {
  var rval = await showDialog<bool>(
      context: context,
      builder: (c) => AlertDialog(
            title: Text('Attenzione', textAlign: TextAlign.center, style: TextStyle(color: Colors.yellow)),
            content: Text('Sei sicuro di volerti disconnettere?'),
            actions: [
              TextButton(style: TextButton.styleFrom(foregroundColor: Colors.green), onPressed: () => Navigator.pop(c, true), child: Text('Si')),
              TextButton(style: TextButton.styleFrom(foregroundColor: Colors.red), onPressed: () => Navigator.pop(c, false), child: Text('No')),
            ],
          ));
  return rval ?? false;
}