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
bdbf0d11
Commit
bdbf0d11
authored
Oct 18, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
18/10/22
parent
22fec12f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1249 additions
and
289 deletions
+1249
-289
looking_driver.png
assets/icons/looking_driver.png
+0
-0
order_delivered.png
assets/icons/order_delivered.png
+0
-0
otw_pickup.png
assets/icons/otw_pickup.png
+0
-0
processing_order.png
assets/icons/processing_order.png
+0
-0
api.dart
lib/api/api.dart
+68
-25
address_user_bloc.dart
lib/bloc/address_user_bloc.dart
+11
-4
helper.dart
lib/helper/helper.dart
+7
-3
prefs.dart
lib/helper/prefs.dart
+18
-0
address_user.dart
lib/models/address_user.dart
+2
-2
bill.dart
lib/models/bill.dart
+28
-25
app_bar_select_branch.dart
lib/ui/app_bar_select_branch.dart
+27
-8
home.dart
lib/ui/home/home.dart
+1
-1
new_home2.dart
lib/ui/home/new_home2.dart
+180
-68
no_route.dart
lib/ui/no_route.dart
+2
-2
select_branch.dart
lib/ui/select_branch.dart
+61
-3
splash.dart
lib/ui/splash.dart
+337
-72
timeline.dart
lib/ui/viewbill/timeline.dart
+356
-0
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+84
-59
app_bar_webview.dart
lib/ui/webview/app_bar_webview.dart
+31
-8
webview.dart
lib/ui/webview/webview.dart
+28
-9
pubspec.lock
pubspec.lock
+7
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
assets/icons/looking_driver.png
0 → 100644
View file @
bdbf0d11
638 Bytes
assets/icons/order_delivered.png
0 → 100644
View file @
bdbf0d11
583 Bytes
assets/icons/otw_pickup.png
0 → 100644
View file @
bdbf0d11
692 Bytes
assets/icons/processing_order.png
0 → 100644
View file @
bdbf0d11
612 Bytes
lib/api/api.dart
View file @
bdbf0d11
...
@@ -69,7 +69,9 @@ class Api {
...
@@ -69,7 +69,9 @@ class Api {
List
<
String
>
listTypeUrl
=
getListTypeUrl
();
List
<
String
>
listTypeUrl
=
getListTypeUrl
();
int
indexTypeUrl
=
listTypeUrl
.
indexWhere
(
int
indexTypeUrl
=
listTypeUrl
.
indexWhere
(
(
element
)
=>
jsonDecode
(
element
)[
'url_type'
]
==
urlType
&&
jsonDecode
(
element
)[
'url_type'
]
!=
typeUrlSatu
,
(
element
)
=>
jsonDecode
(
element
)[
'url_type'
]
==
urlType
&&
jsonDecode
(
element
)[
'url_type'
]
!=
typeUrlSatu
,
);
);
if
(
indexTypeUrl
!=
-
1
)
{
if
(
indexTypeUrl
!=
-
1
)
{
...
@@ -150,7 +152,14 @@ class Api {
...
@@ -150,7 +152,14 @@ class Api {
jsonEncode
(
saveTypeUrlAndOrderId
),
jsonEncode
(
saveTypeUrlAndOrderId
),
);
);
setListTypeUrl
(
listTypeUrl
);
setListTypeUrl
(
listTypeUrl
);
if
(
jsonObject
[
'data'
][
'session_id'
]
!=
null
)
{
Api
.
getAddress
().
then
((
address
)
{
if
(
address
.
id
!=
''
)
{
setLatitude
(
address
.
lat
);
setLongitude
(
address
.
long
);
}
});
}
setMqMessage
(
'ORDER-ID-
${jsonObject['data']['order_id']}
'
);
setMqMessage
(
'ORDER-ID-
${jsonObject['data']['order_id']}
'
);
setOrderId
(
jsonObject
[
'data'
][
'order_id'
]);
setOrderId
(
jsonObject
[
'data'
][
'order_id'
]);
setTypeOrder
(
jsonObject
[
'data'
][
'type_order'
]);
setTypeOrder
(
jsonObject
[
'data'
][
'type_order'
]);
...
@@ -170,6 +179,8 @@ class Api {
...
@@ -170,6 +179,8 @@ class Api {
setAddressOutlet
(
jsonObject
[
'data'
][
'address'
]);
setAddressOutlet
(
jsonObject
[
'data'
][
'address'
]);
setPhoneOutlet
(
jsonObject
[
'data'
][
'mobile'
]);
setPhoneOutlet
(
jsonObject
[
'data'
][
'mobile'
]);
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
setServiceRadius
(
jsonObject
[
'data'
][
'service_radius'
]
??
0
);
setDistance
(
jsonObject
[
'data'
][
'distance'
]
??
'0'
);
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
}
}
...
@@ -835,8 +846,6 @@ class Api {
...
@@ -835,8 +846,6 @@ class Api {
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
&&
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
&&
jsonObject
[
'msg'
]
==
'Bill ditemukan'
)
{
jsonObject
[
'msg'
]
==
'Bill ditemukan'
)
{
List
<
Bill
>
bill
=
[];
List
<
Bill
>
bill
=
[];
List
<
PaymentList
>
paymentList
=
[];
List
<
PaymentList
>
paymentList
=
[];
// List<MemberInfo> memberInfo = [];
// List<MemberInfo> memberInfo = [];
...
@@ -935,13 +944,15 @@ class Api {
...
@@ -935,13 +944,15 @@ class Api {
jsonObject
[
'data'
][
'packaging_fee'
]
??
"0.00"
,
jsonObject
[
'data'
][
'packaging_fee'
]
??
"0.00"
,
"platform_fee"
:
jsonObject
[
'data'
][
'platform_fee'
]
??
"0.00"
,
"platform_fee"
:
jsonObject
[
'data'
][
'platform_fee'
]
??
"0.00"
,
"delivery_fee"
:
jsonObject
[
'data'
][
'delivery_fee'
]
??
"0.00"
,
"delivery_fee"
:
jsonObject
[
'data'
][
'delivery_fee'
]
??
"0.00"
,
"delivery_state"
:
jsonObject
[
'data'
][
'order_delivery_state'
]
??
0
,
};
};
bill
.
add
(
Bill
.
createBill
(
i
));
bill
.
add
(
Bill
.
createBill
(
i
));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
}
}
}
}
}
}
Api
.
ch
ange
Payment
();
Api
.
ch
eck
Payment
();
return
bill
;
return
bill
;
}
else
{
}
else
{
return
[];
return
[];
...
@@ -1166,6 +1177,19 @@ class Api {
...
@@ -1166,6 +1177,19 @@ class Api {
String
sessionId
=
getSessionId
();
String
sessionId
=
getSessionId
();
String
signString
=
signApi
();
String
signString
=
signApi
();
int
sessionC
=
getSessionCounter
();
int
sessionC
=
getSessionCounter
();
String
uriBase
=
"
${Uri.base}
"
;
var
splitpath
=
uriBase
.
split
(
'/'
);
var
lastPath
=
splitpath
.
last
;
String
returnUrl
;
if
(
lastPath
==
''
)
{
returnUrl
=
"
${Uri.base}
go"
;
}
else
{
if
(
lastPath
==
'go'
)
{
returnUrl
=
"
${Uri.base}
"
;
}
else
{
returnUrl
=
"
${Uri.base}
/go"
;
}
}
try
{
try
{
Map
data
=
{
Map
data
=
{
"session_id"
:
sessionId
,
"session_id"
:
sessionId
,
...
@@ -1181,7 +1205,8 @@ class Api {
...
@@ -1181,7 +1205,8 @@ class Api {
"secure_token"
:
token
,
"secure_token"
:
token
,
"amount"
:
amount
,
"amount"
:
amount
,
"time_ready_for_pickup"
:
getPickupTime
(),
"time_ready_for_pickup"
:
getPickupTime
(),
"from"
:
fromByod
"from"
:
fromByod
,
"return_url"
:
returnUrl
};
};
var
bodies
=
jsonEncode
(
data
);
var
bodies
=
jsonEncode
(
data
);
// var apiResult = await http.post(Uri.parse(apiUrl), body: bodies);
// var apiResult = await http.post(Uri.parse(apiUrl), body: bodies);
...
@@ -2017,7 +2042,7 @@ class Api {
...
@@ -2017,7 +2042,7 @@ class Api {
}
}
}
}
static
Future
<
bool
>
changeBranch
(
String
newBranch
)
async
{
static
Future
<
Map
<
String
,
dynamic
>
>
changeBranch
(
String
newBranch
)
async
{
String
baseUrl
=
getBaseUrl
();
String
baseUrl
=
getBaseUrl
();
String
apiUrl
=
"
$baseUrl${endPoint}
change_branch"
;
String
apiUrl
=
"
$baseUrl${endPoint}
change_branch"
;
...
@@ -2037,6 +2062,8 @@ class Api {
...
@@ -2037,6 +2062,8 @@ class Api {
"type_order"
:
getTypeOrder
(),
"type_order"
:
getTypeOrder
(),
"cashier_name"
:
getCashierName
(),
"cashier_name"
:
getCashierName
(),
"from"
:
fromByod
,
"from"
:
fromByod
,
"customer_lat"
:
getLatitude
(),
"customer_long"
:
getLongitude
(),
};
};
var
bodies
=
jsonEncode
(
data
);
var
bodies
=
jsonEncode
(
data
);
...
@@ -2049,22 +2076,38 @@ class Api {
...
@@ -2049,22 +2076,38 @@ class Api {
setLongOutlet
(
jsonObject
[
'data'
][
'long'
]);
setLongOutlet
(
jsonObject
[
'data'
][
'long'
]);
setOpenTime
(
jsonObject
[
'data'
][
'open_time'
]);
setOpenTime
(
jsonObject
[
'data'
][
'open_time'
]);
setCloseTime
(
jsonObject
[
'data'
][
'close_time'
]);
setCloseTime
(
jsonObject
[
'data'
][
'close_time'
]);
return
true
;
setServiceRadius
(
jsonObject
[
'data'
][
'service_radius'
])
;
}
}
return
false
;
Map
<
String
,
dynamic
>
returnResult
=
{
"status"
:
jsonObject
[
'status'
],
"code"
:
jsonObject
[
'code'
],
"msg"
:
jsonObject
[
'msg'
],
};
return
returnResult
;
}
else
{
}
else
{
return
false
;
Map
<
String
,
dynamic
>
returnResult
=
{
"status"
:
'error_server'
,
"code"
:
''
,
"msg"
:
'Something wrong with oure server'
,
};
return
returnResult
;
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
if
(
debug
)
{
if
(
debug
)
{
logd
(
'API CLASS ON API.DART, FUNGSI: changeBranch, URL :
$apiUrl
'
,
logd
(
'API CLASS ON API.DART, FUNGSI: changeBranch, URL :
$apiUrl
'
,
'ERROR CONNECT TO SERVER, ERROR CATCH :
$e
'
);
'ERROR CONNECT TO SERVER, ERROR CATCH :
$e
'
);
}
}
return
false
;
Map
<
String
,
dynamic
>
returnResult
=
{
"status"
:
'error_server'
,
"code"
:
''
,
"msg"
:
'Something wrong with oure server'
,
};
return
returnResult
;
}
}
}
}
static
Future
<
Address
>
getAddress
({
context
})
async
{
static
Future
<
Address
>
getAddress
(
{
context
,
isCallDeliveryCharge
=
true
})
async
{
String
baseUrl
=
getBaseUrl
();
String
baseUrl
=
getBaseUrl
();
String
apiUrl
=
"
$baseUrl${endPointRdm}
get_address/"
;
String
apiUrl
=
"
$baseUrl${endPointRdm}
get_address/"
;
...
@@ -2091,14 +2134,17 @@ class Api {
...
@@ -2091,14 +2134,17 @@ class Api {
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
Map
<
String
,
dynamic
>
data
=
jsonObject
[
'data'
];
setLatitude
(
jsonObject
[
'data'
][
'lat'
]);
setLongitude
(
jsonObject
[
'data'
][
'long'
]);
Map
<
String
,
dynamic
>
dataAddress
=
jsonObject
[
'data'
];
if
(
getTypeOrder
()
==
typeOrderDelivery
)
{
if
(
getTypeOrder
()
==
typeOrderDelivery
)
{
if
(
isCallDeliveryCharge
)
{
Api
.
getDeliveryCharge
(
Api
.
getDeliveryCharge
(
jsonObject
[
'data'
][
'lat'
],
jsonObject
[
'data'
][
'long'
])
jsonObject
[
'data'
][
'lat'
],
jsonObject
[
'data'
][
'long'
])
.
then
((
value
)
{});
.
then
((
value
)
{});
}
}
}
return
Address
.
json
(
data
);
return
Address
.
json
(
data
Address
);
}
}
return
defaultResult
;
return
defaultResult
;
}
else
{
}
else
{
...
@@ -2284,7 +2330,7 @@ class Api {
...
@@ -2284,7 +2330,7 @@ class Api {
}
}
}
}
static
Future
<
bool
>
ch
ange
Payment
()
async
{
static
Future
<
bool
>
ch
eck
Payment
()
async
{
String
baseUrl
=
prefs
.
getString
(
'baseUrl'
)
??
''
;
String
baseUrl
=
prefs
.
getString
(
'baseUrl'
)
??
''
;
String
apiUrl
;
String
apiUrl
;
apiUrl
=
"
$baseUrl${endPoint}
check_payment"
;
apiUrl
=
"
$baseUrl${endPoint}
check_payment"
;
...
@@ -2313,24 +2359,21 @@ class Api {
...
@@ -2313,24 +2359,21 @@ class Api {
};
};
var
bodies
=
jsonEncode
(
data
);
var
bodies
=
jsonEncode
(
data
);
var
jsonObject
=
await
httpPost
(
apiUrl
,
bodies
,
'ch
ange
Payment'
);
var
jsonObject
=
await
httpPost
(
apiUrl
,
bodies
,
'ch
eck
Payment'
);
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
return
true
;
return
true
;
}
else
{
}
else
{
EasyLoading
.
showToast
(
jsonObject
[
'msg'
]);
return
false
;
return
false
;
}
}
}
else
{
}
else
{
EasyLoading
.
showToast
(
'Something went wrong'
);
return
false
;
return
false
;
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
if
(
debug
)
{
if
(
debug
)
{
logd
(
'API CLASS ON API.DART, FUNGSI: ch
ange
Payment, URL :
$apiUrl
'
,
logd
(
'API CLASS ON API.DART, FUNGSI: ch
eck
Payment, URL :
$apiUrl
'
,
'ERROR CONNECT TO SERVER, ERROR CATCH :
$e
'
);
'ERROR CONNECT TO SERVER, ERROR CATCH :
$e
'
);
}
}
EasyLoading
.
showToast
(
'Cant connect to server'
);
return
false
;
return
false
;
}
}
}
}
...
...
lib/bloc/address_user_bloc.dart
View file @
bdbf0d11
// ignore_for_file: use_build_context_synchronously
import
'package:byod/models/address_user.dart'
;
import
'package:byod/models/address_user.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'../api/api.dart'
;
import
'../api/api.dart'
;
import
'branch_list.dart'
;
class
AddressUser
extends
Cubit
<
Address
>
{
class
AddressUser
extends
Cubit
<
Address
>
{
AddressUser
()
AddressUser
()
...
@@ -19,9 +22,13 @@ class AddressUser extends Cubit<Address> {
...
@@ -19,9 +22,13 @@ class AddressUser extends Cubit<Address> {
notes:
''
,
notes:
''
,
),
),
);
);
void
getAddressUser
()
async
{
void
getAddressUser
(
BuildContext
context
,
var
result
=
await
Api
.
getAddress
();
{
bool
isGetBranchList
=
false
,
isCallDeliveryCharge
=
true
})
async
{
var
resultAddress
=
emit
(
result
);
await
Api
.
getAddress
(
isCallDeliveryCharge:
isCallDeliveryCharge
);
if
(
isGetBranchList
)
{
context
.
read
<
BranchList
>().
getBranchList
();
}
emit
(
resultAddress
);
}
}
}
}
lib/helper/helper.dart
View file @
bdbf0d11
...
@@ -400,8 +400,8 @@ bool isCanButtonCheckoutToTap(int orderState) {
...
@@ -400,8 +400,8 @@ bool isCanButtonCheckoutToTap(int orderState) {
}
}
}
}
Future
<
bool
>
changeBranch
(
String
newBranch
)
async
{
Future
<
Map
<
String
,
dynamic
>
>
changeBranch
(
String
newBranch
)
async
{
bool
result
=
await
Api
.
changeBranch
(
newBranch
);
Map
<
String
,
dynamic
>
result
=
await
Api
.
changeBranch
(
newBranch
);
return
result
;
return
result
;
}
}
...
@@ -760,6 +760,10 @@ const int typeOrderPickup = 2;
...
@@ -760,6 +760,10 @@ const int typeOrderPickup = 2;
String
mqMessage
=
getMqMessage
();
String
mqMessage
=
getMqMessage
();
// String MQmessage
// String MQmessage
// devliery state
const
int
orderDeliveryStateOtwPickup
=
0
;
const
int
orderDeliveryStateInDelivery
=
1
;
const
int
orderDeliveryStateDelivered
=
99
;
// devliery state
//** END CONSTANT */
//** END CONSTANT */
lib/helper/prefs.dart
View file @
bdbf0d11
...
@@ -41,6 +41,8 @@ const String _closeTime = 'cT';
...
@@ -41,6 +41,8 @@ const String _closeTime = 'cT';
const
String
_pickupTime
=
'puT'
;
const
String
_pickupTime
=
'puT'
;
const
String
_addressOutlet
=
'addressOutlet'
;
const
String
_addressOutlet
=
'addressOutlet'
;
const
String
_phoneOutlet
=
'phoneOutlet'
;
const
String
_phoneOutlet
=
'phoneOutlet'
;
const
String
_serviceRadius
=
'sr'
;
const
String
_distanceOutletCustomer
=
'doc'
;
String
getBaseUrl
(
)
{
String
getBaseUrl
(
)
{
return
prefs
.
getString
(
_baseUrl
)
??
''
;
return
prefs
.
getString
(
_baseUrl
)
??
''
;
...
@@ -357,3 +359,19 @@ String getPhoneOutlet() {
...
@@ -357,3 +359,19 @@ String getPhoneOutlet() {
Future
<
void
>
setPhoneOutlet
(
String
value
)
async
{
Future
<
void
>
setPhoneOutlet
(
String
value
)
async
{
prefs
.
setString
(
_phoneOutlet
,
value
);
prefs
.
setString
(
_phoneOutlet
,
value
);
}
}
int
getServiceRadius
(
)
{
return
prefs
.
getInt
(
_serviceRadius
)
??
0
;
}
Future
<
void
>
setServiceRadius
(
int
value
)
async
{
prefs
.
setInt
(
_serviceRadius
,
value
);
}
double
getDistance
(
)
{
return
prefs
.
getDouble
(
_distanceOutletCustomer
)
??
0
;
}
Future
<
void
>
setDistance
(
double
value
)
async
{
prefs
.
setDouble
(
_distanceOutletCustomer
,
value
);
}
lib/models/address_user.dart
View file @
bdbf0d11
...
@@ -29,8 +29,8 @@ class Address {
...
@@ -29,8 +29,8 @@ class Address {
locationDetail:
json
[
'location_detail'
],
locationDetail:
json
[
'location_detail'
],
lat:
json
[
'lat'
],
lat:
json
[
'lat'
],
long:
json
[
'long'
],
long:
json
[
'long'
],
recepientName:
json
[
'recipient_name'
],
recepientName:
json
[
'recipient_name'
]
.
toString
()
,
recepientPhone:
json
[
'recipient_phone'
],
recepientPhone:
json
[
'recipient_phone'
]
.
toString
()
,
notes:
json
[
'notes'
],
notes:
json
[
'notes'
],
);
);
}
}
...
...
lib/models/bill.dart
View file @
bdbf0d11
...
@@ -26,6 +26,7 @@ class Bill {
...
@@ -26,6 +26,7 @@ class Bill {
String
packagingFee
;
String
packagingFee
;
String
platformFee
;
String
platformFee
;
String
deliveryFee
;
String
deliveryFee
;
int
deliveryState
;
// List<MemberInfo> memberInfo;
// List<MemberInfo> memberInfo;
Bill
({
Bill
({
...
@@ -52,6 +53,7 @@ class Bill {
...
@@ -52,6 +53,7 @@ class Bill {
this
.
packagingFee
=
"0.00"
,
this
.
packagingFee
=
"0.00"
,
this
.
platformFee
=
"0.00"
,
this
.
platformFee
=
"0.00"
,
this
.
deliveryFee
=
"0.00"
,
this
.
deliveryFee
=
"0.00"
,
this
.
deliveryState
=
0
,
// this.memberInfo = const []
// this.memberInfo = const []
});
});
...
@@ -79,7 +81,8 @@ class Bill {
...
@@ -79,7 +81,8 @@ class Bill {
dateOrder:
json
[
'order_date'
],
dateOrder:
json
[
'order_date'
],
packagingFee:
json
[
'packaging_fee'
],
packagingFee:
json
[
'packaging_fee'
],
platformFee:
json
[
'platform_fee'
],
platformFee:
json
[
'platform_fee'
],
deliveryFee:
json
[
'delivery_fee'
]
deliveryFee:
json
[
'delivery_fee'
],
deliveryState:
json
[
'delivery_state'
]
??
0
// memberInfo: json['member_info']
// memberInfo: json['member_info']
);
);
}
}
...
...
lib/ui/app_bar_select_branch.dart
View file @
bdbf0d11
...
@@ -23,15 +23,34 @@ class CustomAppBar extends StatelessWidget {
...
@@ -23,15 +23,34 @@ class CustomAppBar extends StatelessWidget {
horizontal:
paddingLeftRight
,
vertical:
15
),
horizontal:
paddingLeftRight
,
vertical:
15
),
child:
Column
(
child:
Column
(
children:
[
children:
[
Center
(
Row
(
children:
[
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Container
(
width:
24
,
height:
24
,
child:
fontAwesomeNew
(
arrowBack
,
24
,
),
),
),
Expanded
(
child:
Center
(
child:
defaultText
(
child:
defaultText
(
context
,
context
,
'Silah
kan Pilih Outlet'
,
'Sila
kan Pilih Outlet'
,
maxLines:
1
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
overFlow:
TextOverflow
.
ellipsis
,
style:
appBarNameViewBill
(),
style:
appBarNameViewBill
(),
),
),
),
),
),
],
),
const
SizedBox
(
const
SizedBox
(
height:
16
,
height:
16
,
),
),
...
...
lib/ui/home/home.dart
View file @
bdbf0d11
...
@@ -124,7 +124,7 @@ class _HomeState extends State<Home> {
...
@@ -124,7 +124,7 @@ class _HomeState extends State<Home> {
if
(
categoryDefault
.
isNotEmpty
&&
if
(
categoryDefault
.
isNotEmpty
&&
categoryDefault
[
0
].
id
==
"0"
)
{
categoryDefault
[
0
].
id
==
"0"
)
{
return
errorResponseByod
(
return
errorResponseByod
(
'Gagal mendapatkan menu, sila
h
kan refresh halaman / scan ulang barcode'
);
'Gagal mendapatkan menu, silakan refresh halaman / scan ulang barcode'
);
}
else
if
(
categoryDefault
.
isNotEmpty
)
{
}
else
if
(
categoryDefault
.
isNotEmpty
)
{
List
<
FilterMenu
>
categoryNonFav
=
[];
List
<
FilterMenu
>
categoryNonFav
=
[];
List
<
FilterMenu
>
categoryFav
=
[];
List
<
FilterMenu
>
categoryFav
=
[];
...
...
lib/ui/home/new_home2.dart
View file @
bdbf0d11
...
@@ -26,6 +26,7 @@ import '../../models/fav_group.dart';
...
@@ -26,6 +26,7 @@ import '../../models/fav_group.dart';
import
'../checkout/fuction.dart'
;
import
'../checkout/fuction.dart'
;
import
'../confirm_order/confirm_order.dart'
;
import
'../confirm_order/confirm_order.dart'
;
import
'../screen_responsive.dart'
;
import
'../screen_responsive.dart'
;
import
'../select_branch.dart'
;
import
'../viewbill/view_bill_new.dart'
;
import
'../viewbill/view_bill_new.dart'
;
import
'cat_list.dart'
;
import
'cat_list.dart'
;
import
'fav_grid_menu.dart'
;
import
'fav_grid_menu.dart'
;
...
@@ -181,7 +182,7 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -181,7 +182,7 @@ class _NewHome2State extends State<NewHome2> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
// double heightTotal = MediaQuery.of(context).size.height;
// double heightTotal = MediaQuery.of(context).size.height;
double
appBarHeight
=
4
0
;
double
appBarHeight
=
5
0
;
double
searchFieldHeight
=
50
;
double
searchFieldHeight
=
50
;
double
spacerHeight
=
20
;
double
spacerHeight
=
20
;
double
favListHeight
=
35
;
double
favListHeight
=
35
;
...
@@ -253,7 +254,7 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -253,7 +254,7 @@ class _NewHome2State extends State<NewHome2> {
if
(
categoryDefault
.
isNotEmpty
&&
if
(
categoryDefault
.
isNotEmpty
&&
categoryDefault
[
0
].
id
==
"0"
)
{
categoryDefault
[
0
].
id
==
"0"
)
{
return
errorResponseByod
(
return
errorResponseByod
(
'Gagal mendapatkan menu, sila
h
kan refresh halaman / scan ulang barcode'
);
'Gagal mendapatkan menu, silakan refresh halaman / scan ulang barcode'
);
}
else
if
(
categoryDefault
.
isNotEmpty
)
{
}
else
if
(
categoryDefault
.
isNotEmpty
)
{
List
<
FilterMenu
>
categoryFavTemp
=
[];
List
<
FilterMenu
>
categoryFavTemp
=
[];
List
<
FilterMenu
>
categoryNonFavTemp
=
[];
List
<
FilterMenu
>
categoryNonFavTemp
=
[];
...
@@ -656,17 +657,129 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -656,17 +657,129 @@ class _NewHome2State extends State<NewHome2> {
SliverPersistentHeader
(
SliverPersistentHeader
(
pinned:
true
,
pinned:
true
,
delegate:
DelegateAppBar
(
delegate:
DelegateAppBar
(
appBarHeight
+
searchFieldHeight
,
appBarHeight
,
customAppBar
(
customAppBar
(
context
,
context
,
paddingLeftRight
,
paddingLeftRight
,
appBarHeight
+
searchFieldHeight
,
appBarHeight
,
tableNumber
,
tableNumber
,
userName
,
userName
,
isSearchActive
,
isSearchActive
,
),
),
),
),
),
),
SliverToBoxAdapter
(
child:
Column
(
children:
[
(
getIsDeliveryPickup
())
?
const
SizedBox
(
height:
5
,
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
?
Row
(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
[
Expanded
(
child:
defaultText
(
context
,
"Open Hour:
${timeHm(getOpenTime())}
-
${timeHm(getCloseTime())}
"
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
viewbillStyle
(),
),
),
// const Spacer(),
GestureDetector
(
onTap:
()
{
void
ontapOkeChange
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
isFormBill:
true
,
),
),
);
}
void
onTapCancelChange
()
{
Navigator
.
pop
(
context
);
}
String
textOnOk
=
'OK'
;
String
textOnCancel
=
'Batal'
;
String
title
=
'Ganti Outlet'
;
String
description
=
'''
Ganti outlet akan menyebabkan orderan anda saat ini hilang.
Apakah ingin melanjutkan ?'''
;
buttonDialogGlobal
(
context
,
title
,
description
,
textOnOk
,
textOnCancel
,
ontapOkeChange
,
onTapCancelChange
,
okButtonColor:
buttonColor
,
);
},
child:
Container
(
width:
64
,
height:
20
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
backgroundColor
,
border:
Border
.
all
(
color:
textColorBlack
,
),
),
child:
Center
(
child:
defaultText
(
context
,
'Ganti Outlet'
,
style:
addButton
(
font:
8
,
color:
textColorBlack
,
),
),
),
),
),
],
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
?
(
getDistance
()
>
getServiceRadius
().
toDouble
())
?
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
5
,
),
child:
Align
(
alignment:
Alignment
.
centerLeft
,
child:
defaultText
(
context
,
'Jarak anda dan outlet terlalu jauh, silahkan ganti outlet'
,
style:
viewbillStyle
(
font:
12
,
color:
dangerColor
,
),
),
),
)
:
const
SizedBox
()
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
?
const
SizedBox
(
height:
10
,
)
:
const
SizedBox
(),
],
),
),
SliverPersistentHeader
(
SliverPersistentHeader
(
pinned:
true
,
pinned:
true
,
delegate:
DelegateSearchField
(
delegate:
DelegateSearchField
(
...
@@ -1123,10 +1236,8 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -1123,10 +1236,8 @@ class _NewHome2State extends State<NewHome2> {
onTap:
()
{
onTap:
()
{
// Navigator.push(
// Navigator.push(
// context, MaterialPageRoute(builder: (_) => ViewBill()));
// context, MaterialPageRoute(builder: (_) => ViewBill()));
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()));
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()));
},
},
child:
const
Image
(
child:
const
Image
(
image:
AssetImage
(
'assets/icons/book.png'
),
image:
AssetImage
(
'assets/icons/book.png'
),
...
@@ -1138,7 +1249,8 @@ class _NewHome2State extends State<NewHome2> {
...
@@ -1138,7 +1249,8 @@ class _NewHome2State extends State<NewHome2> {
),
),
)
)
],
],
));
),
);
}
}
Center
errorResponseByod
(
String
message
)
{
Center
errorResponseByod
(
String
message
)
{
...
...
lib/ui/no_route.dart
View file @
bdbf0d11
...
@@ -66,7 +66,7 @@ class NoRoute extends StatelessWidget {
...
@@ -66,7 +66,7 @@ class NoRoute extends StatelessWidget {
:
(
identification
==
locationPermissinDenied
)
:
(
identification
==
locationPermissinDenied
)
?
defaultText
(
?
defaultText
(
context
,
context
,
"Delivery/Pickup order memerlukan akses lokasi anda, Sila
h
kan ubah pengaturan lokasi browser anda"
,
"Delivery/Pickup order memerlukan akses lokasi anda, Silakan ubah pengaturan lokasi browser anda"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
style:
textStyleNormalFont
(
context
),
)
)
...
@@ -92,7 +92,7 @@ class NoRoute extends StatelessWidget {
...
@@ -92,7 +92,7 @@ class NoRoute extends StatelessWidget {
);
);
}
else
{
}
else
{
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
'Sila
h
kan aktifkan lokasi browser anda'
);
'Silakan aktifkan lokasi browser anda'
);
}
}
});
});
},
},
...
...
lib/ui/select_branch.dart
View file @
bdbf0d11
...
@@ -7,11 +7,13 @@ import 'package:byod/helper/prefs.dart';
...
@@ -7,11 +7,13 @@ import 'package:byod/helper/prefs.dart';
import
'package:byod/models/branchs.dart'
;
import
'package:byod/models/branchs.dart'
;
import
'package:byod/ui/home/new_home2.dart'
;
import
'package:byod/ui/home/new_home2.dart'
;
import
'package:byod/ui/screen_responsive.dart'
;
import
'package:byod/ui/screen_responsive.dart'
;
import
'package:byod/ui/webview/webview.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'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'../bloc/search_branch.dart'
;
import
'../bloc/search_branch.dart'
;
import
'../helper/widget/button_dialog.dart'
;
import
'../helper/widget/style.dart'
;
import
'../helper/widget/style.dart'
;
import
'app_bar_select_branch.dart'
;
import
'app_bar_select_branch.dart'
;
...
@@ -80,15 +82,56 @@ class CoreBranch extends StatelessWidget {
...
@@ -80,15 +82,56 @@ class CoreBranch extends StatelessWidget {
itemBuilder:
(
context
,
i
)
{
itemBuilder:
(
context
,
i
)
{
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
void
ontapOkeChange
()
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
WebViewMap
(
titleAppBar:
'Pilih Alamat'
,
url:
'
${getBaseUrl()}
rdm/address/add/?session_id=
${getSessionId()}
'
,
isFromSelectBranch:
true
,
),
),
);
}
String
textOnOk
=
'OK'
;
String
textOnCancel
=
'Batal'
;
String
title
=
'Alamat Terlalu Jauh'
;
String
description
=
'''
Lokasi anda saat ini terlalu jauh dari outlet kami, silakan ganti alamat.
Apakah ingin ganti alamat ?'''
;
void
onTapCancelChange
()
{
Navigator
.
pop
(
context
);
}
if
(
listBranch
[
i
].
isDelivery
==
false
&&
if
(
listBranch
[
i
].
isDelivery
==
false
&&
listBranch
[
i
].
isPickup
==
false
)
{
listBranch
[
i
].
isPickup
==
false
)
{
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
'Outlet tidak menerima delivery dan pickup'
);
'Outlet tidak menerima delivery dan pickup'
);
}
else
if
(
listBranch
[
i
].
distance
>
getServiceRadius
().
toDouble
())
{
buttonDialogGlobal
(
context
,
title
,
description
,
textOnOk
,
textOnCancel
,
ontapOkeChange
,
onTapCancelChange
,
okButtonColor:
buttonColor
,
);
}
else
{
}
else
{
if
(
isFormBill
)
{
if
(
isFormBill
)
{
changeBranch
(
listBranch
[
i
].
branchCode
)
changeBranch
(
listBranch
[
i
].
branchCode
)
.
then
((
value
)
{
.
then
((
value
)
{
if
(
value
)
{
if
(
value
[
'status'
]
.
toString
()
.
toLowerCase
()
==
'ok'
)
{
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
context
.
read
<
FilterMenuBloc
>().
catAndMenu
(
listBranch
[
i
].
branchCode
,
listBranch
[
i
].
branchCode
,
getBrand
(),
getBrand
(),
...
@@ -104,14 +147,29 @@ class CoreBranch extends StatelessWidget {
...
@@ -104,14 +147,29 @@ class CoreBranch extends StatelessWidget {
}
else
{
}
else
{
setIsCustomerDelivery
(
false
);
setIsCustomerDelivery
(
false
);
}
}
setDistance
(
listBranch
[
i
].
distance
);
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
()),
builder:
(
_
)
=>
const
NewHome2
()),
);
);
}
else
{
}
else
{
EasyLoading
.
showToast
(
if
(
value
[
'status'
]
==
'error'
&&
'Outlet tidak dapat dipilih'
);
value
[
'code'
]
==
'SERVICE_OUT_RANGE'
)
{
buttonDialogGlobal
(
context
,
title
,
description
,
textOnOk
,
textOnCancel
,
ontapOkeChange
,
onTapCancelChange
,
okButtonColor:
buttonColor
,
);
}
else
{
EasyLoading
.
showToast
(
value
[
'msg'
]);
}
}
}
});
});
}
else
{
}
else
{
...
...
lib/ui/splash.dart
View file @
bdbf0d11
This diff is collapsed.
Click to expand it.
lib/ui/viewbill/timeline.dart
0 → 100644
View file @
bdbf0d11
This diff is collapsed.
Click to expand it.
lib/ui/viewbill/view_bill_new.dart
View file @
bdbf0d11
...
@@ -47,6 +47,7 @@ import 'app_bar.dart';
...
@@ -47,6 +47,7 @@ import 'app_bar.dart';
import
'list_order.dart'
;
import
'list_order.dart'
;
import
'rincian_pembayaran.dart'
;
import
'rincian_pembayaran.dart'
;
import
'shimmer_bill.dart'
;
import
'shimmer_bill.dart'
;
import
'timeline.dart'
;
class
ViewBillNew
extends
StatefulWidget
{
class
ViewBillNew
extends
StatefulWidget
{
// const ViewBillNew({Key? key}) : super(key: key);
// const ViewBillNew({Key? key}) : super(key: key);
...
@@ -76,15 +77,13 @@ class ViewBillNew extends StatefulWidget {
...
@@ -76,15 +77,13 @@ class ViewBillNew extends StatefulWidget {
}
}
class
_ViewBillNewState
extends
State
<
ViewBillNew
>
{
class
_ViewBillNewState
extends
State
<
ViewBillNew
>
{
// final RefreshController _refreshController =
// final RefreshController _refreshController =
Future
<
void
>
getBillTwice
(
BuildContext
context
)
async
{
Future
<
void
>
getBillTwice
(
BuildContext
context
)
async
{
context
.
read
<
ViewBillBloc
>().
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
}
Future
<
void
>
getAddressTwice
(
BuildContext
context
)
async
{
Future
<
void
>
getAddressTwice
(
BuildContext
context
)
async
{
context
.
read
<
AddressUser
>().
getAddressUser
();
context
.
read
<
AddressUser
>().
getAddressUser
(
context
);
}
}
void
saveBillDetail
(
List
<
Bill
>
dataBill
)
async
{
void
saveBillDetail
(
List
<
Bill
>
dataBill
)
async
{
...
@@ -127,11 +126,9 @@ class _ViewBillNewState extends State<ViewBillNew> {
...
@@ -127,11 +126,9 @@ class _ViewBillNewState extends State<ViewBillNew> {
MqttPublishPayload
.
bytesToStringAsString
(
recMess
.
payload
.
message
);
MqttPublishPayload
.
bytesToStringAsString
(
recMess
.
payload
.
message
);
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
// print('');
// print('');
if
(
c
[
0
].
topic
==
topic
&&
pt
==
mqMessage
)
{
if
(
c
[
0
].
topic
==
topic
&&
pt
==
mqMessage
)
{
// update bill disini
// update bill disini
setState
(()
{
setState
(()
{});
});
if
(
debug
)
{
if
(
debug
)
{
logd
(
'CHECK TOPIC'
,
'TOPIC MASUK::
$topic
, MESSAGE::
$mqMessage
'
);
logd
(
'CHECK TOPIC'
,
'TOPIC MASUK::
$topic
, MESSAGE::
$mqMessage
'
);
}
}
...
@@ -144,8 +141,6 @@ class _ViewBillNewState extends State<ViewBillNew> {
...
@@ -144,8 +141,6 @@ class _ViewBillNewState extends State<ViewBillNew> {
});
});
}
}
context
.
read
<
FeedBackOptionBloc
>().
getOptionFeedback
();
context
.
read
<
FeedBackOptionBloc
>().
getOptionFeedback
();
context
.
read
<
ViewBillBloc
>().
backToDefault
();
context
.
read
<
ViewBillBloc
>().
backToDefault
();
getBillFunc
(
context
);
getBillFunc
(
context
);
...
@@ -486,10 +481,19 @@ class CoreBill extends StatelessWidget {
...
@@ -486,10 +481,19 @@ class CoreBill extends StatelessWidget {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
(
getIsDeliveryPickup
())
?
const
SizedBox
(
height:
24
,
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
?
DeliveryPickupStatus
(
dataBill:
dataBill
)
:
const
SizedBox
(),
Container
(
Container
(
width:
double
.
infinity
,
width:
double
.
infinity
,
color:
backgroundWhite
.
withOpacity
(
0.9
),
color:
backgroundWhite
.
withOpacity
(
0.9
),
height:
115
,
padding:
const
EdgeInsets
.
symmetric
(
vertical:
10
),
// height: 40,
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
...
@@ -1058,12 +1062,27 @@ class CoreBill extends StatelessWidget {
...
@@ -1058,12 +1062,27 @@ class CoreBill extends StatelessWidget {
:
(
dataBill
[
0
].
tableStatus
!=
tableStatusOpen
)
:
(
dataBill
[
0
].
tableStatus
!=
tableStatusOpen
)
?
GestureDetector
(
?
GestureDetector
(
onTap:
()
{
onTap:
()
{
Navigator
.
pushReplacement
(
if
(
dataBill
[
0
].
state
==
orderStateDone
)
{
//**UUID */
const
uuidInit
=
Uuid
();
var
newOrderId
=
uuidInit
.
v4
();
//** UUID */
setOrderId
(
newOrderId
);
context
.
read
<
BranchExist
>()
.
branchExist
(
getBranchPref
(),
getBrand
(),
getRole
(),
getCashierName
(),
getOrderId
(),
context
,
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
()),
);
);
context
.
read
<
BranchExist
>().
branchExist
(
}
else
{
context
.
read
<
BranchExist
>()
.
branchExist
(
getBranchPref
(),
getBranchPref
(),
getBrand
(),
getBrand
(),
getRole
(),
getRole
(),
...
@@ -1071,6 +1090,14 @@ class CoreBill extends StatelessWidget {
...
@@ -1071,6 +1090,14 @@ class CoreBill extends StatelessWidget {
getOrderId
(),
getOrderId
(),
context
,
context
,
);
);
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
()),
);
}
},
},
child:
Column
(
child:
Column
(
children:
[
children:
[
...
@@ -1111,7 +1138,7 @@ class CoreBill extends StatelessWidget {
...
@@ -1111,7 +1138,7 @@ class CoreBill extends StatelessWidget {
Future
<
dynamic
>
modalBottomSelectOption
(
BuildContext
context
)
{
Future
<
dynamic
>
modalBottomSelectOption
(
BuildContext
context
)
{
void
ontapOkeChangeOutlet
()
{
void
ontapOkeChangeOutlet
()
{
Navigator
.
push
Replacement
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
builder:
(
_
)
=>
const
SelectBranch
(
...
@@ -1320,6 +1347,7 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1320,6 +1347,7 @@ class ButtonPayment extends StatelessWidget {
onTap:
()
{
onTap:
()
{
if
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
{
if
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
{
if
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
{
if
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
{
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
if
(
getIsDeliveryPickup
())
{
if
(
getIsDeliveryPickup
())
{
if
(
getIsCustomerDelivery
())
{
if
(
getIsCustomerDelivery
())
{
if
(
addressUser
.
id
==
''
)
{
if
(
addressUser
.
id
==
''
)
{
...
@@ -1329,17 +1357,14 @@ class ButtonPayment extends StatelessWidget {
...
@@ -1329,17 +1357,14 @@ class ButtonPayment extends StatelessWidget {
Api
.
setToPendingOrder
();
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
}
}
else
{
if
(
getPickupTime
()
==
''
)
{
if
(
getPickupTime
()
==
''
)
{
EasyLoading
.
showToast
(
'Silah
kan pilih jam pickup'
);
EasyLoading
.
showToast
(
'Sila
kan pilih jam pickup'
);
}
else
{
}
else
{
Api
.
setToPendingOrder
();
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
}
}
}
}
else
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
}
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
getTableMode
()
==
tableIndividu
)
{
getTableMode
()
==
tableIndividu
)
{
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
...
@@ -2141,7 +2166,7 @@ class DeliveryPickupDetail extends StatelessWidget {
...
@@ -2141,7 +2166,7 @@ class DeliveryPickupDetail extends StatelessWidget {
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
void
ontapOkeChange
()
{
void
ontapOkeChange
()
{
Navigator
.
push
Replacement
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
builder:
(
_
)
=>
const
SelectBranch
(
...
@@ -2341,7 +2366,7 @@ Apakah ingin melanjutkan ?''';
...
@@ -2341,7 +2366,7 @@ Apakah ingin melanjutkan ?''';
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
void
ontapOkeChange
()
{
void
ontapOkeChange
()
{
Navigator
.
push
Replacement
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
builder:
(
_
)
=>
const
SelectBranch
(
...
...
lib/ui/webview/app_bar_webview.dart
View file @
bdbf0d11
...
@@ -2,13 +2,20 @@
...
@@ -2,13 +2,20 @@
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'../../bloc/address_user_bloc.dart'
;
import
'../../bloc/branch_list.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/widget/style.dart'
;
import
'../../helper/widget/style.dart'
;
import
'../select_branch.dart'
;
class
CustomAppBar
extends
StatelessWidget
{
class
CustomAppBar
extends
StatelessWidget
{
const
CustomAppBar
({
Key
?
key
,
required
this
.
titleAppBar
})
:
super
(
key:
key
);
const
CustomAppBar
(
{
Key
?
key
,
required
this
.
titleAppBar
,
required
this
.
isFromSelectBranch
})
:
super
(
key:
key
);
final
String
titleAppBar
;
final
String
titleAppBar
;
final
bool
isFromSelectBranch
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -28,6 +35,21 @@ class CustomAppBar extends StatelessWidget {
...
@@ -28,6 +35,21 @@ class CustomAppBar extends StatelessWidget {
children:
[
children:
[
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
if
(
isFromSelectBranch
)
{
context
.
read
<
AddressUser
>().
getAddressUser
(
context
,
isGetBranchList:
true
,
isCallDeliveryCharge:
false
,
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
isFormBill:
true
,
),
),
);
}
else
{
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -36,6 +58,7 @@ class CustomAppBar extends StatelessWidget {
...
@@ -36,6 +58,7 @@ class CustomAppBar extends StatelessWidget {
),
),
),
),
);
);
}
},
},
child:
Container
(
child:
Container
(
width:
24
,
width:
24
,
...
...
lib/ui/webview/webview.dart
View file @
bdbf0d11
...
@@ -133,12 +133,14 @@
...
@@ -133,12 +133,14 @@
// }
// }
import
'package:byod/bloc/address_user_bloc.dart'
;
import
'package:byod/bloc/address_user_bloc.dart'
;
import
'package:byod/ui/select_branch.dart'
;
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:byod/ui/webview/app_bar_webview.dart'
;
import
'package:byod/ui/webview/app_bar_webview.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'
;
import
'package:webviewx_plus/webviewx_plus.dart'
;
import
'package:webviewx_plus/webviewx_plus.dart'
;
import
'../../bloc/branch_list.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/widget/button_dialog.dart'
;
import
'../../helper/widget/button_dialog.dart'
;
...
@@ -147,9 +149,11 @@ class WebViewMap extends StatefulWidget {
...
@@ -147,9 +149,11 @@ class WebViewMap extends StatefulWidget {
super
.
key
,
super
.
key
,
required
this
.
titleAppBar
,
required
this
.
titleAppBar
,
required
this
.
url
,
required
this
.
url
,
this
.
isFromSelectBranch
=
false
,
});
});
final
String
titleAppBar
;
final
String
titleAppBar
;
final
String
url
;
final
String
url
;
final
bool
isFromSelectBranch
;
@override
@override
State
<
WebViewMap
>
createState
()
=>
_WebViewMapState
();
State
<
WebViewMap
>
createState
()
=>
_WebViewMapState
();
...
@@ -158,7 +162,19 @@ class WebViewMap extends StatefulWidget {
...
@@ -158,7 +162,19 @@ class WebViewMap extends StatefulWidget {
class
_WebViewMapState
extends
State
<
WebViewMap
>
{
class
_WebViewMapState
extends
State
<
WebViewMap
>
{
late
WebViewXController
webviewController
;
late
WebViewXController
webviewController
;
void
onTapOkPop
()
{
void
onTapOkPop
()
{
context
.
read
<
AddressUser
>().
getAddressUser
();
if
(
widget
.
isFromSelectBranch
==
true
)
{
context
.
read
<
AddressUser
>().
getAddressUser
(
context
,
isGetBranchList:
true
,
isCallDeliveryCharge:
false
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(),
),
);
}
else
{
context
.
read
<
AddressUser
>()
.
getAddressUser
(
context
,
isGetBranchList:
true
);
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -168,6 +184,7 @@ class _WebViewMapState extends State<WebViewMap> {
...
@@ -168,6 +184,7 @@ class _WebViewMapState extends State<WebViewMap> {
),
),
);
);
}
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -189,7 +206,9 @@ class _WebViewMapState extends State<WebViewMap> {
...
@@ -189,7 +206,9 @@ class _WebViewMapState extends State<WebViewMap> {
},
},
child:
Column
(
child:
Column
(
children:
[
children:
[
CustomAppBar
(
titleAppBar:
widget
.
titleAppBar
),
CustomAppBar
(
titleAppBar:
widget
.
titleAppBar
,
isFromSelectBranch:
widget
.
isFromSelectBranch
),
Expanded
(
Expanded
(
child:
WebViewX
(
child:
WebViewX
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
...
...
pubspec.lock
View file @
bdbf0d11
...
@@ -483,6 +483,13 @@ packages:
...
@@ -483,6 +483,13 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.4.12"
version: "0.4.12"
timeline_tile:
dependency: "direct main"
description:
name: timeline_tile
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
...
...
pubspec.yaml
View file @
bdbf0d11
...
@@ -45,6 +45,7 @@ dependencies:
...
@@ -45,6 +45,7 @@ dependencies:
shared_preferences
:
^2.0.15
shared_preferences
:
^2.0.15
shimmer
:
^2.0.0
shimmer
:
^2.0.0
sliver_tools
:
^0.2.8
sliver_tools
:
^0.2.8
timeline_tile
:
^2.0.0
url_launcher
:
^6.1.5
url_launcher
:
^6.1.5
url_strategy
:
^0.2.0
url_strategy
:
^0.2.0
uuid
:
^3.0.6
uuid
:
^3.0.6
...
...
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