From 082c475884d3f365d81547cc66570c1630d9d710 Mon Sep 17 00:00:00 2001 From: Jacob Michalskie Date: Tue, 9 Jan 2024 16:38:44 +0100 Subject: [PATCH] Initialize plugins the dart way --- lib/background/main_background.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/background/main_background.dart b/lib/background/main_background.dart index eb990617..6bac550d 100644 --- a/lib/background/main_background.dart +++ b/lib/background/main_background.dart @@ -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'; @@ -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();