feat: 首页UI,搜索,我的UI
This commit is contained in:
1 parent
7f329aef44
commit
a2b38fa1e8
22 files changed
+1382
-22
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MineFuncView extends StatelessWidget {
|
||||
const MineFuncView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:novyronst/common/const/const_color.dart';
|
||||
|
||||
|
||||
|
||||
class NyDashLine extends StatelessWidget {
|
||||
final double width;
|
||||
final double height;
|
||||
final double dashWidth;
|
||||
final double dashSpace;
|
||||
final Axis direction;
|
||||
|
||||
const NyDashLine({
|
||||
super.key,
|
||||
this.width = double.infinity,
|
||||
this.height = 2,
|
||||
this.dashWidth = 4,
|
||||
this.dashSpace = 2,
|
||||
this.direction = Axis.horizontal,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomPaint(
|
||||
size: Size(width, height),
|
||||
painter: _DashedLinePainter(
|
||||
color: ConstColor.withValue('#404040'),
|
||||
dashWidth: dashWidth,
|
||||
dashSpace: dashSpace,
|
||||
direction: direction,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DashedLinePainter extends CustomPainter {
|
||||
final Color color;
|
||||
final double dashWidth;
|
||||
final double dashSpace;
|
||||
final Axis direction;
|
||||
|
||||
_DashedLinePainter({
|
||||
required this.color,
|
||||
required this.dashWidth,
|
||||
required this.dashSpace,
|
||||
required this.direction,
|
||||
});
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final paint = Paint()
|
||||
..color = color
|
||||
..strokeWidth = direction == Axis.horizontal ? size.height : size.width
|
||||
..style = PaintingStyle.stroke;
|
||||
|
||||
if (direction == Axis.horizontal) {
|
||||
double startX = 0;
|
||||
while (startX < size.width) {
|
||||
canvas.drawLine(
|
||||
Offset(startX, size.height / 2),
|
||||
Offset(startX + dashWidth, size.height / 2),
|
||||
paint,
|
||||
);
|
||||
startX += dashWidth + dashSpace;
|
||||
}
|
||||
} else {
|
||||
double startY = 0;
|
||||
while (startY < size.height) {
|
||||
canvas.drawLine(
|
||||
Offset(size.width / 2, startY),
|
||||
Offset(size.width / 2, startY + dashWidth),
|
||||
paint,
|
||||
);
|
||||
startY += dashWidth + dashSpace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
|
||||
}
|
||||
Reference in new issue
Block a user