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

fixed for loading load

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