Remove Material dependency
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
+8
-8
@@ -1,7 +1,7 @@
|
|||||||
import "dart:math" as math;
|
import "dart:math" as math;
|
||||||
|
|
||||||
import "package:flutter/material.dart";
|
|
||||||
import "package:flutter/services.dart";
|
import "package:flutter/services.dart";
|
||||||
|
import "package:flutter/widgets.dart";
|
||||||
|
|
||||||
// dart format off
|
// dart format off
|
||||||
const List<int> map = [
|
const List<int> map = [
|
||||||
@@ -318,7 +318,7 @@ class _PlayerState extends State<Player> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Color wallColor = Colors.transparent;
|
Color wallColor = const Color.fromRGBO(0, 0, 0, 0);
|
||||||
|
|
||||||
if (distanceVert < distanceHor) {
|
if (distanceVert < distanceHor) {
|
||||||
rayX = vx;
|
rayX = vx;
|
||||||
@@ -437,7 +437,7 @@ class PlayerPainter extends CustomPainter {
|
|||||||
// Player dot
|
// Player dot
|
||||||
canvas.drawRect(
|
canvas.drawRect(
|
||||||
Rect.fromLTWH(offset.dx, offset.dy, 8, 8),
|
Rect.fromLTWH(offset.dx, offset.dy, 8, 8),
|
||||||
Paint()..color = Colors.yellow,
|
Paint()..color = const Color.fromRGBO(255, 255, 0, 1),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Player direction line
|
// Player direction line
|
||||||
@@ -445,7 +445,7 @@ class PlayerPainter extends CustomPainter {
|
|||||||
offset + const Offset(4, 4),
|
offset + const Offset(4, 4),
|
||||||
offset + const Offset(4, 4) + (delta * 5),
|
offset + const Offset(4, 4) + (delta * 5),
|
||||||
Paint()
|
Paint()
|
||||||
..color = Colors.yellow
|
..color = const Color.fromRGBO(255, 255, 0, 1)
|
||||||
..strokeWidth = 2,
|
..strokeWidth = 2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -603,9 +603,9 @@ class MapPainter extends CustomPainter {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
final paintWhite = Paint()..color = Colors.white;
|
final paintWhite = Paint()..color = const Color.fromRGBO(255, 255, 255, 1);
|
||||||
final paintBlack = Paint()..color = Colors.black;
|
final paintBlack = Paint()..color = const Color.fromRGBO(0, 0, 0, 1);
|
||||||
final paintGrey = Paint()..color = Colors.grey;
|
final paintGrey = Paint()..color = const Color.fromRGBO(84, 84, 84, 1);
|
||||||
|
|
||||||
canvas.drawRect(
|
canvas.drawRect(
|
||||||
Rect.fromLTWH(0, 0, tileSize * mapX, tileSize * mapY),
|
Rect.fromLTWH(0, 0, tileSize * mapX, tileSize * mapY),
|
||||||
@@ -645,7 +645,7 @@ class MapRayPainter extends CustomPainter {
|
|||||||
playerCenter,
|
playerCenter,
|
||||||
ray.hitPosition - const Offset(1, 1),
|
ray.hitPosition - const Offset(1, 1),
|
||||||
Paint()
|
Paint()
|
||||||
..color = Colors.cyan
|
..color = const Color.fromRGBO(0, 255, 255, 1)
|
||||||
..strokeWidth = 1,
|
..strokeWidth = 1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user