Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: sky/sdk/lib/widgets/dialog.dart

Issue 1189893002: Add a basic Dialog (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/BUILD.gn ('k') | sky/tests/widgets/dialog.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 import 'basic.dart';
6 import 'material.dart';
7
8 class Dialog extends Component {
9 Dialog({
10 String key,
11 this.title,
12 this.content,
13 this.actions,
14 this.onDismiss
15 }) : super(key: key);
16
17 final Widget title;
18 final Widget content;
19 final Widget actions;
20 final Function onDismiss;
21
22 Widget build() {
23 Container mask = new Container(
24 decoration: const BoxDecoration(
25 backgroundColor: const Color(0x7F000000)));
26
27 List<Widget> children = new List<Widget>();
28
29 if (title != null)
30 children.add(title);
31
32 if (content != null)
33 children.add(content);
34
35 if (actions != null)
36 children.add(content);
37
38 return new Stack([
39 new EventListenerNode(mask, onGestureTap: (_) => onDismiss()),
40 new Center(
41 child: new ConstrainedBox(
42 constraints: new BoxConstraints(minWidth: 280.0),
43 child: new Material(
44 level: 4,
45 child: new ShrinkWrapWidth(
46 child: new Block(children)
47 )
48 )
49 )
50 )
51 ]);
52 }
53 }
OLDNEW
« no previous file with comments | « sky/sdk/BUILD.gn ('k') | sky/tests/widgets/dialog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698