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
e92aa2ba
Commit
e92aa2ba
authored
Nov 02, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
02/11/22
parent
1d782096
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
693 additions
and
386 deletions
+693
-386
api.dart
lib/api/api.dart
+21
-7
helper.dart
lib/helper/helper.dart
+13
-1
emoticon_rate_new.dart
lib/helper/widget/emoticon_rate_new.dart
+2
-2
bill.dart
lib/models/bill.dart
+10
-0
app_bar_confirm.dart
lib/ui/confirm_order/app_bar_confirm.dart
+1
-1
history_new.dart
lib/ui/history_order/history_new.dart
+9
-1
menu_list_utama.dart
lib/ui/home/menu_list_utama.dart
+4
-1
new_home2.dart
lib/ui/home/new_home2.dart
+5
-1
splash.dart
lib/ui/splash.dart
+4
-4
rincian_pembayaran.dart
lib/ui/viewbill/rincian_pembayaran.dart
+42
-8
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+574
-360
pubspec.lock
pubspec.lock
+7
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/api/api.dart
View file @
e92aa2ba
...
...
@@ -14,6 +14,7 @@ import 'package:byod/models/filter_menu.dart';
import
'package:byod/models/member_info.dart'
;
import
'package:byod/models/payment_list.dart'
;
import
'package:byod/models/voucher_list.dart'
;
import
'package:byod/ui/home/new_home2.dart'
;
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
...
...
@@ -1020,6 +1021,9 @@ class Api {
jsonObject
[
'data'
][
'rdm_staff_courier_name'
]
??
""
,
"rdm_staff_courier_mobile"
:
jsonObject
[
'data'
][
'rdm_staff_courier_mobile'
]
??
""
,
"branch_name"
:
jsonObject
[
'data'
][
'branch_name'
],
"type"
:
jsonObject
[
'data'
][
'type'
],
"payment_mode"
:
jsonObject
[
'data'
][
'payment_mode'
],
};
if
(
jsonObject
[
'data'
][
'type'
]
==
typeOrderDelivery
)
{
...
...
@@ -1483,10 +1487,17 @@ class Api {
// MaterialPageRoute(
// builder: (_) => FinishOrder(pinOrder: jsonObject['pin'])));
context
.
read
<
OrdersBloc
>().
clearOrder
();
Navigator
.
pushAndRemoveUntil
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()),
(
route
)
=>
false
);
if
(
getPaymentMode
()
==
openBill
)
{
Navigator
.
pushAndRemoveUntil
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
NewHome2
()),
(
route
)
=>
false
);
}
else
{
Navigator
.
pushAndRemoveUntil
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
ViewBillNew
()),
(
route
)
=>
false
);
}
}
else
if
(
jsonObject
[
'code'
]
==
'ORDER_LOCK'
)
{
await
EasyLoading
.
dismiss
();
EasyLoading
.
showToast
(
jsonObject
[
'msg'
]);
...
...
@@ -2156,12 +2167,16 @@ class Api {
if
(
jsonObject
!=
false
)
{
if
(
jsonObject
[
'status'
].
toString
().
toLowerCase
()
==
'ok'
)
{
setBranch
(
newBranch
);
setBranchName
(
jsonObject
[
'data'
][
'
cod
e'
]);
setBranchName
(
jsonObject
[
'data'
][
'
nam
e'
]);
setLatOutlet
(
jsonObject
[
'data'
][
'lat'
]);
setLongOutlet
(
jsonObject
[
'data'
][
'long'
]);
setOpenTime
(
jsonObject
[
'data'
][
'open_time'
]);
setCloseTime
(
jsonObject
[
'data'
][
'close_time'
]);
setServiceRadius
(
jsonObject
[
'data'
][
'service_radius'
]);
setAddressOutlet
(
jsonObject
[
'data'
][
'address'
]);
setIsDelivery
(
jsonObject
[
'data'
][
'is_delivery'
]);
setIsPickup
(
jsonObject
[
'data'
][
'is_pickup'
]);
setPhoneOutlet
(
jsonObject
[
'data'
][
'mobile'
]);
}
Map
<
String
,
dynamic
>
returnResult
=
{
"status"
:
jsonObject
[
'status'
],
...
...
@@ -2196,8 +2211,6 @@ class Api {
String
baseUrl
=
getBaseUrl
();
String
apiUrl
=
"
$baseUrl${endPointRdm}
get_address/"
;
String
sessionId
=
getSessionId
();
Address
defaultResult
=
Address
(
id:
''
,
label:
''
,
...
...
@@ -2209,6 +2222,7 @@ class Api {
recepientPhone:
''
,
notes:
''
,
);
String
sessionId
=
getSessionId
();
try
{
Map
data
=
{
"session_id"
:
sessionId
,
...
...
lib/helper/helper.dart
View file @
e92aa2ba
...
...
@@ -80,6 +80,18 @@ String getOrderStatus(int status) {
}
}
String
typeOrderString
(
int
typeOrder
)
{
if
(
typeOrder
==
typeOrderDineIn
)
{
return
'Dine In'
;
}
else
if
(
typeOrder
==
typeOrderDelivery
)
{
return
'Delivery'
;
}
else
if
(
typeOrder
==
typeOrderPickup
)
{
return
'Pickup'
;
}
else
{
return
'Unknown'
;
}
}
Color
getOrderStatusColor
(
int
status
)
{
if
(
status
==
completeOrder
)
{
return
successColor
;
...
...
@@ -185,7 +197,7 @@ String formatDate(String timeString, {toLocal = false}) {
}
void
setIsCanChangeDeliveryPickupFunc
(
int
orderState
)
{
if
(
orderState
>=
orderStateP
aid
)
{
if
(
orderState
>=
orderStateP
ending
)
{
setIsCanChangeDeliveryPickup
(
false
);
}
else
{
setIsCanChangeDeliveryPickup
(
true
);
...
...
lib/helper/widget/emoticon_rate_new.dart
View file @
e92aa2ba
...
...
@@ -201,7 +201,7 @@ class EmoticonRateNew extends StatelessWidget {
controller:
rateNote
,
maxLength:
maxLengthTextField
,
decoration:
const
InputDecoration
(
labelText:
'Beri
Masuk
an'
,
labelText:
'Beri
Penilai
an'
,
labelStyle:
TextStyle
(
fontFamily:
'OpenSans'
,
fontSize:
12
,
...
...
@@ -280,7 +280,7 @@ class EmoticonRateNew extends StatelessWidget {
child:
Center
(
child:
defaultText
(
context
,
'Kirim
Masuk
an'
,
'Kirim
Penilai
an'
,
style:
rincianPembayaran
(
color:
textInButton
,
fontWeight:
FontWeight
.
w400
,
...
...
lib/models/bill.dart
View file @
e92aa2ba
import
'package:byod/helper/helper.dart'
;
import
'package:byod/models/payment_list.dart'
;
import
'bill_detail.dart'
;
...
...
@@ -29,6 +30,9 @@ class Bill {
int
deliveryState
;
String
courierName
;
String
courierPhone
;
String
branchName
;
int
typeOrder
;
int
paymentMode
;
// List<MemberInfo> memberInfo;
Bill
({
...
...
@@ -58,6 +62,9 @@ class Bill {
this
.
deliveryState
=
0
,
this
.
courierName
=
''
,
this
.
courierPhone
=
''
,
this
.
branchName
=
''
,
this
.
typeOrder
=
typeOrderDineIn
,
this
.
paymentMode
=
openBill
// this.memberInfo = const []
});
...
...
@@ -89,6 +96,9 @@ class Bill {
deliveryState:
json
[
'delivery_state'
]
??
0
,
courierName:
json
[
'rdm_staff_courier_name'
]
??
''
,
courierPhone:
json
[
'rdm_staff_courier_mobile'
]
??
''
,
branchName:
json
[
'branch_name'
]
??
''
,
typeOrder:
json
[
'type'
]
??
typeOrderDineIn
,
paymentMode:
json
[
'payment_mode'
]
??
openBill
,
// memberInfo: json['member_info']
);
}
...
...
lib/ui/confirm_order/app_bar_confirm.dart
View file @
e92aa2ba
...
...
@@ -44,7 +44,7 @@ class CustomAppBarConfirm extends StatelessWidget {
Center
(
child:
defaultText
(
context
,
'Konfirmasi
Order
an'
,
'Konfirmasi
Pesan
an'
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
style:
appBarNameViewBill
(),
...
...
lib/ui/history_order/history_new.dart
View file @
e92aa2ba
...
...
@@ -81,7 +81,7 @@ class HistoryOrderNew extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
6
),
color:
backgroundWhite
,
),
height:
72
,
//
height: 72,
child:
Container
(
padding:
const
EdgeInsets
.
only
(
left:
16
,
...
...
@@ -109,6 +109,14 @@ class HistoryOrderNew extends StatelessWidget {
context
,
"Rp
${formatNumber().format(amountParseToInt(jsonDecodeHistory['total_order']))}
"
,
style:
historyOrderStyle
(),
),
const
SizedBox
(
height:
4
,
),
defaultText
(
context
,
jsonDecodeHistory
[
'typeOrder'
],
style:
historyOrderStyle
(),
)
],
),
...
...
lib/ui/home/menu_list_utama.dart
View file @
e92aa2ba
...
...
@@ -78,7 +78,9 @@ class MenuListUtama extends StatelessWidget {
categoryNonFav
[
i
].
name
,
style:
menuNameStyle
(),
),
const
Spacer
(),
const
SizedBox
(
height:
10
,
),
defaultText
(
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
...
...
@@ -86,6 +88,7 @@ class MenuListUtama extends StatelessWidget {
categoryNonFav
[
i
].
description
,
style:
deskripsiMenuStyle
(),
),
const
Spacer
(),
const
SizedBox
(
height:
4
,
),
...
...
lib/ui/home/new_home2.dart
View file @
e92aa2ba
...
...
@@ -192,6 +192,10 @@ class _NewHome2State extends State<NewHome2> {
isCallDeliveryCharge:
false
,
isGetBranchList:
true
,
);
context
.
read
<
ChangeDeliveryPickupBloc
>()
.
toDelivery
(
getIsCustomerDelivery
());
}
// double heightTotal = MediaQuery.of(context).size.height;
double
appBarHeight
=
50
;
...
...
@@ -694,7 +698,7 @@ class _NewHome2State extends State<NewHome2> {
child:
BlocBuilder
<
ChangeDeliveryPickupBloc
,
bool
>(
builder:
(
ctx
,
isDelivery
)
{
return
ComponentNameUser
(
isDeliveryPickuup:
true
,
isDeliveryPickuup:
getIsDeliveryPickup
()
,
backgroundColorComponent:
backgroundColor
,
isFromMenu:
true
,
isdelivery:
isDelivery
,
...
...
lib/ui/splash.dart
View file @
e92aa2ba
...
...
@@ -49,7 +49,7 @@ class _SplashState extends State<Splash> {
}
}
int
durationDelayBeforToMenu
=
2
000
;
int
durationDelayBeforToMenu
=
3
000
;
@override
void
initState
()
{
...
...
@@ -82,13 +82,13 @@ class _SplashState extends State<Splash> {
}
widget
.
context
.
read
<
BranchExist
>().
branchExist
(
getBranchPref
()
,
getBrand
()
,
''
,
''
,
getRole
(),
getCashierName
(),
''
,
widget
.
context
,
getBrancList:
true
,
//
getBrancList: true,
);
Future
.
delayed
(
Duration
(
milliseconds:
durationDelayBeforToMenu
),
()
async
{
// if (getStatusOrderCreated()) {
...
...
lib/ui/viewbill/rincian_pembayaran.dart
View file @
e92aa2ba
...
...
@@ -11,11 +11,13 @@ class RincianPembayaran extends StatelessWidget {
required
this
.
dataBill
,
required
this
.
totalDiscount
,
required
this
.
outStandingAll
,
this
.
serviceCharge
=
0
,
})
:
super
(
key:
key
);
final
List
<
Bill
>
dataBill
;
final
int
totalDiscount
;
final
int
outStandingAll
;
final
int
serviceCharge
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -89,15 +91,47 @@ class RincianPembayaran extends StatelessWidget {
),
],
),
(
getIsDeliveryPickup
())
?
(
getTypeOrder
()
==
typeOrderDelivery
)
(
dataBill
[
0
].
paymentMode
==
openBill
)
?
Column
(
children:
[
const
SizedBox
(
height:
8
,
),
Row
(
children:
[
defaultText
(
context
,
'Service'
,
style:
rincianPembayaran
(
font:
12
,
color:
textGreyBill
,
),
),
const
Spacer
(),
defaultText
(
context
,
(
serviceCharge
==
0
)
?
'-'
:
'Rp
${formatNumber().format(serviceCharge)}
'
,
style:
rincianPembayaran
(
font:
12
,
color:
textGreyBill
,
),
),
],
),
],
)
:
const
SizedBox
(),
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
(
dataBill
[
0
].
typeOrder
==
typeOrderDelivery
)
?
const
SizedBox
(
height:
8
,
)
:
const
SizedBox
()
:
const
SizedBox
(),
(
getIsDeliveryPickup
()
)
?
(
getTypeOrder
()
==
typeOrderDelivery
)
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
(
dataBill
[
0
].
typeOrder
==
typeOrderDelivery
)
?
Row
(
children:
[
defaultText
(
...
...
@@ -123,12 +157,12 @@ class RincianPembayaran extends StatelessWidget {
)
:
const
SizedBox
()
:
const
SizedBox
(),
(
getIsDeliveryPickup
()
)
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
const
SizedBox
(
height:
8
,
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
()
)
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
Row
(
children:
[
defaultText
(
...
...
@@ -153,12 +187,12 @@ class RincianPembayaran extends StatelessWidget {
],
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
()
)
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
const
SizedBox
(
height:
8
,
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
()
)
(
dataBill
[
0
].
typeOrder
!=
typeOrderDineIn
)
?
Row
(
children:
[
defaultText
(
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
e92aa2ba
This diff is collapsed.
Click to expand it.
pubspec.lock
View file @
e92aa2ba
...
...
@@ -483,6 +483,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
time_picker_widget:
dependency: "direct main"
description:
name: time_picker_widget
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0+10"
timeline_tile:
dependency: "direct main"
description:
...
...
pubspec.yaml
View file @
e92aa2ba
...
...
@@ -45,6 +45,7 @@ dependencies:
shared_preferences
:
^2.0.15
shimmer
:
^2.0.0
sliver_tools
:
^0.2.8
time_picker_widget
:
^1.0.0+10
timeline_tile
:
^2.0.0
url_launcher
:
^6.1.5
url_strategy
:
^0.2.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