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

Unified Diff: sky/sdk/lib/widgets/dialog.dart

Issue 1201273002: Add a confirmation dialog to stock app Settings page and style it by default (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/stocks2/lib/stock_settings.dart ('k') | sky/sdk/lib/widgets/flat_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/dialog.dart
diff --git a/sky/sdk/lib/widgets/dialog.dart b/sky/sdk/lib/widgets/dialog.dart
index 027cd0cb0e669da6f6fd80a81e07e4755823d80d..fc20694e529578cf9379b6ed5a58237cbcfba605 100644
--- a/sky/sdk/lib/widgets/dialog.dart
+++ b/sky/sdk/lib/widgets/dialog.dart
@@ -4,6 +4,7 @@
import '../theme/colors.dart' as colors;
import 'basic.dart';
+import 'default_text_style.dart';
import 'material.dart';
import "theme.dart";
@@ -18,7 +19,7 @@ class Dialog extends Component {
final Widget title;
final Widget content;
- final Widget actions;
+ final List<Widget> actions;
final Function onDismiss;
Color get color {
@@ -37,14 +38,28 @@ class Dialog extends Component {
List<Widget> children = new List<Widget>();
- if (title != null)
- children.add(title);
+ if (title != null) {
+ children.add(new Padding(
+ padding: new EdgeDims(24.0, 24.0, content == null ? 20.0 : 0.0, 24.0),
+ child: new DefaultTextStyle(
+ style: Theme.of(this).text.title,
+ child: title
+ )
+ ));
+ }
- if (content != null)
- children.add(content);
+ if (content != null) {
+ children.add(new Padding(
+ padding: const EdgeDims(20.0, 24.0, 24.0, 24.0),
+ child: new DefaultTextStyle(
+ style: Theme.of(this).text.subhead,
+ child: content
+ )
+ ));
+ }
if (actions != null)
- children.add(actions);
+ children.add(new Flex(actions, justifyContent: FlexJustifyContent.flexEnd));
return new Stack([
new Listener(
@@ -52,13 +67,16 @@ class Dialog extends Component {
onGestureTap: (_) => onDismiss()
),
new Center(
- child: new ConstrainedBox(
- constraints: new BoxConstraints(minWidth: 280.0),
- child: new Material(
- level: 4,
- color: color,
- child: new ShrinkWrapWidth(
- child: new Block(children)
+ child: new Container(
+ margin: new EdgeDims.symmetric(horizontal: 40.0, vertical: 24.0),
+ child: new ConstrainedBox(
+ constraints: new BoxConstraints(minWidth: 280.0),
+ child: new Material(
+ level: 4,
+ color: color,
+ child: new ShrinkWrapWidth(
+ child: new Block(children)
+ )
)
)
)
« no previous file with comments | « sky/examples/stocks2/lib/stock_settings.dart ('k') | sky/sdk/lib/widgets/flat_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698