feat: slicing home page

This commit is contained in:
efrilm
2025-07-31 19:25:45 +07:00
parent 73320561b0
commit 445a22a5a4
13 changed files with 1231 additions and 696 deletions
@@ -1,16 +1,15 @@
import 'package:enaklo_pos/core/constants/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:enaklo_pos/presentation/home/bloc/checkout/checkout_bloc.dart';
import 'package:enaklo_pos/presentation/home/models/product_quantity.dart';
import 'package:enaklo_pos/data/models/response/product_response_model.dart';
import '../../../core/components/buttons.dart';
import '../../../core/components/spaces.dart';
import '../../../core/constants/colors.dart';
class ItemNotesDialog extends StatefulWidget {
final ProductQuantity item;
const ItemNotesDialog({
super.key,
required this.item,
@@ -38,24 +37,52 @@ class _ItemNotesDialogState extends State<ItemNotesDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: const Text('Add Notes'),
backgroundColor: Colors.white,
title: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.item.product.name ?? 'Catatan Item',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: AppColors.black,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 4.0),
Text(
'Masukkan catatan untuk item ini',
style: TextStyle(
fontSize: 14,
color: Colors.grey,
),
),
],
),
),
SpaceWidth(12),
IconButton(
icon: const Icon(Icons.close, color: AppColors.black),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.item.product.name ?? 'Product',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
const SpaceHeight(16.0),
TextField(
controller: notesController,
maxLines: 3,
decoration: const InputDecoration(
hintText: 'Enter notes for this item...',
hintText: 'Masukkan catatan untuk item ini',
border: OutlineInputBorder(),
),
),
@@ -69,11 +96,11 @@ class _ItemNotesDialogState extends State<ItemNotesDialog> {
Button.filled(
onPressed: () {
context.read<CheckoutBloc>().add(
CheckoutEvent.updateItemNotes(
widget.item.product,
notesController.text,
),
);
CheckoutEvent.updateItemNotes(
widget.item.product,
notesController.text,
),
);
Navigator.of(context).pop();
},
label: 'Save',
@@ -81,4 +108,4 @@ class _ItemNotesDialogState extends State<ItemNotesDialog> {
],
);
}
}
}