-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathTestFreeLayout1.dart
48 lines (41 loc) · 1.38 KB
/
TestFreeLayout1.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//Test Code: TestFreeLayout1
import 'package:rikulo_ui/view.dart';
void main() {
final View mainView = new View()..addToDocument();
mainView.style.backgroundColor = "#cca";
View view = new View();
view.style.backgroundColor = "#ddb";
view.style.border = "1px solid white";
view.profile.anchor = "parent";
view.profile.location = "center center";
mainView.addChild(view);
//test if subView will affect its parent's size
View subView = new View();
subView.style.backgroundColor = "#eec";
subView.left = 100;
subView.top = 10;
subView.width = 30; //test: direct with
subView.height = 20;
view.addChild(subView);
subView = new View();
subView.style.backgroundColor = "#eec";
subView.style.border = "2px solid red";
subView.left = 10;
subView.top = 100;
subView.profile.width = "50"; //test: profile.width
subView.profile.height = "30";
view.addChild(subView);
//it shall be placed inside border
View subsubView = new View();
subsubView.style.border = "2px solid blue";
subsubView.profile.width = subsubView.profile.height = "flex";
subView.addChild(subsubView);
//anchored view doesn't affect its parent's size
subView = new View();
subView.style.backgroundColor = "#dd8";
subView.profile.anchor = "parent";
subView.profile.location = "south start";
subView.profile.width = "100%";
subView.profile.height = "15%";
view.addChild(subView);
}