Compare commits
No commits in common. "9c38d001d1df97ebe8d42779f87b3e242f3627ee" and "754048b5652f15e8270c370d36b9642d691f5109" have entirely different histories.
9c38d001d1
...
754048b565
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import '../../../common/extension/extension.dart';
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../../domain/product/product.dart';
|
||||
import '../dialog/dialog.dart';
|
||||
import '../image/image.dart';
|
||||
import '../spaces/space.dart';
|
||||
|
||||
@ -14,20 +13,7 @@ class ProductCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (product.isActive == true) {
|
||||
if (product.variants.isEmpty) {
|
||||
// context.read<CheckoutBloc>().add(
|
||||
// CheckoutEvent.addItem(data, null),
|
||||
// );
|
||||
} else {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => VariantDialog(product: product),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
|
||||
@ -5,7 +5,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../../application/outlet/outlet_loader/outlet_loader_bloc.dart';
|
||||
import '../../../common/extension/extension.dart';
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../../domain/product/product.dart';
|
||||
import '../button/button.dart';
|
||||
import '../card/outlet_card.dart';
|
||||
import '../loader/loader_with_text.dart';
|
||||
@ -13,4 +12,3 @@ import '../spaces/space.dart';
|
||||
|
||||
part 'custom_modal_dialog.dart';
|
||||
part 'outlet_dialog.dart';
|
||||
part 'variant_dialog.dart';
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
part of 'dialog.dart';
|
||||
|
||||
class VariantDialog extends StatelessWidget {
|
||||
final Product product;
|
||||
const VariantDialog({super.key, required this.product});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomModalDialog(
|
||||
title: 'Pilih Varian',
|
||||
subtitle: 'Silahkan pilih varian yang sesuai',
|
||||
minWidth: context.deviceWidth * 0.4,
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
child: Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 12,
|
||||
crossAxisAlignment: WrapCrossAlignment.start,
|
||||
runAlignment: WrapAlignment.start,
|
||||
alignment: WrapAlignment.start,
|
||||
children: product.variants.map((variant) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// Aksi saat varian dipilih
|
||||
// context.pop();
|
||||
// context.read<CheckoutBloc>().add(
|
||||
// CheckoutEvent.addItem(product, variant),
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
width: (context.deviceWidth * 0.4 - 12 - 32) / 2 - 6, // 2 per row
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
variant.name,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
variant.priceModifier.currencyFormatRpV2,
|
||||
style: TextStyle(color: AppColor.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -209,18 +209,6 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
if (hasReachedMax && products.isNotEmpty)
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Text(
|
||||
'Semua produk telah dimuat',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: Colors.grey.shade500,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user