Commit 1272e053 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by Chinmay Garde

prefer_const_constructor in packages/flutter/lib (#7179)

parent 37d78753
...@@ -14,7 +14,7 @@ import 'term.dart'; ...@@ -14,7 +14,7 @@ import 'term.dart';
enum _SymbolType { invalid, external, slack, error, dummy, } enum _SymbolType { invalid, external, slack, error, dummy, }
class _Symbol { class _Symbol {
const _Symbol(this.type); _Symbol(this.type);
final _SymbolType type; final _SymbolType type;
} }
......
...@@ -393,7 +393,7 @@ class _LicensePageState extends State<LicensePage> { ...@@ -393,7 +393,7 @@ class _LicensePageState extends State<LicensePage> {
), ),
child: new Text( child: new Text(
license.packages.join(', '), license.packages.join(', '),
style: new TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.center textAlign: TextAlign.center
) )
)); ));
...@@ -403,7 +403,7 @@ class _LicensePageState extends State<LicensePage> { ...@@ -403,7 +403,7 @@ class _LicensePageState extends State<LicensePage> {
padding: const EdgeInsets.only(top: 16.0), padding: const EdgeInsets.only(top: 16.0),
child: new Text( child: new Text(
paragraph.text, paragraph.text,
style: new TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.center textAlign: TextAlign.center
) )
)); ));
......
...@@ -426,7 +426,7 @@ class BottomNavigationBarState extends State<BottomNavigationBar> with TickerPro ...@@ -426,7 +426,7 @@ class BottomNavigationBarState extends State<BottomNavigationBar> with TickerPro
opacity: animations[i], opacity: animations[i],
child: new DefaultTextStyle.merge( child: new DefaultTextStyle.merge(
context: context, context: context,
style: new TextStyle( style: const TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.white color: Colors.white
), ),
......
...@@ -203,9 +203,9 @@ class _RenderCheckbox extends RenderToggleable { ...@@ -203,9 +203,9 @@ class _RenderCheckbox extends RenderToggleable {
..style = PaintingStyle.stroke ..style = PaintingStyle.stroke
..strokeWidth = _kStrokeWidth; ..strokeWidth = _kStrokeWidth;
Path path = new Path(); Path path = new Path();
Point start = new Point(_kEdgeSize * 0.15, _kEdgeSize * 0.45); Point start = const Point(_kEdgeSize * 0.15, _kEdgeSize * 0.45);
Point mid = new Point(_kEdgeSize * 0.4, _kEdgeSize * 0.7); Point mid = const Point(_kEdgeSize * 0.4, _kEdgeSize * 0.7);
Point end = new Point(_kEdgeSize * 0.85, _kEdgeSize * 0.25); Point end = const Point(_kEdgeSize * 0.85, _kEdgeSize * 0.25);
Point drawStart = Point.lerp(start, mid, 1.0 - value); Point drawStart = Point.lerp(start, mid, 1.0 - value);
Point drawEnd = Point.lerp(mid, end, value); Point drawEnd = Point.lerp(mid, end, value);
path.moveTo(offsetX + drawStart.x, offsetY + drawStart.y); path.moveTo(offsetX + drawStart.x, offsetY + drawStart.y);
......
...@@ -95,7 +95,7 @@ class Chip extends StatelessWidget { ...@@ -95,7 +95,7 @@ class Chip extends StatelessWidget {
message: 'Delete "$label"', message: 'Delete "$label"',
child: new Container( child: new Container(
padding: const EdgeInsets.symmetric(horizontal: 4.0), padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: new Icon( child: const Icon(
Icons.cancel, Icons.cancel,
size: 18.0, size: 18.0,
color: Colors.black54 color: Colors.black54
......
...@@ -126,7 +126,7 @@ class GridTileBar extends StatelessWidget { ...@@ -126,7 +126,7 @@ class GridTileBar extends StatelessWidget {
data: darkTheme, data: darkTheme,
child: new IconTheme.merge( child: new IconTheme.merge(
context: context, context: context,
data: new IconThemeData(color: Colors.white), data: const IconThemeData(color: Colors.white),
child: new Row( child: new Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: children children: children
......
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