Files
FlutterUnit/lib/painter_system/base/draw_grid_axis.dart
2021-09-27 09:38:18 +08:00

29 lines
731 B
Dart

import 'package:flutter/material.dart';
import '../utils/coordinate.dart';
/// create by 张风捷特烈 on 2020/12/5
/// contact me by email 1981462002@qq.com
/// 说明:
class DrawGridAxis extends StatelessWidget {
@override
Widget build(BuildContext context) {
double size = MediaQuery.of(context).size.shortestSide;
return CustomPaint(size: Size(size, size), painter: PaperPainter());
}
}
class PaperPainter extends CustomPainter {
final Coordinate coordinate = Coordinate(yTop: true, numScale: 20);
@override
void paint(Canvas canvas, Size size) {
canvas.clipRect(Offset.zero & size);
coordinate.paint(canvas, size);
}
@override
bool shouldRepaint(PaperPainter oldDelegate) => false;
}