diff --git a/example/lib/screens/login_screen.dart b/example/lib/screens/login_screen.dart index 2f9fd2ad..242df9e8 100644 --- a/example/lib/screens/login_screen.dart +++ b/example/lib/screens/login_screen.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:onegini/callbacks/onegini_custom_registration_callback.dart'; import 'package:onegini/callbacks/onegini_registration_callback.dart'; import 'package:onegini/events/onewelcome_events.dart'; import 'package:onegini/model/request_details.dart'; @@ -110,14 +111,14 @@ class _LoginScreenState extends State { cancelRegistration() async { setState(() => isLoading = false); - - await OneginiRegistrationCallback() - .cancelBrowserRegistration() - .catchError((error) { - if (error is PlatformException) { - showFlutterToast(error.message); - } - }); + try { + await Future.any([ + OneginiRegistrationCallback().cancelBrowserRegistration(), + OneginiCustomRegistrationCallback().submitErrorAction('Canceled') + ]); + } on PlatformException catch (error) { + showFlutterToast(error.message); + } } Future> getUserProfiles() async { diff --git a/example/lib/screens/user_screen.dart b/example/lib/screens/user_screen.dart index c5ce6dfd..a38aa3c6 100644 --- a/example/lib/screens/user_screen.dart +++ b/example/lib/screens/user_screen.dart @@ -84,7 +84,7 @@ class _UserScreenState extends State with RouteAware { _biometricAuthenticator = biometricAuthenticator; }); } on PlatformException catch (err) { - if (err.code != "8043") { + if (err.code != "8060") { showFlutterToast(err.message); } }