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

viewbill page

parent 9473759f
...@@ -771,6 +771,7 @@ class Api { ...@@ -771,6 +771,7 @@ class Api {
"service_tax": orderDetail[d]['service_tax'], "service_tax": orderDetail[d]['service_tax'],
"order_status": orderDetail[d]['order_status'], "order_status": orderDetail[d]['order_status'],
"notes": orderDetail[d]['notes'], "notes": orderDetail[d]['notes'],
"image": orderDetail[d]['image_small'],
"variant": variants "variant": variants
}; };
bill[index].billDetail.add(BillDetail.createBillDetail(z)); bill[index].billDetail.add(BillDetail.createBillDetail(z));
...@@ -794,6 +795,7 @@ class Api { ...@@ -794,6 +795,7 @@ class Api {
"service_tax": orderDetail[d]['service_tax'], "service_tax": orderDetail[d]['service_tax'],
"order_status": orderDetail[d]['order_status'], "order_status": orderDetail[d]['order_status'],
"notes": orderDetail[d]['notes'], "notes": orderDetail[d]['notes'],
"image": orderDetail[d]['image_small'],
"variant": variants "variant": variants
}; };
billDetail.add(BillDetail.createBillDetail(z)); 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>> { ...@@ -109,7 +109,6 @@ class SearchMenu extends Cubit<List<dynamic>> {
} }
} }
} }
emit([searchMenu, categorySelected, isSearch]); emit([searchMenu, categorySelected, isSearch]);
} }
} }
...@@ -245,14 +245,17 @@ double heightTombol = 0.06; // untuk dikalikan di height media query ...@@ -245,14 +245,17 @@ double heightTombol = 0.06; // untuk dikalikan di height media query
//** core warna */ //** core warna */
// const Color backgroundColor = Colors.white; // const Color backgroundColor = Colors.white;
const Color backgroundColor = Color(0xffF4F4F4); const Color backgroundColor = Color(0xffF4F4F4);
const Color backgroundWhite = Color(0xffFFFFFF);
const Color dividerGrey = Color(0xff898A8D);
const textColorTabel = Color(0xff333333); const textColorTabel = Color(0xff333333);
const textColorBlack = Color(0xff000000); const textColorBlack = Color(0xff000000);
const textColorRed = Color(0xffE73636); const textColorRed = Color(0xffE73636);
const textColorPlaceHolder = Color(0xffA89C9C); const textColorPlaceHolder = Color(0xffA89C9C);
const textGrey = Color(0xffE0E0E0); const textGrey = Color(0xffE0E0E0);
const textGreyBill = Color(0xff828282);
const textGreyDeskripsi = Color(0xffBDBDBD); const textGreyDeskripsi = Color(0xffBDBDBD);
const backgroundColorBottomSheet = Color(0xffE5E5E5); const backgroundColorBottomSheet = Color(0xffE5E5E5);
const textColorModalHeaderNama = Color(0xffCCCCFF); const textColorModalHeaderNama = Color(0xff50555C);
const gridCardBackgroundColor = Color(0xffFFFFFF); const gridCardBackgroundColor = Color(0xffFFFFFF);
Color buttonColor = Color buttonColor =
(!isExcelso) ? const Color(0xff003366) : const Color(0xffccb46c); (!isExcelso) ? const Color(0xff003366) : const Color(0xffccb46c);
......
import 'package:byod/helper/widget/style.dart'; import 'package:byod/helper/widget/style.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';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import '../../api/api.dart';
import '../../bloc/order_bloc.dart'; import '../../bloc/order_bloc.dart';
import '../../models/filter_menu.dart'; import '../../models/filter_menu.dart';
import '../../models/order_variants.dart'; import '../../models/order_variants.dart';
...@@ -9,23 +11,34 @@ import '../../models/orders.dart'; ...@@ -9,23 +11,34 @@ import '../../models/orders.dart';
import '../helper.dart'; import '../helper.dart';
class NoteModalBottomSheet extends StatelessWidget { class NoteModalBottomSheet extends StatelessWidget {
const NoteModalBottomSheet({ NoteModalBottomSheet({
Key? key, Key? key,
required this.noteController, required this.noteController,
required this.initialValue, required this.initialValue,
required this.orderVariants, required this.orderVariants,
required this.menuItem, required this.menuItem,
required this.lisrOrders, required this.lisrOrders,
required this.from,
this.idOrderan = '',
this.noteInit = '',
required this.contextFrom,
}) : super(key: key); }) : super(key: key);
final 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> lisrOrders; final List<Orders> lisrOrders;
final String from;
final String idOrderan;
final String noteInit;
final BuildContext contextFrom;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (from == fromBill) {
noteController = TextEditingController(text: noteInit);
}
return Container( return Container(
margin: const EdgeInsets.symmetric(horizontal: 20), margin: const EdgeInsets.symmetric(horizontal: 20),
height: MediaQuery.of(context).size.height * 0.9, height: MediaQuery.of(context).size.height * 0.9,
...@@ -73,19 +86,30 @@ class NoteModalBottomSheet extends StatelessWidget { ...@@ -73,19 +86,30 @@ class NoteModalBottomSheet extends StatelessWidget {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
context.read<OrdersBloc>().insertData([ if (from == fromMenu) {
[ context.read<OrdersBloc>().insertData([
menuItem.id, [
menuItem.name, menuItem.id,
initialValue, menuItem.name,
amountParseToInt(menuItem.price), initialValue,
lisrOrders, amountParseToInt(menuItem.price),
menuItem.imageUrlMedium, lisrOrders,
orderVariants, menuItem.imageUrlMedium,
amountParseToInt(menuItem.price), orderVariants,
noteController.text amountParseToInt(menuItem.price),
] noteController.text
], context); ]
], context);
} else if (from == fromBill) {
if (idOrderan != '') {
Api.changeOrderDetail(
contextFrom,
idOrderan,
initialValue,
noteController.text,
);
}
}
Navigator.pop(context); Navigator.pop(context);
}, },
child: Align( child: Align(
......
...@@ -33,6 +33,64 @@ TextStyle appBarNameVariant({font = 17, Color color = textColorBlack}) { ...@@ -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}) { TextStyle tableNameStyle({font = 20, Color color = textColorTabel}) {
return TextStyle( return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily, fontFamily: (fontFamily == '') ? null : fontFamily,
...@@ -71,7 +129,7 @@ TextStyle menuNameGridFav( ...@@ -71,7 +129,7 @@ TextStyle menuNameGridFav(
} }
TextStyle menuPriceGridFav({ TextStyle menuPriceGridFav({
font = 8, font = 10,
Color color = textColorBlack, Color color = textColorBlack,
}) { }) {
return TextStyle( return TextStyle(
...@@ -106,6 +164,18 @@ TextStyle amountGridFav({ ...@@ -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({ TextStyle categoryStyle({
font = 14, font = 14,
Color color = textColorBlack, Color color = textColorBlack,
...@@ -179,7 +249,7 @@ TextStyle amountMenuStyle({ ...@@ -179,7 +249,7 @@ TextStyle amountMenuStyle({
); );
} }
TextStyle addButtonMenu({ TextStyle addButton({
font = 12, font = 12,
Color color = textInButton, Color color = textInButton,
}) { }) {
...@@ -191,6 +261,18 @@ TextStyle addButtonMenu({ ...@@ -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({ TextStyle addButtonBottomCart({
font = 16, font = 16,
Color color = textInButton, Color color = textInButton,
......
...@@ -27,6 +27,7 @@ import 'bloc/menu_selected_bar.dart'; ...@@ -27,6 +27,7 @@ import 'bloc/menu_selected_bar.dart';
import 'bloc/order_detail_variant.dart'; import 'bloc/order_detail_variant.dart';
import 'bloc/order_variant_temporary.dart'; import 'bloc/order_variant_temporary.dart';
import 'bloc/order_variant_value.dart'; import 'bloc/order_variant_value.dart';
import 'bloc/search_active.dart';
import 'bloc/view_bill.dart'; import 'bloc/view_bill.dart';
import 'package:flutter/services.dart' as bundle_root; import 'package:flutter/services.dart' as bundle_root;
...@@ -156,6 +157,7 @@ class MyApp extends StatelessWidget { ...@@ -156,6 +157,7 @@ class MyApp extends StatelessWidget {
BlocProvider(create: (_) => VoucherListBloc()), BlocProvider(create: (_) => VoucherListBloc()),
BlocProvider(create: (_) => FavSelectedBar()), BlocProvider(create: (_) => FavSelectedBar()),
BlocProvider(create: (_) => MenuSelectedBar()), BlocProvider(create: (_) => MenuSelectedBar()),
BlocProvider(create: (_) => SearchActive()),
], ],
child: MaterialApp( child: MaterialApp(
title: (title == null) ? defaultTitle : title, title: (title == null) ? defaultTitle : title,
......
...@@ -10,6 +10,7 @@ class BillDetail { ...@@ -10,6 +10,7 @@ class BillDetail {
String serviceTax; String serviceTax;
int orderStatus; int orderStatus;
String notes; String notes;
String imageUrl;
// int paidStatus; // int paidStatus;
List<String> variant; List<String> variant;
...@@ -25,6 +26,7 @@ class BillDetail { ...@@ -25,6 +26,7 @@ class BillDetail {
required this.serviceTax, required this.serviceTax,
required this.orderStatus, required this.orderStatus,
required this.notes, required this.notes,
required this.imageUrl,
// required this.paidStatus, // required this.paidStatus,
this.variant = const []}); this.variant = const []});
...@@ -41,6 +43,7 @@ class BillDetail { ...@@ -41,6 +43,7 @@ class BillDetail {
serviceTax: json['service_tax'], serviceTax: json['service_tax'],
orderStatus: json['order_status'], orderStatus: json['order_status'],
notes: json['notes'], notes: json['notes'],
imageUrl: json['image'] ?? '',
// paidStatus: json['paid_status'], // paidStatus: json['paid_status'],
variant: json['variant']); variant: json['variant']);
} }
......
...@@ -222,7 +222,7 @@ class _ShowMenuModalState extends State<ShowMenuModal> { ...@@ -222,7 +222,7 @@ class _ShowMenuModalState extends State<ShowMenuModal> {
child: defaultText( child: defaultText(
context, context,
'Tambah', 'Tambah',
style: addButtonMenu(), style: addButton(),
), ),
), ),
), ),
......
...@@ -5,6 +5,7 @@ import 'package:byod/models/fav_group.dart'; ...@@ -5,6 +5,7 @@ import 'package:byod/models/fav_group.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';
import '../../bloc/search_active.dart';
import '../../helper/helper.dart'; import '../../helper/helper.dart';
import '../../helper/widget/style.dart'; import '../../helper/widget/style.dart';
import '../../models/category_list.dart'; import '../../models/category_list.dart';
...@@ -45,6 +46,7 @@ class _CategoryListHomeState extends State<CategoryListHome> { ...@@ -45,6 +46,7 @@ class _CategoryListHomeState extends State<CategoryListHome> {
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
context.read<SearchActive>().searchClick(true);
context context
.read<MenuSelectedBar>() .read<MenuSelectedBar>()
.selectedBarMenu(i, widget.categoryList[i].id); .selectedBarMenu(i, widget.categoryList[i].id);
...@@ -81,7 +83,8 @@ class _CategoryListHomeState extends State<CategoryListHome> { ...@@ -81,7 +83,8 @@ class _CategoryListHomeState extends State<CategoryListHome> {
margin: const EdgeInsets.only(top: 27), margin: const EdgeInsets.only(top: 27),
width: 30, width: 30,
height: 1, height: 1,
color: buttonColor) color: buttonColor,
)
: const SizedBox( : const SizedBox(
key: Key('underline'), key: Key('underline'),
), ),
......
...@@ -112,33 +112,54 @@ class FavGridMenu extends StatelessWidget { ...@@ -112,33 +112,54 @@ class FavGridMenu extends StatelessWidget {
width: widthGrid - (2 * paddingLeftRigthGrid), width: widthGrid - (2 * paddingLeftRigthGrid),
height: 28, height: 28,
// color: Colors.blue, // color: Colors.blue,
child: Row( child: defaultText(
crossAxisAlignment: CrossAxisAlignment.end, context,
children: [ categoryFavAfterSelect[i].name,
Expanded( maxLines: 2,
child: defaultText( overFlow: TextOverflow.ellipsis,
context, style: menuNameGridFav(),
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(),
),
)
],
), ),
// 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( const SizedBox(
height: 16, height: 4,
),
Container(
width: widthGrid - (2 * paddingLeftRigthGrid),
height: 20,
child: Align(
alignment: Alignment.centerRight,
child: defaultText(
context,
'Rp ${formatNumber().format(amountParseToInt(categoryFavAfterSelect[i].price))}',
maxLines: 3,
overFlow: TextOverflow.ellipsis,
style: menuPriceGridFav(),
),
),
), ),
addRemoveQuantity(context, categoryFavAfterSelect[i]) addRemoveQuantity(context, categoryFavAfterSelect[i])
], ],
...@@ -303,6 +324,8 @@ class FavGridMenu extends StatelessWidget { ...@@ -303,6 +324,8 @@ class FavGridMenu extends StatelessWidget {
orderVariants: orderVariants, orderVariants: orderVariants,
menuItem: menuFav, menuItem: menuFav,
lisrOrders: list, lisrOrders: list,
from: fromMenu,
contextFrom: context,
); );
}, },
); );
......
// ignore_for_file: must_be_immutable // ignore_for_file: must_be_immutable
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
......
...@@ -232,37 +232,38 @@ class MenuListUtama extends StatelessWidget { ...@@ -232,37 +232,38 @@ class MenuListUtama extends StatelessWidget {
1, 1,
[], [],
); // check pada bloc untuk mengethui list arraynya ); // 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( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (_) => VariantCatNew( builder: (_) => VariantCat(
namaMenu: menuUtama.name,
variantCategories: menuUtama.variantCat,
initPrice: initPrice:
amountParseToInt(menuUtama.price), 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 { } else {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white.withOpacity(0), backgroundColor: Colors.white.withOpacity(0),
...@@ -316,7 +317,7 @@ class MenuListUtama extends StatelessWidget { ...@@ -316,7 +317,7 @@ class MenuListUtama extends StatelessWidget {
menuUtama.variantCat.isNotEmpty) menuUtama.variantCat.isNotEmpty)
? variantButtonCount ? variantButtonCount
: 'Tambah', : 'Tambah',
style: addButtonMenu(), style: addButton(),
), ),
), ),
), ),
...@@ -348,6 +349,8 @@ class MenuListUtama extends StatelessWidget { ...@@ -348,6 +349,8 @@ class MenuListUtama extends StatelessWidget {
orderVariants: orderVariants, orderVariants: orderVariants,
menuItem: menuUtama, menuItem: menuUtama,
lisrOrders: list, lisrOrders: list,
from: fromMenu,
contextFrom: context,
); );
}, },
); );
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,10 +14,12 @@ import '../../models/variant_categories.dart'; ...@@ -14,10 +14,12 @@ import '../../models/variant_categories.dart';
class VariantCatNew extends StatefulWidget { class VariantCatNew extends StatefulWidget {
final List<VariantCategories> variantCategories; final List<VariantCategories> variantCategories;
final int initPrice; final int initPrice;
final String namaMenu;
const VariantCatNew({ const VariantCatNew({
Key? key, Key? key,
required this.variantCategories, required this.variantCategories,
required this.initPrice, required this.initPrice,
required this.namaMenu,
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -88,7 +90,9 @@ class _VariantCatNewState extends State<VariantCatNew> { ...@@ -88,7 +90,9 @@ class _VariantCatNewState extends State<VariantCatNew> {
Center( Center(
child: defaultText( child: defaultText(
context, context,
'Custom Pesanan', widget.namaMenu,
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: appBarNameVariant(), style: appBarNameVariant(),
), ),
), ),
......
...@@ -14,7 +14,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; ...@@ -14,7 +14,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import '../bloc/branch_exist.dart'; import '../bloc/branch_exist.dart';
import '../main.dart'; import '../main.dart';
import 'package:flutter/services.dart' as bundle_root; import 'package:flutter/services.dart' as bundle_root;
import 'home/new_home.dart';
import 'home/new_home2.dart'; import 'home/new_home2.dart';
import 'home/shimmer_menu.dart'; import 'home/shimmer_menu.dart';
import 'screen_responsive.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: ...@@ -261,6 +261,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.3" 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: scrollable_positioned_list:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -336,6 +343,13 @@ packages: ...@@ -336,6 +343,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" 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: source_span:
dependency: transitive dependency: transitive
description: description:
......
...@@ -34,6 +34,7 @@ dependencies: ...@@ -34,6 +34,7 @@ dependencies:
http: ^0.13.4 http: ^0.13.4
intl: ^0.17.0 intl: ^0.17.0
loading_animations: ^2.2.0 loading_animations: ^2.2.0
pull_to_refresh: ^2.0.0
scrollable_positioned_list: ^0.3.4 scrollable_positioned_list: ^0.3.4
shared_preferences: ^2.0.15 shared_preferences: ^2.0.15
shimmer: ^2.0.0 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