use color.shadeXxx instead of color[Xxx] (#8932)

* use color.shadeXxx instead of color[Xxx]

* remove calls to .shade500 on MaterialColor

* remove calls to .shade200 on MaterialAccentColor

* fix test
This commit is contained in:
Alexandre Ardhuin
2017-03-21 23:14:55 +01:00
committed by GitHub
parent fac2fac1d6
commit 578ca0a295
33 changed files with 77 additions and 77 deletions

View File

@@ -151,7 +151,7 @@ class SectionDetailView extends StatelessWidget {
}
return new DecoratedBox(
decoration: new BoxDecoration(backgroundColor: Colors.grey[200]),
decoration: new BoxDecoration(backgroundColor: Colors.grey.shade200),
child: item,
);
}

View File

@@ -98,31 +98,31 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
new NavigationIconView(
icon: new Icon(Icons.access_alarm),
title: new Text('Alarm'),
color: Colors.deepPurple[500],
color: Colors.deepPurple,
vsync: this,
),
new NavigationIconView(
icon: new CustomIcon(),
title: new Text('Box'),
color: Colors.deepOrange[500],
color: Colors.deepOrange,
vsync: this,
),
new NavigationIconView(
icon: new Icon(Icons.cloud),
title: new Text('Cloud'),
color: Colors.teal[500],
color: Colors.teal,
vsync: this,
),
new NavigationIconView(
icon: new Icon(Icons.favorite),
title: new Text('Favorites'),
color: Colors.indigo[500],
color: Colors.indigo,
vsync: this,
),
new NavigationIconView(
icon: new Icon(Icons.event_available),
title: new Text('Event'),
color: Colors.pink[500],
color: Colors.pink,
vsync: this,
)
];

View File

@@ -35,7 +35,7 @@ class _InputDropdown extends StatelessWidget {
children: <Widget>[
new Text(valueText, style: valueStyle),
new Icon(Icons.arrow_drop_down,
color: Theme.of(context).brightness == Brightness.light ? Colors.grey[700] : Colors.white70
color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70
),
],
),

View File

@@ -75,7 +75,7 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
appBar: new AppBar(title: new Text('Persistent bottom sheet')),
floatingActionButton: new FloatingActionButton(
onPressed: _showMessage,
backgroundColor: Colors.redAccent[200],
backgroundColor: Colors.redAccent,
child: new Icon(Icons.add)
),
body: new Center(

View File

@@ -17,9 +17,9 @@ class _Page {
final MaterialColor colors;
final IconData icon;
Color get labelColor => colors != null ? colors[300] : Colors.grey[300];
Color get labelColor => colors != null ? colors.shade300 : Colors.grey.shade300;
bool get fabDefined => colors != null && icon != null;
Color get fabColor => colors[400];
Color get fabColor => colors.shade400;
Icon get fabIcon => new Icon(icon);
Key get fabKey => new ValueKey<Color>(fabColor);
}

View File

@@ -25,7 +25,7 @@ final Set<Recipe> _favoriteRecipes = new Set<Recipe>();
final ThemeData _kTheme = new ThemeData(
brightness: Brightness.light,
primarySwatch: Colors.teal,
accentColor: Colors.redAccent[200],
accentColor: Colors.redAccent,
);
class PestoHome extends StatelessWidget {

View File

@@ -127,7 +127,7 @@ class GalleryAppState extends State<GalleryApp> {
return new MaterialApp(
title: 'Flutter Gallery',
color: Colors.grey[500],
color: Colors.grey,
theme: (_useLightTheme ? _kGalleryLightTheme : _kGalleryDarkTheme).copyWith(platform: _platform ?? defaultTargetPlatform),
showPerformanceOverlay: _showPerformanceOverlay,
checkerboardRasterCacheImages: _checkerboardRasterCacheImages,