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 "package:flutter/material.dart";
|
||||
import "package:flutter/services.dart";
|
||||
import "package:flutter/widgets.dart";
|
||||
|
||||
// dart format off
|
||||
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) {
|
||||
rayX = vx;
|
||||
@@ -437,7 +437,7 @@ class PlayerPainter extends CustomPainter {
|
||||
// Player dot
|
||||
canvas.drawRect(
|
||||
Rect.fromLTWH(offset.dx, offset.dy, 8, 8),
|
||||
Paint()..color = Colors.yellow,
|
||||
Paint()..color = const Color.fromRGBO(255, 255, 0, 1),
|
||||
);
|
||||
|
||||
// Player direction line
|
||||
@@ -445,7 +445,7 @@ class PlayerPainter extends CustomPainter {
|
||||
offset + const Offset(4, 4),
|
||||
offset + const Offset(4, 4) + (delta * 5),
|
||||
Paint()
|
||||
..color = Colors.yellow
|
||||
..color = const Color.fromRGBO(255, 255, 0, 1)
|
||||
..strokeWidth = 2,
|
||||
);
|
||||
}
|
||||
@@ -603,9 +603,9 @@ class MapPainter extends CustomPainter {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final paintWhite = Paint()..color = Colors.white;
|
||||
final paintBlack = Paint()..color = Colors.black;
|
||||
final paintGrey = Paint()..color = Colors.grey;
|
||||
final paintWhite = Paint()..color = const Color.fromRGBO(255, 255, 255, 1);
|
||||
final paintBlack = Paint()..color = const Color.fromRGBO(0, 0, 0, 1);
|
||||
final paintGrey = Paint()..color = const Color.fromRGBO(84, 84, 84, 1);
|
||||
|
||||
canvas.drawRect(
|
||||
Rect.fromLTWH(0, 0, tileSize * mapX, tileSize * mapY),
|
||||
@@ -645,7 +645,7 @@ class MapRayPainter extends CustomPainter {
|
||||
playerCenter,
|
||||
ray.hitPosition - const Offset(1, 1),
|
||||
Paint()
|
||||
..color = Colors.cyan
|
||||
..color = const Color.fromRGBO(0, 255, 255, 1)
|
||||
..strokeWidth = 1,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user