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
375f32da
Commit
375f32da
authored
Oct 19, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
19/10/22
parent
300ca720
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
264 additions
and
138 deletions
+264
-138
api.dart
lib/api/api.dart
+13
-10
change_delivery_pickup.dart
lib/bloc/change_delivery_pickup.dart
+1
-1
helper.dart
lib/helper/helper.dart
+26
-22
prefs.dart
lib/helper/prefs.dart
+9
-0
new_home2.dart
lib/ui/home/new_home2.dart
+11
-5
splash.dart
lib/ui/splash.dart
+15
-6
component_name_user.dart
lib/ui/viewbill/component_name_user.dart
+3
-1
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+186
-93
No files found.
lib/api/api.dart
View file @
375f32da
...
@@ -75,15 +75,20 @@ class Api {
...
@@ -75,15 +75,20 @@ class Api {
jsonDecode
(
element
)[
'url_type'
]
!=
typeUrlSatu
,
jsonDecode
(
element
)[
'url_type'
]
!=
typeUrlSatu
,
);
);
if
(
indexTypeUrl
!=
-
1
)
{
currentOrderId
=
jsonDecode
(
listTypeUrl
[
indexTypeUrl
])[
'order_id'
];
}
else
{
currentOrderId
=
getOrderId
();
}
var
uuidOrderId
=
uuidInit
.
v4
();
var
uuidOrderId
=
uuidInit
.
v4
();
String
orderID
;
String
orderID
;
if
(
currentOrderId
!=
''
)
{
if
(
getIsNewOrder
()
==
false
)
{
orderID
=
currentOrderId
;
if
(
indexTypeUrl
!=
-
1
)
{
currentOrderId
=
jsonDecode
(
listTypeUrl
[
indexTypeUrl
])[
'order_id'
];
}
else
{
currentOrderId
=
getOrderId
();
}
if
(
currentOrderId
!=
''
)
{
orderID
=
currentOrderId
;
}
else
{
orderID
=
uuidOrderId
;
}
}
else
{
}
else
{
orderID
=
uuidOrderId
;
orderID
=
uuidOrderId
;
}
}
...
@@ -193,6 +198,7 @@ class Api {
...
@@ -193,6 +198,7 @@ class Api {
}
else
{
}
else
{
setIsCustomerDelivery
(
false
);
setIsCustomerDelivery
(
false
);
}
}
setIsNewOrder
(
false
);
return
responseByodBranchExist
;
return
responseByodBranchExist
;
}
else
if
(
jsonObject
[
'status'
]
==
'error'
&&
}
else
if
(
jsonObject
[
'status'
]
==
'error'
&&
(
jsonObject
[
'code'
]
==
'BYOD_ALWAYS_OFF'
||
(
jsonObject
[
'code'
]
==
'BYOD_ALWAYS_OFF'
||
...
@@ -982,9 +988,6 @@ class Api {
...
@@ -982,9 +988,6 @@ 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'
][
'delivery_fee'
]
!=
""
)
{
setIsCustomerDelivery
(
true
);
}
bill
.
add
(
Bill
.
createBill
(
i
));
bill
.
add
(
Bill
.
createBill
(
i
));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
}
}
...
...
lib/bloc/change_delivery_pickup.dart
View file @
375f32da
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
class
ChangeDeliveryPickupBloc
extends
Cubit
<
bool
>
{
class
ChangeDeliveryPickupBloc
extends
Cubit
<
bool
>
{
ChangeDeliveryPickupBloc
()
:
super
(
fals
e
);
ChangeDeliveryPickupBloc
()
:
super
(
tru
e
);
void
toDelivery
(
bool
status
)
{
void
toDelivery
(
bool
status
)
{
emit
(
status
);
emit
(
status
);
...
...
lib/helper/helper.dart
View file @
375f32da
...
@@ -354,30 +354,34 @@ iscanTapAddRemoveQtyViewBill(int orderState) {
...
@@ -354,30 +354,34 @@ iscanTapAddRemoveQtyViewBill(int orderState) {
return
false
;
return
false
;
}
}
String
textButtonCheckout
(
int
orderState
)
{
String
textButtonCheckout
(
int
orderState
,
bool
isHistory
)
{
int
paymentMethod
=
getPaymentMode
();
int
paymentMethod
=
getPaymentMode
();
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStateCreated
)
{
if
(
isHistory
)
{
return
'Pesan'
;
return
'Kembali'
;
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePending
||
orderState
==
orderStateApproved
)
||
paymentMethod
==
openBill
&&
(
orderState
==
orderStateCreated
||
orderState
==
orderStatePending
))
{
return
'Bayar'
;
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePaid
||
orderState
==
orderStateInproses
||
orderState
==
orderStateReady
))
{
return
'Pesanan Diproses'
;
}
else
if
(
paymentMethod
==
openBill
&&
orderState
!=
orderStateCanceled
)
{
return
'Bayar'
;
}
else
if
(
orderState
==
orderStateCanceled
)
{
return
'Transaksi Dibatalkan'
;
}
else
if
(
orderState
==
orderStateDone
)
{
return
'Buat Pesanan Baru'
;
}
else
{
}
else
{
return
'Bayar'
;
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStateCreated
)
{
return
'Pesan'
;
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePending
||
orderState
==
orderStateApproved
)
||
paymentMethod
==
openBill
&&
(
orderState
==
orderStateCreated
||
orderState
==
orderStatePending
))
{
return
'Bayar'
;
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePaid
||
orderState
==
orderStateInproses
||
orderState
==
orderStateReady
))
{
return
'Pesanan Diproses'
;
}
else
if
(
paymentMethod
==
openBill
&&
orderState
!=
orderStateCanceled
)
{
return
'Bayar'
;
}
else
if
(
orderState
==
orderStateCanceled
)
{
return
'Transaksi Dibatalkan'
;
}
else
if
(
orderState
==
orderStateDone
)
{
return
'Buat Pesanan Baru'
;
}
else
{
return
'Bayar'
;
}
}
}
}
}
...
...
lib/helper/prefs.dart
View file @
375f32da
...
@@ -43,6 +43,7 @@ const String _addressOutlet = 'addressOutlet';
...
@@ -43,6 +43,7 @@ const String _addressOutlet = 'addressOutlet';
const
String
_phoneOutlet
=
'phoneOutlet'
;
const
String
_phoneOutlet
=
'phoneOutlet'
;
const
String
_serviceRadius
=
'sr'
;
const
String
_serviceRadius
=
'sr'
;
const
String
_distanceOutletCustomer
=
'doc'
;
const
String
_distanceOutletCustomer
=
'doc'
;
const
String
_isNewOrder
=
'ino'
;
String
getBaseUrl
(
)
{
String
getBaseUrl
(
)
{
return
prefs
.
getString
(
_baseUrl
)
??
''
;
return
prefs
.
getString
(
_baseUrl
)
??
''
;
...
@@ -375,3 +376,11 @@ double getDistance() {
...
@@ -375,3 +376,11 @@ double getDistance() {
Future
<
void
>
setDistance
(
double
value
)
async
{
Future
<
void
>
setDistance
(
double
value
)
async
{
prefs
.
setDouble
(
_distanceOutletCustomer
,
value
);
prefs
.
setDouble
(
_distanceOutletCustomer
,
value
);
}
}
bool
getIsNewOrder
(
)
{
return
prefs
.
getBool
(
_isNewOrder
)
??
false
;
}
Future
<
void
>
setIsNewOrder
(
bool
value
)
async
{
prefs
.
setBool
(
_isNewOrder
,
value
);
}
lib/ui/home/new_home2.dart
View file @
375f32da
...
@@ -19,6 +19,7 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
...
@@ -19,6 +19,7 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
import
'package:sliver_tools/sliver_tools.dart'
;
import
'package:sliver_tools/sliver_tools.dart'
;
import
'../../bloc/address_user_bloc.dart'
;
import
'../../bloc/address_user_bloc.dart'
;
import
'../../bloc/change_delivery_pickup.dart'
;
import
'../../bloc/filter_menu.dart'
;
import
'../../bloc/filter_menu.dart'
;
import
'../../bloc/outlet_detail.dart'
;
import
'../../bloc/outlet_detail.dart'
;
import
'../../helper/mq.dart'
;
import
'../../helper/mq.dart'
;
...
@@ -678,11 +679,16 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -678,11 +679,16 @@ class _NewHome2State extends State<NewHome2> {
),
),
),
),
(
getIsDeliveryPickup
())
(
getIsDeliveryPickup
())
?
const
SliverToBoxAdapter
(
?
SliverToBoxAdapter
(
child:
ComponentNameUser
(
child:
BlocBuilder
<
ChangeDeliveryPickupBloc
,
bool
>(
isDeliveryPickuup:
true
,
builder:
(
ctx
,
isDelivery
)
{
backgroundColorComponent:
backgroundColor
,
return
ComponentNameUser
(
isFromMenu:
true
,
isDeliveryPickuup:
true
,
backgroundColorComponent:
backgroundColor
,
isFromMenu:
true
,
isdelivery:
isDelivery
,
);
},
),
),
)
)
:
const
SliverToBoxAdapter
(
:
const
SliverToBoxAdapter
(
...
...
lib/ui/splash.dart
View file @
375f32da
...
@@ -13,6 +13,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
...
@@ -13,6 +13,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import
'package:geolocator/geolocator.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'../bloc/branch_exist.dart'
;
import
'../bloc/branch_exist.dart'
;
import
'../bloc/change_delivery_pickup.dart'
;
import
'../bloc/filter_menu.dart'
;
import
'../bloc/filter_menu.dart'
;
import
'../main.dart'
;
import
'../main.dart'
;
import
'package:flutter/services.dart'
as
bundle_root
;
import
'package:flutter/services.dart'
as
bundle_root
;
...
@@ -49,6 +50,8 @@ class _SplashState extends State<Splash> {
...
@@ -49,6 +50,8 @@ class _SplashState extends State<Splash> {
}
}
}
}
int
durationDelayBeforToMenu
=
2000
;
@override
@override
void
initState
()
{
void
initState
()
{
loadBaseUrl
().
then
((
baseUrl
)
{
loadBaseUrl
().
then
((
baseUrl
)
{
...
@@ -88,7 +91,7 @@ class _SplashState extends State<Splash> {
...
@@ -88,7 +91,7 @@ class _SplashState extends State<Splash> {
widget
.
context
,
widget
.
context
,
getBrancList:
true
,
getBrancList:
true
,
);
);
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
// if (getStatusOrderCreated()) {
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
getBranchPref
(),
getBranchPref
(),
...
@@ -97,6 +100,9 @@ class _SplashState extends State<Splash> {
...
@@ -97,6 +100,9 @@ class _SplashState extends State<Splash> {
getCashierName
(),
getCashierName
(),
getOrderId
(),
getOrderId
(),
);
);
context
.
read
<
ChangeDeliveryPickupBloc
>()
.
toDelivery
(
getIsCustomerDelivery
());
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
widget
.
context
,
widget
.
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -160,7 +166,7 @@ class _SplashState extends State<Splash> {
...
@@ -160,7 +166,7 @@ class _SplashState extends State<Splash> {
widget
.
context
,
widget
.
context
,
getBrancList:
true
,
getBrancList:
true
,
);
);
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
// if (getStatusOrderCreated()) {
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
getBranchPref
(),
getBranchPref
(),
...
@@ -169,6 +175,9 @@ class _SplashState extends State<Splash> {
...
@@ -169,6 +175,9 @@ class _SplashState extends State<Splash> {
getCashierName
(),
getCashierName
(),
getOrderId
(),
getOrderId
(),
);
);
context
.
read
<
ChangeDeliveryPickupBloc
>()
.
toDelivery
(
getIsCustomerDelivery
());
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
widget
.
context
,
widget
.
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -297,7 +306,7 @@ class _SplashState extends State<Splash> {
...
@@ -297,7 +306,7 @@ class _SplashState extends State<Splash> {
widget
.
context
,
widget
.
context
,
getMenu:
true
,
getMenu:
true
,
);
);
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
// if (getStatusOrderCreated()) {
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
getBranchPref
(),
getBranchPref
(),
...
@@ -408,7 +417,7 @@ class _SplashState extends State<Splash> {
...
@@ -408,7 +417,7 @@ class _SplashState extends State<Splash> {
widget
.
context
,
widget
.
context
,
getMenu:
true
,
getMenu:
true
,
);
);
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
// if (getStatusOrderCreated()) {
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
getBranchPref
(),
getBranchPref
(),
...
@@ -497,7 +506,7 @@ class _SplashState extends State<Splash> {
...
@@ -497,7 +506,7 @@ class _SplashState extends State<Splash> {
widget
.
context
,
widget
.
context
,
getMenu:
true
,
getMenu:
true
,
);
);
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
// if (getStatusOrderCreated()) {
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
getBranchPref
(),
getBranchPref
(),
...
@@ -566,7 +575,7 @@ class _SplashState extends State<Splash> {
...
@@ -566,7 +575,7 @@ class _SplashState extends State<Splash> {
}
}
void
goToMenu
(
contexts
)
{
void
goToMenu
(
contexts
)
{
Future
.
delayed
(
const
Duration
(
milliseconds:
2000
),
()
async
{
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
contexts
,
contexts
,
MaterialPageRoute
(
MaterialPageRoute
(
...
...
lib/ui/viewbill/component_name_user.dart
View file @
375f32da
...
@@ -13,12 +13,14 @@ class ComponentNameUser extends StatelessWidget {
...
@@ -13,12 +13,14 @@ class ComponentNameUser extends StatelessWidget {
this
.
dataBill
=
const
[],
this
.
dataBill
=
const
[],
required
this
.
backgroundColorComponent
,
required
this
.
backgroundColorComponent
,
this
.
isFromMenu
=
false
,
this
.
isFromMenu
=
false
,
required
this
.
isdelivery
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
final
bool
isDeliveryPickuup
;
final
bool
isDeliveryPickuup
;
final
List
<
Bill
>
dataBill
;
final
List
<
Bill
>
dataBill
;
final
Color
backgroundColorComponent
;
final
Color
backgroundColorComponent
;
final
bool
isFromMenu
;
final
bool
isFromMenu
;
final
bool
isdelivery
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -48,7 +50,7 @@ class ComponentNameUser extends StatelessWidget {
...
@@ -48,7 +50,7 @@ class ComponentNameUser extends StatelessWidget {
child:
defaultText
(
child:
defaultText
(
context
,
context
,
(
isDeliveryPickuup
)
(
isDeliveryPickuup
)
?
(
getIsCustomerDelivery
()
)
?
(
isdelivery
)
?
'Delivery'
?
'Delivery'
:
'Pickup'
:
'Pickup'
:
'Meja
${dataBill[0].tableName}
'
,
:
'Meja
${dataBill[0].tableName}
'
,
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
375f32da
...
@@ -497,6 +497,7 @@ class CoreBill extends StatelessWidget {
...
@@ -497,6 +497,7 @@ class CoreBill extends StatelessWidget {
isDeliveryPickuup:
isDeliveryPickuup
,
isDeliveryPickuup:
isDeliveryPickuup
,
dataBill:
dataBill
,
dataBill:
dataBill
,
backgroundColorComponent:
backgroundWhite
,
backgroundColorComponent:
backgroundWhite
,
isdelivery:
getIsCustomerDelivery
(),
),
),
(
isDeliveryPickuup
)
(
isDeliveryPickuup
)
?
Container
(
?
Container
(
...
@@ -970,6 +971,7 @@ class CoreBill extends StatelessWidget {
...
@@ -970,6 +971,7 @@ class CoreBill extends StatelessWidget {
outStandingTopayMember:
outStandingTopayMember
,
outStandingTopayMember:
outStandingTopayMember
,
indexDataIndividu:
indexDataIndividu
,
indexDataIndividu:
indexDataIndividu
,
memberinfo:
memberinfo
,
memberinfo:
memberinfo
,
isHistory:
isHistory
,
)
)
:
const
SizedBox
(),
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
(
getIsDeliveryPickup
())
...
@@ -984,6 +986,7 @@ class CoreBill extends StatelessWidget {
...
@@ -984,6 +986,7 @@ class CoreBill extends StatelessWidget {
outStandingTopayMember:
outStandingTopayMember
,
outStandingTopayMember:
outStandingTopayMember
,
indexDataIndividu:
indexDataIndividu
,
indexDataIndividu:
indexDataIndividu
,
memberinfo:
memberinfo
,
memberinfo:
memberinfo
,
isHistory:
isHistory
,
)
)
:
const
SizedBox
(),
:
const
SizedBox
(),
(!
getIsDeliveryPickup
())
(!
getIsDeliveryPickup
())
...
@@ -1009,63 +1012,107 @@ class CoreBill extends StatelessWidget {
...
@@ -1009,63 +1012,107 @@ class CoreBill extends StatelessWidget {
],
],
)
)
:
(
dataBill
[
0
].
tableStatus
!=
tableStatusOpen
)
:
(
dataBill
[
0
].
tableStatus
!=
tableStatusOpen
)
?
GestureDetector
(
?
Column
(
onTap:
()
{
children:
[
if
(
dataBill
[
0
].
state
==
const
SizedBox
(
orderStateDone
)
{
height:
12
,
//**UUID */
),
var
newOrderId
=
uuidInit
.
v4
();
GestureDetector
(
//** UUID */
onTap:
()
{
setOrderId
(
newOrderId
);
if
(
isHistory
)
{
context
Navigator
.
push
(
.
read
<
BranchExist
>()
.
branchExist
(
getBranchPref
(),
getBrand
(),
getRole
(),
getCashierName
(),
getOrderId
(),
context
,
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
HistoryOrderNew
(
historyOrder:
getListHistory
(),
),
),
);
);
}
else
{
}
else
{
context
setIsNewOrder
(
true
);
.
read
<
BranchExist
>()
context
.
branchExist
(
.
read
<
BranchExist
>()
getBranchPref
(),
.
branchExist
(
getBrand
(),
getBranchPref
(),
getRole
(),
getBrand
(),
getCashierName
(),
getRole
(),
getOrderId
(),
getCashierName
(),
getOrderId
(),
context
,
);
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
(),
),
);
);
}
Navigator
.
pushReplacement
(
// if (dataBill[0].state ==
context
,
// orderStateDone) {
MaterialPageRoute
(
// //**UUID */
builder:
(
_
)
=>
// // var newOrderId = uuidInit.v4();
const
NewHome2
()),
// //** UUID */
);
// if (isHistory) {
}
// Navigator.push(
},
// context,
child:
Column
(
// MaterialPageRoute(
children:
[
// builder: (_) =>
const
SizedBox
(
// HistoryOrderNew(
height:
12
,
// historyOrder:
),
// getListHistory(),
GestureDetector
(
// ),
onTap:
()
{
// ),
// if (dataBill[0].tableStatus ==
// );
// tableStatusOpen) {
// } else {
// onTapCashier();
// setIsNewOrder(true);
// }
// context
},
// .read<BranchExist>()
child:
const
ButtonComponent
(
// .branchExist(
buttonColor:
successColor
,
// getBranchPref(),
teksButton:
'Buat Pesanan Baru'
,
// getBrand(),
),
// getRole(),
// getCashierName(),
// getOrderId(),
// context,
// );
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (_) =>
// const NewHome2(),
// ),
// );
// }
// } else {
// setIsNewOrder(true);
// context
// .read<BranchExist>()
// .branchExist(
// getBranchPref(),
// getBrand(),
// getRole(),
// getCashierName(),
// getOrderId(),
// context,
// );
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (_) =>
// const NewHome2(),
// ),
// );
// }
},
child:
const
ButtonComponent
(
buttonColor:
successColor
,
teksButton:
'Buat Pesanan Baru'
,
),
),
]
,
)
,
)
,
]
,
)
)
:
const
SizedBox
()
:
const
SizedBox
()
:
const
SizedBox
(),
:
const
SizedBox
(),
...
@@ -1098,6 +1145,7 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1098,6 +1145,7 @@ class ButtonPayment extends StatelessWidget {
required
this
.
outStandingTopayMember
,
required
this
.
outStandingTopayMember
,
required
this
.
indexDataIndividu
,
required
this
.
indexDataIndividu
,
required
this
.
memberinfo
,
required
this
.
memberinfo
,
required
this
.
isHistory
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
final
List
<
Bill
>
dataBill
;
final
List
<
Bill
>
dataBill
;
...
@@ -1110,6 +1158,7 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1110,6 +1158,7 @@ class ButtonPayment extends StatelessWidget {
final
int
outStandingTopayMember
;
final
int
outStandingTopayMember
;
final
int
indexDataIndividu
;
final
int
indexDataIndividu
;
final
MemberInfo
memberinfo
;
final
MemberInfo
memberinfo
;
final
bool
isHistory
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -1126,20 +1175,29 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1126,20 +1175,29 @@ class ButtonPayment extends StatelessWidget {
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
'Alamat harus dipilih terlebih dahulu'
);
'Alamat harus dipilih terlebih dahulu'
);
}
else
{
}
else
{
Api
.
setToPendingOrder
();
Api
.
setToPendingOrder
().
then
((
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
if
(
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
}
});
}
}
}
else
{
}
else
{
if
(
getPickupTime
()
==
''
)
{
if
(
getPickupTime
()
==
''
)
{
EasyLoading
.
showToast
(
'Silakan pilih jam pickup'
);
EasyLoading
.
showToast
(
'Silakan pilih jam pickup'
);
}
else
{
}
else
{
Api
.
setToPendingOrder
();
Api
.
setToPendingOrder
().
then
((
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
if
(
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
}
});
}
}
}
}
}
else
{
}
else
{
Api
.
setToPendingOrder
();
Api
.
setToPendingOrder
().
then
((
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
if
(
value
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
}
});
}
}
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
getTableMode
()
==
tableIndividu
)
{
getTableMode
()
==
tableIndividu
)
{
...
@@ -1147,24 +1205,34 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1147,24 +1205,34 @@ class ButtonPayment extends StatelessWidget {
'Status orderan anda menunggu untuk disetujui'
);
'Status orderan anda menunggu untuk disetujui'
);
}
else
if
(
dataBill
[
0
].
state
==
orderStateDone
)
{
}
else
if
(
dataBill
[
0
].
state
==
orderStateDone
)
{
//**UUID */
//**UUID */
var
newOrderId
=
uuidInit
.
v4
();
//
var newOrderId = uuidInit.v4();
//** UUID */
//** UUID */
setOrderId
(
newOrderId
);
if
(
isHistory
)
{
context
.
read
<
BranchExist
>().
branchExist
(
Navigator
.
push
(
getBranchPref
(),
context
,
getBrand
(),
MaterialPageRoute
(
getRole
(),
builder:
(
_
)
=>
HistoryOrderNew
(
getCashierName
(),
historyOrder:
getListHistory
(),
getOrderId
(),
),
context
,
),
);
);
}
else
{
Navigator
.
pushReplacement
(
setIsNewOrder
(
true
);
context
,
context
.
read
<
BranchExist
>().
branchExist
(
MaterialPageRoute
(
getBranchPref
(),
builder:
(
_
)
=>
const
NewHome2
(),
getBrand
(),
),
getRole
(),
);
getCashierName
(),
getOrderId
(),
context
,
);
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
(),
),
);
}
}
else
{
}
else
{
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
==
''
)
{
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
==
''
)
{
addPayment
(
addPayment
(
...
@@ -1508,7 +1576,10 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1508,7 +1576,10 @@ class ButtonPayment extends StatelessWidget {
child:
Center
(
child:
Center
(
child:
defaultText
(
child:
defaultText
(
context
,
context
,
textButtonCheckout
(
dataBill
[
0
].
state
),
textButtonCheckout
(
dataBill
[
0
].
state
,
isHistory
,
),
style:
buttonBottomBill
(),
style:
buttonBottomBill
(),
),
),
),
),
...
@@ -2048,24 +2119,46 @@ Apakah ingin melanjutkan ?''';
...
@@ -2048,24 +2119,46 @@ Apakah ingin melanjutkan ?''';
font:
10
,
font:
10
,
),
),
),
),
defaultText
(
(
address
.
locationDetail
!=
''
)
context
,
?
defaultText
(
"Detail Lokasi:
${address.locationDetail}
"
,
context
,
style:
addressStyle
(
"Detail Lokasi:
${address.locationDetail}
"
,
font:
10
,
style:
addressStyle
(
),
font:
10
,
),
),
defaultText
(
)
context
,
:
const
SizedBox
(),
"Catatan :
${address.notes}
"
,
(
address
.
notes
!=
''
)
style:
addressStyle
(
?
defaultText
(
font:
10
,
context
,
),
"Catatan :
${address.notes}
"
,
),
style:
addressStyle
(
font:
10
,
),
)
:
const
SizedBox
(),
(
databill
.
isNotEmpty
&&
databill
[
0
].
courierName
!=
''
||
databill
.
isNotEmpty
&&
databill
[
0
].
courierPhone
!=
''
)
?
const
SizedBox
(
height:
10
,
)
:
const
SizedBox
(),
(
databill
.
isNotEmpty
&&
databill
[
0
].
courierName
!=
''
||
databill
.
isNotEmpty
&&
databill
[
0
].
courierPhone
!=
''
)
?
defaultText
(
context
,
'Kurir Detail :'
,
style:
addressStyle
(
font:
10
,
),
)
:
const
SizedBox
(),
(
databill
.
isNotEmpty
&&
databill
[
0
].
courierName
!=
''
)
(
databill
.
isNotEmpty
&&
databill
[
0
].
courierName
!=
''
)
?
defaultText
(
?
defaultText
(
context
,
context
,
"Kurir :
${databill[0].courierName}
"
,
"Kurir
Name
:
${databill[0].courierName}
"
,
style:
addressStyle
(
style:
addressStyle
(
font:
10
,
font:
10
,
),
),
...
@@ -2075,7 +2168,7 @@ Apakah ingin melanjutkan ?''';
...
@@ -2075,7 +2168,7 @@ Apakah ingin melanjutkan ?''';
?
GestureDetector
(
?
GestureDetector
(
onTap:
()
{
onTap:
()
{
htmlOpenLink
(
htmlOpenLink
(
'
https://wa.me/
${databill[0].courierPhone}
'
,
'
tel:
${databill[0].courierPhone}
'
,
self:
false
,
self:
false
,
);
);
},
},
...
@@ -2086,7 +2179,7 @@ Apakah ingin melanjutkan ?''';
...
@@ -2086,7 +2179,7 @@ Apakah ingin melanjutkan ?''';
phoneIconSize
,
phoneIconSize
,
),
),
const
SizedBox
(
const
SizedBox
(
width:
10
,
width:
5
,
),
),
defaultText
(
defaultText
(
context
,
context
,
...
...
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