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
1ed9c728
Commit
1ed9c728
authored
Nov 03, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
03/11/22
parent
f825c3fd
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
135 additions
and
82 deletions
+135
-82
api.dart
lib/api/api.dart
+9
-4
main.dart
lib/main.dart
+3
-0
variants.dart
lib/models/variants.dart
+4
-2
fuction.dart
lib/ui/checkout/fuction.dart
+5
-1
bottom_sheet_variant_new.dart
lib/ui/home/bottom_sheet_variant_new.dart
+43
-21
new_home2.dart
lib/ui/home/new_home2.dart
+1
-0
splash.dart
lib/ui/splash.dart
+1
-1
bottom_sheet_pickup_delivery.dart
lib/ui/viewbill/bottom_sheet_pickup_delivery.dart
+11
-0
rincian_pembayaran.dart
lib/ui/viewbill/rincian_pembayaran.dart
+1
-1
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+26
-14
webview.dart
lib/ui/webview/webview.dart
+20
-13
pubspec.lock
pubspec.lock
+9
-23
pubspec.yaml
pubspec.yaml
+2
-2
No files found.
lib/api/api.dart
View file @
1ed9c728
...
...
@@ -1030,9 +1030,10 @@ class Api {
setIsCustomerDelivery
(
true
);
}
else
if
(
jsonObject
[
'data'
][
'type'
]
==
typeOrderPickup
)
{
setIsCustomerDelivery
(
false
);
}
else
{
setIsDeliveryPickup
(
false
);
}
}
// else {
// setIsDeliveryPickup(false);
// }
bill
.
add
(
Bill
.
createBill
(
i
));
// billDetail.add(BillDetail.createBillDetail(orderDetail[d]));
}
...
...
@@ -2058,7 +2059,9 @@ class Api {
"customer_name"
:
userName
,
"from"
:
fromByod
,
"time_ready_for_pickup"
:
getPickupTime
(),
"order_id"
:
orderID
"order_id"
:
orderID
,
"customer_address_lat"
:
getLatitude
(),
"customer_address_long"
:
getLongitude
(),
};
var
bodies
=
jsonEncode
(
data
);
...
...
@@ -2404,6 +2407,8 @@ class Api {
"from"
:
fromByod
,
"order_id"
:
orderID
,
"customer_name"
:
getCustomerName
(),
"customer_address_lat"
:
getLatitude
(),
"customer_address_long"
:
getLongitude
(),
};
var
bodies
=
jsonEncode
(
data
);
...
...
lib/main.dart
View file @
1ed9c728
...
...
@@ -17,6 +17,8 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:url_strategy/url_strategy.dart'
;
import
'package:web_browser_detect/web_browser_detect.dart'
;
import
'package:webview_flutter/webview_flutter.dart'
;
import
'package:webview_flutter_web/webview_flutter_web.dart'
;
import
'bloc/branch_exist.dart'
;
import
'bloc/branch_list.dart'
;
...
...
@@ -57,6 +59,7 @@ String routesToAccess = '/';
void
main
(
)
async
{
final
browser
=
Browser
.
detectOrNull
();
WebView
.
platform
=
WebWebViewPlatform
();
browserName
=
browser
?.
browser
??
'Wrong platform'
;
browserVersion
=
browser
?.
version
??
'Wrong platform'
;
WidgetsFlutterBinding
.
ensureInitialized
();
...
...
lib/models/variants.dart
View file @
1ed9c728
class
Variants
{
String
id
;
String
idAsli
;
String
name
;
String
price
;
Variants
({
required
this
.
id
,
required
this
.
name
,
required
this
.
price
});
Variants
({
required
this
.
id
,
required
this
.
idAsli
,
required
this
.
name
,
required
this
.
price
});
factory
Variants
.
createVariant
(
Map
<
String
,
dynamic
>
json
)
{
return
Variants
(
id:
json
[
'id'
],
id:
json
[
'id_flag'
],
idAsli:
json
[
'id'
],
name:
json
[
'name'
],
price:
json
[
'price'
],
);
...
...
lib/ui/checkout/fuction.dart
View file @
1ed9c728
...
...
@@ -41,7 +41,11 @@ checkOut(BuildContext context, List<Orders> listOrders, String name) async {
for
(
int
dk
=
0
;
dk
<
listOrders
[
d
].
orderDetail
[
kd
].
orderVariant
.
length
;
dk
++)
{
varaints
.
add
(
listOrders
[
d
].
orderDetail
[
kd
].
orderVariant
[
dk
].
id
);
varaints
.
add
(
listOrders
[
d
]
.
orderDetail
[
kd
]
.
orderVariant
[
dk
]
.
id
.
split
(
'|'
)[
1
]);
// displit karena pembeda ada repitition
}
variantData
.
add
({
"id"
:
listOrders
[
d
].
id
,
...
...
lib/ui/home/bottom_sheet_variant_new.dart
View file @
1ed9c728
...
...
@@ -159,27 +159,49 @@ class _CustomizeVariantNewState extends State<CustomizeVariantNew> {
d
<
variantCaption
.
length
;
d
++)
if
(
variantCaption
[
d
]
!=
''
)
Row
(
children:
[
defaultText
(
context
,
"
${variantCaption[d]}
: "
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
textStyleVariantModal
(),
),
defaultText
(
context
,
variantName
[
d
],
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
textStyleVariantModal
(),
),
],
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
-
(
2
*
paddingLeftRight
),
child:
Row
(
children:
[
Container
(
width:
80
,
child:
defaultText
(
context
,
"
${variantCaption[d]}
: "
,
maxLines:
5
,
overFlow:
TextOverflow
.
ellipsis
,
style:
textStyleVariantModal
(),
),
),
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
-
(
2
*
paddingLeftRight
)
-
80
,
child:
defaultText
(
context
,
variantName
[
d
],
maxLines:
5
,
overFlow:
TextOverflow
.
ellipsis
,
style:
textStyleVariantModal
(),
),
),
],
),
)
],
),
...
...
lib/ui/home/new_home2.dart
View file @
1ed9c728
...
...
@@ -757,6 +757,7 @@ class _NewHome2State extends State<NewHome2> {
(
isShowOutletDetail
)
?
const
OutletDetail
(
isFromMenu:
true
,
isHistory:
false
,
)
:
const
SizedBox
(),
],
...
...
lib/ui/splash.dart
View file @
1ed9c728
...
...
@@ -49,7 +49,7 @@ class _SplashState extends State<Splash> {
}
}
int
durationDelayBeforToMenu
=
30
00
;
int
durationDelayBeforToMenu
=
15
00
;
@override
void
initState
()
{
...
...
lib/ui/viewbill/bottom_sheet_pickup_delivery.dart
View file @
1ed9c728
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'../../api/api.dart'
;
import
'../../bloc/change_delivery_pickup.dart'
;
...
...
@@ -66,7 +67,12 @@ Future<dynamic> modalBottomSelectOption(BuildContext context) {
GestureDetector
(
onTap:
()
{
if
(
getIsPickup
())
{
EasyLoading
.
show
(
status:
'Please wait...'
,
maskType:
EasyLoadingMaskType
.
none
,
);
Api
.
changeTypeOrder
(
typeOrderPickup
).
then
((
value
)
{
EasyLoading
.
dismiss
();
if
(
value
)
{
context
.
read
<
ChangeDeliveryPickupBloc
>()
...
...
@@ -143,8 +149,13 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
okButtonColor:
buttonColor
,
);
}
else
{
EasyLoading
.
show
(
status:
'Please wait...'
,
maskType:
EasyLoadingMaskType
.
none
,
);
Api
.
changeTypeOrder
(
typeOrderDelivery
).
then
((
value
)
{
if
(
value
)
{
EasyLoading
.
dismiss
();
setIsCustomerDelivery
(
true
);
context
.
read
<
ChangeDeliveryPickupBloc
>().
toDelivery
(
true
);
context
.
read
<
ViewBillBloc
>().
getBill
();
...
...
lib/ui/viewbill/rincian_pembayaran.dart
View file @
1ed9c728
...
...
@@ -91,7 +91,7 @@ class RincianPembayaran extends StatelessWidget {
),
],
),
(
dataBill
[
0
].
paymentMode
==
openBill
)
(
dataBill
[
0
].
typeOrder
==
typeOrderDineIn
)
?
Column
(
children:
[
const
SizedBox
(
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
1ed9c728
...
...
@@ -407,9 +407,9 @@ class _ViewBillNewState extends State<ViewBillNew> {
// Navigator.pop(context);
title
=
'Tutup Pesanan'
;
description
=
'''
Selesaikan transaksi dan tutup pesanan ?
Selesaikan transaksi dan tutup pesanan ?
Mohon menuju kasir untuk meminta bukti pembayaran'''
;
Mohon menuju kasir untuk meminta bukti pembayaran'''
;
// } else {
// // // Navigator.pop(context);
// // EasyLoading.showInfo('Tidak ada tagihan yang perlu dibayar');
...
...
@@ -1677,8 +1677,8 @@ class OutletDetail extends StatelessWidget {
const
OutletDetail
({
super
.
key
,
this
.
isFromMenu
=
false
,
this
.
isHistory
=
false
,
this
.
dataBill
=
const
[],
required
this
.
isHistory
,
});
final
bool
isFromMenu
;
final
bool
isHistory
;
...
...
@@ -1687,29 +1687,41 @@ class OutletDetail extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
List
<
String
>
listHistoryOrder
=
getListHistory
();
int
indexListhIstory
=
-
1
;
int
indexListhIstory
;
if
(
isHistory
)
{
indexListhIstory
=
listHistoryOrder
.
indexWhere
((
listHistoryOrders
)
=>
jsonDecode
(
listHistoryOrders
)[
'order_id'
]
==
dataBill
[
0
].
id
);
}
else
{
indexListhIstory
=
-
2
;
}
String
openHours
=
"
${timeHm(getOpenTime())}
-
${timeHm(getCloseTime())}
"
;
String
phoneOutlet
=
getPhoneOutlet
();
bool
isDeliveryCustomer
=
getIsCustomerDelivery
();
String
latOutlet
=
getLatOutlet
();
String
longOutlet
=
getLongOutlet
();
String
openHours
;
String
phoneOutlet
;
bool
isDeliveryCustomer
;
String
latOutlet
;
String
longOutlet
;
String
branchName
;
String
addressOutlet
;
if
(
isHistory
&&
indexListhIstory
!=
-
1
)
{
var
historyOrder
=
jsonDecode
(
listHistoryOrder
[
indexListhIstory
]);
openHours
=
historyOrder
[
'open_hour'
];
phoneOutlet
=
historyOrder
[
'phone_outlet'
];
latOutlet
=
historyOrder
[
'lat_outlet'
];
longOutlet
=
historyOrder
[
'long_outlet'
];
branchName
=
historyOrder
[
'outlet_name'
];
addressOutlet
=
historyOrder
[
'address_outlet'
];
if
(
historyOrder
[
'typeOrder'
]
==
'Delivery'
)
{
isDeliveryCustomer
=
true
;
}
else
{
isDeliveryCustomer
=
false
;
}
}
else
{
openHours
=
"
${timeHm(getOpenTime())}
-
${timeHm(getCloseTime())}
"
;
phoneOutlet
=
getPhoneOutlet
();
isDeliveryCustomer
=
getIsCustomerDelivery
();
latOutlet
=
getLatOutlet
();
longOutlet
=
getLongOutlet
();
branchName
=
getBranchName
();
addressOutlet
=
getAddressOutlet
();
}
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
...
...
@@ -1727,7 +1739,7 @@ class OutletDetail extends StatelessWidget {
children:
[
defaultText
(
context
,
getBranchName
()
,
branchName
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
viewbillStyle
(),
...
...
@@ -1754,7 +1766,7 @@ class OutletDetail extends StatelessWidget {
:
const
SizedBox
(),
defaultText
(
context
,
getAddressOutlet
()
,
addressOutlet
,
style:
viewbillStyle
(),
),
const
SizedBox
(
...
...
@@ -1778,7 +1790,7 @@ class OutletDetail extends StatelessWidget {
),
defaultText
(
context
,
getPhoneOutlet
()
,
phoneOutlet
,
style:
viewbillStyle
(),
),
],
...
...
lib/ui/webview/webview.dart
View file @
1ed9c728
...
...
@@ -139,9 +139,8 @@ import 'package:byod/ui/viewbill/view_bill_new.dart';
import
'package:byod/ui/webview/app_bar_webview.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:webview
x_plus/webviewx_plus
.dart'
;
import
'package:webview
_flutter/webview_flutter
.dart'
;
import
'../../bloc/branch_list.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/widget/button_dialog.dart'
;
...
...
@@ -163,7 +162,7 @@ class WebViewMap extends StatefulWidget {
}
class
_WebViewMapState
extends
State
<
WebViewMap
>
{
late
WebView
XController
webviewC
ontroller
;
late
WebView
Controller
_c
ontroller
;
void
onTapOkPop
()
{
if
(
widget
.
isFromSelectBranch
==
true
)
{
context
.
read
<
AddressUser
>().
getAddressUser
(
context
,
...
...
@@ -224,18 +223,19 @@ class _WebViewMapState extends State<WebViewMap> {
isFromMenu:
widget
.
isFromMenu
,
),
Expanded
(
child:
WebViewX
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
initialContent:
widget
.
url
,
child:
WebView
(
initialUrl:
widget
.
url
,
javascriptMode:
JavascriptMode
.
unrestricted
,
initialSourceType:
SourceType
.
url
,
onWebViewCreated:
(
controller
)
{
webviewController
=
controller
;
onWebViewCreated:
(
webViewController
)
{
_controller
=
webViewController
;
},
onPageStarted:
(
url
)
{},
onPageFinished:
(
url
)
{},
navigationDelegate:
(
NavigationRequest
request
)
{
print
(
request
.
url
);
return
NavigationDecision
.
navigate
;
},
// navigationDelegate: (NavigationRequest request) {
// return NavigationDecision.navigate;
// },
),
)
],
...
...
@@ -243,3 +243,10 @@ class _WebViewMapState extends State<WebViewMap> {
);
}
}
// NavigationDecision setupNavigationDelegate(NavigationRequest request) {
// var url = request.url;
// print("url :::: $url");
// return NavigationDecision.navigate;
// }
pubspec.lock
View file @
1ed9c728
...
...
@@ -163,13 +163,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.22.08+1"
fwfh_webview:
dependency: "direct main"
description:
name: fwfh_webview
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2+3"
geolocator:
dependency: "direct main"
description:
...
...
@@ -338,13 +331,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
pointer_interceptor:
dependency: transitive
description:
name: pointer_interceptor
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.3+3"
process:
dependency: transitive
description:
...
...
@@ -603,7 +589,7 @@ packages:
source: hosted
version: "2.0.3"
webview_flutter:
dependency:
transitive
dependency:
"direct main"
description:
name: webview_flutter
url: "https://pub.dartlang.org"
...
...
@@ -623,6 +609,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
webview_flutter_web:
dependency: "direct main"
description:
name: webview_flutter_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0+4"
webview_flutter_wkwebview:
dependency: transitive
description:
...
...
@@ -630,13 +623,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.5"
webviewx_plus:
dependency: "direct main"
description:
name: webviewx_plus
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
win32:
dependency: transitive
description:
...
...
@@ -652,5 +638,5 @@ packages:
source: hosted
version: "0.2.0+1"
sdks:
dart: ">=2.1
8.0
<3.0.0"
dart: ">=2.1
7.3
<3.0.0"
flutter: ">=3.1.0-0"
pubspec.yaml
View file @
1ed9c728
...
...
@@ -35,7 +35,6 @@ dependencies:
flutter_easyloading
:
^3.0.3
flutter_webview_plugin
:
^0.4.0
flutter_widget_from_html_core
:
^0.8.5+3
fwfh_webview
:
^0.6.2+3
geolocator
:
^9.0.2
http
:
^0.13.4
intl
:
^0.17.0
...
...
@@ -51,7 +50,8 @@ dependencies:
url_strategy
:
^0.2.0
uuid
:
^3.0.6
web_browser_detect
:
^2.0.3
webviewx_plus
:
^0.3.2
webview_flutter
:
^3.0.4
webview_flutter_web
:
^0.1.0+4
dev_dependencies
:
flutter_lints
:
^2.0.0
...
...
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