2024-08-19 11:31:03 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2024-07-24 12:14:17 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../../configs/configs.dart';
|
2024-08-19 04:50:22 +00:00
|
|
|
import '../../domain/entities/order/order.dart';
|
2024-07-24 12:14:17 +00:00
|
|
|
|
|
|
|
|
class InfoCard extends StatelessWidget {
|
2024-08-19 04:50:22 +00:00
|
|
|
final OrderEntity order;
|
|
|
|
|
const InfoCard({super.key, required this.order});
|
2024-07-24 12:14:17 +00:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Card(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
2024-09-03 09:06:42 +00:00
|
|
|
RowTextWidget(title: '${'order_status'.tr()}:', info: order.state.tr()),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_carrier'.tr()}:', info: order.carrier),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_shop'.tr()}:', info: order.shopNo),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_from'.tr()}:', info: order.from),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_to'.tr()}:', info: order.to),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_placement_count'.tr()}:', info: order.placesCount.toString()),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_volume'.tr()}:', info: order.volume.toString()),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 04:50:22 +00:00
|
|
|
RowTextWidget(
|
2024-08-19 11:31:03 +00:00
|
|
|
title: '${'order_dimensions'.tr()}:',
|
|
|
|
|
info: '${order.width}x${order.depth}x${order.height} ${'order_dimensions_desc'.tr()}'),
|
2024-07-24 12:14:17 +00:00
|
|
|
Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
RowTextWidget(title: '${'order_product_name'.tr()}:', info: order.name),
|
2024-08-19 04:50:22 +00:00
|
|
|
// Space.y!,
|
2024-08-19 11:31:03 +00:00
|
|
|
// RowTextWidget(title: 'Sargydyň bahasy:', info: order.price),
|
2024-07-24 12:14:17 +00:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class RowTextWidget extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
final String info;
|
|
|
|
|
const RowTextWidget({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.title,
|
|
|
|
|
required this.info,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Row(
|
2024-08-29 08:48:59 +00:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2024-07-24 12:14:17 +00:00
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
2024-08-29 08:48:59 +00:00
|
|
|
style: AppText.h3!.copyWith(
|
2024-07-24 12:14:17 +00:00
|
|
|
color: const Color(0xFF57575C),
|
|
|
|
|
),
|
2024-08-19 04:50:22 +00:00
|
|
|
maxLines: 2,
|
2024-07-24 12:14:17 +00:00
|
|
|
),
|
|
|
|
|
Space.x!,
|
2024-08-19 04:50:22 +00:00
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
info,
|
2024-08-29 08:48:59 +00:00
|
|
|
style: AppText.h3!.copyWith(
|
2024-08-19 04:50:22 +00:00
|
|
|
color: const Color(0xFF0C0C0D),
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
maxLines: 2,
|
2024-07-24 12:14:17 +00:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|