Files
cutdex/lib/features/editor/timeline_operation_region.dart
T
lingjhf 2e0033ce2d
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
feat(workspace): refresh desktop editing experience and prepare 0.1.2
2026-10-09 01:56:01 +08:00

35 lines
923 B
Dart

import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../workspace/projects.dart';
/// Keeps the surface mounted while a timeline operation temporarily blocks edits.
class TimelineOperationRegion extends ConsumerWidget {
const TimelineOperationRegion({
super.key,
required this.projectId,
required this.child,
this.loading = false,
});
final String projectId;
final bool loading;
final Widget child;
@override
Widget build(BuildContext context, WidgetRef ref) {
final creating = ref.watch(
projectsProvider.select(
(value) =>
value.value?.activeProject?.id == projectId &&
value.value?.creatingTimeline == true,
),
);
final blocked = loading || creating;
return IgnorePointer(
ignoring: blocked,
child: ExcludeFocus(excluding: blocked, child: child),
);
}
}