Skip to main content
Mirror of LMS_Frontend/clean_up.md (generated 27/09/2026, last updated 09/10/2026). Scope: why the repo is slow to load/clone on GitHub, what should be gitignored, what files / assets / code are unused, and how far the pubspec.yaml packages are from their latest release. Target platforms are web, Android, iOS only.
Status 28/09/2026 (commit 2b5a6e7, pushed): Sections C (template relocation) and E (macos/linux removal) are ✅ DONE, plus CLAUDE_old.md from Section A and the 6 empty Dart files from Section D. flutter analyze after the batch: 0 errors.Status 28/09/2026 (later): Section B is ✅ DONE — the 39 zero-reference assets were deleted (see the asset audit at the bottom); flutter analyze after deletion: 0 errors.Status 08/10/2026: Section G.2 is ✅ DONE — every package was bumped to the newest version that resolves on Flutter 3.44.6 / Dart 3.12.2 (commit 513bb83). flutter analyze 0 errors; the release web build and the Android debug build pass; 433 tests pass.Status 08/10/2026 (later, Fixes 1–6): Section D ✅ DONE (the 50 remaining dead Dart files plus the 11 assets only they referenced), G.1 ✅ DONE (13 unused packages removed), the G.2 table refreshed, a new G.4 replacement table for the stale packages, and a new App Speed Suggestions section at the end. After all of it: flutter analyze 0 errors (10 warnings, unchanged), 433 tests pass, flutter build web --release OK.Status 08/10/2026 (evening): flip_card removed — the review screens now swap answers and explanation in place (G.4 ✅); custom_sliding_segmented_control held back at 1.8.5 after its 2.0 broke every call site (§G.2.1 point 5); the exam attempt review page re-sized for 11” / 13” / 15” windows (App Speed → “Applied so far”). flutter analyze 0 errors, 433 tests pass.Status 23/10/2026 (commit 89da932, frontend Update 145): Section D.2 ✅ DONE — the 10 newly orphaned files were deleted, together with 17 more orphans found by a full import-graph walk (27 files, 5,950 lines). flutter analyze 0 errors.Still pending: Section A (.gitignore / graphify-out untracking, .DS_Stores, stray files), Section F, and the G.4 replacements.

Why GitHub is slow with this repo

The tracked tree is ~68.8 MB across ~3,000 files. The breakdown makes the culprit obvious:
  • build/web is NOT the problem — build/ is already gitignored and zero build artifacts are tracked.
  • graphify-out/ IS the problem. Its ignore rule exists in .gitignore but is commented out (#graphify-out/). ~1,560 small JSON cache files + a 9.9 MB graph.json are what make the GitHub file tree, clones and pushes slow. It’s regenerable local tool output (/graphify .).
  • 12 .DS_Store files are tracked (macOS Finder junk).

A. Untrack + gitignore (biggest win, zero risk) — ⬜ pending

Estimated saving: ~47 MB and ~1,575 files (≈68% of the repo). Suggested .gitignore additions:

B. Unused assets — zero references anywhere (39 files, ~3.5 MB) — ✅ DONE (28/09/2026)

Every file in assets/images, assets/icons, assets/svg was scanned for its filename across lib/, web/, test/, integration_test/, pubspec.yaml, flutter_native_splash.yaml, translations and asset HTML. These had zero hits and were all deleted on 28/09/2026 (re-verified by the full asset audit first; flutter analyze → 0 errors after). ⚠️ These were also shipped inside every app build (the pubspec.yaml assets: globs include their folders), so deleting them shrank the deployed web bundle and the APK/IPA too — not just the git repo.
Fonts were already clean before this pass: only the 6 Poppins weights actually used are tracked, and all 6 are declared in pubspec.yaml (the Update 33 trim). Nothing to do there.

C. Design-template HTML shipped inside the app bundle — ✅ DONE (2b5a6e7)

pubspec.yaml declares - assets/, which bundles every file at the root of assets/ into the web build, APK and IPA — but the design templates were only referenced from Dart comments (they’re the visual source of truth, never loaded at runtime). Executed in 2b5a6e7: the 4 templates were git mv-ed from assets/ to docs/templates/ (~295 KB no longer ships in any build), every path reference was updated (CLAUDE.md, AGENTS.md, major_code_updates.md, the clean-up file itself, and 8 Dart doc-comments), and the 3 stale /assets/*template.html .gitignore rules were dropped so the templates stay tracked as documentation.
gridview_items_cards_designs_template.html (referenced in docs but never committed — it was gitignored) had its doc references rewritten to docs/templates/ too, so it lands there if ever restored.

D. Dart files never imported anywhere (56 files, ~330 KB) — ✅ DONE (08/10/2026)

No import / export / part reference to these files existed in lib/, test/ or integration_test/. The 6 empty files (the whole content_manager_pages/profile/ folder) went in 2b5a6e7; the remaining 50 were deleted on 08/10/2026 (436 KB on disk).
Before deleting, every file was re-checked with an import-graph scan that resolves package:strived/…, relative and part URIs and the if (dart.library.html) '…' branches of conditional imports (that is why url_strategy_web.dart / iframe_view_factory_web.dart are not dead although nothing names them directly). Four folders became empty and were removed: ui/widgets/exam/, ui/widgets/shared/stepper/, ui/widgets/side_menu_test_widget/, ui/pages/admin_pages/plateform_config/widget/. The 11 assets only these files referenced (see the asset audit below) went with them. No package lost its last importer because of this batch. CLAUDE.md §4 tree updated (web_context_menu_wrapper.dart removed, file count 707). flutter analyze after the batch: 0 errors, 10 warnings (unchanged), infos 143 → 134.
Two known-issue side effects: deleting profile_side_widget.dart removes the dashboard “Edit profile information” button that opened the shopping cart (known issue 20), and deleting lesson_content_screen.dart removes the unused fourth HTML renderer mentioned in known issue 12.

D.2 Newly orphaned since 28/09/2026 (10 files, ~120 KB) — ✅ DONE (23/10/2026)

The same scan on 08/10/2026 found 10 more files that nothing imports any more (they lost their last importer in Updates 30–92, or were missed by the first grep). They were outside the list the clean-up was asked for, so they were left in place for a decision, then deleted on 23/10/2026 (commit 89da932, frontend Update 145) after a fresh import-graph walk from main.dart + the tests (imports / exports / parts, conditional imports included) confirmed nothing reachable used them. The ExamSimulatorBanner note in the frontend CLAUDE.md §3 was trimmed to match (31/10/2026). The same commit removed 17 more orphans the walk found; every reference to them came from inside the orphan group itself:
  • the admin coupon / voucher detail widgets: admin_pages/coupons/admin_view_coupon_details_widget.dart, admin_pages/vouchers/admin_view_voucher_details_widget.dart, coupons_and_vouchers_widgets/admin_view_coupon_details_widget.dart, coupons_and_vouchers_widgets/coupon/dynamic_ticket_widget.dart;
  • the rest of the old reminders dialog stack: reminders/dropdown_data_widget.dart, reminders/custom_dropdown_widget.dart (superseded by notification_sender_view);
  • the 5 src/ files left in the vendored ui/widgets/shared/stepper/ folder (its stepper.dart went in Section D);
  • the old training-content stack: training/training_content_widget.dart, quiz/quiz_chapter_widget.dart, quiz/quiz_training_widget.dart, quiz/card_details_widget.dart;
  • the iframe view-factory pair plateform_config/landing/widget/iframe_view_factory.dart / iframe_view_factory_web.dart. Nothing reachable imports the pair any more, so the Section D note that kept iframe_view_factory_web.dart alive through a conditional import no longer applies (url_strategy_web.dart is still in use).

E. Unsupported-platform shells — ✅ DONE (2b5a6e7)

CLAUDE.md / AGENTS.md project tree + the Update-28 macOS note were updated to match.

F. Root-level notes clutter — ⬜ pending (optional, tiny — tidiness only)


G. pubspec.yaml package audit (added 28/09/2026, versions bumped 08/10/2026)

G.1 Unused packages — ✅ DONE (08/10/2026)

Every package:<name>/ import was grepped across lib/, test/, integration_test/, plus usage-without-import checks (CupertinoIcons., GoogleFonts, LoggingIntegration, FlutterNativeSplash). These 11 had zero hits:
Removed from pubspec.yaml on 08/10/2026 — 13 packages in total. The re-audit run after Section D (this time covering the flutter_* names the first grep skipped) found two more with zero imports: flutter_rating_bar (its only mentions are commented-out RatingBarIndicator blocks in trainings_filters_widget.dart) and super_banners — both removed too, and progress_stepper was already commented out. pubspec.lock lost 9 packages (flutter_rating_bar, google_fonts, infinite_scroll_pagination, logger, mime_type, sentry_logging, super_banners + the transitive flutter_staggered_grid_view, sliver_tools). cupertino_icons, uuid, quiver, path_provider and logging are still in the lock file as transitive dependencies of other packages (chewie, dropdown_search, Syncfusion, flutter_quill, plugins…), so the app no longer declares them but they still ship — nothing to do about that. flutter analyze after the removal: 0 errors, the same 10 warnings; 433 tests pass; flutter build web --release OK.
Not removable despite looking idle:

G.2 Version freshness — installed vs latest on pub.dev

Refreshed 08/10/2026, after the version bump (first snapshot: 28/09/2026). Toolchain: Flutter 3.44.6 / Dart 3.12.2. Every package was moved to the newest version that resolves on that toolchain. “Installed” is the resolved version in pubspec.lock; bold (was x) marks what the bump changed. “Latest” is the newest stable release on pub.dev, and its date tells you when the developers last shipped. Each name links to the package’s versions page. Status: ✅ on the latest release · 🔒 on the newest version this toolchain can use (the cell says what blocks the next one; details in §G.2.1). Totals: 54 ✅ · 21 🔒 (70 dependencies + 5 dev dependencies). The 13 🗑️ UNUSED rows of the first snapshot were removed from pubspec.yaml on 08/10/2026 (§G.1), flip_card was replaced the same day (§G.4), and custom_sliding_segmented_control went back to 1.8.5 after its 2.0 broke the app (§G.2.1 point 5).
Dev dependencies (build tools — not shipped in the app):

G.2.1 Why some packages are not on the latest release

Five things hold packages back. None of them can be fixed by editing pubspec.yaml alone:
  1. Versions pinned by the Flutter 3.44 SDK. The SDK fixes intl 0.20.2 (through flutter_localizations), meta 1.18.0, material_ui 1.2.0 and cupertino_ui 1.0.2. Releases that need newer copies can’t resolve: intl 0.20.3, file_saver 0.5+ (meta 1.19), dropdown_search 8 (material_ui 1.4), cached_network_image 4.0.4 (material_ui 1.3), build_runner 2.16 and retrofit_generator 10.2.10+ (they need analyzer ≥ 13.3, which needs meta 1.18.3).
  2. Releases that already require Flutter ≥ 3.47 / Dart ≥ 3.13: flutter_form_builder 11, flex_color_picker 4, google_fonts 9, webview_flutter_wkwebview 3.27. These unlock with the next Flutter upgrade.
  3. The win32 5 chain. html_editor_enhanced 2.7.1 (its latest, last release 2025-07-12) requires file_picker ^10, and file_picker 10 requires win32 ^5 and dbus ^0.7. The vendored third_party/quill_native_bridge_windows (0.0.2, win32 ^5) exists for the same reason: flutter_quill pulls quill_native_bridge 11.2, which wants the published 0.1.x on win32 ^6, and the override swaps it for the old copy so both can resolve. Every package whose next release moved to win32 6 therefore stays on its last win32 5 line: device_info_plus 12 (13 needs win32 6), flutter_secure_storage 10 (11’s Windows plugin needs win32 6), chewie 1.13 (1.14+ needs wakelock_plus 1.6+, which needs win32 6 and package_info_plus 10), the five syncfusion_* packages on 33 (syncfusion_flutter_pdfviewer 33.2.15+ needs device_info_plus ^13.1, and the other four follow syncfusion_flutter_core), and connectivity_plus 7.3.2 (needs dbus 0.8). The chain only comes from Windows desktop code, which the app doesn’t ship, but pub resolves every platform. It clears when html_editor_enhanced allows file_picker ≥ 11 (or is replaced, see §G.4). Then delete the quill_native_bridge_windows override and its third_party/ folder, and re-run this bump.
  4. Android toolchain. permission_handler 13 compiles its Android plugin against compileSdk 37. With the project’s AGP 8.11.1 (android/settings.gradle) the build fails with Failed to find target with hash string 'android-37' (tried 08/10/2026; Gradle did install SDK Platform 37 as platforms/android-37.0, but this AGP can’t use it), so it stays on 12.0.3. To take 13: raise AGP to a version that supports API 37 and set compileSdk = 37 in android/app/build.gradle. (connectivity_plus 7 / device_info_plus 12 also list “AGP ≥ 8.12.1, Gradle ≥ 8.13, Kotlin 2.2.0” in their changelogs, but they build fine on 8.11.1.)
  5. material_ui is not Flutter’s Material (yet). Several 2026 releases “migrate to material_ui”, the standalone package the Flutter team is carving the Material library into (SDK-pinned to 1.2.0 on Flutter 3.44). But package:flutter 3.44 does not depend on it and package:flutter/material.dart still ships its own classes, so material_ui’s Material, InkWell, Scaffold… are different types from the app’s. A widget from such a package that needs a Material ancestor (InkWell → debugCheckHasMaterial) can never find the app’s Flutter Scaffold and asserts No Material widget found — that is what broke the exam attempt review (CustomSlidingSegmentedControl in quiz_review_side_menu_option.dart, found 08/10/2026) and would have broken its other 10 call sites. custom_sliding_segmented_control is therefore held at 1.8.5. The other bumped packages that moved to material_ui are safe because nothing in them looks for a Material ancestor: go_router 18 (pages render), animations 3 (the app only uses FadeScaleTransition), cached_network_image 4, shimmer 4. Re-check this whenever a changelog says “migrates to material_ui”; the hold clears once package:flutter/material.dart itself re-exports material_ui (a future Flutter release).
Also on purpose: sentry_flutter stays on 9.30.1, the latest stable; pub would otherwise offer the 10.0.0-rc.2 pre-release.

G.2.2 What the bump changed besides pubspec.yaml (08/10/2026)

No code change was needed for the other majors: get_it 9, go_router 18 (17.0 makes ShellRoute navigation notify GoRouter observers; the app registers none), animations 3, cached_network_image 4 and shimmer 4 (these moved to material_ui without needing a Material ancestor), fl_chart 1.2, flutter_widget_from_html 0.17, connectivity_plus 7, device_info_plus 12 (dropped serialNumber, unused here), open_file 4, permission_handler 12 (the app already uses the request() result, as the new docs ask), Syncfusion 33 (theme renames for chat/AI widgets the app doesn’t use; the PDF viewer’s pageNumber timing, unused).

G.2.3 Verification (08/10/2026)

After Section D + G.1 (08/10/2026, later): flutter analyze 0 errors / 10 warnings / 134 infos; 433 tests pass (same single pre-existing widget_test.dart load failure); flutter build web --release OK, main.dart.js unchanged at 12.2 MB (dead code was already tree-shaken; the bundle only shrinks with code splitting, see App Speed Suggestions #1). After the flip_card removal, the segmented-control hold and the review re-size (08/10/2026, evening): flutter analyze 0 errors / 10 warnings / 134 infos; 433 tests pass (same widget_test.dart); the review page was rendered through the widget-test harness at 1280, 1440 and 1728px before and after (it used to force a 1516px-wide page).
Not yet done: an iOS build (pod install will pick up the new plugin pods) and a manual pass on the screens touched above (drag-and-drop questions, training basic info uploads, YouTube fullscreen on web, 2FA recovery-codes download, the three dropdowns, certificate download on Android).

G.3 Reading the table — highlights

  • Abandoned-looking packages the app depends on (developer’s last release 3+ years ago, as of 08/10/2026): expandable (5y 7mo), modal_side_sheet (5y 2mo), auto_size_text (4y 11mo), qr_flutter / styled_divider (3y 5mo), tuple (3y 4mo), fluid_dialog (3y 3mo). They still work on Flutter 3.44 today, but nobody is maintaining them — candidates to replace or vendor if they ever break (super_banners, flutter_rating_bar and flip_card, also on that list, are gone since 08/10/2026).
  • html_editor_enhanced is now the main blocker: it alone keeps the win32 5 chain alive (§G.2.1 point 3), which holds back Syncfusion (33 → 35), file_picker (10 → 13), flutter_secure_storage (10 → 11), device_info_plus (12 → 13) and chewie (1.13 → 1.17).
  • Waiting on Flutter ≥ 3.47: flutter_form_builder 11, flex_color_picker 4, webview_flutter_wkwebview 3.27, plus the SDK-pinned ones (intl, file_saver, dropdown_search 8, build_runner 2.16). Re-run flutter pub outdated after the next Flutter upgrade.
  • Waiting on the Android toolchain: permission_handler 13 (an AGP that supports compileSdk 37).
  • ✅ Bump done 08/10/2026. The earlier note (“this table is the map, not an instruction to upgrade”) is resolved: every package is on its newest compatible version, and the code changes are listed in §G.2.2.

G.4 Stale packages — where they are used and what to replace them with (added 08/10/2026)

Built from the G.3 list. “Where” comes from a grep of the importing files after Section D; “replace with” prefers what ships in the Flutter / Dart SDK or a package that is already in pubspec.yaml, in line with the no-new-dependencies rule. The “gain” column is honest: most of these are tiny and only buy dependency hygiene — the two that matter for speed are html_editor_enhanced and auto_size_text. Suggested order: tuple (mechanical, touches the hottest Selectors), then auto_size_text in the quiz screens, then html_editor_enhanced → Fleather (the one that unlocks the win32 chain), then the small ones whenever their screen is next touched.

Execution order

  1. ⬜ .gitignore additions, then git rm -r --cached graphify-out + git rm --cached the .DS_Stores (Section A) — ~47 MB / ~1,575 files gone, zero functional risk.
  2. 🔶 Delete the Section A stray files — CLAUDE_old.md ✅ done (2b5a6e7); gitignore, save_settings.local_json.txt, docs/api_samples/ (⚠️ check the auth_user dump) still pending.
  3. ✅ Section B unused assets — done (28/09/2026): 39 files deleted, flutter analyze 0 errors. Remaining: run the web app once to visually confirm no broken images.
  4. ✅ Section C templates moved out of assets/ + CLAUDE.md paths updated — done (2b5a6e7).
  5. ✅ Section D dead Dart files — the 6 empty files (2b5a6e7) + the remaining 50 and their 11 dead-only assets (08/10/2026); the 10 newly orphaned files of D.2 + 17 more orphans (23/10/2026, 89da932).
  6. 🔶 Section E ✅ done (2b5a6e7: macos/ + linux/ removed & gitignored); Section F still pending.
  7. ✅ Section G — versions bumped (513bb83) and the 13 unused packages removed (08/10/2026). Next: the G.4 replacements, starting with tuple → records.
Since LMS_Frontend was reset to a single commit, doing this cleanup before the next force-push (or as commit #2) keeps the new repo permanently light — files removed later still live in pack history otherwise.

Full asset audit (assets/, re-scanned 28/09/2026)

Every asset filename was grepped across lib/, web/, test/, integration_test/, pubspec.yaml, flutter_native_splash.yaml, ios/, android/ (generated *.g.dart excluded). No dynamically-built asset paths exist, so filename matching is reliable. 142 asset files total before the Section B deletion (excluding .DS_Store); 103 after it, 92 after the 08/10/2026 dead-code batch.

✅ Used — keep (92 files)

⚠️ Referenced ONLY by dead Dart code (11 files, ~1.2 MB) — ✅ DELETED (08/10/2026)

Their only references were files in Section D. Deleted on 08/10/2026 together with those files, after a repo-wide grep (lib/, web/, test/, pubspec.yaml, android/, ios/) confirmed zero references outside the deleted code. build/web/assets/assets shrank from 6,120 KB to 4,884 KB.

🚩 Near-miss lookalikes — don’t delete the wrong twin

  • assets/icons/appbar_icons/role_permissions.svg (underscore) is USED; role-permissions.svg (hyphen) was not.
  • assets/icons/google-authenticator-logo.png is USED; the .svg in assets/svg/ was not.
  • assets/icons/bell.svg is USED; assets/images/bell.jpg was not.
  • assets/icons/appbar_icons/classroom.svg + assets/images/classroom_svg.svg are USED; assets/images/classroom.png was not.
  • assets/icons/avatar.png is USED (Constants.avatarHolder); avatar2.png was not.
  • Both payment_success.svg copies (in assets/svg/ and assets/images/payment_img/) are USED (mobile vs desktop page).
After any further deletion: flutter analyze, then run the web app and click through login, dashboards, cart/payment, quiz review and onboarding to confirm no broken images.

App Speed Suggestions

Added 08/10/2026. Measured on that day’s release build (Flutter 3.44.6, CanvasKit): main.dart.js 12.2 MB (3.2 MB gzipped), canvaskit/ 37 MB on disk (the browser downloads only the variant it needs), assets/ 13.1 MB (fetched on demand, not at startup). Counts are grep counts over lib/. Nothing here is about wasm — these are things in the app’s own code, HTML shell and server that make the web app (and the phones) faster. Ordered by expected impact. Applied so far (08/10/2026): the four review screens’ FlipCard became a static swap (ExplanationSwap, §G.4) — a toggle now costs one build and one paint instead of ~30 frames of 3-D rotation with both faces mounted, and only the card rebuilds, not every provider listener. The exam attempt review page (/student-my-content/attempts) takes its sizes from the new StudentWebLayout.review* tokens (nav bar 60–72px instead of 100, side panel 300–390px instead of 450, 13.5–15px body text instead of the theme’s 18px default, numbered tabs 34–40px instead of 45) and lays out from 960px instead of forcing a 1516px-wide page, so 11” / 13” / 14” windows no longer scroll sideways to reach the question panel. The training review twins (training_quiz_review_*) still use the old fixed sizes — same tokens, next pass.
Already in good shape — keep doing this: gzip / brotli on the server; translations compiled in with CodegenLoader (no JSON fetch at boot); icon fonts tree-shaken by the build (MaterialIcons 1.6 MB → 43 KB, Font Awesome −92 to −99 %); AppNavigation created once (??=); the glass cards use ImageFiltered on their own cover and never BackdropFilter (1 use in the whole app); the changelog is parsed off the UI thread with compute(); SystemDisplayGuard only applies its FittedBox on native; Selector already outnumbers context.watch 2 : 1.