Skip to content

Commit 234aa60

Browse files
committed
Canvas object with toMap
1 parent 4428f41 commit 234aa60

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

lib/canvas.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Canvas {
2+
String backgroundColor;
3+
List<String> bodyElementIds;
4+
bool isHidden = false;
5+
bool isPublished = false;
6+
String name;
7+
8+
Map<String, dynamic> toMap() {
9+
return {
10+
'background_color': backgroundColor,
11+
'body_element_ids': bodyElementIds,
12+
'is_hidden': isHidden,
13+
'is_published': isPublished,
14+
'name': name,
15+
};
16+
}
17+
}

lib/facebook_canvas.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
library facebook_canvas;
2+
3+
export 'canvas.dart';

pubspec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: facebook_canvas
2+
version: 0.1.0
3+
description: Facebook Canvas elements in Dart.

0 commit comments

Comments
 (0)