perf(startup): paint a splash immediately, run init off the first frame

main() awaited all of configureDependencies() (open the encrypted DB,
derive the social key, seed/scan the species catalog) before the first
runApp, so nothing painted until init finished — startup jank visible as
skipped frames. Now main() runs runApp immediately with a Bootstrap
widget that shows a native-splash-matching green splash while the heavy
work runs, then swaps in TaneApp. On failure it shows a localized error
with a retry (configureDependencies is idempotent, so retry is safe).

Adds a bootstrap i18n group (en/es/pt/ast) and a widget test for the
splash/error frame.
This commit is contained in:
vjrj 2026-07-10 17:34:08 +02:00
parent 33d8b2a4d7
commit 71413f3801
12 changed files with 289 additions and 53 deletions

View file

@ -41,6 +41,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
// Translations
late final Translations$app$en app = Translations$app$en.internal(_root);
late final Translations$bootstrap$en bootstrap = Translations$bootstrap$en.internal(_root);
late final Translations$common$en common = Translations$common$en.internal(_root);
late final Translations$home$en home = Translations$home$en.internal(_root);
late final Translations$photo$en photo = Translations$photo$en.internal(_root);
@ -88,6 +89,21 @@ class Translations$app$en {
String get title => 'Tanemaki';
}
// Path: bootstrap
class Translations$bootstrap$en {
Translations$bootstrap$en.internal(this._root);
final Translations _root; // ignore: unused_field
// Translations
/// en: 'Tanemaki couldn't start'
String get failed => 'Tanemaki couldn\'t start';
/// en: 'Try again'
String get retry => 'Try again';
}
// Path: common
class Translations$common$en {
Translations$common$en.internal(this._root);
@ -1776,6 +1792,8 @@ extension on Translations {
dynamic _flatMapFunction(String path) {
return switch (path) {
'app.title' => 'Tanemaki',
'bootstrap.failed' => 'Tanemaki couldn\'t start',
'bootstrap.retry' => 'Try again',
'common.save' => 'Save',
'common.cancel' => 'Cancel',
'common.delete' => 'Delete',