diff --git a/lib/presentation/home/pages/home_page.dart b/lib/presentation/home/pages/home_page.dart index daed74e..9e2f0ce 100644 --- a/lib/presentation/home/pages/home_page.dart +++ b/lib/presentation/home/pages/home_page.dart @@ -168,11 +168,10 @@ class _HomePageState extends State { padding: const EdgeInsets.all(16), gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent( - maxCrossAxisExtent: - 200, // Lebar maksimal tiap item (bisa kamu ubah) + maxCrossAxisExtent: 180, mainAxisSpacing: 30, crossAxisSpacing: 30, - childAspectRatio: 0.85, + childAspectRatio: 180 / 240, ), itemBuilder: (context, index) => ProductCard( diff --git a/lib/presentation/home/widgets/home_title.dart b/lib/presentation/home/widgets/home_title.dart index 135051d..ba32909 100644 --- a/lib/presentation/home/widgets/home_title.dart +++ b/lib/presentation/home/widgets/home_title.dart @@ -29,7 +29,7 @@ class HomeTitle extends StatelessWidget { 'DEFAULT OUTLET', style: TextStyle( color: AppColors.primary, - fontSize: 28, + fontSize: 20, fontWeight: FontWeight.w600, ), ), diff --git a/lib/presentation/home/widgets/product_card.dart b/lib/presentation/home/widgets/product_card.dart index 3e80058..8e45252 100644 --- a/lib/presentation/home/widgets/product_card.dart +++ b/lib/presentation/home/widgets/product_card.dart @@ -7,7 +7,6 @@ import 'package:enaklo_pos/core/extensions/string_ext.dart'; import 'package:enaklo_pos/data/models/response/product_response_model.dart'; import 'package:enaklo_pos/presentation/home/bloc/checkout/checkout_bloc.dart'; -import '../../../core/components/spaces.dart'; import '../../../core/constants/colors.dart'; class ProductCard extends StatelessWidget { @@ -27,88 +26,80 @@ class ProductCard extends StatelessWidget { context.read().add(CheckoutEvent.addItem(data)); }, child: Container( - padding: const EdgeInsets.all(16.0), decoration: BoxDecoration( color: AppColors.white, - borderRadius: BorderRadius.circular(12.0), + borderRadius: BorderRadius.circular(8.0), border: Border.all( color: AppColors.disabled, ), ), child: Stack( children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SpaceHeight(8), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(12.0), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: AppColors.disabled.withOpacity(0.4), - ), - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(40.0)), + Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(8.0)), child: CachedNetworkImage( imageUrl: data.image!.contains('http') ? data.image! : '${Variables.baseUrl}/${data.image}', fit: BoxFit.cover, - width: 60, - height: 60, + width: double.infinity, + height: 120, errorWidget: (context, url, error) => Container( - width: 60, - height: 60, + width: double.infinity, + height: 120, decoration: BoxDecoration( - shape: BoxShape.circle, color: AppColors.disabled.withOpacity(0.4), ), child: const Icon( - Icons.image_not_supported, + Icons.image, color: AppColors.grey, ), ), ), ), - ), - const Spacer(), - Text( - "${data.name}", - style: const TextStyle( - fontSize: 15, - fontWeight: FontWeight.w700, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - const Spacer(), - Align( - alignment: Alignment.center, - child: Text( - data.category?.name ?? '-', + const Spacer(), + Text( + "${data.name}", style: const TextStyle( fontSize: 14, - color: AppColors.grey, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, ), - maxLines: 2, + maxLines: 1, overflow: TextOverflow.ellipsis, ), - ), - const Spacer(), - Align( - alignment: Alignment.center, - child: Text( - data.price!.toIntegerFromText.currencyFormatRp, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 13, + const Spacer(), + Align( + alignment: Alignment.center, + child: Text( + data.category?.name ?? '-', + style: const TextStyle( + fontSize: 12, + color: AppColors.grey, + fontWeight: FontWeight.w500, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, ), ), - ), - const Spacer(), - ], + const Spacer(), + Align( + alignment: Alignment.center, + child: Text( + data.price!.toIntegerFromText.currencyFormatRp, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + ), + const Spacer(), + ], + ), ), BlocBuilder( builder: (context, state) {