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
94c58a71
Commit
94c58a71
authored
Oct 17, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
17/10/22
parent
7a75e7bb
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1575 additions
and
785 deletions
+1575
-785
api.dart
lib/api/api.dart
+34
-30
outlet_detail.dart
lib/bloc/outlet_detail.dart
+9
-0
helper.dart
lib/helper/helper.dart
+36
-3
mq.dart
lib/helper/mq.dart
+7
-7
prefs.dart
lib/helper/prefs.dart
+18
-0
emoticon_rate_new.dart
lib/helper/widget/emoticon_rate_new.dart
+2
-4
note_modal_bottom_sheet.dart
lib/helper/widget/note_modal_bottom_sheet.dart
+21
-0
main.dart
lib/main.dart
+2
-0
confirm_order.dart
lib/ui/confirm_order/confirm_order.dart
+225
-0
new_home2.dart
lib/ui/home/new_home2.dart
+69
-45
list_order.dart
lib/ui/viewbill/list_order.dart
+38
-16
order_view_bill_new.dart
lib/ui/viewbill/order_view_bill_new.dart
+82
-56
view_bill.dart
lib/ui/viewbill/view_bill.dart
+2
-1
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+1002
-595
app_bar_webview.dart
lib/ui/webview/app_bar_webview.dart
+28
-28
No files found.
lib/api/api.dart
View file @
94c58a71
...
...
@@ -100,6 +100,7 @@ class Api {
:
''
,
"customer_lat"
:
latitude
,
"customer_long"
:
longitude
,
"table_number"
:
(
getUrlType
()
==
typeUrlDua
)
?
getTabelNumber
()
:
''
,
"type_url"
:
urlType
,
};
var
bodies
=
json
.
encode
(
data
);
...
...
@@ -110,32 +111,32 @@ class Api {
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
//** save sessionID and Table Mode*/
List
<
String
>
listHistory
=
getListHistory
();
String
tableNumber
=
getTabelNumber
();
String
userName
=
getCustomerName
();
String
totalOrder
=
getTotalOrder
();
String
dateOrder
=
getOrderDate
();
String
branchCode
=
getBranchPref
();
String
brandCode
=
getBrand
();
String
token
=
getToken
();
if
(
orderID
!=
jsonObject
[
'data'
][
'order_id'
])
{
Map
historyOrder
=
{
"order_id"
:
orderId
,
"table"
:
tableNumber
,
"user_name"
:
userName
,
"total_order"
:
totalOrder
,
"date_order"
:
localDate
(
dateOrder
,
isHistory:
true
,
),
"branch_code"
:
branchCode
,
"brand"
:
brandCode
,
"token"
:
token
,
};
String
historySave
=
jsonEncode
(
historyOrder
);
listHistory
.
add
(
historySave
);
setListHistory
(
listHistory
);
}
//
List<String> listHistory = getListHistory();
//
String tableNumber = getTabelNumber();
//
String userName = getCustomerName();
//
String totalOrder = getTotalOrder();
//
String dateOrder = getOrderDate();
//
String branchCode = getBranchPref();
//
String brandCode = getBrand();
//
String token = getToken();
//
if (orderID != jsonObject['data']['order_id']) {
//
Map historyOrder = {
//
"order_id": orderId,
//
"table": tableNumber,
//
"user_name": userName,
//
"total_order": totalOrder,
//
"date_order": localDate(
//
dateOrder,
//
isHistory: true,
//
),
//
"branch_code": branchCode,
//
"brand": brandCode,
//
"token": token,
//
};
//
String historySave = jsonEncode(historyOrder);
//
listHistory.add(historySave);
//
setListHistory(listHistory);
//
}
if
(
indexTypeUrl
!=
-
1
)
{
listTypeUrl
.
removeWhere
(
...
...
@@ -150,7 +151,7 @@ class Api {
);
setListTypeUrl
(
listTypeUrl
);
setMqMessage
(
'
update
-
${jsonObject['data']['order_id']}
'
);
setMqMessage
(
'
ORDER-ID
-
${jsonObject['data']['order_id']}
'
);
setOrderId
(
jsonObject
[
'data'
][
'order_id'
]);
setTypeOrder
(
jsonObject
[
'data'
][
'type_order'
]);
setLogoUrl
(
jsonObject
[
'data'
][
'logo'
]);
...
...
@@ -166,6 +167,8 @@ class Api {
setIsPickup
(
jsonObject
[
'data'
][
'is_pickup'
]);
setOpenTime
(
jsonObject
[
'data'
][
'open_time'
]);
setCloseTime
(
jsonObject
[
'data'
][
'close_time'
]);
setAddressOutlet
(
jsonObject
[
'data'
][
'address'
]);
setPhoneOutlet
(
jsonObject
[
'data'
][
'mobile'
]);
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
...
...
@@ -1335,7 +1338,8 @@ class Api {
"menu"
:
variantData
,
'secure_token'
:
secureToken
,
"from"
:
fromByod
,
"type_order"
:
typeOrder
"type_order"
:
typeOrder
,
"type_url"
:
getUrlType
(),
};
var
bodies
=
jsonEncode
(
data
);
// var apiResult = await http.post(Uri.parse(urlCheckout), body: bodies);
...
...
@@ -1358,7 +1362,7 @@ class Api {
timeOfDayPickup
.
minute
.
toString
().
padLeft
(
2
,
'0'
);
// String amPM = timeToset.split(' ')[1];
String
setPickup
=
"
$hourString
:
$minuteString
"
;
setPickupTime
(
setPickup
);
//
setPickupTime(setPickup);
}
setStatusOrderCreated
(
true
);
...
...
lib/bloc/outlet_detail.dart
0 → 100644
View file @
94c58a71
import
'package:flutter_bloc/flutter_bloc.dart'
;
class
ExpandDetailOutlet
extends
Cubit
<
bool
>
{
ExpandDetailOutlet
()
:
super
(
false
);
void
show
(
bool
status
)
{
emit
(
status
);
}
}
lib/helper/helper.dart
View file @
94c58a71
...
...
@@ -298,6 +298,22 @@ bool isCanTapAddMoreButton(int orderState) {
return
true
;
}
bool
isRemoveButtonBillShow
(
int
orderState
,
int
orderDetailState
)
{
int
paymentMethod
=
getPaymentMode
();
if
(
orderState
==
orderStateApproved
&&
orderDetailState
==
approvedOrder
&&
paymentMethod
==
closebill
)
{
return
true
;
}
else
{
return
false
;
}
}
String
timeHm
(
String
timeComplete
)
{
timeComplete
.
split
(
':'
);
return
"
${timeComplete.split(':')[0]}
:
${timeComplete.split(':')[1]}
"
;
}
bool
isVisibleAddMoreButton
(
int
tableStatus
,
int
orderState
)
{
int
paymentMethod
=
getPaymentMode
();
if
(
tableStatus
==
tableStatusOpen
&&
getTableMode
()
==
tableIndividu
)
{
...
...
@@ -319,11 +335,12 @@ bool isVisibleAddMoreButton(int tableStatus, int orderState) {
}
bool
isVisibleAddRemoveQuantityButtonCheckout
(
bool
isHistory
,
int
orderStatusBillDetail
)
{
bool
isHistory
,
int
orderStatusBillDetail
,
int
orderState
)
{
int
paymentMethod
=
getPaymentMode
();
if
(!
isHistory
&&
paymentMethod
==
closebill
&&
orderStatusBillDetail
==
pendingOrder
)
{
orderStatusBillDetail
==
pendingOrder
&&
orderState
==
orderStateCreated
)
{
return
true
;
}
return
false
;
...
...
@@ -339,7 +356,7 @@ iscanTapAddRemoveQtyViewBill(int orderState) {
String
textButtonCheckout
(
int
orderState
)
{
int
paymentMethod
=
getPaymentMode
();
if
(
paymentMethod
==
closebill
&&
orderState
==
orderStateCreated
)
{
return
'
Kirim Pesan
an'
;
return
'
Pes
an'
;
}
else
if
(
paymentMethod
==
closebill
&&
(
orderState
==
orderStatePending
||
orderState
==
orderStateApproved
)
||
...
...
@@ -592,6 +609,7 @@ String defaultViewBill = 'default';
//** call from untuk notemenu */
String
fromMenu
=
'menu'
;
String
fromBill
=
'bill'
;
String
fromConfirmationPage
=
'confirmationPage'
;
//** call from untuk notemenu */
//**Rating Value */
...
...
@@ -690,6 +708,15 @@ const double shopingBagSize = 0.03;
const
String
refreshIcon
=
'
\
uf2f9'
;
const
double
refreshIconSize
=
0.02
;
const
String
openLink
=
'
\
uf35d'
;
const
double
openLinkSize
=
14
;
const
String
phoneIcon
=
'
\
uf098'
;
const
double
phoneIconSize
=
16
;
const
String
trahsIcon
=
'
\
uf2ed'
;
const
double
trahsIconSize
=
16
;
//** fontawesome unicode */
//** max item menu */
...
...
@@ -727,4 +754,10 @@ const int typeOrderDineIn = 1;
const
int
typeOrderPickup
=
2
;
//** Type ORder */
// String MQmessage
String
mqMessage
=
getMqMessage
();
// String MQmessage
//** END CONSTANT */
lib/helper/mq.dart
View file @
94c58a71
// ignore_for_file: unused_catch_clause
import
'dart:io'
;
import
'dart:js'
;
import
'package:byod/bloc/view_bill.dart'
;
import
'package:byod/helper/logger.dart'
;
import
'package:byod/helper/prefs.dart'
;
import
'package:byod/main.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
...
...
@@ -13,12 +10,15 @@ import 'package:mqtt_client/mqtt_browser_client.dart';
import
'package:mqtt_client/mqtt_client.dart'
;
import
'package:uuid/uuid.dart'
;
import
'../bloc/view_bill.dart'
;
import
'helper.dart'
;
String
mqttUrl
=
'wss://mq.jasadigital.co.id'
;
final
mqClient
=
MqttBrowserClient
(
mqttUrl
,
''
);
const
int
mqttPort
=
8083
;
const
String
queueTopic
=
'
byod/bill/update
'
;
String
queueMessage
=
getMqMessage
();
const
String
queueTopic
=
'
romi/byod/payment
'
;
//
String queueMessage = getMqMessage();
const
String
usernameMq
=
'jasadigital'
;
const
String
passwordMq
=
'jasadigital'
;
const
uuidInit
=
Uuid
();
...
...
@@ -81,11 +81,11 @@ Future<int> runMqTT(BuildContext context) async {
MqttPublishPayload
.
bytesToStringAsString
(
recMess
.
payload
.
message
);
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
// print('');
if
(
c
[
0
].
topic
==
topic
&&
pt
==
queue
Message
)
{
if
(
c
[
0
].
topic
==
topic
&&
pt
==
mq
Message
)
{
// update bill disini
context
.
read
<
ViewBillBloc
>().
getBill
();
if
(
debug
)
{
logd
(
'CHECK TOPIC'
,
'TOPIC MASUK::
$topic
, MESSAGE::
$
queue
Message
'
);
logd
(
'CHECK TOPIC'
,
'TOPIC MASUK::
$topic
, MESSAGE::
$
mq
Message
'
);
}
}
else
{
if
(
debug
)
{
...
...
lib/helper/prefs.dart
View file @
94c58a71
...
...
@@ -39,6 +39,8 @@ const String _longOutlet = 'longO';
const
String
_openTime
=
'oT'
;
const
String
_closeTime
=
'cT'
;
const
String
_pickupTime
=
'puT'
;
const
String
_addressOutlet
=
'addressOutlet'
;
const
String
_phoneOutlet
=
'phoneOutlet'
;
String
getBaseUrl
(
)
{
return
prefs
.
getString
(
_baseUrl
)
??
''
;
...
...
@@ -339,3 +341,19 @@ String getPickupTime() {
Future
<
void
>
setPickupTime
(
String
value
)
async
{
prefs
.
setString
(
_pickupTime
,
value
);
}
String
getAddressOutlet
(
)
{
return
prefs
.
getString
(
_addressOutlet
)
??
''
;
}
Future
<
void
>
setAddressOutlet
(
String
value
)
async
{
prefs
.
setString
(
_addressOutlet
,
value
);
}
String
getPhoneOutlet
(
)
{
return
prefs
.
getString
(
_phoneOutlet
)
??
''
;
}
Future
<
void
>
setPhoneOutlet
(
String
value
)
async
{
prefs
.
setString
(
_phoneOutlet
,
value
);
}
lib/helper/widget/emoticon_rate_new.dart
View file @
94c58a71
...
...
@@ -73,7 +73,7 @@ class EmoticonRateNew extends StatelessWidget {
),
defaultText
(
context
,
'Bagaimana pengalaman anda bertransaksi di
excelso
?'
,
'Bagaimana pengalaman anda bertransaksi di
${getBranchName()}
?'
,
textAlign:
TextAlign
.
center
,
style:
emojiStyle
(),
),
...
...
@@ -240,9 +240,7 @@ class EmoticonRateNew extends StatelessWidget {
).
then
((
value
)
{
Navigator
.
pop
(
context
);
if
(!
isHistory
)
{
context
.
read
<
ViewBillBloc
>()
.
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
else
{
List
<
String
>
listHistory
=
getListHistory
();
if
(
listHistory
.
isNotEmpty
)
{
...
...
lib/helper/widget/note_modal_bottom_sheet.dart
View file @
94c58a71
...
...
@@ -23,6 +23,10 @@ class NoteModalBottomSheet extends StatelessWidget {
required
this
.
from
,
this
.
idOrderan
=
''
,
this
.
noteInit
=
''
,
this
.
idMenu
=
''
,
this
.
menuName
=
''
,
this
.
imageUrl
=
''
,
this
.
priceMemu
=
0
,
required
this
.
contextFrom
,
})
:
super
(
key:
key
);
...
...
@@ -35,6 +39,10 @@ class NoteModalBottomSheet extends StatelessWidget {
final
String
idOrderan
;
final
String
noteInit
;
final
BuildContext
contextFrom
;
final
String
idMenu
;
final
String
menuName
;
final
String
imageUrl
;
final
int
priceMemu
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -109,6 +117,19 @@ class NoteModalBottomSheet extends StatelessWidget {
context
.
read
<
ViewBillBloc
>().
getBill
();
});
}
}
else
if
(
from
==
fromConfirmationPage
)
{
Map
<
String
,
dynamic
>
insertData
=
{
'menu_id'
:
idMenu
,
'menu_name'
:
menuName
,
'initvalue'
:
initialValue
,
'menu_price'
:
priceMemu
,
'old_order'
:
lisrOrders
,
'image_url'
:
menuItem
.
imageUrlMedium
,
'total_price'
:
priceMemu
,
'order_variant'
:
orderVariants
,
'note'
:
noteController
.
text
,
};
context
.
read
<
OrdersBloc
>().
insertData
(
insertData
);
}
Navigator
.
pop
(
context
);
},
...
...
lib/main.dart
View file @
94c58a71
...
...
@@ -29,6 +29,7 @@ import 'bloc/menu_selected_bar.dart';
import
'bloc/order_detail_variant.dart'
;
import
'bloc/order_variant_temporary.dart'
;
import
'bloc/order_variant_value.dart'
;
import
'bloc/outlet_detail.dart'
;
import
'bloc/search_active.dart'
;
import
'bloc/search_branch.dart'
;
import
'bloc/search_history.dart'
;
...
...
@@ -195,6 +196,7 @@ class _MyAppState extends State<MyApp> {
BlocProvider
(
create:
(
_
)
=>
BranchList
()),
BlocProvider
(
create:
(
_
)
=>
SearchBranch
()),
BlocProvider
(
create:
(
_
)
=>
AddressUser
()),
BlocProvider
(
create:
(
_
)
=>
ExpandDetailOutlet
()),
],
child:
MaterialApp
(
title:
(
widget
.
title
==
null
)
?
defaultTitle
:
widget
.
title
,
...
...
lib/ui/confirm_order/confirm_order.dart
View file @
94c58a71
// ignore_for_file: sized_box_for_whitespace
import
'package:byod/helper/helper.dart'
;
import
'package:byod/helper/widget/plus_minus_button.dart'
;
import
'package:byod/helper/widget/style.dart'
;
import
'package:byod/ui/screen_responsive.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -10,6 +11,9 @@ import '../../bloc/order_bloc.dart';
import
'../../helper/prefs.dart'
;
import
'../../helper/widget/button_modal.dart'
;
import
'../../helper/widget/modal_input_name.dart'
;
import
'../../helper/widget/note_modal_bottom_sheet.dart'
;
import
'../../main.dart'
;
import
'../../models/filter_menu.dart'
;
import
'../../models/orders.dart'
;
import
'../checkout/fuction.dart'
;
import
'app_bar_confirm.dart'
;
...
...
@@ -100,6 +104,10 @@ class CoreConfirm extends StatelessWidget {
// totalItem = fixTotalItem + totalItemBukanOrderDetail;
}
void
plus
()
{}
void
minus
()
{}
return
Container
(
width:
widthScreen
,
child:
Stack
(
...
...
@@ -269,6 +277,223 @@ class CoreConfirm extends StatelessWidget {
],
),
),
Container
(
width:
double
.
infinity
,
color:
backgroundWhite
,
padding:
const
EdgeInsets
.
only
(
left:
paddingLeftRight
,
right:
paddingLeftRight
,
bottom:
10
,
),
child:
Row
(
children:
[
GestureDetector
(
onTap:
()
{
final
noteController
=
TextEditingController
(
text:
listOrders
[
j
].
note
);
FocusScopeNode
currentFocus
=
FocusScope
.
of
(
context
);
if
(!
currentFocus
.
hasPrimaryFocus
)
{
currentFocus
.
unfocus
();
}
showModalBottomSheet
(
backgroundColor:
backgroundColor
,
isScrollControlled:
true
,
context:
context
,
builder:
(
context
)
{
return
NoteModalBottomSheet
(
noteController:
noteController
,
initialValue:
listOrders
[
j
].
totalItem
,
orderVariants:
[],
menuItem:
FilterMenu
(
id:
''
,
name:
''
,
price:
''
,
originalPrice:
''
,
imageUrlMedium:
''
,
imageUrlThumbnail:
''
,
isSell:
false
,
type:
1
,
categoryName:
''
,
categoryId:
''
,
description:
''
,
groupName:
''
,
groupId:
''
,
),
lisrOrders:
listOrders
,
from:
fromConfirmationPage
,
contextFrom:
context
,
idMenu:
listOrders
[
j
].
id
,
menuName:
listOrders
[
j
].
namaMenu
,
priceMemu:
listOrders
[
j
].
satuanHarga
,
imageUrl:
listOrders
[
j
].
imageUrl
,
);
},
);
},
child:
Container
(
height:
30
,
width:
98
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
21
),
color:
buttonColor
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
const
Image
(
height:
16
,
width:
16
,
image:
AssetImage
(
'assets/icons/note.png'
),
),
const
SizedBox
(
width:
10
,
),
Container
(
height:
16
,
child:
Center
(
child:
defaultText
(
context
,
(
listOrders
[
j
].
note
!=
''
)
?
'Ubah'
:
'Catatan'
,
style:
noteViewBill
(
color:
textInButton
,
),
),
),
)
],
),
),
),
const
Spacer
(),
Stack
(
children:
[
Container
(
width:
94
,
height:
22
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
30
),
color:
backgroundColor
,
),
child:
Center
(
child:
defaultText
(
context
,
listOrders
[
j
]
.
totalItem
.
toString
(),
style:
amountViewBillButton
(),
),
),
),
Positioned
(
left:
0
,
child:
GestureDetector
(
onTap:
()
{
FocusScopeNode
currentFocus
=
FocusScope
.
of
(
context
);
if
(!
currentFocus
.
hasPrimaryFocus
)
{
currentFocus
.
unfocus
();
}
Map
<
String
,
dynamic
>
insertData
=
{
'menu_id'
:
listOrders
[
j
].
id
,
'menu_name'
:
listOrders
[
j
].
namaMenu
,
'initvalue'
:
listOrders
[
j
].
totalItem
-
1
,
'menu_price'
:
listOrders
[
j
].
satuanHarga
,
'total_price'
:
listOrders
[
j
].
satuanHarga
,
'old_order'
:
listOrders
,
'image_url'
:
listOrders
[
j
].
imageUrl
,
'order_variant'
:
[],
'note'
:
listOrders
[
j
].
note
,
};
context
.
read
<
OrdersBloc
>()
.
insertData
(
insertData
);
},
child:
Container
(
width:
22
,
height:
22
,
child:
Image
(
image:
AssetImage
((
isExcelso
)
?
'assets/icons/minus-gold.png'
:
'assets/icons/minus-blue.png'
),
),
),
),
),
Positioned
(
right:
0
,
child:
GestureDetector
(
onTap:
()
{
FocusScopeNode
currentFocus
=
FocusScope
.
of
(
context
);
if
(!
currentFocus
.
hasPrimaryFocus
)
{
currentFocus
.
unfocus
();
}
Map
<
String
,
dynamic
>
insertData
=
{
'menu_id'
:
listOrders
[
j
].
id
,
'menu_name'
:
listOrders
[
j
].
namaMenu
,
'initvalue'
:
listOrders
[
j
].
totalItem
+
1
,
'menu_price'
:
listOrders
[
j
].
satuanHarga
,
'total_price'
:
listOrders
[
j
].
satuanHarga
,
'old_order'
:
listOrders
,
'image_url'
:
listOrders
[
j
].
imageUrl
,
'order_variant'
:
[],
'note'
:
listOrders
[
j
].
note
,
};
context
.
read
<
OrdersBloc
>()
.
insertData
(
insertData
);
},
child:
Container
(
width:
22
,
height:
22
,
child:
Image
(
image:
AssetImage
((
isExcelso
)
?
'assets/icons/plus-gold.png'
:
'assets/icons/plus.png'
),
),
),
),
)
],
),
const
SizedBox
(
width:
12
,
)
],
),
),
const
SizedBox
(
height:
24
,
)
...
...
lib/ui/home/new_home2.dart
View file @
94c58a71
...
...
@@ -1057,23 +1057,42 @@ class _NewHome2State extends State<NewHome2> {
String
userName
,
bool
isSearchActive
)
{
String
barName
;
if
(
getIsDeliveryPickup
())
{
if
(
getIsCustomerDelivery
())
{
barName
=
"
${getBranchName()}
- Delivery"
;
}
else
{
barName
=
"
${getBranchName()}
- Pickup"
;
}
}
else
{
if
(
userName
!=
''
)
{
barName
=
'Meja
$tableNumber
-
$userName
'
;
}
else
{
barName
=
"Meja
$tableNumber
"
;
}
}
return
Container
(
padding:
const
EdgeInsets
.
only
(
top:
10
),
height:
appBarHeight
,
color:
backgroundColor
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
defaultText
(
Expanded
(
child:
defaultText
(
context
,
barName
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
tableNameStyle
(),
),
const
Spacer
(),
),
// const Spacer(),
Container
(
width:
64
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
GestureDetector
(
onTap:
()
{
context
.
read
<
SearchActive
>().
searchClick
(
isSearchActive
);
...
...
@@ -1104,8 +1123,10 @@ class _NewHome2State extends State<NewHome2> {
onTap:
()
{
// Navigator.push(
// context, MaterialPageRoute(builder: (_) => ViewBill()));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()));
},
child:
const
Image
(
image:
AssetImage
(
'assets/icons/book.png'
),
...
...
@@ -1114,6 +1135,9 @@ class _NewHome2State extends State<NewHome2> {
),
),
],
),
)
],
));
}
...
...
lib/ui/viewbill/list_order.dart
View file @
94c58a71
// ignore_for_file: sized_box_for_whitespace
import
'package:flutter/material.dart'
;
import
'../../helper/helper.dart'
;
import
'../../helper/widget/style.dart'
;
import
'../../models/bill.dart'
;
import
'../../models/bill_detail.dart'
;
import
'order_view_bill_new.dart'
;
class
ListOrder
extends
StatelessWidget
{
...
...
@@ -24,7 +25,26 @@ class ListOrder extends StatelessWidget {
shrinkWrap:
true
,
itemCount:
bill
.
length
,
itemBuilder:
(
context
,
i
)
{
return
ListView
.
builder
(
return
Column
(
children:
[
Container
(
width:
double
.
infinity
,
color:
backgroundWhite
,
padding:
const
EdgeInsets
.
only
(
left:
paddingLeftRight
,
right:
paddingLeftRight
,
top:
16
,
),
child:
defaultText
(
context
,
bill
[
i
].
customerName
,
style:
viewbillStyle
(
font:
14
,
fontWeight:
FontWeight
.
w600
,
),
),
),
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
// to disable scrolling
shrinkWrap:
true
,
...
...
@@ -33,14 +53,16 @@ class ListOrder extends StatelessWidget {
return
OrderViewBillNew
(
billDetail:
bill
[
i
].
billDetail
[
d
],
bill:
bill
[
0
],
lastItem:
(
i
+
1
==
bill
.
length
&&
d
+
1
==
bill
[
i
].
billDetail
.
length
)
lastItem:
(
i
+
1
==
bill
.
length
&&
d
+
1
==
bill
[
i
].
billDetail
.
length
)
?
true
:
false
,
isHistory:
isHistory
,
tableStatus:
tableStatus
,
);
},
),
],
);
});
}
...
...
lib/ui/viewbill/order_view_bill_new.dart
View file @
94c58a71
...
...
@@ -155,7 +155,7 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
left:
paddingLeftRightBill
,
right:
paddingLeftRightBill
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
5
),
...
...
@@ -230,15 +230,39 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
)
:
const
SizedBox
(),
],
))
),
),
(
isRemoveButtonBillShow
(
widget
.
bill
.
state
,
widget
.
billDetail
.
orderStatus
))
?
const
SizedBox
(
width:
5
,
)
:
const
SizedBox
(),
(
isRemoveButtonBillShow
(
widget
.
bill
.
state
,
widget
.
billDetail
.
orderStatus
))
?
GestureDetector
(
onTap:
()
{
deleteOrder
(
context
,
widget
.
billDetail
.
menuName
,
ontapOkDelete
,
ontapCancelDelete
);
},
child:
Container
(
color:
backgroundWhite
,
child:
fontAwesomeNew
(
trahsIcon
,
trahsIconSize
,
color:
dangerColor
,
),
),
)
:
const
SizedBox
()
],
),
),
],
),
),
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
)
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
,
widget
.
bill
.
state
)
?
Container
(
padding:
EdgeInsets
.
only
(
left:
paddingLeftRightBill
,
right:
paddingLeftRightBill
),
...
...
@@ -248,17 +272,19 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
),
)
:
const
SizedBox
(),
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
)
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
,
widget
.
bill
.
state
)
?
const
SizedBox
(
height:
11
,
)
:
const
SizedBox
(),
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
)
isVisibleAddRemoveQuantityButtonCheckout
(
widget
.
isHistory
,
widget
.
billDetail
.
orderStatus
,
widget
.
bill
.
state
)
?
Container
(
padding:
EdgeInsets
.
only
(
left:
paddingLeftRightBill
,
right:
paddingLeftRightBill
),
left:
paddingLeftRightBill
,
right:
paddingLeftRightBill
,
),
child:
Row
(
children:
[
GestureDetector
(
...
...
lib/ui/viewbill/view_bill.dart
View file @
94c58a71
...
...
@@ -23,6 +23,7 @@ import 'package:uuid/uuid.dart';
import
'../../api/api.dart'
;
import
'../../bloc/branch_exist.dart'
;
import
'../../bloc/feedback_option.dart'
;
import
'../../helper/prefs.dart'
;
import
'../../helper/widget/button_dialog.dart'
;
import
'../../helper/widget/emoticon_rate.dart'
;
import
'../../helper/widget/open_url.dart'
;
...
...
@@ -323,7 +324,7 @@ Mohon menuju kasir untuk meminta bukti pembayaran''';
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
defaultText
(
context
,
'Bagaimana pengalaman anda bertransaksi di
excelso
?'
,
'Bagaimana pengalaman anda bertransaksi di
${getBranchName()}
?'
,
style:
textStyleNormalFont
(
context
),
),
content:
EmoticonRate
(
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
94c58a71
// ignore_for_file: sized_box_for_whitespace
import
'dart:convert'
;
import
'dart:math'
;
import
'package:byod/bloc/member_info.dart'
;
import
'package:byod/helper/helper.dart'
;
...
...
@@ -15,6 +16,7 @@ import 'package:dotted_line/dotted_line.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:intl/intl.dart'
;
import
'package:uuid/uuid.dart'
;
...
...
@@ -22,6 +24,7 @@ import '../../api/api.dart';
import
'../../bloc/address_user_bloc.dart'
;
import
'../../bloc/branch_exist.dart'
;
import
'../../bloc/feedback_option.dart'
;
import
'../../bloc/outlet_detail.dart'
;
import
'../../bloc/view_bill.dart'
;
import
'../../bloc/voucher_list.dart'
;
import
'../../helper/widget/button_dialog.dart'
;
...
...
@@ -161,6 +164,48 @@ class ViewBillNew extends StatelessWidget {
isCoreLayout:
true
,
);
}
else
{
List
<
String
>
listHistoryOrder
=
getListHistory
();
int
indexListhIstory
=
listHistoryOrder
.
indexWhere
(
(
listHistoryOrders
)
=>
jsonDecode
(
listHistoryOrders
)[
'order_id'
]
==
dataBill
[
0
].
id
);
if
(
indexListhIstory
==
-
1
)
{
Map
historyOrder
=
{
"order_id"
:
dataBill
[
0
].
id
,
"table"
:
dataBill
[
0
].
tableName
,
"user_name"
:
dataBill
[
0
].
customerName
,
"total_order"
:
dataBill
[
0
].
totalSeluruhOrderan
,
"date_order"
:
localDate
(
dataBill
[
0
].
dateOrder
,
isHistory:
true
,
),
"branch_code"
:
branchCode
,
"brand"
:
brandCode
,
"token"
:
token
,
};
String
historySave
=
jsonEncode
(
historyOrder
);
listHistoryOrder
.
add
(
historySave
);
setListHistory
(
listHistoryOrder
);
}
else
{
listHistoryOrder
.
removeAt
(
indexListhIstory
);
Map
historyOrder
=
{
"order_id"
:
dataBill
[
0
].
id
,
"table"
:
dataBill
[
0
].
tableName
,
"user_name"
:
dataBill
[
0
].
customerName
,
"total_order"
:
dataBill
[
0
].
totalSeluruhOrderan
,
"date_order"
:
localDate
(
dataBill
[
0
].
dateOrder
,
isHistory:
true
,
),
"branch_code"
:
branchCode
,
"brand"
:
brandCode
,
"token"
:
token
,
};
String
historySave
=
jsonEncode
(
historyOrder
);
listHistoryOrder
.
add
(
historySave
);
setListHistory
(
listHistoryOrder
);
}
saveBillDetail
(
dataBill
);
// int totalService = 0;
...
...
@@ -293,6 +338,8 @@ Mohon menuju kasir untuk meminta bukti pembayaran''';
);
}
return
BlocBuilder
<
ExpandDetailOutlet
,
bool
>(
builder:
(
context
,
isShowOutletDetail
)
{
return
ScreenResponsive
(
widget:
CoreBill
(
widthScreen:
widthScreen
,
...
...
@@ -307,10 +354,13 @@ Mohon menuju kasir untuk meminta bukti pembayaran''';
branchCode:
branchCode
,
brandCode:
brandCode
,
orderId:
orderId
,
isShowOutletDetail:
isShowOutletDetail
,
),
widthScreen:
MediaQuery
.
of
(
context
).
size
.
width
,
isCoreLayout:
true
,
);
},
);
}
}
else
{
return
ScreenResponsive
(
...
...
@@ -369,6 +419,7 @@ class CoreBill extends StatelessWidget {
required
this
.
branchCode
,
required
this
.
brandCode
,
required
this
.
orderId
,
required
this
.
isShowOutletDetail
,
})
:
super
(
key:
key
);
final
double
widthScreen
;
...
...
@@ -383,6 +434,7 @@ class CoreBill extends StatelessWidget {
final
String
branchCode
;
final
String
brandCode
;
final
String
orderId
;
final
bool
isShowOutletDetail
;
void
getBillFunction
(
BuildContext
context
)
{
context
.
read
<
ViewBillBloc
>().
getBill
();
...
...
@@ -494,7 +546,25 @@ class CoreBill extends StatelessWidget {
)
:
const
SizedBox
(),
(
isDeliveryPickuup
)
?
DeliveryPickupDetail
()
?
DeliveryPickupDetail
(
isShowOutletDetail:
isShowOutletDetail
,
)
:
const
SizedBox
(),
(
isDeliveryPickuup
)
?
(
isShowOutletDetail
)
?
Container
(
color:
backgroundWhite
,
child:
const
DottedLine
(
dashColor:
dashGrey
,
dashLength:
12
,
),
)
:
const
SizedBox
()
:
const
SizedBox
(),
(
isDeliveryPickuup
)
?
(
isShowOutletDetail
)
?
const
OutletDetail
()
:
const
SizedBox
()
:
const
SizedBox
(),
const
SizedBox
(
height:
24
,
...
...
@@ -528,7 +598,7 @@ class CoreBill extends StatelessWidget {
),
defaultText
(
context
,
'Bagaimana pengalaman anda bertransaksi di
excelso
'
,
'Bagaimana pengalaman anda bertransaksi di
${getBranchName()}
'
,
style:
emojiStyle
(),
),
const
SizedBox
(
...
...
@@ -574,23 +644,23 @@ class CoreBill extends StatelessWidget {
],
)
:
const
SizedBox
(),
Container
(
width:
double
.
infinity
,
color:
backgroundWhite
,
padding:
const
EdgeInsets
.
only
(
left:
paddingLeftRight
,
right:
paddingLeftRight
,
top:
16
,
),
child:
defaultText
(
context
,
'Daftar Order'
,
style:
viewbillStyle
(
font:
14
,
fontWeight:
FontWeight
.
w600
,
),
),
),
//
Container(
//
width: double.infinity,
//
color: backgroundWhite,
//
padding: const EdgeInsets.only(
//
left: paddingLeftRight,
//
right: paddingLeftRight,
//
top: 16,
//
),
//
child: defaultText(
//
context,
//
'Daftar Order',
//
style: viewbillStyle(
//
font: 14,
//
fontWeight: FontWeight.w600,
//
),
//
),
//
),
ListOrder
(
bill:
dataBill
,
isHistory:
isHistory
,
...
...
@@ -1083,6 +1153,7 @@ class CoreBill extends StatelessWidget {
setTypeOrder
(
typeOrderPickup
);
}
});
context
.
read
<
ExpandDetailOutlet
>().
show
(
false
);
Navigator
.
pop
(
context
);
}
else
{
String
textOnOk
=
'OK'
;
...
...
@@ -1156,7 +1227,7 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
setTypeOrder
(
typeOrderDelivery
);
}
});
context
.
read
<
ExpandDetailOutlet
>().
show
(
false
);
Navigator
.
pop
(
context
);
}
},
...
...
@@ -1181,11 +1252,11 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
)
],
),
defaultText
(
context
,
'23 Menit'
,
style:
pickUpdeliveryStyleFont
(),
)
//
defaultText(
//
context,
//
'23 Menit',
//
style: pickUpdeliveryStyleFont(),
//
)
],
),
),
...
...
@@ -1226,11 +1297,30 @@ class ButtonPayment extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
BlocBuilder
<
AddressUser
,
Address
>(
builder:
(
context
,
addressUser
)
{
return
GestureDetector
(
onTap:
()
{
if
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
{
if
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
{
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
if
(
getIsDeliveryPickup
())
{
if
(
getIsCustomerDelivery
())
{
if
(
addressUser
.
id
==
''
)
{
EasyLoading
.
showToast
(
'Alamat harus dipilih terlebih dahulu'
);
}
else
{
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
}
else
{
if
(
getPickupTime
()
==
''
)
{
EasyLoading
.
showToast
(
'Silahkan pilih jam pickup'
);
}
else
{
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
}
}
else
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
...
...
@@ -1586,15 +1676,13 @@ class ButtonPayment extends StatelessWidget {
),
),
);
},
);
}
}
class
DeliveryPickupDetail
extends
StatelessWidget
{
DeliveryPickupDetail
({
Key
?
key
,
})
:
super
(
key:
key
);
final
bool
isDelivery
=
getIsCustomerDelivery
();
class
OutletDetail
extends
StatelessWidget
{
const
OutletDetail
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -1603,39 +1691,21 @@ class DeliveryPickupDetail extends StatelessWidget {
horizontal:
paddingLeftRight
,
vertical:
12
,
),
width:
double
.
infinity
,
color:
backgroundWhite
.
withOpacity
(
0.9
),
child:
(
isDelivery
)
?
deliveryOption
(
context
)
:
pickupOption
(
context
),
);
}
Row
pickupOption
(
BuildContext
context
)
{
DateTime
dateTime
=
DateTime
.
now
().
toLocal
();
String
hourTime
=
DateFormat
.
H
().
format
(
dateTime
);
String
minuteTime
=
DateFormat
.
m
().
format
(
dateTime
);
TimeOfDay
timeOfDayPickup
=
TimeOfDay
(
hour:
int
.
parse
(
hourTime
)
+
1
,
minute:
int
.
parse
(
minuteTime
));
return
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Image
(
fit:
BoxFit
.
fill
,
width:
40
,
height:
40
,
image:
AssetImage
(
'assets/icons/outlet.png'
),
),
const
SizedBox
(
width:
12
,
),
Column
(
(
getIsCustomerDelivery
())
?
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
defaultText
(
context
,
getBranchName
(),
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
viewbillStyle
(),
),
const
SizedBox
(
height:
5
,
...
...
@@ -1644,43 +1714,65 @@ class DeliveryPickupDetail extends StatelessWidget {
children:
[
defaultText
(
context
,
"Open Hour:
${getOpenTime()}
-
${getCloseTime(
)}
"
,
"Open Hour:
${timeHm(getOpenTime())}
-
${timeHm(getCloseTime()
)}
"
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
style:
viewbillStyle
(),
),
],
),
const
SizedBox
(
height:
5
,
),
Row
(
children:
[
],
)
:
const
SizedBox
(),
defaultText
(
context
,
"Pickup: "
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
getAddressOutlet
(),
style:
viewbillStyle
(),
),
const
SizedBox
(
height:
10
,
),
GestureDetector
(
onTap:
()
{
htmlOpenLink
(
'https://wa.me/
${getPhoneOutlet()}
'
,
self:
false
,
);
},
child:
Row
(
children:
[
fontAwesomeNew
(
phoneIcon
,
phoneIconSize
,
),
const
SizedBox
(
width:
10
,
),
defaultText
(
context
,
"
${getPickupTime()}
:00"
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
getPhoneOutlet
(),
style:
viewbillStyle
(),
),
],
),
),
const
SizedBox
(
height:
5
,
height:
10
,
),
GestureDetector
(
onTap:
()
{
Geolocator
.
getCurrentPosition
().
then
((
position
)
{
htmlOpenLink
(
'https://
maps.google.com/?q=
${getLatOutlet()}
,
${getLongOutlet()}
'
,
'https://
www.google.com/maps/dir/
${position.latitude}
,
${position.longitude}
/
${getLatOutlet()}
,
${getLongOutlet()}
'
,
self:
false
,
);
});
},
child:
Container
(
width:
10
0
,
width:
15
0
,
height:
23
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
...
...
@@ -1699,7 +1791,7 @@ class DeliveryPickupDetail extends StatelessWidget {
),
defaultText
(
context
,
'Alamat Outlet
'
,
'Open Google Maps
'
,
style:
addButton
(
font:
8
,
),
...
...
@@ -1708,84 +1800,180 @@ class DeliveryPickupDetail extends StatelessWidget {
),
),
),
)
),
],
),
);
}
}
class
DeliveryPickupDetail
extends
StatelessWidget
{
DeliveryPickupDetail
({
Key
?
key
,
required
this
.
isShowOutletDetail
,
})
:
super
(
key:
key
);
final
bool
isDelivery
=
getIsCustomerDelivery
();
final
bool
isShowOutletDetail
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
paddingLeftRight
,
vertical:
12
,
),
color:
backgroundWhite
.
withOpacity
(
0.9
),
child:
(
isDelivery
)
?
deliveryOption
(
context
)
:
pickupOption
(
context
),
);
}
Row
pickupOption
(
BuildContext
context
)
{
DateTime
dateTime
=
DateTime
.
now
().
toLocal
();
String
hourTime
=
DateFormat
.
H
().
format
(
dateTime
);
String
minuteTime
=
DateFormat
.
m
().
format
(
dateTime
);
TimeOfDay
timeOfDayPickup
=
TimeOfDay
(
hour:
int
.
parse
(
hourTime
)
+
1
,
minute:
int
.
parse
(
minuteTime
));
return
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
const
Image
(
fit:
BoxFit
.
fill
,
width:
40
,
height:
40
,
image:
AssetImage
(
'assets/icons/outlet.png'
),
),
const
SizedBox
(
width:
12
,
),
const
Spacer
(),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
GestureDetector
(
onTap:
()
{
void
ontapOkeChange
()
{
Navigator
.
pushReplacement
(
defaultText
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
SelectBranch
(
isFormBill:
true
,
getBranchName
(),
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
),
const
SizedBox
(
height:
5
,
),
);
}
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
(
Row
(
children:
[
defaultText
(
context
,
title
,
description
,
textOnOk
,
textOnCancel
,
ontapOkeChange
,
onTapCancelChange
,
okButtonColor:
buttonColor
,
);
},
child:
Container
(
width:
98
,
height:
30
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
backgroundWhite
,
border:
Border
.
all
(
color:
buttonColor
,
),
"Open Hour:
${timeHm(getOpenTime())}
-
${timeHm(getCloseTime())}
"
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
),
child:
Center
(
child:
defaultText
(
context
,
'Ganti Outlet'
,
style:
addButton
(
font:
8
,
color:
buttonColor
,
],
),
const
SizedBox
(
height:
5
,
),
Row
(
children:
[
defaultText
(
context
,
"Pickup: "
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
),
defaultText
(
context
,
getPickupTime
(),
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
),
],
),
const
SizedBox
(
height:
5
,
),
GestureDetector
(
onTap:
()
{
showTimePicker
(
context:
context
,
initialTime:
timeOfDayPickup
,
).
then
((
value
)
{
if
(
value
==
null
)
{
return
;
}
else
{
// GestureDetector(
// onTap: () {
// context.read<ExpandDetailOutlet>().show(!isShowOutletDetail);
// // Geolocator.getCurrentPosition().then((position) {
// // htmlOpenLink(
// // 'https://www.google.com/maps/dir/${position.latitude},${position.longitude}/${getLatOutlet()},${getLongOutlet()}',
// // self: false,
// // );
// // });
// },
// child: Container(
// width: 98,
// height: 30,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// color: backgroundWhite,
// border: Border.all(
// color: buttonColor,
// ),
// ),
// child: Center(
// child: defaultText(
// context,
// 'Detail Outlet',
// style: addButton(
// font: 8,
// color: buttonColor,
// ),
// ),
// ),
// )
// // child: Container(
// // width: 100,
// // height: 23,
// // decoration: BoxDecoration(
// // borderRadius: BorderRadius.circular(40),
// // color: buttonColor,
// // ),
// // child: Center(
// // child: Row(
// // crossAxisAlignment: CrossAxisAlignment.center,
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // const Image(
// // image: AssetImage('assets/icons/pin-address.png'),
// // ),
// // const SizedBox(
// // width: 12.6,
// // ),
// // defaultText(
// // context,
// // 'Detail Outlet',
// // style: addButton(
// // font: 8,
// // ),
// // )
// // ],
// // ),
// // ),
// // ),
// )
],
),
const
SizedBox
(
width:
12
,
),
const
Spacer
(),
Column
(
children:
[
changeOutlet
(
context
),
const
SizedBox
(
height:
5
,
),
GestureDetector
(
onTap:
()
{
showTimePicker
(
context:
context
,
initialTime:
timeOfDayPickup
,
).
then
((
value
)
{
if
(
value
==
null
)
{
return
;
}
else
{
void
ontapClose
()
{
Navigator
.
pop
(
context
);
}
...
...
@@ -1816,8 +2004,7 @@ Apakah ingin melanjutkan ?''';
dateTimeCloseOutlet
.
difference
(
dateSelectedPickupTime
);
final
differenceOpen
=
dateTimeOpenOutlet
.
difference
(
dateSelectedPickupTime
);
dateSelectedPickupTime
.
difference
(
dateTimeOpenOutlet
);
final
differenceFromNow
=
dateSelectedPickupTime
.
difference
(
now
);
if
(
differenceFromNow
.
inMinutes
<
0
)
{
...
...
@@ -1893,13 +2080,106 @@ Apakah ingin melanjutkan ?''';
),
),
),
)
),
const
SizedBox
(
height:
5
,
),
detailOutlet
(
context
),
],
)
],
);
}
GestureDetector
detailOutlet
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
{
context
.
read
<
ExpandDetailOutlet
>().
show
(!
isShowOutletDetail
);
},
child:
Container
(
width:
98
,
height:
30
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
backgroundWhite
,
border:
Border
.
all
(
color:
buttonColor
,
),
),
child:
Center
(
child:
defaultText
(
context
,
'Detail Outlet'
,
style:
addButton
(
font:
8
,
color:
buttonColor
,
),
),
),
),
);
}
GestureDetector
changeOutlet
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
{
void
ontapOkeChange
()
{
Navigator
.
pushReplacement
(
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:
98
,
height:
30
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
backgroundWhite
,
border:
Border
.
all
(
color:
buttonColor
,
),
),
child:
Center
(
child:
defaultText
(
context
,
'Ganti Outlet'
,
style:
addButton
(
font:
8
,
color:
buttonColor
,
),
),
),
),
);
}
BlocBuilder
deliveryOption
(
BuildContext
context
)
{
void
ontapAddressDetail
()
{
Navigator
.
pop
(
context
);
...
...
@@ -1908,6 +2188,8 @@ Apakah ingin melanjutkan ?''';
return
BlocBuilder
<
AddressUser
,
Address
>(
builder:
(
context
,
address
)
{
if
(
address
.
id
!=
''
)
{
setLatitude
(
address
.
lat
);
setLongitude
(
address
.
long
);
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
...
...
@@ -1955,6 +2237,20 @@ Apakah ingin melanjutkan ?''';
font:
10
,
),
),
defaultText
(
context
,
"Detail Lokasi:
${address.locationDetail}
"
,
style:
addressStyle
(
font:
10
,
),
),
defaultText
(
context
,
"Catatan :
${address.notes}
"
,
style:
addressStyle
(
font:
10
,
),
),
// (address.locationDetail != '')
// ? Container(
// padding: const EdgeInsets.only(top: 6),
...
...
@@ -2023,7 +2319,7 @@ Apakah ingin melanjutkan ?''';
),
),
const
SizedBox
(
height:
10
,
height:
5
,
),
GestureDetector
(
onTap:
()
{
...
...
@@ -2082,131 +2378,213 @@ Apakah ingin melanjutkan ?''';
),
),
),
],
const
SizedBox
(
height:
5
,
),
detailOutlet
(
context
),
],
),
const
SizedBox
(
height:
21
,
],
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
// const SizedBox(
// height: 21,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// (address.locationDetail != '')
// ? GestureDetector(
// onTap: () {
// buttonDialogGlobal(
// context,
// 'Detail Lokasi',
// address.locationDetail,
// 'OK',
// 'Close',
// ontapAddressDetail,
// ontapAddressDetail,
// isOkeButtonShow: false,
// );
// },
// child: Container(
// width: 100,
// height: 23,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// color: buttonColor,
// ),
// child: Center(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// const Image(
// image: AssetImage(
// 'assets/icons/pin-address.png'),
// ),
// const SizedBox(
// width: 12.6,
// ),
// defaultText(
// context,
// 'Detail Alamat',
// style: addButton(
// font: 8,
// ),
// )
// ],
// ),
// ),
// ),
// )
// : const SizedBox(),
// (address.locationDetail != '')
// ? const SizedBox(
// width: 16,
// )
// : const SizedBox(),
// (address.notes != '')
// ? GestureDetector(
// onTap: () {
// buttonDialogGlobal(
// context,
// 'Catatan',
// address.notes,
// 'OK',
// 'Close',
// ontapAddressDetail,
// ontapAddressDetail,
// isOkeButtonShow: false,
// );
// },
// child: Container(
// width: 84,
// height: 23,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// color: buttonColor,
// ),
// child: Center(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// const Image(
// image: AssetImage('assets/icons/note.png'),
// ),
// const SizedBox(
// width: 10,
// ),
// defaultText(
// context,
// 'Catatan',
// style: addButton(font: 8),
// )
// ],
// ),
// ),
// ),
// )
// : const SizedBox(),
// ],
// ),
],
);
}
else
{
return
Row
(
// crossAxisAlignment: CrossAxisAlignment.start,
children:
[
(
address
.
locationDetail
!=
''
)
?
GestureDetector
(
// Container(
// width: maxWidthScreens,
// color: backgroundWhite,
// child: Align(
// alignment: Alignment.centerLeft,
// child: GestureDetector(
// onTap: () {
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (_) => WebViewMap(
// titleAppBar: 'Pilih Alamat',
// url:
// '${getBaseUrl()}rdm/address/add/?session_id=${getSessionId()}'),
// ),
// );
// },
// child: Container(
// width: 98,
// height: 30,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// color: backgroundWhite,
// border: Border.all(
// color: buttonColor,
// ),
// ),
// child: Center(
// child: defaultText(
// context,
// 'Pilih Alamat',
// style: addButton(
// font: 8,
// color: buttonColor,
// ),
// ),
// ),
// ),
// ),
// ),
// ),
GestureDetector
(
onTap:
()
{
buttonDialogGlobal
(
Navigator
.
pushReplacement
(
context
,
'Detail Lokasi'
,
address
.
locationDetail
,
'OK'
,
'Close'
,
ontapAddressDetail
,
ontapAddressDetail
,
isOkeButtonShow:
false
,
MaterialPageRoute
(
builder:
(
_
)
=>
WebViewMap
(
titleAppBar:
'Pilih Alamat'
,
url:
'
${getBaseUrl()}
rdm/address/add/?session_id=
${getSessionId()}
'
),
),
);
},
child:
Container
(
width:
100
,
height:
23
,
width:
98
,
height:
30
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
backgroundWhite
,
border:
Border
.
all
(
color:
buttonColor
,
),
child:
Center
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
const
Image
(
image:
AssetImage
(
'assets/icons/pin-address.png'
),
),
const
SizedBox
(
width:
12.6
,
),
defaultText
(
child:
Center
(
child:
defaultText
(
context
,
'Detail
Alamat'
,
'Pilih
Alamat'
,
style:
addButton
(
font:
8
,
),
)
],
),
),
),
)
:
const
SizedBox
(),
(
address
.
locationDetail
!=
''
)
?
const
SizedBox
(
width:
16
,
)
:
const
SizedBox
(),
(
address
.
notes
!=
''
)
?
GestureDetector
(
onTap:
()
{
buttonDialogGlobal
(
context
,
'Catatan'
,
address
.
notes
,
'OK'
,
'Close'
,
ontapAddressDetail
,
ontapAddressDetail
,
isOkeButtonShow:
false
,
);
},
child:
Container
(
width:
84
,
height:
23
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
),
color:
buttonColor
,
),
child:
Center
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
const
Image
(
image:
AssetImage
(
'assets/icons/note.png'
),
),
const
SizedBox
(
width:
10
,
),
defaultText
(
context
,
'Catatan'
,
style:
addButton
(
font:
8
),
)
],
),
),
const
SizedBox
(
width:
5
,
),
)
:
const
SizedBox
(),
]
,
changeOutlet
(
context
),
const
SizedBox
(
width:
5
,
),
],
);
}
else
{
return
Container
(
width:
maxWidthScreens
,
color:
backgroundWhite
,
child:
Align
(
alignment:
Alignment
.
centerRight
,
child:
GestureDetector
(
GestureDetector
(
onTap:
()
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
WebViewMap
(
titleAppBar:
'Pilih Alamat'
,
url:
'
${getBaseUrl()}
rdm/address/add/?session_id=
${getSessionId()}
'
),
),
);
context
.
read
<
ExpandDetailOutlet
>().
show
(!
isShowOutletDetail
);
// Geolocator.getCurrentPosition().then((position) {
// htmlOpenLink(
// 'https://www.google.com/maps/dir/${position.latitude},${position.longitude}/${getLatOutlet()},${getLongOutlet()}',
// self: false,
// );
// });
},
child:
Container
(
width:
98
,
...
...
@@ -2221,7 +2599,7 @@ Apakah ingin melanjutkan ?''';
child:
Center
(
child:
defaultText
(
context
,
'
Pilih Alama
t'
,
'
Detail Outle
t'
,
style:
addButton
(
font:
8
,
color:
buttonColor
,
...
...
@@ -2229,8 +2607,37 @@ Apakah ingin melanjutkan ?''';
),
),
),
),
),
// child: Container(
// width: 100,
// height: 23,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// color: buttonColor,
// ),
// child: Center(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// const Image(
// image: AssetImage('assets/icons/pin-address.png'),
// ),
// const SizedBox(
// width: 12.6,
// ),
// defaultText(
// context,
// 'Detail Outlet',
// style: addButton(
// font: 8,
// ),
// )
// ],
// ),
// ),
// ),
)
],
);
}
},
...
...
lib/ui/webview/app_bar_webview.dart
View file @
94c58a71
...
...
@@ -62,34 +62,34 @@ class CustomAppBar extends StatelessWidget {
),
],
),
GestureDetector
(
onTap:
()
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
(
isRepeatViewBill:
true
,
),
),
);
},
child:
Row
(
children:
[
defaultText
(
context
,
'Simpan'
,
style:
appBarNameViewBill
(),
),
const
SizedBox
(
width:
5
,
),
fontAwesomeNew
(
saveIcon
,
saveIconSize
,
),
],
),
),
//
GestureDetector(
//
onTap: () {
//
Navigator.pushReplacement(
//
context,
//
MaterialPageRoute(
//
builder: (_) => const ViewBillNew(
//
isRepeatViewBill: true,
//
),
//
),
//
);
//
},
//
child: Row(
//
children: [
//
defaultText(
//
context,
//
'Simpan',
//
style: appBarNameViewBill(),
//
),
//
const SizedBox(
//
width: 5,
//
),
//
fontAwesomeNew(
//
saveIcon,
//
saveIconSize,
//
),
//
],
//
),
//
),
],
),
);
...
...
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