The developer asked for Meditate to offer what Learn's Settings offer first
(ADR 0014's amendment of 4 Nov 2026). Meditate passed a fixed look, the
system's theme and language; it now opens halkyon_app's LookCubit on
<app support>/look.json in main, provides it above InstanceGate, and its
start screens and each person's MaterialApp follow it. Settings show
DeviceLookCard right after the Sync and operator's cards, as Learn's,
offering English (UK), English (US) and Deutsch (meditateLanguages).
Today's streak line ("Noch keine Tage in Folge") overflowed a phone's
width in German in the tests' wide font, as it would with a large font
on a device; it wraps now (Flexible). The new test, choosing Deutsch and
starting again, found it.
Whats-New: Settings: choose the app's appearance and language.
Whats-New-De: Einstellungen: Darstellung und Sprache der App wählen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
57 lines
2.3 KiB
Dart
57 lines
2.3 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/services.dart';
|
|
import 'package:halkyon_app/halkyon_app.dart';
|
|
import 'package:halkyon_meditate_flutter/src/app/licences.dart';
|
|
import 'package:halkyon_meditate_flutter/src/app/meditate_app.dart';
|
|
import 'package:halkyon_meditate_flutter/src/app/meditate_dependencies.dart';
|
|
import 'package:halkyon_ui/halkyon_ui.dart';
|
|
import 'package:material_ui/material_ui.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:serverpod_flutter/serverpod_flutter.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// Noto Sans' notice (halkyon_ui), the flags' and Unicode CLDR's
|
|
// (halkyon_app), and Lucide's for the app's icon.
|
|
registerFontLicenses();
|
|
registerHalkyonAppLicenses();
|
|
registerLucideLicense();
|
|
// The instance the build names (`--dart-define=SERVER_URL=…`, or
|
|
// `assets/config.json`): the first offered at the first start.
|
|
final builtIn = Instance.parse(await getServerUrl())!;
|
|
final device = await MeditateDevice.create(builtIn: builtIn);
|
|
final instances = InstanceChoice(
|
|
FileInstanceStore(File(p.join(device.support, 'instances.json'))),
|
|
builtIn: builtIn,
|
|
forget: device.storage.forget,
|
|
sharesStorage: device.storage.sharesWith,
|
|
);
|
|
await instances.load(usedBefore: device.storage.usedBefore());
|
|
// The device's appearance and language, read before the first frame so
|
|
// that it opens in them.
|
|
final look = await LookCubit.open(
|
|
FileLookStore(File(p.join(device.support, 'look.json'))),
|
|
);
|
|
runApp(
|
|
// What's new in each release (Train's ADR 0030, D61), from
|
|
// assets/whats_new/, shown once after an update.
|
|
WhatsNewScope(
|
|
whatsNew: WhatsNew(
|
|
AssetWhatsNewSource(rootBundle),
|
|
FileWhatsNewStore(File(p.join(device.support, 'whats_new.json'))),
|
|
version: device.appVersion,
|
|
),
|
|
// An instance chosen before: the app ran on this device already.
|
|
usedBefore: instances.current != null,
|
|
child: MeditateApp(
|
|
choice: instances,
|
|
// Only an instance of Halkyon Meditate: one of another Halkyon app's
|
|
// answers too, but holds nothing of this app's.
|
|
checker: ServerpodInstanceChecker(app: 'meditate'),
|
|
open: (instance) => MeditateDependencies.create(instance, device),
|
|
look: look,
|
|
),
|
|
),
|
|
);
|
|
}
|