feat: 首页UI,搜索,我的UI

This commit is contained in:
chengsiwen committed 2026-07-03 18:20:34 +08:00
1 parent 7f329aef44
commit a2b38fa1e8
22 files changed
+1382 -22

No files matched your search

+63 -1
View File
@@ -1,4 +1,9 @@
import 'package:flutter/material.dart';
import 'package:novyronst/common/help/help_image.dart';
import 'package:novyronst/pages/my/widgets/ny_dash_line.dart';
import 'package:novyronst/root/lib_export.dart';
import 'package:novyronst/tools/widgets/app_bg_page.dart';
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
class MyPage extends StatefulWidget {
const MyPage({super.key});
@@ -13,6 +18,63 @@ class _RootPageState extends State<MyPage> {
@override
Widget build(BuildContext context) {
return Scaffold();
return AppBgPage(
typeBg: 2,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
SizedBox(height: AppScreen.statusBarHeight + 48),
_buildUserInfo(),
NyDashLine()
],
),
),
);
}
Widget _buildUserInfo() {
return Row(
children: [
Container(
clipBehavior: Clip.antiAlias,
width: 60, height: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(color: Colors.white.withAlpha(127), width: 1)
),
child: ClipOval(
child: HelpImage.asset(ConstImage.homeTopLogo, width: 60, height: 60, fit: BoxFit.fill),
)
),
const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
NovyText('Visitor',
fontSize: 18,
),
const SizedBox(height: 6),
Container(
height: 18,
padding: const EdgeInsets.symmetric(horizontal: 9),
decoration: BoxDecoration(
color: Colors.white.withAlpha(60),
borderRadius: BorderRadius.circular(9),
),
child: Row(
children: [
NovyText('ID: 3242545454',
fontSize: 11,
),
const SizedBox(width: 6),
HelpImage.asset(ConstImage.copy, width: 12, height: 12)
],
),
)
],
)
],
);
}
}
+10
View File
@@ -0,0 +1,10 @@
import 'package:flutter/material.dart';
class MineFuncView extends StatelessWidget {
const MineFuncView({super.key});
@override
Widget build(BuildContext context) {
return Container();
}
}
+81
View File
@@ -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;
}