-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathTestViewTag.dart
36 lines (33 loc) · 991 Bytes
/
TestViewTag.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
//Sample Code: Test Log
import 'dart:html';
import 'package:rikulo_ui/view.dart';
void main() {
/* Notice that this is only for testing purpose. This sample is better to be
done by use of the TextView.fromHtml constructor as follows (not exactly
equalivalent but you got the point).
new TextView.fromHtml('''
<dl>
<li type="i" value="$index">This is the <b>$index</b> item</li>
</dl>
''');
*/
View dl = new View.tag("dl");
for (int i = 0; i < 10; ++i) {
View li = new View.tag("li");
(li.node as LIElement)
..value = i*2 + 1
..innerHtml = "This is the <b>$i</b> item.";
li.top = 22 * i;
dl.addChild(li);
}
final View mainView = new View()..addToDocument();
mainView.addChild(dl);
mainView.addChild(
new View.html('''
<table cellapding="10" border="1">
<tr><td>Cell 1.1</td><td>Cell 1.2</td></tr>
<tr><td>Cell 2.1</td><td>Cell 2.2</td></tr>
</table>
''')
..left = 200..width = 300);
}