added path

This commit is contained in:
Komek Hayytnazarov 2024-07-29 17:30:30 +05:00
parent 02f8f2a81d
commit 3d9e431914
7 changed files with 160 additions and 13 deletions

View File

@ -7,4 +7,5 @@ sealed class AppColors {
static const Color green = Color(0xFFA2E052);
static const Color grey = Color(0xFF96969C);
static const Color darkGrey = Color(0xFF57575C);
static const Color lightGrey = Color(0xFFE5E5E6);
}

View File

@ -28,7 +28,7 @@ class OrderDetailsScreen extends StatelessWidget {
/// map
SliverToBoxAdapter(
child: SizedBox(
height: AppDimensions.normalize(140),
height: AppDimensions.normalize(120),
child: const ClusteringPage(),
),
),
@ -70,8 +70,8 @@ class OrderDetailsScreen extends StatelessWidget {
/// gap
Space.y!,
/// info card
const InfoCard(),
/// location card
const LocationCard()
],
),
),

View File

@ -42,7 +42,7 @@ class BottomNavigation extends StatelessWidget {
iconSize: AppDimensions.normalize(12),
selectedLabelStyle: AppText.b2b,
unselectedLabelStyle: AppText.b2!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
backgroundColor: AppColors.surface,
),

View File

@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
class DashedLine extends StatelessWidget {
final double height;
final double width;
final Color color;
final double strokeWidth;
final double dashWidth;
final double dashSpace;
const DashedLine({
super.key,
this.height = 1,
this.width = double.infinity,
this.color = Colors.black,
this.strokeWidth = 1,
this.dashWidth = 5,
this.dashSpace = 3,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: CustomPaint(
painter: _DashedLinePainter(
color: color,
strokeWidth: strokeWidth,
dashWidth: dashWidth,
dashSpace: dashSpace,
),
),
);
}
}
class _DashedLinePainter extends CustomPainter {
final Color color;
final double strokeWidth;
final double dashWidth;
final double dashSpace;
_DashedLinePainter({
required this.color,
required this.strokeWidth,
required this.dashWidth,
required this.dashSpace,
});
@override
void paint(Canvas canvas, Size size) {
double startX = 0;
final paint = Paint()
..color = color
..strokeWidth = strokeWidth;
while (startX < size.width) {
canvas.drawLine(
Offset(startX, size.height / 2),
Offset(startX + dashWidth, size.height / 2),
paint,
);
startX += dashWidth + dashSpace;
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}

View File

@ -1,10 +1,85 @@
import 'package:flutter/material.dart';
import '../../configs/configs.dart';
import '../../core/core.dart';
import 'dashed_line.dart';
class LocationCard extends StatelessWidget {
const LocationCard({super.key});
@override
Widget build(BuildContext context) {
return const Placeholder();
return SizedBox(
width: double.infinity,
child: Card(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Row(
children: [
index % 2 == 0
? const Icon(
Icons.radio_button_checked,
color: AppColors.grey,
)
: Container(
margin: Space.hf(0.35), //const EdgeInsets.only(left: 6),
height: AppDimensions.normalize(4.5),
width: AppDimensions.normalize(4.5),
decoration: const BoxDecoration(
color: AppColors.grey,
shape: BoxShape.circle,
),
),
Space.x!,
Text(
routess[index].city,
style: AppText.b1b,
),
const Spacer(),
Text(
routess[index].date,
style: AppText.b1!.copyWith(color: AppColors.grey),
),
],
);
},
itemCount: routess.length,
separatorBuilder: (BuildContext context, int index) {
return Padding(
padding: Space.vf(0.5),
child: DashedLine(
height: 1,
width: AppDimensions.normalize(8),
color: AppColors.lightGrey,
strokeWidth: 1,
dashWidth: 5,
dashSpace: AppDimensions.normalize(2),
),
);
},
),
),
),
);
}
}
class Path {
final String city;
final String date;
Path(this.city, this.date);
}
List<Path> routess = [
Path('Urumchi', '10.07.2024'),
Path('Astana', '14.07.2024'),
Path('Tashkent', '16.07.2024'),
Path('Samarkant', '25.07.2024'),
Path('Mary', '30.07.2024'),
];

View File

@ -50,14 +50,14 @@ class OrderCard extends StatelessWidget {
Text(
'Ýolda',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
const Spacer(),
Text(
'Ugradylan senesi: 16.07.2024',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
],
@ -94,7 +94,7 @@ class OrderCard extends StatelessWidget {
Text(
'Nireden:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(
@ -107,7 +107,7 @@ class OrderCard extends StatelessWidget {
Text(
'Nirede:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(
@ -132,7 +132,7 @@ class OrderCard extends StatelessWidget {
Text(
'Ýer sany:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(
@ -145,7 +145,7 @@ class OrderCard extends StatelessWidget {
Text(
'Göwrümi:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(
@ -165,7 +165,7 @@ class OrderCard extends StatelessWidget {
Text(
'Maşyn №:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(
@ -178,7 +178,7 @@ class OrderCard extends StatelessWidget {
Text(
'Dukan №:',
style: AppText.b2b!.copyWith(
color: const Color(0xFF96969C),
color: AppColors.grey,
),
),
Text(

View File

@ -8,3 +8,4 @@ export 'order_card.dart';
export 'order_header.dart';
export 'successful_auth_dialog.dart';
export 'vertical_line.dart';
export 'dashed_line.dart';