Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #245 from Parabeac/sprint/cornelius
Browse files Browse the repository at this point in the history
Sprint/cornelius
  • Loading branch information
mergify[bot] authored Feb 9, 2021
2 parents 0eb15f1 + 5aec1b4 commit c6e1e5d
Show file tree
Hide file tree
Showing 47 changed files with 551 additions and 164 deletions.
18 changes: 7 additions & 11 deletions lib/configurations/configurations.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"default": {
"widgetStyle": "Material",
"widgetType": "Stateless",
"widgetSpacing": "Expanded",
"layoutPrecedence": [
"column",
"row",
"stack"
]
},
"state-management": "none"
"default": {
"widgetStyle": "Material",
"widgetType": "Stateless",
"widgetSpacing": "Expanded",
"layoutPrecedence": ["column", "row", "stack"]
},
"state-management": "provider"
}
10 changes: 6 additions & 4 deletions lib/controllers/figma_controller.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'package:parabeac_core/controllers/controller.dart';
import 'package:parabeac_core/controllers/main_info.dart';
import 'package:parabeac_core/input/figma/entities/layers/frame.dart';
import 'package:parabeac_core/input/figma/helper/figma_asset_processor.dart';
import 'package:parabeac_core/input/figma/helper/figma_project.dart';
import 'package:parabeac_core/input/helper/asset_processing_service.dart';
import 'package:parabeac_core/input/helper/design_project.dart';
import 'package:quick_log/quick_log.dart';

import 'interpret.dart';

class FigmaController extends Controller {
///SERVICE
@override
Expand Down Expand Up @@ -44,7 +42,11 @@ class FigmaController extends Controller {

FigmaProject generateFigmaTree(var jsonFigma, var projectname) {
try {
return FigmaProject(projectname, jsonFigma);
return FigmaProject(
projectname,
jsonFigma,
id: MainInfo().figmaProjectID,
);
} catch (e, stackTrace) {
print(e);
return null;
Expand Down
20 changes: 14 additions & 6 deletions lib/design_logic/artboard.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:parabeac_core/design_logic/color.dart';
import 'package:parabeac_core/design_logic/design_node.dart';
import 'package:parabeac_core/design_logic/group_node.dart';
import 'package:parabeac_core/design_logic/pb_style.dart';
import 'package:parabeac_core/design_logic/rect.dart';
import 'package:parabeac_core/input/sketch/entities/layers/flow.dart';
import 'package:parabeac_core/input/sketch/entities/objects/frame.dart';
Expand All @@ -17,6 +18,9 @@ class PBArtboard extends DesignNode implements GroupNode, DesignNodeFactory {
@override
var boundaryRectangle;
var isFlowHome;

@override
var style;
PBArtboard(
{Color this.backgroundColor,
this.isFlowHome,
Expand All @@ -43,10 +47,10 @@ class PBArtboard extends DesignNode implements GroupNode, DesignNodeFactory {
hasClippingMask,
clippingMaskMode,
userInfo,
Style style,
maintainScrollPosition,
prototypeNode,
type})
type,
this.style})
: super(UUID, name, isVisible, boundaryRectangle, type, style,
prototypeNode);

Expand Down Expand Up @@ -92,17 +96,21 @@ class PBArtboard extends DesignNode implements GroupNode, DesignNodeFactory {
hasClippingMask: json['hasClippingMask'],
clippingMaskMode: json['clippingMaskMode'],
userInfo: json['userInfo'],
maintainScrollPosition: json['maintainScrollPosition'],
style: json['style'] == null
? null
: Style.fromJson(json['style'] as Map<String, dynamic>),
maintainScrollPosition: json['maintainScrollPosition'],
: PBStyle.fromPBDF(json['style'] as Map<String, dynamic>),
)
..prototypeNodeUUID = json['prototypeNodeUUID'] as String
..type = json['type'] as String;
if (json.containsKey('children')) {
if (json['children'] != null) {
node.children
.add(DesignNode.fromPBDF(json['children'] as Map<String, dynamic>));
for (var item in json['children']) {
var child = DesignNode.fromPBDF(item as Map<String, dynamic>);
if (child != null) {
node.children.add(child);
}
}
}
}
return node;
Expand Down
2 changes: 1 addition & 1 deletion lib/design_logic/boolean_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BooleanOperation implements DesignNodeFactory, DesignNode {
type,
Frame this.boundaryRectangle,
String UUID,
String name,
String this.name,
bool isVisible,
pbdfType,
});
Expand Down
18 changes: 17 additions & 1 deletion lib/design_logic/design_element.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import 'package:parabeac_core/design_logic/design_node.dart';

abstract class DesignElement extends DesignNode {
DesignElement() : super('', '', false, null, '', null, null);
DesignElement({
UUID,
name,
isVisible,
boundaryRectangle,
type,
style,
prototypeNodeUUID,
}) : super(
UUID,
name,
isVisible,
boundaryRectangle,
type,
style,
prototypeNodeUUID,
);
}
12 changes: 10 additions & 2 deletions lib/design_logic/group_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class GroupNode implements DesignNodeFactory, DesignNode {
userInfo,
maintainScrollPosition,
this.pbdfType = 'group',
this.style,
});

@override
Expand Down Expand Up @@ -72,13 +73,20 @@ class GroupNode implements DesignNodeFactory, DesignNode {
userInfo: json['userInfo'],
maintainScrollPosition: json['maintainScrollPosition'],
pbdfType: json['pbdfType'],
style: json['style'] == null
? null
: PBStyle.fromPBDF(json['style'] as Map<String, dynamic>),
)
..prototypeNodeUUID = json['prototypeNodeUUID'] as String
..type = json['type'] as String;
if (json.containsKey('children')) {
if (json['children'] != null) {
node.children
.add(DesignNode.fromPBDF(json['children'] as Map<String, dynamic>));
for (var item in json['children']) {
var child = DesignNode.fromPBDF(item as Map<String, dynamic>);
if (child != null) {
node.children.add(child);
}
}
}
}
return node;
Expand Down
24 changes: 17 additions & 7 deletions lib/design_logic/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';
import 'package:parabeac_core/controllers/main_info.dart';
import 'package:parabeac_core/design_logic/design_element.dart';
import 'package:parabeac_core/design_logic/design_node.dart';
import 'package:parabeac_core/design_logic/pb_style.dart';
import 'package:parabeac_core/input/helper/azure_asset_service.dart';
import 'package:parabeac_core/input/sketch/entities/objects/frame.dart';
import 'package:parabeac_core/interpret_and_optimize/entities/inherited_bitmap.dart';
Expand All @@ -12,16 +13,15 @@ import 'package:parabeac_core/interpret_and_optimize/helpers/pb_context.dart';
import 'abstract_design_node_factory.dart';

class Image extends DesignElement implements DesignNodeFactory, DesignNode {
var boundaryRectangle;

var UUID;
@override
var style;

Image({
this.imageReference,
this.UUID,
UUID,
booleanOperation,
exportOptions,
Frame this.boundaryRectangle,
Frame boundaryRectangle,
isFixedToViewport,
isFlippedHorizontal,
isFlippedVertical,
Expand All @@ -39,8 +39,15 @@ class Image extends DesignElement implements DesignNodeFactory, DesignNode {
clippingMaskMode,
userInfo,
maintainScrollPosition,
pbdfType,
});
this.pbdfType = 'image',
this.style,
}) : super(
UUID: UUID,
name: name,
isVisible: isVisible,
boundaryRectangle: boundaryRectangle,
style: style,
);

String imageReference;

Expand Down Expand Up @@ -76,6 +83,9 @@ class Image extends DesignElement implements DesignNodeFactory, DesignNode {
userInfo: json['userInfo'],
maintainScrollPosition: json['maintainScrollPosition'],
pbdfType: json['pbdfType'],
style: json['style'] == null
? null
: PBStyle.fromPBDF(json['style'] as Map<String, dynamic>),
)
..prototypeNodeUUID = json['prototypeNodeUUID'] as String
..type = json['type'] as String;
Expand Down
4 changes: 4 additions & 0 deletions lib/design_logic/oval.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Oval implements DesignNodeFactory, DesignNode {
maintainScrollPosition,
type,
this.pbdfType = 'oval',
this.style,
});
DesignNode fromPBDF(Map<String, dynamic> json) {
return Oval(
Expand Down Expand Up @@ -79,6 +80,9 @@ class Oval implements DesignNodeFactory, DesignNode {
maintainScrollPosition: json['maintainScrollPosition'],
type: json['type'] as String,
pbdfType: json['pbdfType'] as String,
style: json['style'] == null
? null
: PBStyle.fromPBDF(json['style'] as Map<String, dynamic>),
);
}

Expand Down
12 changes: 9 additions & 3 deletions lib/design_logic/pb_shared_instance_design_node.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:parabeac_core/design_logic/design_node.dart';
import 'package:parabeac_core/design_logic/pb_style.dart';
import 'package:parabeac_core/input/sketch/entities/objects/frame.dart';
import 'package:parabeac_core/input/sketch/entities/objects/override_value.dart';
import 'package:parabeac_core/input/sketch/helper/symbol_node_mixin.dart';
Expand Down Expand Up @@ -41,12 +42,14 @@ class PBSharedInstanceDesignNode extends DesignNode
userInfo,
bool maintainScrollPosition,
num scale,
String symbolID,
this.symbolID,
num verticalSpacing,
num horizontalSpacing,
pbdfType})
this.pbdfType})
: super(UUID, name, isVisible, boundaryRectangle, type, style,
prototypeNode);
prototypeNode) {
pbdfType = 'symbol_instance';
}

@override
String pbdfType = 'symbol_instance';
Expand Down Expand Up @@ -90,6 +93,9 @@ class PBSharedInstanceDesignNode extends DesignNode
horizontalSpacing: (json['horizontalSpacing'] as num)?.toDouble(),
type: json['type'] as String,
pbdfType: json['pbdfType'],
style: json['style'] == null
? null
: PBStyle.fromPBDF(json['style'] as Map<String, dynamic>),
)
..prototypeNodeUUID = json['prototypeNodeUUID'] as String
..parameters = json['parameters'] as List;
Expand Down
Loading

0 comments on commit c6e1e5d

Please sign in to comment.