From e442dd2f5c7f7e3caa76baa719da436d790646b7 Mon Sep 17 00:00:00 2001 From: holybiber Date: Fri, 12 Jul 2024 16:58:38 +0200 Subject: [PATCH] Disable background task; correct roadmap Most of the functionality of automatically checking for updates in the background is already implemented. However the backend is not ready yet and not delivering updates currently. Disabling the background task functionality and correcting the roadmap: Moving this feature to version 0.9. --- README.md | 4 ++-- lib/background/background_scheduler.dart | 5 ++--- lib/main.dart | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3bf30a5..f80d069 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ By contributing you release your contributed code under the licensing terms expl ## Roadmap * **0.7**: Go to Google Play Store -* **0.8**: Implement automatic updates -* **0.9**: Provide PDF files as well for all worksheets +* **0.8**: Provide PDF files as well for all worksheets +* **0.9**: Enable automatic updates (half-way implemented already but currently not operational - waiting for backend development to catch up) * **1.0**: We're solid now and excited about the future We plan to release an iOS version sometime in 2024. \ No newline at end of file diff --git a/lib/background/background_scheduler.dart b/lib/background/background_scheduler.dart index 989edfa..30cce26 100644 --- a/lib/background/background_scheduler.dart +++ b/lib/background/background_scheduler.dart @@ -1,7 +1,4 @@ -import 'package:app4training/data/updates.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:workmanager/workmanager.dart'; /// The state indicates whether our background task is scheduled or not. /// The schedule() method gets called @@ -20,6 +17,7 @@ class BackgroundScheduler extends Notifier { /// /// Make sure TestBackgroundScheduler.schedule() has the same logic Future schedule() async { + /* TODO Enable this with version 0.9 debugPrint('Cancelling all currently scheduled background tasks'); await Workmanager().cancelByUniqueName('backgroundTask'); Duration? interval = ref.read(checkFrequencyProvider).getDuration(); @@ -32,6 +30,7 @@ class BackgroundScheduler extends Notifier { initialDelay: interval ~/ 2); debugPrint('Succesfully scheduled the background task: $interval'); state = true; + */ } } diff --git a/lib/main.dart b/lib/main.dart index f406c7f..08cc46a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,10 +1,8 @@ -import 'package:app4training/background/background_task.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:app4training/routes/routes.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:workmanager/workmanager.dart'; import 'data/app_language.dart'; import 'data/globals.dart'; import 'design/theme.dart'; @@ -15,8 +13,8 @@ void main() async { final prefs = await SharedPreferences.getInstance(); final packageInfo = await PackageInfo.fromPlatform(); - // Run initialization for our background task - await Workmanager().initialize(backgroundTask, isInDebugMode: false); + // Run initialization for our background task TODO enable in version 0.9 + // await Workmanager().initialize(backgroundTask, isInDebugMode: false); runApp(ProviderScope(overrides: [ sharedPrefsProvider.overrideWithValue(prefs),