From 2490e21207b2a3bd436f28d6f688eabb3f6ec0c7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 9 Nov 2023 14:59:08 +0200 Subject: [PATCH] Add designs templates --- lib/ui/invoice/invoice_pdf.dart | 76 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/ui/invoice/invoice_pdf.dart b/lib/ui/invoice/invoice_pdf.dart index 4befed785..b3f4d2ef1 100644 --- a/lib/ui/invoice/invoice_pdf.dart +++ b/lib/ui/invoice/invoice_pdf.dart @@ -146,10 +146,9 @@ class _InvoicePdfViewState extends State { final activitySelector = _activityId == null || (kIsWeb && state.prefState.enableNativeBrowser) ? SizedBox() - : Padding( - padding: const EdgeInsets.only(left: 17), - child: SizedBox( - width: 350, + : Expanded( + child: Padding( + padding: const EdgeInsets.only(left: 17), child: IgnorePointer( ignoring: _isLoading, child: AppDropdownButton( @@ -183,10 +182,9 @@ class _InvoicePdfViewState extends State { !hasDesignTemplatesForEntityType( state.designState.map, invoice.entityType!) ? SizedBox() - : Padding( - padding: const EdgeInsets.only(left: 17), - child: SizedBox( - width: 200, + : Expanded( + child: Padding( + padding: const EdgeInsets.only(left: 17), child: IgnorePointer( ignoring: _isLoading, child: DesignPicker( @@ -205,8 +203,7 @@ class _InvoicePdfViewState extends State { ), ); - final deliveryNote = Container( - width: 200, + final deliveryNote = Flexible( child: CheckboxListTile( title: Text( localization.deliveryNote, @@ -277,35 +274,38 @@ class _InvoicePdfViewState extends State { ], ) : null, - body: Column(children: [ - Material( - child: Row( - children: [ - if (supportsDesignTemplates()) designSelector, - activitySelector, - if (invoice.isInvoice && _activityId == null) deliveryNote, - ], + body: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Material( + child: Row( + children: [ + if (supportsDesignTemplates()) designSelector, + activitySelector, + if (invoice.isInvoice && _activityId == null) deliveryNote, + ], + ), ), - ), - Expanded( - child: _isLoading || _response == null - ? LoadingIndicator() - : (kIsWeb && state.prefState.enableNativeBrowser) - ? HtmlElementView(viewType: _pdfString!) - : PdfPreview( - build: (format) => _response!.bodyBytes, - canChangeOrientation: false, - canChangePageFormat: false, - canDebug: false, - maxPageWidth: 600, - pdfFileName: - localization.lookup(invoice.entityType!.snakeCase) + - '_' + - invoice.number + - '.pdf', - ), - ), - ]), + Expanded( + child: _isLoading || _response == null + ? LoadingIndicator() + : (kIsWeb && state.prefState.enableNativeBrowser) + ? HtmlElementView(viewType: _pdfString!) + : PdfPreview( + build: (format) => _response!.bodyBytes, + canChangeOrientation: false, + canChangePageFormat: false, + canDebug: false, + maxPageWidth: 600, + pdfFileName: + localization.lookup(invoice.entityType!.snakeCase) + + '_' + + invoice.number + + '.pdf', + ), + ), + ], + ), ); } }