OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'basic.dart'; | 5 import 'basic.dart'; |
6 import 'material.dart'; | 6 import 'material.dart'; |
7 | 7 |
8 class Dialog extends Component { | 8 class Dialog extends Component { |
9 Dialog({ | 9 Dialog({ |
10 String key, | 10 String key, |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 List<Widget> children = new List<Widget>(); | 27 List<Widget> children = new List<Widget>(); |
28 | 28 |
29 if (title != null) | 29 if (title != null) |
30 children.add(title); | 30 children.add(title); |
31 | 31 |
32 if (content != null) | 32 if (content != null) |
33 children.add(content); | 33 children.add(content); |
34 | 34 |
35 if (actions != null) | 35 if (actions != null) |
36 children.add(content); | 36 children.add(actions); |
37 | 37 |
38 return new Stack([ | 38 return new Stack([ |
39 new Listener( | 39 new Listener( |
40 child: mask, | 40 child: mask, |
41 onGestureTap: (_) => onDismiss() | 41 onGestureTap: (_) => onDismiss() |
42 ), | 42 ), |
43 new Center( | 43 new Center( |
44 child: new ConstrainedBox( | 44 child: new ConstrainedBox( |
45 constraints: new BoxConstraints(minWidth: 280.0), | 45 constraints: new BoxConstraints(minWidth: 280.0), |
46 child: new Material( | 46 child: new Material( |
47 level: 4, | 47 level: 4, |
48 child: new ShrinkWrapWidth( | 48 child: new ShrinkWrapWidth( |
49 child: new Block(children) | 49 child: new Block(children) |
50 ) | 50 ) |
51 ) | 51 ) |
52 ) | 52 ) |
53 ) | 53 ) |
54 ]); | 54 ]); |
55 } | 55 } |
56 } | 56 } |
OLD | NEW |