Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
60 lines
1.7 KiB
Dart
60 lines
1.7 KiB
Dart
import 'package:cutdex/l10n/l10n.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cutdex_ui/icons.dart';
|
|
import 'package:cutdex_ui/theme.dart';
|
|
|
|
import '../../workspace/media_availability.dart';
|
|
|
|
class UnavailableMediaPlaceholder extends StatelessWidget {
|
|
const UnavailableMediaPlaceholder({
|
|
super.key,
|
|
required this.availability,
|
|
this.showLabel = true,
|
|
this.isPreview = false,
|
|
});
|
|
final MediaAvailability availability;
|
|
final bool showLabel;
|
|
final bool isPreview;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final label = availability == MediaAvailability.missing
|
|
? context.l10n.mediaMissing
|
|
: context.l10n.mediaUnavailable;
|
|
// Project covers share the canvas background, including missing media.
|
|
return ColoredBox(
|
|
color: isPreview
|
|
? Colors.transparent
|
|
: AppSurfaces.of(context).previewBackground,
|
|
child: Center(
|
|
child: FittedBox(
|
|
fit: BoxFit.scaleDown,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(
|
|
AppIcons.imageUnavailable,
|
|
size: isPreview ? 32 : 24,
|
|
color: theme.colorScheme.error,
|
|
),
|
|
if (showLabel) ...[
|
|
const SizedBox(height: AppSpacing.gap),
|
|
Text(
|
|
label,
|
|
style:
|
|
(isPreview
|
|
? theme.textTheme.bodyMedium
|
|
: theme.textTheme.bodySmall)
|
|
?.copyWith(color: theme.colorScheme.error),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|