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

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

Issue 1207373005: Add some dartdoc comments (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/lib/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../theme/colors.dart' as colors; 5 import '../theme/colors.dart' as colors;
6 import 'basic.dart'; 6 import 'basic.dart';
7 import 'default_text_style.dart'; 7 import 'default_text_style.dart';
8 import 'material.dart'; 8 import 'material.dart';
9 import "theme.dart"; 9 import "theme.dart";
10 10
11 /// A material design dialog
12 ///
13 /// <https://www.google.com/design/spec/components/dialogs.html>
11 class Dialog extends Component { 14 class Dialog extends Component {
12 Dialog({ 15 Dialog({
13 String key, 16 String key,
14 this.title, 17 this.title,
15 this.content, 18 this.content,
16 this.actions, 19 this.actions,
17 this.onDismiss 20 this.onDismiss
18 }) : super(key: key); 21 }) : super(key: key);
19 22
23 /// The (optional) title of the dialog is displayed in a large font at the top
Hixie 2015/07/08 15:10:57 This is an interesting convention (putting the doc
abarth-chromium 2015/07/08 15:29:29 I was just experimenting with different approaches
24 /// of the dialog.
20 final Widget title; 25 final Widget title;
26
27 /// The (optional) content of the dialog is displayed in the center of the
28 /// dialog in a lighter font.
21 final Widget content; 29 final Widget content;
30
31 /// The (optional) set of actions that are displayed at the bottom of the
32 /// dialog.
22 final List<Widget> actions; 33 final List<Widget> actions;
34
35 /// An (optional) callback that is called when the dialog is dismissed.
23 final Function onDismiss; 36 final Function onDismiss;
24 37
25 Color get color { 38 Color get _color {
26 switch (Theme.of(this).brightness) { 39 switch (Theme.of(this).brightness) {
27 case ThemeBrightness.light: 40 case ThemeBrightness.light:
28 return colors.White; 41 return colors.White;
29 case ThemeBrightness.dark: 42 case ThemeBrightness.dark:
30 return colors.Grey[800]; 43 return colors.Grey[800];
31 } 44 }
32 } 45 }
33 46
34 Widget build() { 47 Widget build() {
35 Container mask = new Container( 48 Container mask = new Container(
(...skipping 30 matching lines...) Expand all
66 child: mask, 79 child: mask,
67 onGestureTap: (_) => onDismiss() 80 onGestureTap: (_) => onDismiss()
68 ), 81 ),
69 new Center( 82 new Center(
70 child: new Container( 83 child: new Container(
71 margin: new EdgeDims.symmetric(horizontal: 40.0, vertical: 24.0), 84 margin: new EdgeDims.symmetric(horizontal: 40.0, vertical: 24.0),
72 child: new ConstrainedBox( 85 child: new ConstrainedBox(
73 constraints: new BoxConstraints(minWidth: 280.0), 86 constraints: new BoxConstraints(minWidth: 280.0),
74 child: new Material( 87 child: new Material(
75 level: 4, 88 level: 4,
76 color: color, 89 color: _color,
77 child: new ShrinkWrapWidth( 90 child: new ShrinkWrapWidth(
78 child: new Block(children) 91 child: new Block(children)
79 ) 92 )
80 ) 93 )
81 ) 94 )
82 ) 95 )
83 ) 96 )
84 ]); 97 ]);
85 } 98 }
86 } 99 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698