From c7f473eb5f075cd2fa425dda55bedadfb1aa5c08 Mon Sep 17 00:00:00 2001 From: efrilm Date: Mon, 4 Aug 2025 13:24:40 +0700 Subject: [PATCH] feat: customer page --- .../customer/pages/customer_page.dart | 123 +++++++++++++++++- 1 file changed, 122 insertions(+), 1 deletion(-) diff --git a/lib/presentation/customer/pages/customer_page.dart b/lib/presentation/customer/pages/customer_page.dart index 99e2511..b3ab443 100644 --- a/lib/presentation/customer/pages/customer_page.dart +++ b/lib/presentation/customer/pages/customer_page.dart @@ -1,4 +1,7 @@ +import 'package:enaklo_pos/core/components/dashed_divider.dart'; +import 'package:enaklo_pos/core/components/spaces.dart'; import 'package:enaklo_pos/core/constants/colors.dart'; +import 'package:enaklo_pos/core/extensions/build_context_ext.dart'; import 'package:enaklo_pos/data/models/response/customer_response_model.dart'; import 'package:enaklo_pos/presentation/customer/bloc/customer_loader/customer_loader_bloc.dart'; import 'package:enaklo_pos/presentation/customer/widgets/customer_card.dart'; @@ -15,6 +18,7 @@ class CustomerPage extends StatefulWidget { class _CustomerPageState extends State { Customer? _customer; + @override void initState() { super.initState(); @@ -86,7 +90,124 @@ class _CustomerPageState extends State { ), Expanded( flex: 4, - child: Container(), + child: _customer == null + ? Center( + child: Text( + "Belum ada pelanggan yang dipilih.", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ) + : Center( + child: Container( + width: context.deviceHeight * 0.5, + height: context.deviceHeight * 0.6, + decoration: BoxDecoration( + color: AppColors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12.0, + vertical: 16.0, + ), + child: Column( + children: [ + CircleAvatar( + radius: 24, + backgroundColor: AppColors.primary, + child: + Icon(Icons.person, color: Colors.white), + ), + const SizedBox(height: 12), + Text( + _customer?.name ?? "", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ), + DashedDivider(color: AppColors.stroke), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12.0, + vertical: 16.0, + ), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + 'No. Handphone', + style: TextStyle( + fontSize: 12.0, + ), + ), + Text( + _customer?.phone ?? "-", + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + SpaceHeight(8), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Email', + style: TextStyle( + fontSize: 12.0, + ), + ), + Text( + _customer?.email ?? "-", + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + SpaceHeight(8), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Alamat', + style: TextStyle( + fontSize: 12.0, + ), + ), + Text( + _customer?.address ?? "-", + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), ), ], ),