Skip to content

Commit

Permalink
Merge pull request #1 from BigFlexLiu/component-properties
Browse files Browse the repository at this point in the history
Added component properties
  • Loading branch information
BigFlexLiu authored Aug 10, 2023
2 parents d9a8390 + 8d6d60d commit 5ef6cf9
Show file tree
Hide file tree
Showing 36 changed files with 342 additions and 259 deletions.
2 changes: 1 addition & 1 deletion lib/src/models/boolean_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BooleanOperation extends Vector {
required super.strokeJoin,
required super.strokeDashes,
required super.strokeMiterAngle,
super.componentPropertyReferencesMap,
super.componentPropertyReferences,
super.name,
super.rotation,
super.pluginData,
Expand Down
29 changes: 14 additions & 15 deletions lib/src/models/boolean_operation.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/models/canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Canvas extends Node {
Canvas({
required super.id,
required super.visible,
super.componentPropertyReferencesMap,
super.componentPropertyReferences,
super.name,
super.rotation,
super.pluginData,
Expand Down
29 changes: 14 additions & 15 deletions lib/src/models/canvas.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion lib/src/models/component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class Component extends Equatable {
/// if any.
final String? componentSetId;

// Mapping of property name to its definitions
@JsonKey(defaultValue: {})
final Map<String, ComponentPropertyDefinition> componentPropertyDefinitions;

Component({
this.key,
this.fileKey,
Expand All @@ -69,6 +73,7 @@ class Component extends Equatable {
this.containingFrame,
this.containingPage,
this.componentSetId,
required this.componentPropertyDefinitions,
});

@override
Expand All @@ -84,7 +89,8 @@ class Component extends Equatable {
user,
containingFrame,
containingPage,
componentSetId
componentSetId,
componentPropertyDefinitions,
];

factory Component.fromJson(Map<String, dynamic> json) =>
Expand Down
27 changes: 27 additions & 0 deletions lib/src/models/component.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/models/component_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ComponentNode extends Frame {
required super.size,
required this.componentPropertyDefinitions,
super.styles,
super.componentPropertyReferencesMap,
super.componentPropertyReferences,
super.absoluteBoundingBox,
super.absoluteRenderBounds,
super.rotation,
Expand Down
29 changes: 14 additions & 15 deletions lib/src/models/component_node.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lib/src/models/component_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class ComponentSet extends Equatable {
@JsonKey(name: 'containing_page')
final dynamic containingPage;

// Mapping of property name to its definitions
@JsonKey(defaultValue: {})
final Map<String, ComponentPropertyDefinition> componentPropertyDefinitions;

ComponentSet({
this.key,
this.fileKey,
Expand All @@ -63,6 +67,7 @@ class ComponentSet extends Equatable {
this.user,
this.containingFrame,
this.containingPage,
required this.componentPropertyDefinitions,
});

@override
Expand All @@ -78,6 +83,7 @@ class ComponentSet extends Equatable {
user,
containingFrame,
containingPage,
componentPropertyDefinitions,
];

factory ComponentSet.fromJson(Map<String, dynamic> json) =>
Expand Down
Loading

0 comments on commit 5ef6cf9

Please sign in to comment.