85 lines
2.5 KiB
Dart
85 lines
2.5 KiB
Dart
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
|
import 'package:enaklo_pos/presentation/home/dialog/payment_add_order_dialog.dart';
|
|
import 'package:enaklo_pos/presentation/home/dialog/payment_save_dialog.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class SaveDialog extends StatelessWidget {
|
|
const SaveDialog({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomModalDialog(
|
|
title: 'Pilih Aksi',
|
|
subtitle: 'Lanjutkan proses pesanan atau simpan untuk nanti.',
|
|
contentPadding:
|
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
|
|
child: Column(
|
|
children: [
|
|
_item(
|
|
icon: Icons.schedule_outlined,
|
|
title: 'Bayar Nanti',
|
|
subtitle: 'Simpan pesanan dan bayar nanti',
|
|
onTap: () => showDialog(
|
|
context: context,
|
|
builder: (context) => const PaymentSaveDialog(),
|
|
),
|
|
),
|
|
SpaceHeight(16.0),
|
|
_item(
|
|
icon: Icons.shopping_cart_checkout_outlined,
|
|
title: 'Tambahkan Pesanan',
|
|
subtitle: 'Tambah item ke daftar pesanan',
|
|
onTap: () => showDialog(
|
|
context: context,
|
|
builder: (context) => const PaymentAddOrderDialog(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _item({
|
|
required IconData icon,
|
|
required String title,
|
|
required String subtitle,
|
|
required Function() onTap,
|
|
}) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.white,
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
border: Border.all(
|
|
color: AppColors.grey,
|
|
width: 1.0,
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Icon(icon, color: AppColors.primary, size: 26.0),
|
|
SpaceWidth(12.0),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
|
),
|
|
Text(
|
|
subtitle,
|
|
style: const TextStyle(color: Colors.grey),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|