Show PDF as route

This commit is contained in:
Hillel Coren 2021-01-19 11:49:15 +02:00
parent 65c290f5f2
commit 73996c68bc
1 changed files with 31 additions and 31 deletions

View File

@ -177,6 +177,32 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
Spacer(), 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( return Scaffold(
backgroundColor: Colors.grey, backgroundColor: Colors.grey,
appBar: widget.showAppBar appBar: widget.showAppBar
@ -185,39 +211,13 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
automaticallyImplyLeading: isMobile(context), automaticallyImplyLeading: isMobile(context),
title: Row( title: Row(
children: [ children: [
if (isDesktop(context)) ...[ Text(localization.lookup('${invoice.entityType}') +
Text(localization.lookup('${invoice.entityType}') + ' ' +
' ' + invoice.number),
(invoice.number ?? '')), Spacer(),
Spacer(),
],
if (isDesktop(context)) ...activitySelector, if (isDesktop(context)) ...activitySelector,
if (isDesktop(context)) ...pageSelector, if (isDesktop(context)) ...pageSelector,
Theme( if (isDesktop(context)) deliveryNote,
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,
),
),
),
], ],
), ),
actions: <Widget>[ actions: <Widget>[