Commit 2c2fa238 authored by Adam Barth's avatar Adam Barth

Remove ThemeData.primarySwatch

In the dark theme, there isn't really a primary swatch, so this API was
a sandtrap. Instead, be explicit about the colors we need for various
widgets in the theme.

Fixes #1277
parent d91d3347
...@@ -300,7 +300,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -300,7 +300,7 @@ class CardCollectionState extends State<CardCollection> {
onResized: () { _invalidator(<int>[index]); }, onResized: () { _invalidator(<int>[index]); },
onDismissed: () { dismissCard(cardModel); }, onDismissed: () { dismissCard(cardModel); },
child: new Card( child: new Card(
color: Theme.of(context).primarySwatch[cardModel.color], color: _primaryColor[cardModel.color],
child: new Container( child: new Container(
height: cardModel.height, height: cardModel.height,
padding: const EdgeDims.all(kCardMargins), padding: const EdgeDims.all(kCardMargins),
...@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> {
Widget body = new Container( Widget body = new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: Theme.of(context).primarySwatch[50]), decoration: new BoxDecoration(backgroundColor: _primaryColor[50]),
child: cardCollection child: cardCollection
); );
......
...@@ -181,8 +181,8 @@ class DayPicker extends StatelessComponent { ...@@ -181,8 +181,8 @@ class DayPicker extends StatelessComponent {
final DateTime displayedMonth; final DateTime displayedMonth;
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData theme = Theme.of(context); ThemeData themeData = Theme.of(context);
TextStyle headerStyle = theme.text.caption.copyWith(fontWeight: FontWeight.w700); TextStyle headerStyle = themeData.text.caption.copyWith(fontWeight: FontWeight.w700);
TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0); TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0);
TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500); TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500);
DateFormat dateFormat = new DateFormat(); DateFormat dateFormat = new DateFormat();
...@@ -230,7 +230,7 @@ class DayPicker extends StatelessComponent { ...@@ -230,7 +230,7 @@ class DayPicker extends StatelessComponent {
selectedDate.month == month && selectedDate.month == month &&
selectedDate.day == day) selectedDate.day == day)
decoration = new BoxDecoration( decoration = new BoxDecoration(
backgroundColor: theme.primarySwatch[100], backgroundColor: themeData.backgroundColor,
shape: BoxShape.circle shape: BoxShape.circle
); );
...@@ -239,7 +239,7 @@ class DayPicker extends StatelessComponent { ...@@ -239,7 +239,7 @@ class DayPicker extends StatelessComponent {
if (currentDate.year == year && if (currentDate.year == year &&
currentDate.month == month && currentDate.month == month &&
currentDate.day == day) currentDate.day == day)
itemStyle = itemStyle.copyWith(color: theme.primaryColor); itemStyle = itemStyle.copyWith(color: themeData.primaryColor);
item = new GestureDetector( item = new GestureDetector(
onTap: () { onTap: () {
...@@ -389,7 +389,7 @@ class _YearPickerState extends State<YearPicker> { ...@@ -389,7 +389,7 @@ class _YearPickerState extends State<YearPicker> {
child: new Container( child: new Container(
height: _itemExtent, height: _itemExtent,
decoration: year == config.selectedDate.year ? new BoxDecoration( decoration: year == config.selectedDate.year ? new BoxDecoration(
backgroundColor: Theme.of(context).primarySwatch[100], backgroundColor: Theme.of(context).backgroundColor,
shape: BoxShape.circle shape: BoxShape.circle
) : null, ) : null,
child: new Center( child: new Center(
......
...@@ -84,9 +84,17 @@ class _InputState extends State<Input> { ...@@ -84,9 +84,17 @@ class _InputState extends State<Input> {
bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus); bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus);
TextStyle textStyle = config.style ?? themeData.text.subhead; TextStyle textStyle = config.style ?? themeData.text.subhead;
Color focusHighlightColor = themeData.accentColor; Color activeColor = themeData.hintColor;
if (themeData.primarySwatch != null) if (focused) {
focusHighlightColor = focused ? themeData.primarySwatch[400] : themeData.hintColor; switch (themeData.brightness) {
case ThemeBrightness.dark:
activeColor = themeData.accentColor;
break;
case ThemeBrightness.light:
activeColor = themeData.primaryColor;
break;
}
}
double topPadding = config.isDense ? 12.0 : 16.0; double topPadding = config.isDense ? 12.0 : 16.0;
List<Widget> stackChildren = <Widget>[]; List<Widget> stackChildren = <Widget>[];
...@@ -96,7 +104,7 @@ class _InputState extends State<Input> { ...@@ -96,7 +104,7 @@ class _InputState extends State<Input> {
if (config.labelText != null) { if (config.labelText != null) {
TextStyle labelStyle = hasInlineLabel ? TextStyle labelStyle = hasInlineLabel ?
themeData.text.subhead.copyWith(color: themeData.hintColor) : themeData.text.subhead.copyWith(color: themeData.hintColor) :
themeData.text.caption.copyWith(color: focused ? focusHighlightColor : themeData.hintColor); themeData.text.caption.copyWith(color: activeColor);
double topPaddingIncrement = themeData.text.caption.fontSize + (config.isDense ? 4.0 : 8.0); double topPaddingIncrement = themeData.text.caption.fontSize + (config.isDense ? 4.0 : 8.0);
double top = topPadding; double top = topPadding;
...@@ -123,13 +131,9 @@ class _InputState extends State<Input> { ...@@ -123,13 +131,9 @@ class _InputState extends State<Input> {
)); ));
} }
Color cursorColor = themeData.primarySwatch == null ?
themeData.accentColor :
themeData.primarySwatch[200];
EdgeDims margin = new EdgeDims.only(bottom: config.isDense ? 4.0 : 8.0); EdgeDims margin = new EdgeDims.only(bottom: config.isDense ? 4.0 : 8.0);
EdgeDims padding = new EdgeDims.only(top: topPadding, bottom: 8.0); EdgeDims padding = new EdgeDims.only(top: topPadding, bottom: 8.0);
Color borderColor = focusHighlightColor; Color borderColor = activeColor;
double borderWidth = focused ? 2.0 : 1.0; double borderWidth = focused ? 2.0 : 1.0;
if (config.errorText != null) { if (config.errorText != null) {
...@@ -160,8 +164,8 @@ class _InputState extends State<Input> { ...@@ -160,8 +164,8 @@ class _InputState extends State<Input> {
focusKey: focusKey, focusKey: focusKey,
style: textStyle, style: textStyle,
hideText: config.hideText, hideText: config.hideText,
cursorColor: cursorColor, cursorColor: themeData.selectionColor,
selectionColor: cursorColor, selectionColor: themeData.selectionColor,
keyboardType: config.keyboardType, keyboardType: config.keyboardType,
onChanged: config.onChanged, onChanged: config.onChanged,
onSubmitted: config.onSubmitted onSubmitted: config.onSubmitted
...@@ -190,7 +194,7 @@ class _InputState extends State<Input> { ...@@ -190,7 +194,7 @@ class _InputState extends State<Input> {
width: config.isDense ? 40.0 : 48.0, width: config.isDense ? 40.0 : 48.0,
child: new Icon( child: new Icon(
icon: config.icon, icon: config.icon,
color: focused ? focusHighlightColor : Colors.black45, color: focused ? activeColor : Colors.black45,
size: config.isDense ? IconSize.s18 : IconSize.s24 size: config.isDense ? IconSize.s18 : IconSize.s24
) )
), ),
......
...@@ -22,7 +22,7 @@ abstract class ProgressIndicator extends StatefulComponent { ...@@ -22,7 +22,7 @@ abstract class ProgressIndicator extends StatefulComponent {
final double value; // Null for non-determinate progress indicator. final double value; // Null for non-determinate progress indicator.
Color _getBackgroundColor(BuildContext context) => Theme.of(context).primarySwatch[200]; Color _getBackgroundColor(BuildContext context) => Theme.of(context).backgroundColor;
Color _getValueColor(BuildContext context) => Theme.of(context).primaryColor; Color _getValueColor(BuildContext context) => Theme.of(context).primaryColor;
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
......
...@@ -74,15 +74,7 @@ class _RaisedButtonState extends MaterialButtonState<RaisedButton> { ...@@ -74,15 +74,7 @@ class _RaisedButtonState extends MaterialButtonState<RaisedButton> {
Color getColor(BuildContext context) { Color getColor(BuildContext context) {
if (config.enabled) { if (config.enabled) {
if (config.color != null) return config.color ?? Theme.of(context).buttonColor;
return config.color;
switch (Theme.of(context).brightness) {
case ThemeBrightness.light:
return Colors.grey[300];
case ThemeBrightness.dark:
Map<int, Color> swatch = Theme.of(context).primarySwatch ?? Colors.blue;
return swatch[600];
}
} else { } else {
if (config.disabledColor != null) if (config.disabledColor != null)
return config.disabledColor; return config.disabledColor;
......
...@@ -31,9 +31,10 @@ class ThemeData { ...@@ -31,9 +31,10 @@ class ThemeData {
ThemeData.raw({ ThemeData.raw({
this.brightness, this.brightness,
this.primarySwatch,
this.primaryColor, this.primaryColor,
this.primaryColorBrightness, this.primaryColorBrightness,
this.accentColor,
this.accentColorBrightness,
this.canvasColor, this.canvasColor,
this.cardColor, this.cardColor,
this.dividerColor, this.dividerColor,
...@@ -41,8 +42,9 @@ class ThemeData { ...@@ -41,8 +42,9 @@ class ThemeData {
this.splashColor, this.splashColor,
this.unselectedColor, this.unselectedColor,
this.disabledColor, this.disabledColor,
this.accentColor, this.buttonColor,
this.accentColorBrightness, this.selectionColor,
this.backgroundColor,
this.indicatorColor, this.indicatorColor,
this.hintColor, this.hintColor,
this.hintOpacity, this.hintOpacity,
...@@ -52,9 +54,10 @@ class ThemeData { ...@@ -52,9 +54,10 @@ class ThemeData {
this.primaryIconTheme this.primaryIconTheme
}) { }) {
assert(brightness != null); assert(brightness != null);
// primarySwatch can be null; TODO(ianh): see https://github.com/flutter/flutter/issues/1277
assert(primaryColor != null); assert(primaryColor != null);
assert(primaryColorBrightness != null); assert(primaryColorBrightness != null);
assert(accentColor != null);
assert(accentColorBrightness != null);
assert(canvasColor != null); assert(canvasColor != null);
assert(cardColor != null); assert(cardColor != null);
assert(dividerColor != null); assert(dividerColor != null);
...@@ -62,8 +65,9 @@ class ThemeData { ...@@ -62,8 +65,9 @@ class ThemeData {
assert(splashColor != null); assert(splashColor != null);
assert(unselectedColor != null); assert(unselectedColor != null);
assert(disabledColor != null); assert(disabledColor != null);
assert(accentColor != null); assert(buttonColor != null);
assert(accentColorBrightness != null); assert(selectionColor != null);
assert(disabledColor != null);
assert(indicatorColor != null); assert(indicatorColor != null);
assert(hintColor != null); assert(hintColor != null);
assert(hintOpacity != null); assert(hintOpacity != null);
...@@ -74,10 +78,12 @@ class ThemeData { ...@@ -74,10 +78,12 @@ class ThemeData {
} }
factory ThemeData({ factory ThemeData({
ThemeBrightness brightness: ThemeBrightness.light, ThemeBrightness brightness,
Map<int, Color> primarySwatch, Map<int, Color> primarySwatch,
Color primaryColor, Color primaryColor,
ThemeBrightness primaryColorBrightness, ThemeBrightness primaryColorBrightness,
Color accentColor,
ThemeBrightness accentColorBrightness,
Color canvasColor, Color canvasColor,
Color cardColor, Color cardColor,
Color dividerColor, Color dividerColor,
...@@ -85,8 +91,9 @@ class ThemeData { ...@@ -85,8 +91,9 @@ class ThemeData {
Color splashColor, Color splashColor,
Color unselectedColor, Color unselectedColor,
Color disabledColor, Color disabledColor,
Color accentColor, Color buttonColor,
ThemeBrightness accentColorBrightness: ThemeBrightness.dark, Color selectionColor,
Color backgroundColor,
Color indicatorColor, Color indicatorColor,
Color hintColor, Color hintColor,
double hintOpacity, double hintOpacity,
...@@ -95,10 +102,13 @@ class ThemeData { ...@@ -95,10 +102,13 @@ class ThemeData {
TextTheme primaryTextTheme, TextTheme primaryTextTheme,
IconThemeData primaryIconTheme IconThemeData primaryIconTheme
}) { }) {
// brightness default is in the arguments list brightness ??= ThemeBrightness.light;
bool isDark = brightness == ThemeBrightness.dark; final bool isDark = brightness == ThemeBrightness.dark;
primaryColor ??= primarySwatch == null ? isDark ? Colors.grey[900] : Colors.grey[100] : primarySwatch[500]; primarySwatch ??= Colors.blue;
primaryColorBrightness ??= primarySwatch == null ? brightness : ThemeBrightness.dark /* swatch[500] is always dark */; primaryColor ??= isDark ? Colors.grey[900] : primarySwatch[500];
primaryColorBrightness ??= ThemeBrightness.dark;
accentColor ??= primarySwatch[500];
accentColorBrightness ??= ThemeBrightness.dark;
canvasColor ??= isDark ? Colors.grey[850] : Colors.grey[50]; canvasColor ??= isDark ? Colors.grey[850] : Colors.grey[50];
cardColor ??= isDark ? Colors.grey[800] : Colors.white; cardColor ??= isDark ? Colors.grey[800] : Colors.white;
dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000); dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000);
...@@ -106,8 +116,9 @@ class ThemeData { ...@@ -106,8 +116,9 @@ class ThemeData {
splashColor ??= isDark ? _kDarkThemeSplashColor : _kLightThemeSplashColor; splashColor ??= isDark ? _kDarkThemeSplashColor : _kLightThemeSplashColor;
unselectedColor ??= isDark ? Colors.white70 : Colors.black54; unselectedColor ??= isDark ? Colors.white70 : Colors.black54;
disabledColor ??= isDark ? Colors.white30 : Colors.black26; disabledColor ??= isDark ? Colors.white30 : Colors.black26;
accentColor ??= primarySwatch == null ? Colors.blue[500] : primarySwatch[500]; buttonColor ??= isDark ? primarySwatch[600] : Colors.grey[300];
// accentColorBrightness default is in the arguments list selectionColor ??= isDark ? accentColor : primarySwatch[200];
backgroundColor ??= isDark ? Colors.grey[700] : primarySwatch[200];
indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor; indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor;
hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000); hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000);
hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30; hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30;
...@@ -117,9 +128,10 @@ class ThemeData { ...@@ -117,9 +128,10 @@ class ThemeData {
primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: IconThemeColor.white) : const IconThemeData(color: IconThemeColor.black); primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: IconThemeColor.white) : const IconThemeData(color: IconThemeColor.black);
return new ThemeData.raw( return new ThemeData.raw(
brightness: brightness, brightness: brightness,
primarySwatch: primarySwatch,
primaryColor: primaryColor, primaryColor: primaryColor,
primaryColorBrightness: primaryColorBrightness, primaryColorBrightness: primaryColorBrightness,
accentColor: accentColor,
accentColorBrightness: accentColorBrightness,
canvasColor: canvasColor, canvasColor: canvasColor,
cardColor: cardColor, cardColor: cardColor,
dividerColor: dividerColor, dividerColor: dividerColor,
...@@ -127,8 +139,9 @@ class ThemeData { ...@@ -127,8 +139,9 @@ class ThemeData {
splashColor: splashColor, splashColor: splashColor,
unselectedColor: unselectedColor, unselectedColor: unselectedColor,
disabledColor: disabledColor, disabledColor: disabledColor,
accentColor: accentColor, buttonColor: buttonColor,
accentColorBrightness: accentColorBrightness, selectionColor: selectionColor,
backgroundColor: backgroundColor,
indicatorColor: indicatorColor, indicatorColor: indicatorColor,
hintColor: hintColor, hintColor: hintColor,
hintOpacity: hintOpacity, hintOpacity: hintOpacity,
...@@ -139,7 +152,7 @@ class ThemeData { ...@@ -139,7 +152,7 @@ class ThemeData {
); );
} }
factory ThemeData.light() => new ThemeData(primarySwatch: Colors.blue, brightness: ThemeBrightness.light); factory ThemeData.light() => new ThemeData(brightness: ThemeBrightness.light);
factory ThemeData.dark() => new ThemeData(brightness: ThemeBrightness.dark); factory ThemeData.dark() => new ThemeData(brightness: ThemeBrightness.dark);
factory ThemeData.fallback() => new ThemeData.light(); factory ThemeData.fallback() => new ThemeData.light();
...@@ -155,8 +168,6 @@ class ThemeData { ...@@ -155,8 +168,6 @@ class ThemeData {
/// dark, use Colors.white or the accentColor for a contrasting color. /// dark, use Colors.white or the accentColor for a contrasting color.
final ThemeBrightness brightness; final ThemeBrightness brightness;
final Map<int, Color> primarySwatch;
/// The background colour for major parts of the app (toolbars, tab bars, etc) /// The background colour for major parts of the app (toolbars, tab bars, etc)
final Color primaryColor; final Color primaryColor;
...@@ -164,14 +175,6 @@ class ThemeData { ...@@ -164,14 +175,6 @@ class ThemeData {
/// icons placed on top of the primary color (e.g. toolbar text). /// icons placed on top of the primary color (e.g. toolbar text).
final ThemeBrightness primaryColorBrightness; final ThemeBrightness primaryColorBrightness;
final Color canvasColor;
final Color cardColor;
final Color dividerColor;
final Color highlightColor;
final Color splashColor;
final Color unselectedColor;
final Color disabledColor;
/// The foreground color for widgets (knobs, text, etc) /// The foreground color for widgets (knobs, text, etc)
final Color accentColor; final Color accentColor;
...@@ -180,6 +183,17 @@ class ThemeData { ...@@ -180,6 +183,17 @@ class ThemeData {
/// action button). /// action button).
final ThemeBrightness accentColorBrightness; final ThemeBrightness accentColorBrightness;
final Color canvasColor;
final Color cardColor;
final Color dividerColor;
final Color highlightColor;
final Color splashColor;
final Color unselectedColor;
final Color disabledColor;
final Color buttonColor;
final Color selectionColor;
final Color backgroundColor;
/// The color of the selected tab indicator in a tab strip. /// The color of the selected tab indicator in a tab strip.
final Color indicatorColor; final Color indicatorColor;
...@@ -199,18 +213,8 @@ class ThemeData { ...@@ -199,18 +213,8 @@ class ThemeData {
final IconThemeData primaryIconTheme; final IconThemeData primaryIconTheme;
static ThemeData lerp(ThemeData begin, ThemeData end, double t) { static ThemeData lerp(ThemeData begin, ThemeData end, double t) {
Map<int, Color> primarySwatch;
if (begin.primarySwatch != null && end.primarySwatch != null) {
primarySwatch = <int, Color>{};
for (int index in begin.primarySwatch.keys) {
if (!end.primarySwatch.containsKey(index))
continue;
primarySwatch[index] = Color.lerp(begin.primarySwatch[index], end.primarySwatch[index], t);
}
}
return new ThemeData.raw( return new ThemeData.raw(
brightness: t < 0.5 ? begin.brightness : end.brightness, brightness: t < 0.5 ? begin.brightness : end.brightness,
primarySwatch: primarySwatch,
primaryColor: Color.lerp(begin.primaryColor, end.primaryColor, t), primaryColor: Color.lerp(begin.primaryColor, end.primaryColor, t),
primaryColorBrightness: t < 0.5 ? begin.primaryColorBrightness : end.primaryColorBrightness, primaryColorBrightness: t < 0.5 ? begin.primaryColorBrightness : end.primaryColorBrightness,
canvasColor: Color.lerp(begin.canvasColor, end.canvasColor, t), canvasColor: Color.lerp(begin.canvasColor, end.canvasColor, t),
...@@ -220,6 +224,9 @@ class ThemeData { ...@@ -220,6 +224,9 @@ class ThemeData {
splashColor: Color.lerp(begin.splashColor, end.splashColor, t), splashColor: Color.lerp(begin.splashColor, end.splashColor, t),
unselectedColor: Color.lerp(begin.unselectedColor, end.unselectedColor, t), unselectedColor: Color.lerp(begin.unselectedColor, end.unselectedColor, t),
disabledColor: Color.lerp(begin.disabledColor, end.disabledColor, t), disabledColor: Color.lerp(begin.disabledColor, end.disabledColor, t),
buttonColor: Color.lerp(begin.buttonColor, end.buttonColor, t),
selectionColor: Color.lerp(begin.selectionColor, end.selectionColor, t),
backgroundColor: Color.lerp(begin.backgroundColor, end.backgroundColor, t),
accentColor: Color.lerp(begin.accentColor, end.accentColor, t), accentColor: Color.lerp(begin.accentColor, end.accentColor, t),
accentColorBrightness: t < 0.5 ? begin.accentColorBrightness : end.accentColorBrightness, accentColorBrightness: t < 0.5 ? begin.accentColorBrightness : end.accentColorBrightness,
indicatorColor: Color.lerp(begin.indicatorColor, end.indicatorColor, t), indicatorColor: Color.lerp(begin.indicatorColor, end.indicatorColor, t),
...@@ -237,7 +244,6 @@ class ThemeData { ...@@ -237,7 +244,6 @@ class ThemeData {
return false; return false;
ThemeData otherData = other; ThemeData otherData = other;
return (otherData.brightness == brightness) && return (otherData.brightness == brightness) &&
(otherData.primarySwatch == primarySwatch) &&
(otherData.primaryColor == primaryColor) && (otherData.primaryColor == primaryColor) &&
(otherData.primaryColorBrightness == primaryColorBrightness) && (otherData.primaryColorBrightness == primaryColorBrightness) &&
(otherData.canvasColor == canvasColor) && (otherData.canvasColor == canvasColor) &&
...@@ -247,6 +253,9 @@ class ThemeData { ...@@ -247,6 +253,9 @@ class ThemeData {
(otherData.splashColor == splashColor) && (otherData.splashColor == splashColor) &&
(otherData.unselectedColor == unselectedColor) && (otherData.unselectedColor == unselectedColor) &&
(otherData.disabledColor == disabledColor) && (otherData.disabledColor == disabledColor) &&
(otherData.buttonColor == buttonColor) &&
(otherData.selectionColor == selectionColor) &&
(otherData.backgroundColor == backgroundColor) &&
(otherData.accentColor == accentColor) && (otherData.accentColor == accentColor) &&
(otherData.accentColorBrightness == accentColorBrightness) && (otherData.accentColorBrightness == accentColorBrightness) &&
(otherData.indicatorColor == indicatorColor) && (otherData.indicatorColor == indicatorColor) &&
...@@ -260,8 +269,6 @@ class ThemeData { ...@@ -260,8 +269,6 @@ class ThemeData {
int get hashCode { int get hashCode {
return hashValues( return hashValues(
brightness, brightness,
hashList(primarySwatch.keys),
hashList(primarySwatch.values),
primaryColor, primaryColor,
primaryColorBrightness, primaryColorBrightness,
canvasColor, canvasColor,
...@@ -271,6 +278,9 @@ class ThemeData { ...@@ -271,6 +278,9 @@ class ThemeData {
splashColor, splashColor,
unselectedColor, unselectedColor,
disabledColor, disabledColor,
buttonColor,
selectionColor,
backgroundColor,
accentColor, accentColor,
accentColorBrightness, accentColorBrightness,
hashValues( // Too many values. hashValues( // Too many values.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment