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
400dfcbf
Commit
400dfcbf
authored
Oct 19, 2022
by
Jasa Digital
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug di halaman confirmation gabisa refresh
parent
ab387a28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
817 additions
and
441 deletions
+817
-441
order_bloc.dart
lib/bloc/order_bloc.dart
+5
-2
note_modal_bottom_sheet.dart
lib/helper/widget/note_modal_bottom_sheet.dart
+34
-4
confirm_order.dart
lib/ui/confirm_order/confirm_order.dart
+775
-432
fav_grid_menu.dart
lib/ui/home/fav_grid_menu.dart
+1
-1
menu_list_utama.dart
lib/ui/home/menu_list_utama.dart
+1
-1
order_view_bill_new.dart
lib/ui/viewbill/order_view_bill_new.dart
+1
-1
No files found.
lib/bloc/order_bloc.dart
View file @
400dfcbf
...
@@ -9,6 +9,7 @@ class OrdersBloc extends Cubit<List<Orders>> {
...
@@ -9,6 +9,7 @@ class OrdersBloc extends Cubit<List<Orders>> {
if
(
json
[
'action'
]
==
'editVariant'
)
{
if
(
json
[
'action'
]
==
'editVariant'
)
{
// hanya ketika bottom sheet muncul untuk order yang mempunyai variant
// hanya ketika bottom sheet muncul untuk order yang mempunyai variant
// Orders singleOrder = list[0][1];
// Orders singleOrder = list[0][1];
List
<
Orders
>
newResult
=
[];
List
<
Orders
>
listOrders
=
json
[
'list_orders'
];
List
<
Orders
>
listOrders
=
json
[
'list_orders'
];
OrderDetail
singleOrderDetail
=
json
[
'single_order_detail'
];
OrderDetail
singleOrderDetail
=
json
[
'single_order_detail'
];
...
@@ -27,14 +28,16 @@ class OrdersBloc extends Cubit<List<Orders>> {
...
@@ -27,14 +28,16 @@ class OrdersBloc extends Cubit<List<Orders>> {
singleOrderDetail
.
totalItem
;
singleOrderDetail
.
totalItem
;
listOrders
[
indexListOrder
].
orderDetail
[
indexListOrderDetail
].
totalHarga
=
listOrders
[
indexListOrder
].
orderDetail
[
indexListOrderDetail
].
totalHarga
=
singleOrderDetail
.
totalHarga
;
singleOrderDetail
.
totalHarga
;
listOrders
[
indexListOrder
].
orderDetail
[
indexListOrderDetail
].
note
=
singleOrderDetail
.
note
;
if
(
singleOrderDetail
.
totalItem
==
0
)
{
if
(
singleOrderDetail
.
totalItem
==
0
)
{
listOrders
[
indexListOrder
].
orderDetail
.
removeAt
(
indexListOrderDetail
);
listOrders
[
indexListOrder
].
orderDetail
.
removeAt
(
indexListOrderDetail
);
if
(
listOrders
[
indexListOrder
].
orderDetail
.
isEmpty
)
{
if
(
listOrders
[
indexListOrder
].
orderDetail
.
isEmpty
)
{
listOrders
.
removeAt
(
indexListOrder
);
listOrders
.
removeAt
(
indexListOrder
);
}
}
}
}
newResult
=
listOrders
;
emit
(
listOrders
);
emit
(
newResult
);
}
else
{
}
else
{
var
listOrderOld
=
json
[
'old_order'
];
// orderan lama
var
listOrderOld
=
json
[
'old_order'
];
// orderan lama
List
<
Orders
>
orders
=
[];
List
<
Orders
>
orders
=
[];
...
...
lib/helper/widget/note_modal_bottom_sheet.dart
View file @
400dfcbf
// ignore_for_file: must_be_immutable
// ignore_for_file: must_be_immutable
import
'package:byod/helper/widget/style.dart'
;
import
'package:byod/helper/widget/style.dart'
;
import
'package:byod/models/order_details.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'
;
...
@@ -19,7 +20,7 @@ class NoteModalBottomSheet extends StatelessWidget {
...
@@ -19,7 +20,7 @@ class NoteModalBottomSheet extends StatelessWidget {
required
this
.
initialValue
,
required
this
.
initialValue
,
required
this
.
orderVariants
,
required
this
.
orderVariants
,
required
this
.
menuItem
,
required
this
.
menuItem
,
required
this
.
lis
r
Orders
,
required
this
.
lis
t
Orders
,
required
this
.
from
,
required
this
.
from
,
this
.
idOrderan
=
''
,
this
.
idOrderan
=
''
,
this
.
noteInit
=
''
,
this
.
noteInit
=
''
,
...
@@ -27,15 +28,19 @@ class NoteModalBottomSheet extends StatelessWidget {
...
@@ -27,15 +28,19 @@ class NoteModalBottomSheet extends StatelessWidget {
this
.
menuName
=
''
,
this
.
menuName
=
''
,
this
.
imageUrl
=
''
,
this
.
imageUrl
=
''
,
this
.
priceMemu
=
0
,
this
.
priceMemu
=
0
,
this
.
editVariantConfirmationPage
=
false
,
required
this
.
contextFrom
,
required
this
.
contextFrom
,
this
.
indexOrder
=
0
,
this
.
indexOrderDetail
=
0
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
late
TextEditingController
noteController
;
late
TextEditingController
noteController
;
final
int
initialValue
;
final
int
initialValue
;
final
List
<
OrderVariant
>
orderVariants
;
final
List
<
OrderVariant
>
orderVariants
;
final
FilterMenu
menuItem
;
final
FilterMenu
menuItem
;
final
List
<
Orders
>
lis
r
Orders
;
final
List
<
Orders
>
lis
t
Orders
;
final
String
from
;
final
String
from
;
final
bool
editVariantConfirmationPage
;
final
String
idOrderan
;
final
String
idOrderan
;
final
String
noteInit
;
final
String
noteInit
;
final
BuildContext
contextFrom
;
final
BuildContext
contextFrom
;
...
@@ -43,6 +48,8 @@ class NoteModalBottomSheet extends StatelessWidget {
...
@@ -43,6 +48,8 @@ class NoteModalBottomSheet extends StatelessWidget {
final
String
menuName
;
final
String
menuName
;
final
String
imageUrl
;
final
String
imageUrl
;
final
int
priceMemu
;
final
int
priceMemu
;
final
int
indexOrder
;
final
int
indexOrderDetail
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -99,7 +106,7 @@ class NoteModalBottomSheet extends StatelessWidget {
...
@@ -99,7 +106,7 @@ class NoteModalBottomSheet extends StatelessWidget {
'menu_name'
:
menuItem
.
name
,
'menu_name'
:
menuItem
.
name
,
'initvalue'
:
initialValue
,
'initvalue'
:
initialValue
,
'menu_price'
:
amountParseToInt
(
menuItem
.
price
),
'menu_price'
:
amountParseToInt
(
menuItem
.
price
),
'old_order'
:
lis
r
Orders
,
'old_order'
:
lis
t
Orders
,
'image_url'
:
menuItem
.
imageUrlMedium
,
'image_url'
:
menuItem
.
imageUrlMedium
,
'total_price'
:
amountParseToInt
(
menuItem
.
price
),
'total_price'
:
amountParseToInt
(
menuItem
.
price
),
'order_variant'
:
orderVariants
,
'order_variant'
:
orderVariants
,
...
@@ -117,13 +124,36 @@ class NoteModalBottomSheet extends StatelessWidget {
...
@@ -117,13 +124,36 @@ class NoteModalBottomSheet extends StatelessWidget {
context
.
read
<
ViewBillBloc
>().
getBill
();
context
.
read
<
ViewBillBloc
>().
getBill
();
});
});
}
}
}
else
if
(
from
==
fromConfirmationPage
&&
editVariantConfirmationPage
)
{
OrderDetail
orderDetailNow
=
OrderDetail
(
allIdVariant:
listOrders
[
indexOrder
]
.
orderDetail
[
indexOrderDetail
]
.
allIdVariant
,
totalItem:
listOrders
[
indexOrder
]
.
orderDetail
[
indexOrderDetail
]
.
totalItem
,
totalHarga:
listOrders
[
indexOrder
]
.
orderDetail
[
indexOrderDetail
]
.
totalHarga
,
note:
noteController
.
text
,
orderVariant:
listOrders
[
indexOrder
]
.
orderDetail
[
indexOrderDetail
]
.
orderVariant
,
);
Map
<
String
,
dynamic
>
insertData
=
{
'action'
:
'editVariant'
,
'list_orders'
:
listOrders
,
'single_order_detail'
:
orderDetailNow
,
};
context
.
read
<
OrdersBloc
>().
insertData
(
insertData
);
}
else
if
(
from
==
fromConfirmationPage
)
{
}
else
if
(
from
==
fromConfirmationPage
)
{
Map
<
String
,
dynamic
>
insertData
=
{
Map
<
String
,
dynamic
>
insertData
=
{
'menu_id'
:
idMenu
,
'menu_id'
:
idMenu
,
'menu_name'
:
menuName
,
'menu_name'
:
menuName
,
'initvalue'
:
initialValue
,
'initvalue'
:
initialValue
,
'menu_price'
:
priceMemu
,
'menu_price'
:
priceMemu
,
'old_order'
:
lis
r
Orders
,
'old_order'
:
lis
t
Orders
,
'image_url'
:
menuItem
.
imageUrlMedium
,
'image_url'
:
menuItem
.
imageUrlMedium
,
'total_price'
:
priceMemu
,
'total_price'
:
priceMemu
,
'order_variant'
:
orderVariants
,
'order_variant'
:
orderVariants
,
...
...
lib/ui/confirm_order/confirm_order.dart
View file @
400dfcbf
This diff is collapsed.
Click to expand it.
lib/ui/home/fav_grid_menu.dart
View file @
400dfcbf
...
@@ -397,7 +397,7 @@ class FavGridMenu extends StatelessWidget {
...
@@ -397,7 +397,7 @@ class FavGridMenu extends StatelessWidget {
initialValue:
initialValue
,
initialValue:
initialValue
,
orderVariants:
orderVariants
,
orderVariants:
orderVariants
,
menuItem:
menuFav
,
menuItem:
menuFav
,
lis
r
Orders:
list
,
lis
t
Orders:
list
,
from:
fromMenu
,
from:
fromMenu
,
contextFrom:
context
,
contextFrom:
context
,
);
);
...
...
lib/ui/home/menu_list_utama.dart
View file @
400dfcbf
...
@@ -446,7 +446,7 @@ class MenuListUtama extends StatelessWidget {
...
@@ -446,7 +446,7 @@ class MenuListUtama extends StatelessWidget {
initialValue:
initialValue
,
initialValue:
initialValue
,
orderVariants:
orderVariants
,
orderVariants:
orderVariants
,
menuItem:
menuUtama
,
menuItem:
menuUtama
,
lis
r
Orders:
list
,
lis
t
Orders:
list
,
from:
fromMenu
,
from:
fromMenu
,
contextFrom:
context
,
contextFrom:
context
,
);
);
...
...
lib/ui/viewbill/order_view_bill_new.dart
View file @
400dfcbf
...
@@ -369,7 +369,7 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
...
@@ -369,7 +369,7 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
description:
''
,
description:
''
,
groupName:
''
,
groupName:
''
,
groupId:
''
),
groupId:
''
),
lis
r
Orders:
const
[],
lis
t
Orders:
const
[],
from:
fromBill
,
from:
fromBill
,
idOrderan:
widget
.
billDetail
.
id
,
idOrderan:
widget
.
billDetail
.
id
,
contextFrom:
contextOrderViewBill
,
contextFrom:
contextOrderViewBill
,
...
...
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