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:
committed by
GitHub
parent
fac2fac1d6
commit
578ca0a295
@@ -633,7 +633,7 @@ class FancyDrawerHeader extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.purple[500]
|
||||
backgroundColor: Colors.purple
|
||||
),
|
||||
height: 200.0
|
||||
);
|
||||
|
||||
@@ -378,7 +378,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
|
||||
final Widget body = new Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
|
||||
color: _primaryColor[50],
|
||||
color: _primaryColor.shade50,
|
||||
child: cardCollection,
|
||||
);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class ExampleDragTarget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class ExampleDragTargetState extends State<ExampleDragTarget> {
|
||||
Color _color = Colors.grey[500];
|
||||
Color _color = Colors.grey;
|
||||
|
||||
void _handleAccept(Color data) {
|
||||
setState(() {
|
||||
@@ -31,9 +31,9 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
|
||||
decoration: new BoxDecoration(
|
||||
border: new Border.all(
|
||||
width: 3.0,
|
||||
color: data.isEmpty ? Colors.white : Colors.blue[500]
|
||||
color: data.isEmpty ? Colors.white : Colors.blue
|
||||
),
|
||||
backgroundColor: data.isEmpty ? _color : Colors.grey[200]
|
||||
backgroundColor: data.isEmpty ? _color : Colors.grey.shade200
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ class MovableBall extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
child: new Dot(
|
||||
key: kBallKey,
|
||||
color: Colors.blue[700],
|
||||
color: Colors.blue.shade700,
|
||||
size: kBallSize,
|
||||
tappable: true,
|
||||
child: new Center(child: new Text('BALL'))
|
||||
@@ -248,19 +248,19 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new ExampleDragSource(
|
||||
color: Colors.yellow[300],
|
||||
color: Colors.yellow.shade300,
|
||||
under: true,
|
||||
heavy: false,
|
||||
child: new Text('under')
|
||||
),
|
||||
new ExampleDragSource(
|
||||
color: Colors.green[300],
|
||||
color: Colors.green.shade300,
|
||||
under: false,
|
||||
heavy: true,
|
||||
child: new Text('long-press above')
|
||||
),
|
||||
new ExampleDragSource(
|
||||
color: Colors.indigo[300],
|
||||
color: Colors.indigo.shade300,
|
||||
under: false,
|
||||
heavy: false,
|
||||
child: new Text('above')
|
||||
|
||||
@@ -71,11 +71,11 @@ class _PointDemoPainter extends CustomPainter {
|
||||
final Paint paint = new Paint();
|
||||
|
||||
if (arc.center != null)
|
||||
drawPoint(canvas, arc.center, Colors.grey[400]);
|
||||
drawPoint(canvas, arc.center, Colors.grey.shade400);
|
||||
|
||||
paint
|
||||
..isAntiAlias = false // Work-around for github.com/flutter/flutter/issues/5720
|
||||
..color = Colors.green[500].withOpacity(0.25)
|
||||
..color = Colors.green.withOpacity(0.25)
|
||||
..strokeWidth = 4.0
|
||||
..style = PaintingStyle.stroke;
|
||||
if (arc.center != null && arc.radius != null)
|
||||
@@ -83,11 +83,11 @@ class _PointDemoPainter extends CustomPainter {
|
||||
else
|
||||
canvas.drawLine(arc.begin, arc.end, paint);
|
||||
|
||||
drawPoint(canvas, arc.begin, Colors.green[500]);
|
||||
drawPoint(canvas, arc.end, Colors.red[500]);
|
||||
drawPoint(canvas, arc.begin, Colors.green);
|
||||
drawPoint(canvas, arc.end, Colors.red);
|
||||
|
||||
paint
|
||||
..color = Colors.green[500]
|
||||
..color = Colors.green
|
||||
..style = PaintingStyle.fill;
|
||||
canvas.drawCircle(arc.lerp(_repaint.value), _kPointRadius, paint);
|
||||
}
|
||||
@@ -252,9 +252,9 @@ class _RectangleDemoPainter extends CustomPainter {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
drawRect(canvas, arc.begin, Colors.green[500]);
|
||||
drawRect(canvas, arc.end, Colors.red[500]);
|
||||
drawRect(canvas, arc.lerp(_repaint.value), Colors.blue[500]);
|
||||
drawRect(canvas, arc.begin, Colors.green);
|
||||
drawRect(canvas, arc.end, Colors.red);
|
||||
drawRect(canvas, arc.lerp(_repaint.value), Colors.blue);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -146,7 +146,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
|
||||
48.0, 63.0, 82.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0,
|
||||
];
|
||||
cardModels = new List<CardModel>.generate(cardHeights.length, (int i) {
|
||||
final Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardHeights.length);
|
||||
final Color color = Color.lerp(Colors.red.shade300, Colors.blue.shade900, i / cardHeights.length);
|
||||
return new CardModel(i, cardHeights[i], color);
|
||||
});
|
||||
}
|
||||
@@ -207,7 +207,7 @@ void main() {
|
||||
theme: new ThemeData(
|
||||
brightness: Brightness.light,
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200],
|
||||
accentColor: Colors.redAccent,
|
||||
),
|
||||
title: 'Cards',
|
||||
home: new OverlayGeometryApp(),
|
||||
|
||||
@@ -31,7 +31,7 @@ class PageViewAppState extends State<PageViewApp> {
|
||||
];
|
||||
|
||||
cardModels = new List<CardModel>.generate(cardSizes.length, (int i) {
|
||||
final Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardSizes.length);
|
||||
final Color color = Color.lerp(Colors.red.shade300, Colors.blue.shade900, i / cardSizes.length);
|
||||
return new CardModel(i, cardSizes[i], color);
|
||||
});
|
||||
}
|
||||
@@ -148,7 +148,7 @@ void main() {
|
||||
theme: new ThemeData(
|
||||
brightness: Brightness.light,
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200],
|
||||
accentColor: Colors.redAccent,
|
||||
),
|
||||
home: new PageViewApp(),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user