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

@@ -10,12 +10,12 @@ import 'package:flutter/rendering.dart';
// Material design colors. :p
List<Color> _kColors = <Color>[
Colors.teal[500],
Colors.amber[500],
Colors.purple[500],
Colors.lightBlue[500],
Colors.deepPurple[500],
Colors.lime[500],
Colors.teal,
Colors.amber,
Colors.purple,
Colors.lightBlue,
Colors.deepPurple,
Colors.lime,
];
/// A simple model object for a dot that reacts to pointer pressure.

View File

@@ -30,8 +30,8 @@ class _GesturePainter extends CustomPainter {
final Point center = (size.center(Point.origin).toOffset() * zoom + offset).toPoint();
final double radius = size.width / 2.0 * zoom;
final Gradient gradient = new RadialGradient(
colors: forward ? <Color>[swatch[50], swatch[900]]
: <Color>[swatch[900], swatch[50]]
colors: forward ? <Color>[swatch.shade50, swatch.shade900]
: <Color>[swatch.shade900, swatch.shade50]
);
final Paint paint = new Paint()
..shader = gradient.createShader(new Rect.fromLTWH(

View File

@@ -18,7 +18,7 @@ class AdaptedListItem extends StatelessWidget {
height: 32.0,
margin: const EdgeInsets.all(8.0),
decoration: new BoxDecoration(
backgroundColor: Colors.lightBlueAccent[100]
backgroundColor: Colors.lightBlueAccent.shade100
)
),
new Text(name)
@@ -40,7 +40,7 @@ class AdaptedGridItem extends StatelessWidget {
new Expanded(
child: new Container(
decoration: new BoxDecoration(
backgroundColor: Colors.lightBlueAccent[100]
backgroundColor: Colors.lightBlueAccent.shade100
)
)
),

View File

@@ -23,8 +23,8 @@ final List<List<String>> _kNameLines = _kDialogText
.map((String line) => line.split(':'))
.toList();
final TextStyle _kDaveStyle = new TextStyle(color: Colors.indigo[400], height: 1.8);
final TextStyle _kHalStyle = new TextStyle(color: Colors.red[400], fontFamily: "monospace");
final TextStyle _kDaveStyle = new TextStyle(color: Colors.indigo.shade400, height: 1.8);
final TextStyle _kHalStyle = new TextStyle(color: Colors.red.shade400, fontFamily: "monospace");
final TextStyle _kBold = const TextStyle(fontWeight: FontWeight.bold);
final TextStyle _kUnderline = const TextStyle(
decoration: TextDecoration.underline,
@@ -127,7 +127,7 @@ void main() {
title: new Text('Hal and Dave')
),
body: new Material(
color: Colors.grey[50],
color: Colors.grey.shade50,
child: new StyledTextDemo()
)
)