From 73996c68bcf50f08e99558fc70577958a30cfa7a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 19 Jan 2021 11:49:15 +0200 Subject: [PATCH] Show PDF as route --- lib/ui/invoice/invoice_pdf.dart | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/ui/invoice/invoice_pdf.dart b/lib/ui/invoice/invoice_pdf.dart index 40423ae2f..f2f3adb39 100644 --- a/lib/ui/invoice/invoice_pdf.dart +++ b/lib/ui/invoice/invoice_pdf.dart @@ -177,6 +177,32 @@ class _InvoicePdfViewState extends State { Spacer(), ]; + final deliveryNote = Theme( + data: ThemeData( + unselectedWidgetColor: state.headerTextColor, + ), + child: Container( + width: 200, + child: CheckboxListTile( + title: Text( + localization.deliveryNote, + style: TextStyle( + color: state.headerTextColor, + ), + ), + value: _isDeliveryNote, + onChanged: (value) { + setState(() { + _isDeliveryNote = !_isDeliveryNote; + loadPdf(); + }); + }, + controlAffinity: ListTileControlAffinity.leading, + activeColor: state.accentColor, + ), + ), + ); + return Scaffold( backgroundColor: Colors.grey, appBar: widget.showAppBar @@ -185,39 +211,13 @@ class _InvoicePdfViewState extends State { automaticallyImplyLeading: isMobile(context), title: Row( children: [ - if (isDesktop(context)) ...[ - Text(localization.lookup('${invoice.entityType}') + - ' ' + - (invoice.number ?? '')), - Spacer(), - ], + Text(localization.lookup('${invoice.entityType}') + + ' › ' + + invoice.number), + Spacer(), if (isDesktop(context)) ...activitySelector, if (isDesktop(context)) ...pageSelector, - Theme( - data: ThemeData( - unselectedWidgetColor: state.headerTextColor, - ), - child: Container( - width: 200, - child: CheckboxListTile( - title: Text( - localization.deliveryNote, - style: TextStyle( - color: state.headerTextColor, - ), - ), - value: _isDeliveryNote, - onChanged: (value) { - setState(() { - _isDeliveryNote = !_isDeliveryNote; - loadPdf(); - }); - }, - controlAffinity: ListTileControlAffinity.leading, - activeColor: state.accentColor, - ), - ), - ), + if (isDesktop(context)) deliveryNote, ], ), actions: [