use final

This commit is contained in:
Renan Araujo
2019-03-22 13:35:46 -03:00
parent 5a2f576610
commit b1a3d222a9
26 changed files with 144 additions and 149 deletions

View File

@ -20,8 +20,8 @@ class MyTextBox extends TextBoxComponent {
@override
void drawBackground(Canvas c) {
Rect rect = Rect.fromLTWH(0, 0, width, height);
c.drawRect(rect, Paint()..color = Color(0xFFFF00FF));
final Rect rect = Rect.fromLTWH(0, 0, width, height);
c.drawRect(rect, Paint()..color = const Color(0xFFFF00FF));
c.drawRect(
rect.deflate(boxConfig.margin),
Paint()
@ -36,7 +36,7 @@ class MyGame extends BaseGame {
}
_start() async {
Size size = await Flame.util.initialDimensions();
final Size size = await Flame.util.initialDimensions();
add(TextComponent('Hello, Flame', config: regular)
..anchor = Anchor.topCenter