Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'package:cutdex_core/project.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
import '../errors/app_failure.dart';
|
|
|
|
part 'project_state.freezed.dart';
|
|
|
|
enum ProjectAvailability {
|
|
available,
|
|
missing,
|
|
volumeOffline,
|
|
invalid,
|
|
unavailable;
|
|
|
|
bool get canOpen => this == available;
|
|
}
|
|
|
|
@freezed
|
|
abstract class RecentProject with _$RecentProject {
|
|
const factory RecentProject({
|
|
required String id,
|
|
required String name,
|
|
required String path,
|
|
@Default(ProjectAvailability.available) ProjectAvailability availability,
|
|
}) = _RecentProject;
|
|
}
|
|
|
|
@freezed
|
|
abstract class ProjectState with _$ProjectState {
|
|
const factory ProjectState({
|
|
@Default([]) List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
@Default([]) List<TimelineSummary> timelines,
|
|
@Default([]) List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
@Default(false) bool projectBusy,
|
|
String? openingTimelineId,
|
|
@Default(false) bool creatingTimeline,
|
|
AppFailure? error,
|
|
}) = _ProjectState;
|
|
}
|
|
|
|
extension ProjectTimelineSelection on ProjectState {
|
|
/// Navigation intent is visible before its editing session is ready.
|
|
String? get visibleTimelineId => openingTimelineId ?? timeline?.id;
|
|
}
|