mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-08-18 13:55:52 +00:00
The root shell rendered LoadingIcon for both the loading and the error branch of migrationProvider, so a failed migration left the app on a blank splash forever with no message, no cause and nothing to act on. Add a shared ErrorState widget (readable line, the technical cause kept but demoted, optional retry) and use it for the error branch, wired to re-run the migration. Screens currently hand-roll Center(child: Text(error.toString())) in ten places; those move over separately. LoadingIcon also hardcoded a white background with a black icon, which meant a full screen white flash on every cold start under a dark theme. Both colours now come from the active scheme.
27 lines
826 B
Dart
27 lines
826 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// The full screen shown while the app finishes starting up.
|
|
///
|
|
/// This used to paint a fixed white background with a black icon, which meant a
|
|
/// full screen white flash on every cold start under a dark theme. Both colours
|
|
/// now come from the active scheme, so the splash matches whatever palette the
|
|
/// user picked.
|
|
class LoadingIcon extends StatelessWidget {
|
|
const LoadingIcon({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
return Scaffold(
|
|
backgroundColor: theme.scaffoldBackgroundColor,
|
|
body: Center(
|
|
child: Image.asset(
|
|
"assets/app_icons/icon.png",
|
|
color: theme.colorScheme.onSurface,
|
|
fit: BoxFit.cover,
|
|
height: 100,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|