Merge remote-tracking branch 'origin/main'

# Conflicts:
#	apps/app_seeds/lib/i18n/strings.g.dart
#	apps/app_seeds/lib/state/inventory_cubit.dart
This commit is contained in:
vjrj 2026-07-11 13:31:04 +02:00
commit 00db9d4b6a
13 changed files with 218 additions and 17 deletions

View file

@ -49,7 +49,9 @@ class InventoryListScreen extends StatelessWidget {
),
child: const Icon(Icons.add),
),
body: state.loading
body: state.error != null
? _LoadError(onRetry: context.read<InventoryCubit>().retry)
: state.loading
? const Center(child: CircularProgressIndicator())
: Column(
children: [
@ -240,6 +242,38 @@ class InventoryListScreen extends StatelessWidget {
/// A tappable banner announcing how many photo-first captures are waiting to be
/// named. Opens the "to catalogue" tray.
/// Shown when the inventory stream fails to open instead of an endless
/// spinner, offer a clear message and a way to try again.
class _LoadError extends StatelessWidget {
const _LoadError({required this.onRetry});
final VoidCallback onRetry;
@override
Widget build(BuildContext context) {
final t = context.t;
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.cloud_off_outlined, size: 48, color: seedGreen),
const SizedBox(height: 16),
Text(t.inventory.loadError, textAlign: TextAlign.center),
const SizedBox(height: 16),
FilledButton(
key: const Key('inventory.retry'),
onPressed: onRetry,
child: Text(t.inventory.retry),
),
],
),
),
);
}
}
class _TriageBanner extends StatelessWidget {
const _TriageBanner({required this.count});