Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
59 lines
1.7 KiB
Dart
59 lines
1.7 KiB
Dart
import 'package:cutdex/l10n/l10n.dart';
|
|
import 'package:flutter/material.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(
|
|
Icons.broken_image_outlined,
|
|
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),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|