Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
Byodv2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
Byodv2
Commits
9473759f
Commit
9473759f
authored
Sep 18, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed for loading load
parent
b99ba798
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
182 additions
and
180 deletions
+182
-180
menu_list_utama.dart
lib/ui/home/menu_list_utama.dart
+6
-17
new_home2.dart
lib/ui/home/new_home2.dart
+176
-163
No files found.
lib/ui/home/menu_list_utama.dart
View file @
9473759f
...
...
@@ -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
,
...
...
lib/ui/home/new_home2.dart
View file @
9473759f
...
...
@@ -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++)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment