-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathTestDialog2.dart
33 lines (31 loc) · 969 Bytes
/
TestDialog2.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
//Test Code: TestDialog
import 'package:rikulo_ui/view.dart';
void main() {
Button btn = new Button("Open a dialog");
btn.profile.location = "center left";
btn.on.click.listen((event) {
final dialog = new View()
..classes.add("v-dialog")
..layout.text = "type: linear; orient: vertical"
..profile.text = "width:120; height:60";
dialog
..addChild(
new TextView.fromHtml("<b>Delete this file?</b>"))
..addChild(
new View()
..layout.text = "type: linear"
..addChild(
new Button("Yes")
..on.click.listen((event) { //delete
//removeFile(); //assume you have this method
dialog.remove();
}))
..addChild(
new Button("No")
..on.click.listen((event) { //cancel
dialog.remove();
})))
..addToDocument(mode: "dialog");
});
new View()..addChild(btn)..addToDocument();
}