Skip to content

Commit

Permalink
Disable background task; correct roadmap
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
holybiber committed Jul 12, 2024
1 parent 4df7e96 commit e442dd2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 2 additions & 3 deletions lib/background/background_scheduler.dart
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,6 +17,7 @@ class BackgroundScheduler extends Notifier<bool> {
///
/// Make sure TestBackgroundScheduler.schedule() has the same logic
Future<void> 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();
Expand All @@ -32,6 +30,7 @@ class BackgroundScheduler extends Notifier<bool> {
initialDelay: interval ~/ 2);
debugPrint('Succesfully scheduled the background task: $interval');
state = true;
*/
}
}

Expand Down
6 changes: 2 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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),
Expand Down

0 comments on commit e442dd2

Please sign in to comment.