make @immutable const classes (#9532)
* make @immutable const * fix build
This commit is contained in:
committed by
GitHub
parent
1abb6f5d74
commit
9541848272
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class _MarkerPainter extends CustomPainter {
|
||||
}
|
||||
|
||||
class Marker extends StatelessWidget {
|
||||
Marker({
|
||||
const Marker({
|
||||
Key key,
|
||||
this.type: MarkerType.touch,
|
||||
this.position,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user