Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eedfbb9
feat: add connectivity detection service
GabrielSousa02 Jul 14, 2026
dfd3865
feat: schedule background task from check-frequency setting
GabrielSousa02 Jul 14, 2026
121669b
feat: download languages in background per automatic-updates setting
GabrielSousa02 Jul 14, 2026
fc1ab0f
feat: initialize workmanager and wire providers in main
GabrielSousa02 Jul 14, 2026
93ac928
feat: prompt to confirm updates when requireConfirmation is set
GabrielSousa02 Jul 14, 2026
1da387d
docs: document settings-driven background download
GabrielSousa02 Jul 14, 2026
8e4a398
build: automated android build files
GabrielSousa02 Jul 15, 2026
eee0643
refactor(settings): update layout to remove overflow risk
GabrielSousa02 Jul 15, 2026
9a27b5c
refactor(test): mock the update check API call
GabrielSousa02 Jul 16, 2026
c9a9ccb
fix: correct rebase wrong merge
GabrielSousa02 Sep 24, 2026
36ee05c
bump: minor flutter version bumps
GabrielSousa02 Sep 24, 2026
0f49f3e
build: update exclusions from analyzer by flutter itself
GabrielSousa02 Sep 24, 2026
3fb4fdb
style: run dart auto format tool on the repo
GabrielSousa02 Sep 24, 2026
20890dc
bump: upgrade flutter version on `.fvmrc`
GabrielSousa02 Sep 24, 2026
864de4e
test: fix broken `startup_page_test.dart`
GabrielSousa02 Sep 24, 2026
2b1ff1e
build: auto update iOS build files
GabrielSousa02 Sep 30, 2026
1ff5f71
refactor(background): update background_task for iOS environment
GabrielSousa02 Sep 30, 2026
478640b
feat(ios): add background task to ios runner
GabrielSousa02 Sep 30, 2026
3e0a766
docs(background-tasks): describe new function flow for ios
GabrielSousa02 Sep 30, 2026
7078546
test: add new tests for `background_check_frequency`
GabrielSousa02 Sep 30, 2026
5c65cd5
fix(downloader): restore previous language version after interrupted …
GabrielSousa02 Oct 2, 2026
08e5c63
feat(ios): defer background downloads to a BGProcessingTask
GabrielSousa02 Oct 2, 2026
a2632ac
docs(background-tasks): document iOS check/download split
GabrielSousa02 Oct 2, 2026
7ad2bc5
test(integration_test): fix ios broken task name handoff issue
GabrielSousa02 Oct 3, 2026
71e21c8
build: auto generated updates flutter + xcode
GabrielSousa02 Oct 3, 2026
2f09894
bump: bump app version to `0.9.0` on pubspec
GabrielSousa02 Oct 3, 2026
03c953e
build: update build settings for iOS
GabrielSousa02 Oct 6, 2026
2fbd4b1
build: update build version for Android
GabrielSousa02 Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"flutter": "3.41.6"
"flutter": "3.47.2"
}
10 changes: 5 additions & 5 deletions ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The detailed docs live in `docs/`. Read them in this order if you're new:
1. **[docs/content-rendering.md](docs/content-rendering.md)** — HTML rendering, the `sanitize()` workarounds, `flutter_html_table` filter in `main.dart`.
1. **[docs/onboarding-flow.md](docs/onboarding-flow.md)** — the three onboarding pages and their persistence side-effects.
1. **[docs/features.md](docs/features.md)** — pages, widgets, drawer, share menu, language switcher.
1. **[docs/background-tasks.md](docs/background-tasks.md)** — `workmanager` isolate, the result-sync trick, why parts are commented out.
1. **[docs/background-tasks.md](docs/background-tasks.md)** — `workmanager` isolate, the two-phase check/download flow, the settings matrix, and the result-sync trick.
1. **[docs/localization.md](docs/localization.md)** — `.arb` workflow, `context.l10n` extension, in-app language vs. content language.
1. **[docs/testing.md](docs/testing.md)** — unit/widget tests, fixtures, integration test, CI.
1. **[docs/conventions.md](docs/conventions.md)** — coding conventions, lints, do/don't.
Expand All @@ -131,7 +131,7 @@ These are the load-bearing oddities — read these before changing code in their
- **`LanguageDownloader`** (`lib/data/language_downloader.dart`) is the in-house module that downloads + unzips a language's HTML + PDF into a staging directory and swaps it into place atomically. Failed downloads never destroy prior offline content, concurrent `download()` calls are serialized (peak memory bounded by two zips), and a `.staging` leftover from a crashed run is cleaned up on the next attempt. It replaced the third-party `download_assets` package and is wired up in `main.dart` and the background isolate via `languageDownloaderProvider.overrideWithValue(...)`.
- **`flutter_html` error filter.** `main.dart` installs a `FlutterError.onError` shim that swallows four specific assertions thrown by `flutter_html_table` 3.0.0. Read the long docstring there before touching it — the four assertion variants are documented in detail.
- **HTML pre-processing.** `widgets/html_view.dart` calls `sanitize()` to fix bugs in `flutter_html` (e.g. percent table widths, fuzzy translations, stylized subtitles). Some workarounds are also in the HTML generator (`pywikitools`) upstream.
- **Background task is half-disabled.** Big chunks of `BackgroundScheduler.schedule()` and `Workmanager().initialize` in `main.dart` are commented out, gated on a "version 0.9" milestone. Don't delete them — they are the working scaffolding for the next release.
- **Background task is enabled and settings-driven.** `BackgroundScheduler.schedule()` registers a periodic `workmanager` task at the `CheckFrequency` interval (or cancels it when `never`), and `backgroundMain()` runs a two-phase flow: `backgroundCheck` then a settings-gated `backgroundDownload` (see the `AutomaticUpdates` × connectivity matrix in `docs/background-tasks.md`). Scheduling is owned by `BackgroundScheduler`, triggered from startup / onboarding step 3 / the check-frequency setting — `main.dart` only calls `Workmanager().initialize(backgroundTask)`.
- **No package on pub.dev.** `pubspec.yaml` has `publish_to: 'none'`.
- **License is AGPL** with an Apple App Store exception. See `LICENSE` and `COPYING.iOS`.
- **`test` is pinned to ^1.29.0** because 1.30+ needs a newer `test_api` than `flutter_test` allows.
Expand Down Expand Up @@ -170,8 +170,8 @@ ______________________________________________________________________

## 8. Roadmap context (from README)

- **0.9**: enable automatic background updates (scaffolding present but commented out).
- **0.9**: enable automatic background updates — **done**: the periodic task is
scheduled from `CheckFrequency` and downloads per `AutomaticUpdates` (see
`docs/background-tasks.md`).
- **1.0**: solid release.
- iOS planned for 2024.

If you see code with `TODO for version 0.9`, that's why.
5 changes: 5 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
exclude:
- build/**
- android/**
- ios/**
include: package:flutter_lints/flutter.yaml

linter:
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" tools:node="remove" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- connectivity_plus: query WiFi/mobile connection type for onlyOnWifi -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:label="4training.net"
android:name="${applicationName}"
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=false
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
9 changes: 6 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ There is no app-owned backend; all content comes from public GitHub repos and th
- **Background isolate**:
- Spawned by `workmanager`. Runs `backgroundTask()` in `lib/background/background_task.dart`,
builds its own `ProviderContainer`, checks each downloaded language for new GitHub commits,
persists results to `SharedPreferences`.
persists results to `SharedPreferences`, and — depending on the `AutomaticUpdates` setting and
connectivity — downloads the languages that have updates.
The main isolate later detects the activity by reloading shared prefs (see `BackgroundResultNotifier.checkForActivity`).

> **Note:** Currently the periodic registration of the background task is **commented out** (gated behind "version 0.9").
> The task is wired up and tested in the integration test, but is not actually being scheduled at app launch.
> **Note:** The periodic task is scheduled by `BackgroundScheduler.schedule()`
> at the `CheckFrequency` interval (not scheduled when `never`), and its run is
> gated by the `AutomaticUpdates` setting (check-only, or download on WiFi /
> always). See `docs/background-tasks.md`.

## Layered overview

Expand Down
Loading
Loading