地区选择和罗盘十字

This commit is contained in:
cxc
2022-06-27 17:37:25 +08:00
parent 8cb96b4c5e
commit 2a933199ed
8 changed files with 632 additions and 263 deletions

View File

@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
class CrossPaint extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.transparent,
alignment: Alignment.center,
child: CustomPaint(
// 使用CustomPaint 背景画板
painter: MyPainter(),
),
);
}
}
class MyPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
// 创建画笔
final Paint paintLine = Paint()
..color = Colors.grey
..strokeWidth = 2;
// 绘制线
canvas.drawLine(Offset(-400, 0), Offset(400, 0), paintLine);
canvas.drawLine(Offset(0, 500), Offset(0, -440), paintLine);
// 创建画笔
// final Paint paintPoint = Paint()..color = Colors.red;
// 绘制圆点
// canvas.drawCircle(Offset(0, 0), 10, paintPoint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}