Catch wakelock exception on desktop

pull/88/head
NaiJi ✨ 2022-04-29 13:45:15 +03:00
parent 125788c3ab
commit 834cddfe13
2 changed files with 9 additions and 9 deletions

View File

@ -301,14 +301,6 @@ class UsersCubit extends AppConfigDependendCubit<UsersState> {
}
}
@override
void onChange(Change<UsersState> change) {
super.onChange(change);
print('UsersState changed');
print(change);
}
@override
void clear() async {
emit(UsersState(<User>[], User(login: 'root'), User(login: 'loading...')));

View File

@ -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();