Commit f825c3fd authored by Jasa Digital's avatar Jasa Digital

fixed bug

parent e92aa2ba
......@@ -102,7 +102,7 @@ class Api {
"session_id": sessionId,
"from": fromByod,
"url_lookup": (debug)
? 'https://www.ravintola.web.id/'
? 'https://byod-neo.ravku.com'
: (urlType == typeUrlTiga)
? getUrlLookUp()
: '',
......
......@@ -25,12 +25,13 @@ class BranchExist extends Cubit<String> {
BuildContext context, {
bool getMenu = false,
bool getBrancList = false,
String token = '',
}) {
getBranch(branchCode, brandCode, role, cashierName, orderId).then((value) {
if (getMenu) {
context
.read<FilterMenuBloc>()
.catAndMenu(branchCode, brandCode, role, cashierName, orderId);
.catAndMenu(branchCode, brandCode, role, cashierName, token);
}
if (getBrancList) {
context.read<BranchList>().getBranchList();
......
......@@ -56,6 +56,7 @@ class _SplashState extends State<Splash> {
loadBaseUrl().then((baseUrl) {
setBaseUrl(baseUrl);
if (widget.pathSegmentString.isEmpty) {
// contoh url http://localhost/
Geolocator.requestPermission().then((permission) {
if (permission != LocationPermission.denied &&
permission != LocationPermission.deniedForever) {
......@@ -90,14 +91,15 @@ class _SplashState extends State<Splash> {
widget.context,
// getBrancList: true,
);
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async {
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(),
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
'',
);
context
.read<ChangeDeliveryPickupBloc>()
......@@ -131,6 +133,7 @@ class _SplashState extends State<Splash> {
});
} else if (widget.pathSegmentString.length == 1) {
if (widget.pathSegmentString[0] == 'go') {
// contoh url http://localhost/go
Geolocator.requestPermission().then((permission) {
if (permission != LocationPermission.denied &&
permission != LocationPermission.deniedForever) {
......@@ -165,14 +168,15 @@ class _SplashState extends State<Splash> {
widget.context,
getBrancList: true,
);
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async {
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(),
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
'',
);
context
.read<ChangeDeliveryPickupBloc>()
......@@ -205,6 +209,7 @@ class _SplashState extends State<Splash> {
}
});
} else {
// contoh url http://localhost/asalaja <-- ini tidak di allow
setPaymentMode(closebill);
setIsDeliveryPickup(false);
setUrlLookUp('');
......@@ -222,6 +227,7 @@ class _SplashState extends State<Splash> {
setIsDeliveryPickup(false);
setUrlLookUp('');
if (widget.pathSegmentString[0] == 'o') {
// contoh url http://localhost/o/uuid <--- ini untuk QR dynamic
if (widget.pathSegmentString[1] != '') {
setOrderId(widget.pathSegmentString[1]);
setUrlType(typeUrlSatu);
......@@ -277,6 +283,7 @@ class _SplashState extends State<Splash> {
setIsDeliveryPickup(false);
setUrlLookUp('');
if (widget.pathSegmentString[0] == 'o') {
// contoh url http://localhost/o/uuid/go <--- ini untuk QR dynamic direct go bill
if (widget.pathSegmentString[1] != '') {
setOrderId(widget.pathSegmentString[1]);
setUrlType(typeUrlSatu);
......@@ -305,14 +312,15 @@ class _SplashState extends State<Splash> {
widget.context,
getMenu: true,
);
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async {
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(),
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
'',
);
Navigator.pushReplacement(
widget.context,
......@@ -340,6 +348,7 @@ class _SplashState extends State<Splash> {
);
}
} else {
// contoh url http://localhost/as/uuiasasd/goasasasas <--- ini ketika tidak valid url
Navigator.pushReplacement(
widget.context,
MaterialPageRoute(
......@@ -350,6 +359,7 @@ class _SplashState extends State<Splash> {
);
}
} else {
// contoh url http://localhost/EXC/RVN2/D-12 <--- ini untuk QR static
setPaymentMode(closebill);
setIsDeliveryPickup(false);
setUrlLookUp('');
......@@ -385,6 +395,7 @@ class _SplashState extends State<Splash> {
}
} else if (widget.pathSegmentString.length == 4) {
if (widget.pathSegmentString[3] == 'go') {
// contoh url http://localhost/EXC/RVN2/D-12/go <--- ini untuk QR static direct ke bill
setPaymentMode(closebill);
setIsDeliveryPickup(false);
setUrlLookUp('');
......@@ -416,15 +427,11 @@ class _SplashState extends State<Splash> {
widget.context,
getMenu: true,
);
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async {
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(),
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
);
getBranchPref(), getBrand(), getRole(), getCashierName(), '');
Navigator.pushReplacement(
widget.context,
MaterialPageRoute(
......@@ -433,6 +440,7 @@ class _SplashState extends State<Splash> {
);
});
} else {
// contoh url http://localhost/EXC/RVN2/D-12/UUID <--- ini untuk QR static dengan securetoken
setPaymentMode(closebill);
setIsDeliveryPickup(false);
setUrlLookUp('');
......@@ -466,11 +474,13 @@ class _SplashState extends State<Splash> {
getOrderId(), // ini orderId dari path URL
widget.context,
getMenu: true,
token: widget.pathSegmentString[3],
);
goToMenu(widget.context);
}
} else if (widget.pathSegmentString.length == 5) {
if (widget.pathSegmentString[4] == 'go') {
// contoh url http://localhost/EXC/RVN2/D-12/UUID/go <--- ini untuk QR static dengan securetoken dan direct bill
setPaymentMode(closebill);
setIsDeliveryPickup(false);
setUrlLookUp('');
......@@ -505,14 +515,15 @@ class _SplashState extends State<Splash> {
widget.context,
getMenu: true,
);
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async {
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(),
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
'',
);
Navigator.pushReplacement(
widget.context,
......
......@@ -1687,8 +1687,13 @@ class OutletDetail extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<String> listHistoryOrder = getListHistory();
int indexListhIstory = listHistoryOrder.indexWhere((listHistoryOrders) =>
jsonDecode(listHistoryOrders)['order_id'] == dataBill[0].id);
int indexListhIstory = -1;
if (isHistory) {
indexListhIstory = listHistoryOrder.indexWhere((listHistoryOrders) =>
jsonDecode(listHistoryOrders)['order_id'] == dataBill[0].id);
}
String openHours = "${timeHm(getOpenTime())} - ${timeHm(getCloseTime())}";
String phoneOutlet = getPhoneOutlet();
bool isDeliveryCustomer = getIsCustomerDelivery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment