From 834cddfe13f45716180739197f5df0970149a5b4 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Fri, 29 Apr 2022 13:45:15 +0300 Subject: [PATCH] Catch wakelock exception on desktop --- lib/logic/cubit/users/users_cubit.dart | 8 -------- lib/main.dart | 10 +++++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/logic/cubit/users/users_cubit.dart b/lib/logic/cubit/users/users_cubit.dart index e8774f92..65967a9a 100644 --- a/lib/logic/cubit/users/users_cubit.dart +++ b/lib/logic/cubit/users/users_cubit.dart @@ -301,14 +301,6 @@ class UsersCubit extends AppConfigDependendCubit { } } - @override - void onChange(Change change) { - super.onChange(change); - - print('UsersState changed'); - print(change); - } - @override void clear() async { emit(UsersState([], User(login: 'root'), User(login: 'loading...'))); diff --git a/lib/main.dart b/lib/main.dart index 9a2d0233..db3f3b96 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,15 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); await HiveConfig.init(); await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); - Wakelock.enable(); + + try { + /* Wakelock support for Linux + * desktop is not yet implemented */ + await Wakelock.enable(); + } on PlatformException catch (e) { + print(e); + } + await getItSetup(); await EasyLocalization.ensureInitialized(); tz.initializeTimeZones();