refactor(app): instances, sign-in and sync plumbing come from halkyon_app

The instances a device keeps an account on, the first start, the
account switcher, signing in and switching person, the gates that build
the dependencies per instance and per person, and the sync service with
its status, card and banner move to halkyon_app (halkyon_shared, ADR
0014), on halkyon_base's client. Learn supplies its frame (name, word,
icon, theme, launch screen, and the two texts only it can say), its
dependencies, whether the device holds content, and its world map's
country names; every text reads as before. An instance counts only
where its basics name the app `learn`, which learnBase now sets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-19 16:07:44 +02:00
commit 9486b3586e
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -1,7 +1,8 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:halkyon_app/halkyon_app.dart';
import 'package:halkyon_learn_flutter/l10n/app_localizations.dart';
import 'package:halkyon_learn_flutter/src/core/dependencies/person_scope.dart';
import 'package:halkyon_learn_flutter/src/core/dependencies/person_dependencies.dart';
import 'package:halkyon_learn_flutter/src/core/router/app_shell.dart';
import 'package:halkyon_learn_flutter/src/core/router/route_paths.dart';
import 'package:halkyon_learn_flutter/src/core/router/tab_visibility.dart';
@ -201,7 +202,7 @@ GoRouter buildRouter({String initialLocation = RoutePaths.home}) => GoRouter(
GoRoute(
path: '/study/:studysetId',
builder: (context, state) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
final studysetId = state.pathParameters['studysetId']!;
return _inStudyset(
context,
@ -337,7 +338,7 @@ GoRouter buildRouter({String initialLocation = RoutePaths.home}) => GoRouter(
/// The learning path [pathId] of the studyset [studysetId], to work
/// through; a studyset gone says so.
Widget _pathRunner(BuildContext context, String studysetId, String pathId) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
return _inStudyset(
context,
studysetId,
@ -353,7 +354,7 @@ Widget _pathRunner(BuildContext context, String studysetId, String pathId) {
/// The learning path [pathId] of the studyset [studysetId], to write.
/// Leaving closes its bloc, which saves what is unsaved.
Widget _pathEditor(BuildContext context, String studysetId, String pathId) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
return _inStudyset(
context,
studysetId,
@ -378,7 +379,7 @@ Widget _stepEditor(
String pathId,
String stepId,
) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
return _inStudyset(
context,
studysetId,
@ -416,7 +417,7 @@ Widget _inStudyset(
({String label, VoidCallback onPressed})? wayBack,
}) => FoundById<Studyset>(
id: id,
items: PersonScope.of(context).studysets.watchAll,
items: PersonDependencies.of(context).studysets.watchAll,
idOf: (studyset) => studyset.id,
wayBack: wayBack,
builder: (studyset, all) => StudysetLanguageScope(
@ -437,7 +438,7 @@ Widget _inStudyset(
/// studyset gone (deleted, or an old link) says so. Leaving the note closes
/// its bloc, which saves what is unsaved.
Widget _noteEditor(BuildContext context, String studysetId, {String? noteId}) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
return _inStudyset(
context,
studysetId,
@ -453,7 +454,7 @@ Widget _noteEditor(BuildContext context, String studysetId, {String? noteId}) {
/// The composer of the studyset [studysetId]'s cards, opened on [cardId] if
/// given; a studyset gone (deleted, or an old link) says so.
Widget _composer(BuildContext context, String studysetId, {String? cardId}) {
final person = PersonScope.of(context);
final person = PersonDependencies.of(context);
return _inStudyset(
context,
studysetId,