webViewBackpress method

Future<bool> webViewBackpress()

Implementation

Future<bool> webViewBackpress() {
  flutterWebviewPlugin.hide();
  return showDialog(
    context: context,
    barrierDismissible: false,
    builder: (context) => new AlertDialog(
      title: new Text(
        'Confirm Cancellation',
        style: TextStyle(
          fontFamily: 'OpenSans',
        ),
      ),
      content: new Text(
        'Are you sure you want to cancel the verification process?',
        style: TextStyle(
          fontFamily: 'OpenSans',
        ),
      ),
      actions: <Widget>[
        Padding(
          padding: const EdgeInsets.all(8.0),
          child: new GestureDetector(
            onTap: () => {
              flutterWebviewPlugin.show(),
              Navigator.of(context).pop(false)
            },
            child: Text(
              "Not Now",
              style: TextStyle(
                fontSize: 13.w,
                color: Color(0xff2b6ad8),
                fontFamily: 'OpenSans',
              ),
            ),
          ),
        ),
        SizedBox(height: 16),
        Padding(
          padding: const EdgeInsets.all(8.0),
          child: new GestureDetector(
            onTap: () => {
              isCheck = false,
              verificationTypeList = [],
              indexTempList = [],
              supportedTypes_list = [],
              Navigator.pushAndRemoveUntil(
                  context,
                  MaterialPageRoute(builder: (context) => userHome),
                  (route) => false),
              flutterWebviewPlugin.dispose(),
              widget.callback(verificatonCancel),
            },
            child: Text(
              "Confirm",
              style: TextStyle(
                fontSize: 13.w,
                color: Color(0xff2b6ad8),
                fontFamily: 'OpenSans',
              ),
            ),
          ),
        ),
      ],
    ),
  ).then((value) => value ?? false);
}