mangayomi-mirror/lib/modules/widgets/loading_icon.dart
Mehakdeep Singh 9ed8607e49 fix: show a real error state when startup fails
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.
2026-08-14 01:30:56 -07:00

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,
),
),
);
}
}