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
c9417de6
Commit
c9417de6
authored
Oct 21, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
variant fixed
parent
33a2e00c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
831 additions
and
507 deletions
+831
-507
api.dart
lib/api/api.dart
+38
-1
helper.dart
lib/helper/helper.dart
+10
-0
prefs.dart
lib/helper/prefs.dart
+9
-0
bottom_sheet_variant_new.dart
lib/ui/home/bottom_sheet_variant_new.dart
+240
-215
fav_grid_menu.dart
lib/ui/home/fav_grid_menu.dart
+67
-24
new_home2.dart
lib/ui/home/new_home2.dart
+88
-78
bottom_sheet_pickup_delivery.dart
lib/ui/viewbill/bottom_sheet_pickup_delivery.dart
+2
-3
component_name_user.dart
lib/ui/viewbill/component_name_user.dart
+7
-1
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+345
-163
app_bar_webview.dart
lib/ui/webview/app_bar_webview.dart
+25
-22
No files found.
lib/api/api.dart
View file @
c9417de6
...
@@ -186,6 +186,7 @@ class Api {
...
@@ -186,6 +186,7 @@ class Api {
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
setServiceRadius
(
jsonObject
[
'data'
][
'service_radius'
]
??
0
);
setServiceRadius
(
jsonObject
[
'data'
][
'service_radius'
]
??
0
);
setDistance
(
jsonObject
[
'data'
][
'distance'
]
??
'0'
);
setDistance
(
jsonObject
[
'data'
][
'distance'
]
??
'0'
);
setIsCanChangeDeliveryPickupFunc
(
jsonObject
[
'data'
][
'order_state'
]);
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
}
}
...
@@ -573,7 +574,7 @@ class Api {
...
@@ -573,7 +574,7 @@ class Api {
if
(
favDetail
[
i
][
'favorite_group_id'
]
==
favGroup
[
s
][
'id'
])
{
if
(
favDetail
[
i
][
'favorite_group_id'
]
==
favGroup
[
s
][
'id'
])
{
// List<dynamic> variantCat = favDetail[i]['variants'];
// List<dynamic> variantCat = favDetail[i]['variants'];
List
<
VariantCategories
>
variantCategories
=
[];
//
List<VariantCategories> variantCategories = [];
// for (int o = 0; o < variantCat.length; o++) {
// for (int o = 0; o < variantCat.length; o++) {
// List<Variants> variants = [];
// List<Variants> variants = [];
...
@@ -593,6 +594,35 @@ class Api {
...
@@ -593,6 +594,35 @@ class Api {
// VariantCategories.createVariantCategory(dataVariantCat));
// VariantCategories.createVariantCategory(dataVariantCat));
// }
// }
List
<
dynamic
>
variantCat
=
favDetail
[
i
][
'variants'
];
List
<
VariantCategories
>
variantCategories
=
[];
// for (int o = 0; o < variantCat.length; o++) {
for
(
int
j
=
0
;
j
<
variantCat
.
length
;
j
++)
{
int
index
=
variantCategories
.
indexWhere
((
varCat
)
=>
varCat
.
id
==
variantCat
[
j
][
'category_variant_id'
]);
if
(
index
==
-
1
)
{
List
<
Variants
>
variants
=
[];
for
(
int
k
=
0
;
k
<
variantCat
.
length
;
k
++)
{
if
(
variantCat
[
j
][
'category_variant_id'
]
==
variantCat
[
k
][
'category_variant_id'
])
{
variants
.
add
(
Variants
.
createVariant
(
variantCat
[
k
]));
}
}
Map
<
String
,
dynamic
>
dataVariantCat
=
{
"id"
:
variantCat
[
j
][
'category_variant_id'
],
"caption"
:
variantCat
[
j
][
'category_variant_caption'
],
"type"
:
variantCat
[
j
][
'category_variant_type'
],
"variants"
:
variants
};
variantCategories
.
add
(
VariantCategories
.
createVariantCategory
(
dataVariantCat
));
}
}
// pemisahan type group
// pemisahan type group
if
(
favDetail
[
i
][
'group_id'
]
!=
groupIdForFiltering
)
{
if
(
favDetail
[
i
][
'group_id'
]
!=
groupIdForFiltering
)
{
groupIdForFiltering
=
favDetail
[
i
][
'group_id'
];
groupIdForFiltering
=
favDetail
[
i
][
'group_id'
];
...
@@ -953,6 +983,8 @@ class Api {
...
@@ -953,6 +983,8 @@ class Api {
billDetail
.
add
(
BillDetail
.
createBillDetail
(
z
));
billDetail
.
add
(
BillDetail
.
createBillDetail
(
z
));
int
totalPerCustomer
=
amountParseToInt
(
z
[
'total'
]);
int
totalPerCustomer
=
amountParseToInt
(
z
[
'total'
]);
setIsCanChangeDeliveryPickupFunc
(
jsonObject
[
'data'
][
'order_state'
]);
var
i
=
{
var
i
=
{
"id"
:
jsonObject
[
'data'
][
'id'
],
"id"
:
jsonObject
[
'data'
][
'id'
],
"total"
:
jsonObject
[
'data'
][
'total'
],
"total"
:
jsonObject
[
'data'
][
'total'
],
...
@@ -987,6 +1019,11 @@ class Api {
...
@@ -987,6 +1019,11 @@ class Api {
"rdm_staff_courier_mobile"
:
"rdm_staff_courier_mobile"
:
jsonObject
[
'data'
][
'rdm_staff_courier_mobile'
]
??
""
,
jsonObject
[
'data'
][
'rdm_staff_courier_mobile'
]
??
""
,
};
};
if
(
jsonObject
[
'data'
][
'type'
]
==
typeOrderDelivery
)
{
setIsCustomerDelivery
(
true
);
}
else
{
setIsCustomerDelivery
(
false
);
}
bill
.
add
(
Bill
.
createBill
(
i
));
bill
.
add
(
Bill
.
createBill
(
i
));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
}
}
...
...
lib/helper/helper.dart
View file @
c9417de6
...
@@ -184,6 +184,14 @@ String formatDate(String timeString, {toLocal = false}) {
...
@@ -184,6 +184,14 @@ String formatDate(String timeString, {toLocal = false}) {
return
dateResult
;
return
dateResult
;
}
}
void
setIsCanChangeDeliveryPickupFunc
(
int
orderState
)
{
if
(
orderState
>=
orderStatePaid
)
{
setIsCanChangeDeliveryPickup
(
false
);
}
else
{
setIsCanChangeDeliveryPickup
(
true
);
}
}
String
localDate
(
String
date
,
{
isHistory
=
false
})
{
String
localDate
(
String
date
,
{
isHistory
=
false
})
{
String
day
;
String
day
;
String
year
;
String
year
;
...
@@ -361,6 +369,8 @@ String textButtonCheckout(int orderState, bool isHistory) {
...
@@ -361,6 +369,8 @@ String textButtonCheckout(int orderState, bool isHistory) {
}
else
{
}
else
{
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStateCreated
)
{
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStateCreated
)
{
return
'Pesan'
;
return
'Pesan'
;
}
else
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStatePending
)
{
return
'Menunggu konfirmasi outlet'
;
}
else
if
(
paymentMethod
==
closebill
&&
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePending
||
(
orderState
==
orderStatePending
||
orderState
==
orderStateApproved
)
||
orderState
==
orderStateApproved
)
||
...
...
lib/helper/prefs.dart
View file @
c9417de6
...
@@ -44,6 +44,7 @@ const String _phoneOutlet = 'phoneOutlet';
...
@@ -44,6 +44,7 @@ const String _phoneOutlet = 'phoneOutlet';
const
String
_serviceRadius
=
'sr'
;
const
String
_serviceRadius
=
'sr'
;
const
String
_distanceOutletCustomer
=
'doc'
;
const
String
_distanceOutletCustomer
=
'doc'
;
const
String
_isNewOrder
=
'ino'
;
const
String
_isNewOrder
=
'ino'
;
const
String
_isCanChangeDeliveryPickup
=
'iccdp'
;
String
getBaseUrl
(
)
{
String
getBaseUrl
(
)
{
return
prefs
.
getString
(
_baseUrl
)
??
''
;
return
prefs
.
getString
(
_baseUrl
)
??
''
;
...
@@ -384,3 +385,11 @@ bool getIsNewOrder() {
...
@@ -384,3 +385,11 @@ bool getIsNewOrder() {
Future
<
void
>
setIsNewOrder
(
bool
value
)
async
{
Future
<
void
>
setIsNewOrder
(
bool
value
)
async
{
prefs
.
setBool
(
_isNewOrder
,
value
);
prefs
.
setBool
(
_isNewOrder
,
value
);
}
}
bool
getIsCanChangeDeliveryPickup
(
)
{
return
prefs
.
getBool
(
_isCanChangeDeliveryPickup
)
??
true
;
}
Future
<
void
>
setIsCanChangeDeliveryPickup
(
bool
value
)
async
{
prefs
.
setBool
(
_isCanChangeDeliveryPickup
,
value
);
}
lib/ui/home/bottom_sheet_variant_new.dart
View file @
c9417de6
This diff is collapsed.
Click to expand it.
lib/ui/home/fav_grid_menu.dart
View file @
c9417de6
...
@@ -17,7 +17,9 @@ import '../../models/order_variants.dart';
...
@@ -17,7 +17,9 @@ import '../../models/order_variants.dart';
import
'../screen_responsive.dart'
;
import
'../screen_responsive.dart'
;
import
'bottom_sheet_menu_new.dart'
;
import
'bottom_sheet_menu_new.dart'
;
import
'bottom_sheet_variant.dart'
;
import
'bottom_sheet_variant.dart'
;
import
'bottom_sheet_variant_new.dart'
;
import
'variant_cat.dart'
;
import
'variant_cat.dart'
;
import
'variant_cat_new.dart'
;
class
FavGridMenu
extends
StatelessWidget
{
class
FavGridMenu
extends
StatelessWidget
{
const
FavGridMenu
({
const
FavGridMenu
({
...
@@ -192,7 +194,7 @@ class FavGridMenu extends StatelessWidget {
...
@@ -192,7 +194,7 @@ class FavGridMenu extends StatelessWidget {
addCondition
;
// true untuk menampilkan tambah, false untuk menampilkan quantity plus minus
addCondition
;
// true untuk menampilkan tambah, false untuk menampilkan quantity plus minus
int
indexListOrderan
=
int
indexListOrderan
=
list
.
indexWhere
((
listOrderan
)
=>
listOrderan
.
id
==
menuFav
.
id
);
list
.
indexWhere
((
listOrderan
)
=>
listOrderan
.
id
==
menuFav
.
id
);
int
initialValue
;
int
initialValue
=
0
;
if
(
indexListOrderan
!=
-
1
)
{
if
(
indexListOrderan
!=
-
1
)
{
if
(
menuFav
.
variantCat
.
isNotEmpty
)
{
if
(
menuFav
.
variantCat
.
isNotEmpty
)
{
addCondition
=
true
;
// kalau menu itu ada variantnya, biarin true
addCondition
=
true
;
// kalau menu itu ada variantnya, biarin true
...
@@ -200,11 +202,20 @@ class FavGridMenu extends StatelessWidget {
...
@@ -200,11 +202,20 @@ class FavGridMenu extends StatelessWidget {
addCondition
=
false
;
addCondition
=
false
;
}
}
initialValue
=
list
[
indexListOrderan
].
totalItem
;
if
(
list
[
indexListOrderan
].
orderDetail
.
isNotEmpty
)
{
for
(
int
d
=
0
;
d
<
list
[
indexListOrderan
].
orderDetail
.
length
;
d
++)
{
initialValue
+=
list
[
indexListOrderan
].
orderDetail
[
d
].
totalItem
;
}
}
else
{
initialValue
=
list
[
indexListOrderan
].
totalItem
;
}
}
else
{
}
else
{
addCondition
=
true
;
addCondition
=
true
;
initialValue
=
0
;
initialValue
=
0
;
}
}
String
variantButtonCount
=
''
;
String
variantButtonCount
=
''
;
if
(
initialValue
==
1
&&
menuFav
.
variantCat
.
isNotEmpty
)
{
if
(
initialValue
==
1
&&
menuFav
.
variantCat
.
isNotEmpty
)
{
variantButtonCount
=
'
$initialValue
Item'
;
variantButtonCount
=
'
$initialValue
Item'
;
...
@@ -270,7 +281,7 @@ class FavGridMenu extends StatelessWidget {
...
@@ -270,7 +281,7 @@ class FavGridMenu extends StatelessWidget {
key:
const
Key
(
'AddButton'
),
key:
const
Key
(
'AddButton'
),
onTap:
()
{
onTap:
()
{
FocusScopeNode
currentFocus
=
FocusScope
.
of
(
context
);
FocusScopeNode
currentFocus
=
FocusScope
.
of
(
context
);
print
(
"Panjangnya :
${menuFav.variantCat.length}
"
);
if
(!
currentFocus
.
hasPrimaryFocus
)
{
if
(!
currentFocus
.
hasPrimaryFocus
)
{
currentFocus
.
unfocus
();
currentFocus
.
unfocus
();
}
}
...
@@ -285,34 +296,66 @@ class FavGridMenu extends StatelessWidget {
...
@@ -285,34 +296,66 @@ class FavGridMenu extends StatelessWidget {
1
,
1
,
[],
[],
);
// check pada bloc untuk mengethui list arraynya
);
// check pada bloc untuk mengethui list arraynya
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => VariantCat(
// namaMenu: menuFav.name,
// variantCategories: menuFav.variantCat,
// initPrice: amountParseToInt(menuFav.price),
// idItem: menuFav.id,
// imageUrl: menuFav.imageUrlThumbnail,
// listCurrentOrder: list,
// orderDetail: OrderDetail(
// allIdVariant: '',
// totalItem: 0,
// totalHarga: 0,
// note: '',
// orderVariant: [],
// ),
// ),
// ),
// );
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
_
)
=>
VariantCat
(
builder:
(
_
)
=>
VariantCatNew
(
namaMenu:
menuFav
.
name
,
initPrice:
amountParseToInt
(
menuFav
.
price
),
variantCategories:
menuFav
.
variantCat
,
variantCategories:
menuFav
.
variantCat
,
initPrice:
namaMenu:
menuFav
.
name
,
amountParseToInt
(
menuFav
.
price
),
idItem:
menuFav
.
id
,
idItem:
menuFav
.
id
,
imageUrl:
menuFav
.
imageUrlMedium
,
imageUrl:
menuFav
.
imageUrlThumbnail
,
listCurrentOrder:
list
,
listCurrentOrder:
list
,
),
orderDetail:
OrderDetail
(
),
allIdVariant:
''
,
);
totalItem:
0
,
totalHarga:
0
,
note:
''
,
orderVariant:
[],
),
)));
}
else
{
}
else
{
// showModalBottomSheet(
// backgroundColor: Colors.white.withOpacity(0),
// isScrollControlled: true,
// context: context,
// builder: (context) {
// return CustomizeVariant(
// orders: list[indexListOrderan],
// variantCat: menuFav.variantCat);
// },
// );
showModalBottomSheet
(
showModalBottomSheet
(
backgroundColor:
Colors
.
white
.
withOpacity
(
0
),
backgroundColor:
Colors
.
white
.
withOpacity
(
0
),
isScrollControlled:
true
,
isScrollControlled:
true
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
19
),
),
context:
context
,
context:
context
,
builder:
(
context
)
{
builder:
(
context
)
{
return
CustomizeVariant
(
// return CustomizeVariant(
orders:
list
[
indexListOrderan
],
// orders: list[indexListOrderan],
variantCat:
menuFav
.
variantCat
);
// variantCat: menuUtama.variantCat,
// );
return
CustomizeVariantNew
(
orders:
list
[
indexListOrderan
],
variantCat:
menuFav
.
variantCat
,
);
},
},
);
);
}
}
...
...
lib/ui/home/new_home2.dart
View file @
c9417de6
This diff is collapsed.
Click to expand it.
lib/ui/viewbill/bottom_sheet_pickup_delivery.dart
View file @
c9417de6
...
@@ -13,6 +13,7 @@ import '../select_branch.dart';
...
@@ -13,6 +13,7 @@ import '../select_branch.dart';
Future
<
dynamic
>
modalBottomSelectOption
(
BuildContext
context
)
{
Future
<
dynamic
>
modalBottomSelectOption
(
BuildContext
context
)
{
void
ontapOkeChangeOutlet
()
{
void
ontapOkeChangeOutlet
()
{
Navigator
.
pop
(
context
);
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -145,9 +146,7 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
...
@@ -145,9 +146,7 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
Api
.
changeTypeOrder
(
typeOrderDelivery
).
then
((
value
)
{
Api
.
changeTypeOrder
(
typeOrderDelivery
).
then
((
value
)
{
if
(
value
)
{
if
(
value
)
{
setIsCustomerDelivery
(
true
);
setIsCustomerDelivery
(
true
);
context
context
.
read
<
ChangeDeliveryPickupBloc
>().
toDelivery
(
true
);
.
read
<
ChangeDeliveryPickupBloc
>()
.
toDelivery
(
true
);
context
.
read
<
ViewBillBloc
>().
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
setTypeOrder
(
typeOrderDelivery
);
setTypeOrder
(
typeOrderDelivery
);
}
}
...
...
lib/ui/viewbill/component_name_user.dart
View file @
c9417de6
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/prefs.dart'
;
import
'../../helper/prefs.dart'
;
...
@@ -72,7 +73,12 @@ class ComponentNameUser extends StatelessWidget {
...
@@ -72,7 +73,12 @@ class ComponentNameUser extends StatelessWidget {
(
isDeliveryPickuup
)
(
isDeliveryPickuup
)
?
GestureDetector
(
?
GestureDetector
(
onTap:
()
{
onTap:
()
{
modalBottomSelectOption
(
context
);
if
(
getIsCanChangeDeliveryPickup
())
{
modalBottomSelectOption
(
context
);
}
else
{
EasyLoading
.
showToast
(
'Tidak dapat ganti tipe order karena status orderan sedang diproses / telah selesai'
);
}
},
},
child:
Container
(
child:
Container
(
height:
30
,
height:
30
,
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
c9417de6
This diff is collapsed.
Click to expand it.
lib/ui/webview/app_bar_webview.dart
View file @
c9417de6
...
@@ -40,33 +40,36 @@ class CustomAppBar extends StatelessWidget {
...
@@ -40,33 +40,36 @@ class CustomAppBar extends StatelessWidget {
children:
[
children:
[
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
if
(
isFromSelectBranch
)
{
if
(
isFromSelectBranch
||
isFromMenu
)
{
context
.
read
<
AddressUser
>().
getAddressUser
(
context
.
read
<
AddressUser
>().
getAddressUser
(
context
,
context
,
isGetBranchList:
true
,
isGetBranchList:
true
,
isCallDeliveryCharge:
false
,
isCallDeliveryCharge:
false
,
);
);
Navigator
.
push
(
// Navigator.push(
context
,
// context,
MaterialPageRoute
(
// MaterialPageRoute(
builder:
(
_
)
=>
const
SelectBranch
(
// builder: (_) => const SelectBranch(
isFormBill:
true
,
// isFormBill: true,
),
// ),
),
// ),
);
// );
}
else
if
(
isFromMenu
)
{
Navigator
.
pop
(
context
);
context
.
read
<
AddressUser
>().
getAddressUser
(
}
context
,
// else if (isFromMenu) {
isGetBranchList:
true
,
// context.read<AddressUser>().getAddressUser(
isCallDeliveryCharge:
false
,
// context,
);
// isGetBranchList: true,
Navigator
.
push
(
// isCallDeliveryCharge: false,
context
,
// );
MaterialPageRoute
(
// Navigator.push(
builder:
(
_
)
=>
const
NewHome2
(),
// context,
),
// MaterialPageRoute(
);
// builder: (_) => const NewHome2(),
}
else
{
// ),
// );
// }
else
{
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
...
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