make @immutable const classes (#9532)

* make @immutable const

* fix build
This commit is contained in:
Alexandre Ardhuin
2017-04-21 23:09:42 +02:00
committed by GitHub
parent 1abb6f5d74
commit 9541848272
166 changed files with 397 additions and 403 deletions

View File

@@ -74,7 +74,7 @@ class DotState extends State<Dot> {
}
class ExampleDragSource extends StatelessWidget {
ExampleDragSource({
const ExampleDragSource({
Key key,
this.color,
this.heavy: false,
@@ -174,7 +174,7 @@ class DashOutlineCirclePainter extends CustomPainter {
}
class MovableBall extends StatelessWidget {
MovableBall(this.position, this.ballPosition, this.callback);
const MovableBall(this.position, this.ballPosition, this.callback);
final int position;
final int ballPosition;

View File

@@ -103,7 +103,7 @@ class _PointDemoPainter extends CustomPainter {
}
class _PointDemo extends StatefulWidget {
_PointDemo({ Key key, this.controller }) : super(key: key);
const _PointDemo({ Key key, this.controller }) : super(key: key);
final AnimationController controller;
@@ -268,7 +268,7 @@ class _RectangleDemoPainter extends CustomPainter {
}
class _RectangleDemo extends StatefulWidget {
_RectangleDemo({ Key key, this.controller }) : super(key: key);
const _RectangleDemo({ Key key, this.controller }) : super(key: key);
final AnimationController controller;
@@ -404,7 +404,7 @@ class _ArcDemo {
}
class AnimationDemo extends StatefulWidget {
AnimationDemo({ Key key }) : super(key: key);
const AnimationDemo({ Key key }) : super(key: key);
@override
_AnimationDemoState createState() => new _AnimationDemoState();
@@ -469,6 +469,6 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
void main() {
runApp(new MaterialApp(
home: new AnimationDemo()
home: const AnimationDemo()
));
}

View File

@@ -57,7 +57,7 @@ class _MarkerPainter extends CustomPainter {
}
class Marker extends StatelessWidget {
Marker({
const Marker({
Key key,
this.type: MarkerType.touch,
this.position,

View File

@@ -12,15 +12,15 @@ void main() {
appBar: new AppBar(
title: const Text('Hardware Key Demo'),
),
body: new Center(
child: new RawKeyboardDemo(),
body: const Center(
child: const RawKeyboardDemo(),
),
),
));
}
class RawKeyboardDemo extends StatefulWidget {
RawKeyboardDemo({ Key key }) : super(key: key);
const RawKeyboardDemo({ Key key }) : super(key: key);
@override
_HardwareKeyDemoState createState() => new _HardwareKeyDemoState();