Skip to content

Commit

Permalink
Initialize plugins the dart way
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp committed Jan 9, 2024
1 parent 4361a8e commit 082c475
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/background/main_background.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:ui';

import 'package:cobble/background/modules/apps_background.dart';
import 'package:cobble/background/modules/notifications_background.dart';
Expand All @@ -14,16 +15,12 @@ import 'package:cobble/util/container_extensions.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:shared_preferences_android/shared_preferences_android.dart';
import 'package:shared_preferences_ios/shared_preferences_ios.dart';

import 'actions/master_action_handler.dart';
import 'modules/calendar_background.dart';

void main_background() {
// https://github.com/flutter/flutter/issues/98473#issuecomment-1041895729
if (Platform.isAndroid) SharedPreferencesAndroid.registerWith();
if (Platform.isIOS) SharedPreferencesIOS.registerWith();
DartPluginRegistrant.ensureInitialized();
WidgetsFlutterBinding.ensureInitialized();

BackgroundReceiver();
Expand Down

0 comments on commit 082c475

Please sign in to comment.