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

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

Issue 1218153005: Refactoring to support dark theme better (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix import issues 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/widgets/menu_item.dart ('k') | sky/sdk/lib/widgets/raised_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/radio.dart
diff --git a/sky/sdk/lib/widgets/radio.dart b/sky/sdk/lib/widgets/radio.dart
index eb82dfd0a5bc961ded58fc78df2aab3155c6708e..32f0c1c63c9fdc2d1de2de308af456b9b55ec7d4 100644
--- a/sky/sdk/lib/widgets/radio.dart
+++ b/sky/sdk/lib/widgets/radio.dart
@@ -5,9 +5,12 @@
import 'dart:sky' as sky;
import '../rendering/object.dart';
-import '../theme/colors.dart' as colors;
import 'basic.dart';
import 'button_base.dart';
+import 'theme.dart';
+
+const sky.Color _kLightOffColor = const sky.Color(0x8A000000);
+const sky.Color _kDarkOffColor = const sky.Color(0xB2FFFFFF);
typedef void ValueChanged(value);
@@ -31,9 +34,14 @@ class Radio extends ButtonBase {
super.syncFields(source);
}
+ Color get color {
+ ThemeData themeData = Theme.of(this);
+ if (value == groupValue)
+ return themeData.accentColor;
+ return themeData.brightness == ThemeBrightness.light ? _kLightOffColor : _kDarkOffColor;
+ }
+
Widget buildContent() {
- // TODO(jackson): This should change colors with the theme
- Color color = highlight ? colors.Purple[500] : const Color(0x8A000000);
const double kDiameter = 16.0;
const double kOuterRadius = kDiameter / 2;
const double kInnerRadius = 5.0;
« no previous file with comments | « sky/sdk/lib/widgets/menu_item.dart ('k') | sky/sdk/lib/widgets/raised_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698