add pagination for invoice and update ui for material 3

This commit is contained in:
tzw
2024-01-26 16:56:20 +06:30
parent 93a5fe071a
commit 8d0f712bf4
32 changed files with 351 additions and 635 deletions

View File

@@ -13,8 +13,9 @@ import '../widgets/pdf_screen.dart';
class InvoiceListRow extends StatelessWidget {
final dateFormatter = new DateFormat('dd MMM yyyy');
final Invoice? invoice;
final bool? forCustomer;
InvoiceListRow({Key? key, this.invoice, this.forCustomer}) : super(key: key);
final bool isCustomer;
InvoiceListRow({Key? key, this.invoice, required this.isCustomer})
: super(key: key);
@override
Widget build(BuildContext context) {
@@ -22,9 +23,7 @@ class InvoiceListRow extends StatelessWidget {
onTap: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => PDFScreen(
title: invoice!.invoiceNumber,
url: invoice!.invoiceURL,
)));
title: invoice!.invoiceNumber, url: invoice!.invoiceURL)));
},
child: Row(
children: <Widget>[
@@ -55,7 +54,7 @@ class InvoiceListRow extends StatelessWidget {
new Text(
invoice!.status ?? "",
style: new TextStyle(
fontSize: 13.0, color: primaryColor),
fontSize: 15.0, color: primaryColor),
),
new Text(
invoice!.invoiceDate != null
@@ -76,28 +75,25 @@ class InvoiceListRow extends StatelessWidget {
? Padding(
padding: const EdgeInsets.only(left: 10.0),
child: InkWell(
child: ElevatedButton(
child: Row(
children: <Widget>[
Icon(
Icons.payment,
color: primaryColor,
),
Padding(
padding: const EdgeInsets.only(left: 3.0),
child: Text(
"Payment",
style: TextStyle(fontSize: 12, color: Colors.black),
),
)
],
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(5))),
elevation: 0,
backgroundColor: Colors.grey.shade300),
icon: Icon(
Icons.payment,
color: primaryColor,
),
label: Padding(
padding: const EdgeInsets.only(left: 3.0),
child: Text("Payment",
style:
TextStyle(fontSize: 12, color: Colors.black))),
onPressed: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => PaymentPage(
invoice: invoice,
forCustomer: forCustomer,
)));
invoice: invoice, forCustomer: isCustomer)));
},
)),
)
@@ -141,7 +137,7 @@ class InvoiceListRow extends StatelessWidget {
Navigator.pop(context);
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) =>
InvoiceInfo(invoice: invoice, forCustomer: forCustomer)));
InvoiceInfo(invoice: invoice, forCustomer: isCustomer)));
},
),
CupertinoActionSheetAction(
@@ -162,7 +158,7 @@ class InvoiceListRow extends StatelessWidget {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => PaymentPage(
invoice: invoice,
forCustomer: forCustomer,
forCustomer: isCustomer,
)));
},
)