feat: initial Cutdex application
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.
This commit is contained in:
commit
27e77fff39
718 files changed
+183958
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import 'package:cutdex_sdk/project.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../integrations/runtime/media_presentations.dart';
|
||||
|
||||
/// Subscribes to one cover frame so loading it only rebuilds its image.
|
||||
class MediaAssetCover extends ConsumerWidget {
|
||||
const MediaAssetCover({
|
||||
super.key,
|
||||
required this.asset,
|
||||
required this.fallback,
|
||||
this.errorFallback,
|
||||
this.fit = BoxFit.contain,
|
||||
this.timeMilliseconds = 0,
|
||||
});
|
||||
|
||||
final AssetDocument asset;
|
||||
final Widget fallback;
|
||||
final Widget? errorFallback;
|
||||
final BoxFit fit;
|
||||
final int timeMilliseconds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final bytes = ref
|
||||
.watch(mediaCoverProvider(asset, timeMilliseconds: timeMilliseconds))
|
||||
.value;
|
||||
return bytes == null
|
||||
? fallback
|
||||
: Image.memory(
|
||||
bytes,
|
||||
fit: fit,
|
||||
excludeFromSemantics: true,
|
||||
errorBuilder: (_, _, _) => errorFallback ?? fallback,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user