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

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

Issue 1192773004: Teach Sky buttons and dialogs how to use the new Theme system (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/sdk/lib/widgets/material_button.dart ('k') | sky/sdk/lib/widgets/theme.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/raised_button.dart
diff --git a/sky/sdk/lib/widgets/raised_button.dart b/sky/sdk/lib/widgets/raised_button.dart
index 7e8bfb5aa338c0ce1435bde347b425d08965c5c4..2ff19038e50240714e01fa7b444d049add83964f 100644
--- a/sky/sdk/lib/widgets/raised_button.dart
+++ b/sky/sdk/lib/widgets/raised_button.dart
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import '../theme/colors.dart';
+import '../theme/colors.dart' as colors;
import 'basic.dart';
import 'material_button.dart';
-
-export 'material_button.dart' show MaterialButtonTheme;
+import 'theme.dart';
class RaisedButton extends MaterialButton {
@@ -14,32 +13,30 @@ class RaisedButton extends MaterialButton {
String key,
Widget child,
bool enabled: true,
- Function onPressed,
- MaterialButtonTheme theme: MaterialButtonTheme.light
+ Function onPressed
}) : super(key: key,
child: child,
enabled: enabled,
- onPressed: onPressed,
- theme: theme);
+ onPressed: onPressed);
Color get color {
if (enabled) {
- switch (theme) {
- case MaterialButtonTheme.light:
+ switch (Theme.of(this).brightness) {
+ case ThemeBrightness.light:
if (highlight)
- return Grey[350];
+ return colors.Grey[350];
else
- return Grey[300];
+ return colors.Grey[300];
break;
- case MaterialButtonTheme.dark:
+ case ThemeBrightness.dark:
if (highlight)
- return Blue[700];
+ return Theme.of(this).primary[700];
else
- return Blue[600];
+ return Theme.of(this).primary[600];
break;
}
} else {
- return Grey[350];
+ return colors.Grey[350];
}
}
« no previous file with comments | « sky/sdk/lib/widgets/material_button.dart ('k') | sky/sdk/lib/widgets/theme.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698