null safety
This commit is contained in:
@@ -12,9 +12,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 Invoice? invoice;
|
||||
final bool? forCustomer;
|
||||
InvoiceListRow({Key? key, this.invoice, this.forCustomer}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -22,8 +22,8 @@ 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(
|
||||
@@ -48,17 +48,17 @@ class InvoiceListRow extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
invoice.invoiceNumber ?? "",
|
||||
invoice!.invoiceNumber ?? "",
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
new Text(
|
||||
invoice.status ?? "",
|
||||
invoice!.status ?? "",
|
||||
style: new TextStyle(
|
||||
fontSize: 13.0, color: primaryColor),
|
||||
),
|
||||
new Text(
|
||||
dateFormatter.format(invoice.invoiceDate),
|
||||
dateFormatter.format(invoice!.invoiceDate),
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
)
|
||||
@@ -70,7 +70,7 @@ class InvoiceListRow extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
invoice.status == invoice_issued_status
|
||||
invoice!.status == invoice_issued_status
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0),
|
||||
child: InkWell(
|
||||
|
||||
Reference in New Issue
Block a user