logic-circuits-simulator/lib/models/project.dart
Dan Cojocaru 85838c2b32
Implemented logic expressions
Also made truth table horizontally scrollable
2022-06-19 18:23:16 +03:00

33 lines
979 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'project.freezed.dart';
part 'project.g.dart';
@freezed
class ProjectIndex with _$ProjectIndex {
const factory ProjectIndex({
required List<ComponentEntry> components,
}) = _ProjectIndex;
factory ProjectIndex.fromJson(Map<String, Object?> json) => _$ProjectIndexFromJson(json);
}
@freezed
class ComponentEntry with _$ComponentEntry {
const factory ComponentEntry({
required String componentId,
required String componentName,
@JsonKey(includeIfNull: false)
String? componentDescription,
required List<String> inputs,
required List<String> outputs,
@JsonKey(includeIfNull: false)
List<String>? truthTable,
@JsonKey(includeIfNull: false)
List<String>? logicExpression,
@JsonKey(defaultValue: false)
required bool visualDesigned,
}) = _ComponentEntry;
factory ComponentEntry.fromJson(Map<String, Object?> json) => _$ComponentEntryFromJson(json);
}