showBackupDialog method

dynamic showBackupDialog(
  1. BuildContext context
)

Implementation

showBackupDialog(BuildContext context) {
  SizeConfig().init(context);
  showDialog(
      context: context,
      builder: (BuildContext ctxt) {
        return AlertDialog(
          title: Center(
            child: Text(
              Strings.backUpKeysTitle,
              style: TextStyle(fontWeight: FontWeight.bold),
            ),
          ),
          content: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Text(
                Strings.backUpKeysDescription,
                textAlign: TextAlign.center,
              ),
              SizedBox(height: 20.toHeight),
              Row(
                children: [
                  TextButton(
                      child: Text(Strings.backButtonTitle,
                          style: TextStyle(fontWeight: FontWeight.bold)),
                      onPressed: () async {
                        var result = await _onBackup(context);
                        Navigator.pop(ctxt);
                        if (result == false) {
                          _showAlertDialog(context);
                        }
                      }),
                  Spacer(),
                  TextButton(
                      child:
                          Text(Strings.cancelButtonTitle, style: TextStyle()),
                      onPressed: () {
                        Navigator.pop(context);
                      })
                ],
              )
            ],
          ),
        );
      });
}