diff --git a/lib/controllers/controller_ready_mixin.dart b/lib/controllers/controller_ready_mixin.dart deleted file mode 100644 index 55a45ad..0000000 --- a/lib/controllers/controller_ready_mixin.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'dart:async'; -import 'package:get/get.dart'; - -mixin ReadyMixin on GetxController { - final isControllerReady = false.obs; - FutureOr initController(); - FutureOr controllerReady() {} - - @override - void onInit() async { - await initController(); - super.onInit(); - } - - @override - void onReady() async { - await controllerReady(); - super.onReady(); - isControllerReady.value = true; - } -} diff --git a/lib/controllers/controllers.dart b/lib/controllers/controllers.dart index c02f843..24dcc93 100644 --- a/lib/controllers/controllers.dart +++ b/lib/controllers/controllers.dart @@ -4,4 +4,3 @@ export 'network_controller.dart'; export 'reward_controller.dart'; export 'settings_controller.dart'; export 'notifications_controller.dart'; -export 'controller_ready_mixin.dart'; diff --git a/lib/controllers/settings_controller.dart b/lib/controllers/settings_controller.dart index 56aa7ed..3534fea 100644 --- a/lib/controllers/settings_controller.dart +++ b/lib/controllers/settings_controller.dart @@ -31,22 +31,25 @@ class SettingsController extends GetxController with StateMixin { Future performLocalAuthentication(String reason) async { bool authenticated = false; - try { - authenticated = await localAuthentication.authenticate( - localizedReason: reason, - options: const AuthenticationOptions( - stickyAuth: true, - sensitiveTransaction: true, - ), - ); - } on PlatformException catch (e) { - authenticated = false; - debugPrint(e.toString()); - } catch (e) { - debugPrint(e.toString()); - } + if (Platform.isIOS || Platform.isAndroid) { + try { + authenticated = await localAuthentication.authenticate( + localizedReason: reason, + options: const AuthenticationOptions( + stickyAuth: true, + sensitiveTransaction: true, + ), + ); + } on PlatformException catch (e) { + authenticated = false; + debugPrint(e.toString()); + } catch (e) { + debugPrint(e.toString()); + } - return authenticated; + return authenticated; + } + return true; } Future deviceSupportsLocalAuth() async {