Commit 427674c0 authored by Dio Maulana's avatar Dio Maulana

viewbill page

parent 9473759f
......@@ -771,6 +771,7 @@ class Api {
"service_tax": orderDetail[d]['service_tax'],
"order_status": orderDetail[d]['order_status'],
"notes": orderDetail[d]['notes'],
"image": orderDetail[d]['image_small'],
"variant": variants
};
bill[index].billDetail.add(BillDetail.createBillDetail(z));
......@@ -794,6 +795,7 @@ class Api {
"service_tax": orderDetail[d]['service_tax'],
"order_status": orderDetail[d]['order_status'],
"notes": orderDetail[d]['notes'],
"image": orderDetail[d]['image_small'],
"variant": variants
};
billDetail.add(BillDetail.createBillDetail(z));
......
import 'package:flutter_bloc/flutter_bloc.dart';
class SearchActive extends Cubit<bool> {
SearchActive() : super(false);
void searchClick(bool status) {
emit(!status);
}
}
......@@ -109,7 +109,6 @@ class SearchMenu extends Cubit<List<dynamic>> {
}
}
}
emit([searchMenu, categorySelected, isSearch]);
}
}
......@@ -245,14 +245,17 @@ double heightTombol = 0.06; // untuk dikalikan di height media query
//** core warna */
// const Color backgroundColor = Colors.white;
const Color backgroundColor = Color(0xffF4F4F4);
const Color backgroundWhite = Color(0xffFFFFFF);
const Color dividerGrey = Color(0xff898A8D);
const textColorTabel = Color(0xff333333);
const textColorBlack = Color(0xff000000);
const textColorRed = Color(0xffE73636);
const textColorPlaceHolder = Color(0xffA89C9C);
const textGrey = Color(0xffE0E0E0);
const textGreyBill = Color(0xff828282);
const textGreyDeskripsi = Color(0xffBDBDBD);
const backgroundColorBottomSheet = Color(0xffE5E5E5);
const textColorModalHeaderNama = Color(0xffCCCCFF);
const textColorModalHeaderNama = Color(0xff50555C);
const gridCardBackgroundColor = Color(0xffFFFFFF);
Color buttonColor =
(!isExcelso) ? const Color(0xff003366) : const Color(0xffccb46c);
......
import 'package:byod/helper/widget/style.dart';
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/order_bloc.dart';
import '../../models/filter_menu.dart';
import '../../models/order_variants.dart';
......@@ -9,23 +11,34 @@ import '../../models/orders.dart';
import '../helper.dart';
class NoteModalBottomSheet extends StatelessWidget {
const NoteModalBottomSheet({
NoteModalBottomSheet({
Key? key,
required this.noteController,
required this.initialValue,
required this.orderVariants,
required this.menuItem,
required this.lisrOrders,
required this.from,
this.idOrderan = '',
this.noteInit = '',
required this.contextFrom,
}) : super(key: key);
final TextEditingController noteController;
late TextEditingController noteController;
final int initialValue;
final List<OrderVariant> orderVariants;
final FilterMenu menuItem;
final List<Orders> lisrOrders;
final String from;
final String idOrderan;
final String noteInit;
final BuildContext contextFrom;
@override
Widget build(BuildContext context) {
if (from == fromBill) {
noteController = TextEditingController(text: noteInit);
}
return Container(
margin: const EdgeInsets.symmetric(horizontal: 20),
height: MediaQuery.of(context).size.height * 0.9,
......@@ -73,6 +86,7 @@ class NoteModalBottomSheet extends StatelessWidget {
),
GestureDetector(
onTap: () {
if (from == fromMenu) {
context.read<OrdersBloc>().insertData([
[
menuItem.id,
......@@ -86,6 +100,16 @@ class NoteModalBottomSheet extends StatelessWidget {
noteController.text
]
], context);
} else if (from == fromBill) {
if (idOrderan != '') {
Api.changeOrderDetail(
contextFrom,
idOrderan,
initialValue,
noteController.text,
);
}
}
Navigator.pop(context);
},
child: Align(
......
......@@ -33,6 +33,64 @@ TextStyle appBarNameVariant({font = 17, Color color = textColorBlack}) {
);
}
TextStyle appBarNameViewBill({font = 17, Color color = textColorBlack}) {
return TextStyle(
fontFamily: 'Mulish',
fontSize: font,
fontWeight: FontWeight.w700,
color: color,
);
}
TextStyle menuNameListViewBill({font = 17, Color color = textColorBlack}) {
return TextStyle(
fontFamily: 'Mulish',
fontSize: font,
fontWeight: FontWeight.w700,
color: color,
);
}
TextStyle descriptionListViewBill(
{font = 14, Color color = textColorPlaceHolder}) {
return TextStyle(
fontFamily: 'Mulish',
fontSize: font,
fontWeight: FontWeight.w400,
color: color,
);
}
TextStyle viewbillStyle(
{font = 16,
Color color = textColorBlack,
FontWeight fontWeight = FontWeight.w400}) {
return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily,
fontSize: font,
fontWeight: fontWeight,
color: color,
);
}
TextStyle customerNameViewbill({font = 14, Color color = textColorBlack}) {
return TextStyle(
fontFamily: 'OpenSans',
fontSize: font,
fontWeight: FontWeight.w400,
color: color,
);
}
TextStyle noteViewBill({font = 8, Color color = textColorBlack}) {
return TextStyle(
fontFamily: 'OpenSans',
fontSize: font,
fontWeight: FontWeight.w400,
color: color,
);
}
TextStyle tableNameStyle({font = 20, Color color = textColorTabel}) {
return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily,
......@@ -71,7 +129,7 @@ TextStyle menuNameGridFav(
}
TextStyle menuPriceGridFav({
font = 8,
font = 10,
Color color = textColorBlack,
}) {
return TextStyle(
......@@ -106,6 +164,18 @@ TextStyle amountGridFav({
);
}
TextStyle amountViewBillButton({
font = 17,
Color color = textColorBlack,
}) {
return TextStyle(
fontFamily: 'Mulish',
fontSize: font,
fontWeight: FontWeight.w400,
color: color,
);
}
TextStyle categoryStyle({
font = 14,
Color color = textColorBlack,
......@@ -179,7 +249,7 @@ TextStyle amountMenuStyle({
);
}
TextStyle addButtonMenu({
TextStyle addButton({
font = 12,
Color color = textInButton,
}) {
......@@ -191,6 +261,18 @@ TextStyle addButtonMenu({
);
}
TextStyle rincianPembayaran(
{font = 12,
Color color = textColorBlack,
FontWeight fontWeight = FontWeight.w400}) {
return TextStyle(
fontFamily: 'OpenSans',
fontSize: font,
fontWeight: fontWeight,
color: color,
);
}
TextStyle addButtonBottomCart({
font = 16,
Color color = textInButton,
......
......@@ -27,6 +27,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/search_active.dart';
import 'bloc/view_bill.dart';
import 'package:flutter/services.dart' as bundle_root;
......@@ -156,6 +157,7 @@ class MyApp extends StatelessWidget {
BlocProvider(create: (_) => VoucherListBloc()),
BlocProvider(create: (_) => FavSelectedBar()),
BlocProvider(create: (_) => MenuSelectedBar()),
BlocProvider(create: (_) => SearchActive()),
],
child: MaterialApp(
title: (title == null) ? defaultTitle : title,
......
......@@ -10,6 +10,7 @@ class BillDetail {
String serviceTax;
int orderStatus;
String notes;
String imageUrl;
// int paidStatus;
List<String> variant;
......@@ -25,6 +26,7 @@ class BillDetail {
required this.serviceTax,
required this.orderStatus,
required this.notes,
required this.imageUrl,
// required this.paidStatus,
this.variant = const []});
......@@ -41,6 +43,7 @@ class BillDetail {
serviceTax: json['service_tax'],
orderStatus: json['order_status'],
notes: json['notes'],
imageUrl: json['image'] ?? '',
// paidStatus: json['paid_status'],
variant: json['variant']);
}
......
......@@ -222,7 +222,7 @@ class _ShowMenuModalState extends State<ShowMenuModal> {
child: defaultText(
context,
'Tambah',
style: addButtonMenu(),
style: addButton(),
),
),
),
......
......@@ -5,6 +5,7 @@ import 'package:byod/models/fav_group.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../bloc/search_active.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
import '../../models/category_list.dart';
......@@ -45,6 +46,7 @@ class _CategoryListHomeState extends State<CategoryListHome> {
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
context.read<SearchActive>().searchClick(true);
context
.read<MenuSelectedBar>()
.selectedBarMenu(i, widget.categoryList[i].id);
......@@ -81,7 +83,8 @@ class _CategoryListHomeState extends State<CategoryListHome> {
margin: const EdgeInsets.only(top: 27),
width: 30,
height: 1,
color: buttonColor)
color: buttonColor,
)
: const SizedBox(
key: Key('underline'),
),
......
......@@ -112,10 +112,6 @@ class FavGridMenu extends StatelessWidget {
width: widthGrid - (2 * paddingLeftRigthGrid),
height: 28,
// color: Colors.blue,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: defaultText(
context,
categoryFavAfterSelect[i].name,
......@@ -123,9 +119,39 @@ class FavGridMenu extends StatelessWidget {
overFlow: TextOverflow.ellipsis,
style: menuNameGridFav(),
),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Expanded(
// child: defaultText(
// context,
// categoryFavAfterSelect[i].name,
// maxLines: 2,
// overFlow: TextOverflow.ellipsis,
// style: menuNameGridFav(),
// ),
// ),
// Container(
// width: 40,
// child: defaultText(
// context,
// 'Rp ${formatNumber().format(amountParseToInt(categoryFavAfterSelect[i].price))}',
// maxLines: 3,
// overFlow: TextOverflow.ellipsis,
// style: menuPriceGridFav(),
// ),
// )
// ],
// ),
),
const SizedBox(
height: 4,
),
Container(
width: 40,
width: widthGrid - (2 * paddingLeftRigthGrid),
height: 20,
child: Align(
alignment: Alignment.centerRight,
child: defaultText(
context,
'Rp ${formatNumber().format(amountParseToInt(categoryFavAfterSelect[i].price))}',
......@@ -133,13 +159,8 @@ class FavGridMenu extends StatelessWidget {
overFlow: TextOverflow.ellipsis,
style: menuPriceGridFav(),
),
)
],
),
),
const SizedBox(
height: 16,
),
addRemoveQuantity(context, categoryFavAfterSelect[i])
],
),
......@@ -303,6 +324,8 @@ class FavGridMenu extends StatelessWidget {
orderVariants: orderVariants,
menuItem: menuFav,
lisrOrders: list,
from: fromMenu,
contextFrom: context,
);
},
);
......
// ignore_for_file: must_be_immutable
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
......
......@@ -232,37 +232,38 @@ class MenuListUtama extends StatelessWidget {
1,
[],
); // check pada bloc untuk mengethui list arraynya
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => VariantCat(
// namaMenu: menuUtama.name,
// variantCategories:
// menuUtama.variantCat,
// initPrice: amountParseToInt(
// menuUtama.price),
// idItem: menuUtama.id,
// imageUrl:
// menuUtama.imageUrlThumbnail,
// listCurrentOrder: list,
// orderDetail: OrderDetail(
// allIdVariant: '',
// totalItem: 0,
// totalHarga: 0,
// note: '',
// orderVariant: [],
// ),
// )));
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => VariantCatNew(
builder: (_) => VariantCat(
namaMenu: menuUtama.name,
variantCategories: menuUtama.variantCat,
initPrice:
amountParseToInt(menuUtama.price),
variantCategories: menuUtama.variantCat,
idItem: menuUtama.id,
imageUrl: menuUtama.imageUrlThumbnail,
listCurrentOrder: list,
orderDetail: OrderDetail(
allIdVariant: '',
totalItem: 0,
totalHarga: 0,
note: '',
orderVariant: [],
),
),
),
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => VariantCatNew(
// initPrice:
// amountParseToInt(menuUtama.price),
// variantCategories: menuUtama.variantCat,
// namaMenu: menuUtama.name,
// ),
// ),
// );
} else {
showModalBottomSheet(
backgroundColor: Colors.white.withOpacity(0),
......@@ -316,7 +317,7 @@ class MenuListUtama extends StatelessWidget {
menuUtama.variantCat.isNotEmpty)
? variantButtonCount
: 'Tambah',
style: addButtonMenu(),
style: addButton(),
),
),
),
......@@ -348,6 +349,8 @@ class MenuListUtama extends StatelessWidget {
orderVariants: orderVariants,
menuItem: menuUtama,
lisrOrders: list,
from: fromMenu,
contextFrom: context,
);
},
);
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,10 +14,12 @@ import '../../models/variant_categories.dart';
class VariantCatNew extends StatefulWidget {
final List<VariantCategories> variantCategories;
final int initPrice;
final String namaMenu;
const VariantCatNew({
Key? key,
required this.variantCategories,
required this.initPrice,
required this.namaMenu,
}) : super(key: key);
@override
......@@ -88,7 +90,9 @@ class _VariantCatNewState extends State<VariantCatNew> {
Center(
child: defaultText(
context,
'Custom Pesanan',
widget.namaMenu,
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: appBarNameVariant(),
),
),
......
......@@ -14,7 +14,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import '../bloc/branch_exist.dart';
import '../main.dart';
import 'package:flutter/services.dart' as bundle_root;
import 'home/new_home.dart';
import 'home/new_home2.dart';
import 'home/shimmer_menu.dart';
import 'screen_responsive.dart';
......
// ignore_for_file: sized_box_for_whitespace
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../bloc/branch_exist.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
import '../../main.dart';
import '../home/new_home2.dart';
class CustomAppBar extends StatelessWidget {
const CustomAppBar({
Key? key,
required this.isHistory,
}) : super(key: key);
final bool isHistory;
@override
Widget build(BuildContext context) {
String branchCode = prefs.getString('outlet') ?? '';
String brandCode = prefs.getString('brand') ?? '';
String role = prefs.getString('role') ?? '';
String cashierName = prefs.getString('cashier_name') ?? '';
String sessionId = prefs.getString('sessionId') ?? '';
return Container(
margin: const EdgeInsets.only(
top: 15,
bottom: 30,
),
padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
if (!isHistory) {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (_) => const NewHome2()));
context.read<BranchExist>().branchExist(
branchCode, brandCode, role, cashierName, sessionId);
} else {
Navigator.pop(context);
}
},
child: Container(
width: 24,
height: 24,
child: Center(
child: fontAwesomeNew(
arrowBack,
arrowBackSize,
),
),
),
),
const SizedBox(
width: 16,
),
Center(
child: defaultText(
context,
'Check-Out',
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: appBarNameViewBill(),
),
),
],
),
);
}
}
// ignore_for_file: sized_box_for_whitespace
import 'package:flutter/material.dart';
import '../../models/bill_detail.dart';
import 'order_view_bill_new.dart';
class ListOrder extends StatelessWidget {
const ListOrder({
Key? key,
required this.billDetail,
}) : super(key: key);
final List<BillDetail> billDetail;
@override
Widget build(BuildContext context) {
int itemCounts = billDetail.length;
return ListView.builder(
physics: const NeverScrollableScrollPhysics(), // to disable scrolling
shrinkWrap: true,
itemCount: itemCounts,
itemBuilder: (ctx, i) {
return OrderViewBillNew(
billDetail: billDetail[i],
lastItem: (i + 1 == itemCounts) ? true : false,
);
},
);
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
import '../../models/bill.dart';
class RincianPembayaran extends StatelessWidget {
const RincianPembayaran({
Key? key,
required this.dataBill,
required this.totalDiscount,
required this.outStandingAll,
}) : super(key: key);
final List<Bill> dataBill;
final int totalDiscount;
final int outStandingAll;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: paddingLeftRight,
vertical: 16,
),
height: 209,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
defaultText(
context,
'Rincian Pembayaran',
style: rincianPembayaran(font: 14),
),
const SizedBox(
height: 20,
),
const Divider(
thickness: 0.3,
color: dividerGrey,
),
Row(
children: [
defaultText(
context,
'Subtotal',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
const Spacer(),
defaultText(
context,
'Rp ${formatNumber().format(amountParseToInt(dataBill[0].subTotalSeluruhOrderan))}',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
],
),
const SizedBox(
height: 8,
),
Row(
children: [
defaultText(
context,
'Discount',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
const Spacer(),
defaultText(
context,
(totalDiscount == 0)
? '-'
: 'Rp ${formatNumber().format(totalDiscount)}',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
],
),
const SizedBox(
height: 8,
),
Row(
children: [
defaultText(
context,
'Total',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
const Spacer(),
defaultText(
context,
'Rp ${formatNumber().format(amountParseToInt(dataBill[0].totalSeluruhOrderan))}',
style: rincianPembayaran(
font: 12,
color: textGreyBill,
),
),
],
),
const SizedBox(
height: 8,
),
const Divider(
thickness: 0.3,
color: dividerGrey,
),
const SizedBox(
height: 8,
),
Row(
children: [
defaultText(
context,
'Unpaid',
style: rincianPembayaran(
font: 12,
),
),
const Spacer(),
defaultText(
context,
(outStandingAll == 0)
? '-'
: 'Rp ${formatNumber().format(outStandingAll)}',
style: rincianPembayaran(
font: 12,
),
),
],
),
],
),
);
}
}
This diff is collapsed.
......@@ -261,6 +261,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.3"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
scrollable_positioned_list:
dependency: "direct main"
description:
......@@ -336,6 +343,13 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
sliver_tools:
dependency: "direct main"
description:
name: sliver_tools
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.8"
source_span:
dependency: transitive
description:
......
......@@ -34,6 +34,7 @@ dependencies:
http: ^0.13.4
intl: ^0.17.0
loading_animations: ^2.2.0
pull_to_refresh: ^2.0.0
scrollable_positioned_list: ^0.3.4
shared_preferences: ^2.0.15
shimmer: ^2.0.0
......
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