Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Figma properties #24

Merged
merged 11 commits into from
Aug 10, 2023
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