Commit 9473759f authored by Dio Maulana's avatar Dio Maulana

fixed for loading load

parent b99ba798
......@@ -24,34 +24,22 @@ class MenuListUtama extends StatelessWidget {
required this.i,
required this.widthScreen,
required this.scrollController,
required this.idCategory,
}) : super(key: key);
final List<FilterMenu> categoryNonFav;
final int i;
final double widthScreen;
final ScrollController scrollController;
final String idCategory;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(categoryNonFav[i].type == typeCategory)
? defaultText(
context,
categoryNonFav[i].categoryName,
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: categoryNameStyle(),
)
: const SizedBox(),
(categoryNonFav[i].type == typeCategory)
? const Divider(
thickness: 0.5,
color: textColorBlack,
)
: const SizedBox(),
(categoryNonFav[i].type == typeGroup)
(categoryNonFav[i].type == typeGroup &&
categoryNonFav[i].categoryId == idCategory)
? Container(
margin: const EdgeInsets.only(
top: 6,
......@@ -65,7 +53,8 @@ class MenuListUtama extends StatelessWidget {
),
)
: const SizedBox(),
(categoryNonFav[i].type == typeMenu)
(categoryNonFav[i].type == typeMenu &&
categoryNonFav[i].categoryId == idCategory)
? Container(
margin: EdgeInsets.only(
top: 19,
......
......@@ -9,6 +9,7 @@ import 'package:byod/helper/helper.dart';
import 'package:byod/helper/widget/style.dart';
import 'package:byod/models/filter_menu.dart';
import 'package:byod/models/orders.dart';
import 'package:byod/ui/home/menu_list_utama.dart';
import 'package:byod/ui/home/variant_cat_new.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
......@@ -735,170 +736,182 @@ class _NewHome2State extends State<NewHome2> {
),
),
),
for (var menu in categoryMenuAfterSelect)
(menu.categoryId == categoryListMenu[i].id &&
menu.type != typeCategory &&
menu.type == typeGroup)
? Container(
margin: const EdgeInsets.only(
top: 6,
),
child: defaultText(
context,
maxLines: 3,
overFlow: TextOverflow.ellipsis,
categoryNonFav[i].groupName,
style: subCategoryStyle(),
),
)
: (menu.categoryId == categoryListMenu[i].id &&
menu.type != typeCategory &&
menu.type == typeMenu)
? Container(
margin: EdgeInsets.only(
top: 19,
bottom: (i + 1 ==
categoryMenuAfterSelect
.length)
? 85
: 19,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Container(
height: 125,
width: double.infinity,
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
defaultText(
context,
menu.name,
style:
menuNameStyle(),
),
const Spacer(),
defaultText(
maxLines: 2,
overFlow: TextOverflow
.ellipsis,
context,
menu.description,
style:
deskripsiMenuStyle(),
),
const SizedBox(
height: 4,
),
defaultText(
maxLines: 1,
overFlow: TextOverflow
.ellipsis,
context,
'Rp ${formatNumber().format(amountParseToInt(menu.price))}',
style:
amountMenuStyle(),
)
],
),
),
Container(
width: 12,
height: double.infinity,
),
GestureDetector(
onTap: () {
FocusScopeNode
currentFocus =
FocusScope.of(
context);
SliverList(
delegate:
SliverChildBuilderDelegate((context, index) {
return MenuListUtama(
categoryNonFav: categoryMenuAfterSelect,
i: index,
widthScreen: widthScreen,
scrollController: _scrollController,
idCategory: categoryListMenu[i].id,
);
}, childCount: categoryMenuAfterSelect.length),
),
// for (var menu in categoryMenuAfterSelect)
// (menu.categoryId == categoryListMenu[i].id &&
// menu.type != typeCategory &&
// menu.type == typeGroup)
// ? Container(
// margin: const EdgeInsets.only(
// top: 6,
// ),
// child: defaultText(
// context,
// maxLines: 3,
// overFlow: TextOverflow.ellipsis,
// categoryNonFav[i].groupName,
// style: subCategoryStyle(),
// ),
// )
// : (menu.categoryId == categoryListMenu[i].id &&
// menu.type != typeCategory &&
// menu.type == typeMenu)
// ? Container(
// margin: EdgeInsets.only(
// top: 19,
// bottom: (i + 1 ==
// categoryMenuAfterSelect
// .length)
// ? 85
// : 19,
// ),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.end,
// children: [
// Container(
// height: 125,
// width: double.infinity,
// child: Row(
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment
// .start,
// children: [
// defaultText(
// context,
// menu.name,
// style:
// menuNameStyle(),
// ),
// const Spacer(),
// defaultText(
// maxLines: 2,
// overFlow: TextOverflow
// .ellipsis,
// context,
// menu.description,
// style:
// deskripsiMenuStyle(),
// ),
// const SizedBox(
// height: 4,
// ),
// defaultText(
// maxLines: 1,
// overFlow: TextOverflow
// .ellipsis,
// context,
// 'Rp ${formatNumber().format(amountParseToInt(menu.price))}',
// style:
// amountMenuStyle(),
// )
// ],
// ),
// ),
// Container(
// width: 12,
// height: double.infinity,
// ),
// GestureDetector(
// onTap: () {
// FocusScopeNode
// currentFocus =
// FocusScope.of(
// context);
if (!currentFocus
.hasPrimaryFocus) {
currentFocus.unfocus();
}
showModalBottomSheet(
backgroundColor:
Colors.white,
isScrollControlled:
true,
context: context,
builder: (context) {
return ShowMenuModal(
imageUrl: menu
.imageUrlMedium,
namaMenu: menu.name,
hargaMenu:
amountParseToInt(
menu.price),
isHavevariant: menu
.variantCat
.isNotEmpty
? true
: false,
description: menu
.description,
id: menu.id,
variantCat:
menu.variantCat,
isSell: menu.isSell,
);
},
);
},
child: Container(
width: 125,
height: 125,
decoration: BoxDecoration(
borderRadius:
BorderRadius
.circular(14),
color: disabledColor
.withOpacity(0.8),
),
child: ClipRRect(
borderRadius:
BorderRadius
.circular(14),
child:
(menu.imageUrlMedium !=
'')
? Image(
fit: BoxFit
.fill,
image:
NetworkImage(
menu.imageUrlMedium,
),
)
: const Image(
fit: BoxFit
.fill,
image: AssetImage(
'assets/noimage.png'),
),
),
),
)
],
),
),
Container(
height: 8,
width: double.infinity,
),
addRemoveQuantity(context, menu)
],
),
)
: const SizedBox()
// if (!currentFocus
// .hasPrimaryFocus) {
// currentFocus.unfocus();
// }
// showModalBottomSheet(
// backgroundColor:
// Colors.white,
// isScrollControlled:
// true,
// context: context,
// builder: (context) {
// return ShowMenuModal(
// imageUrl: menu
// .imageUrlMedium,
// namaMenu: menu.name,
// hargaMenu:
// amountParseToInt(
// menu.price),
// isHavevariant: menu
// .variantCat
// .isNotEmpty
// ? true
// : false,
// description: menu
// .description,
// id: menu.id,
// variantCat:
// menu.variantCat,
// isSell: menu.isSell,
// );
// },
// );
// },
// child: Container(
// width: 125,
// height: 125,
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(14),
// color: disabledColor
// .withOpacity(0.8),
// ),
// child: ClipRRect(
// borderRadius:
// BorderRadius
// .circular(14),
// child:
// (menu.imageUrlMedium !=
// '')
// ? Image(
// fit: BoxFit
// .fill,
// image:
// NetworkImage(
// menu.imageUrlMedium,
// ),
// )
// : const Image(
// fit: BoxFit
// .fill,
// image: AssetImage(
// 'assets/noimage.png'),
// ),
// ),
// ),
// )
// ],
// ),
// ),
// Container(
// height: 8,
// width: double.infinity,
// ),
// addRemoveQuantity(context, menu)
// ],
// ),
// )
// : const SizedBox()
],
),
// for (int i = 0; i < categoryMenuAfterSelect.length; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment