2025-08-02 10:50:48 +07:00
|
|
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
|
|
|
|
import 'package:enaklo_pos/core/extensions/date_time_ext.dart';
|
2025-08-03 14:39:15 +07:00
|
|
|
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
2025-08-02 10:50:48 +07:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class SalesOrderInformation extends StatelessWidget {
|
2025-08-03 14:39:15 +07:00
|
|
|
final Order? order;
|
2025-08-02 10:50:48 +07:00
|
|
|
const SalesOrderInformation({super.key, this.order});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'Informasi Pesanan',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppColors.black,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
_item(
|
|
|
|
|
title: 'No. Order',
|
2025-08-03 14:39:15 +07:00
|
|
|
value: "${order?.orderNumber}",
|
2025-08-02 10:50:48 +07:00
|
|
|
),
|
|
|
|
|
_item(
|
|
|
|
|
title: 'Tanggal',
|
2025-08-03 14:39:15 +07:00
|
|
|
value: (order?.createdAt ?? DateTime.now()).toFormattedDate2(),
|
2025-08-02 10:50:48 +07:00
|
|
|
),
|
|
|
|
|
_item(
|
2025-08-03 14:39:15 +07:00
|
|
|
title: 'No. Meja',
|
|
|
|
|
value: order?.tableNumber ?? "-",
|
2025-08-02 10:50:48 +07:00
|
|
|
),
|
|
|
|
|
_item(
|
|
|
|
|
title: 'Jenis Order',
|
2025-08-03 14:39:15 +07:00
|
|
|
value: order?.orderType ?? "-",
|
2025-08-02 10:50:48 +07:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Padding _item({
|
|
|
|
|
required String title,
|
|
|
|
|
required String value,
|
|
|
|
|
}) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
value,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|