Add designs templates
This commit is contained in:
parent
b83b2e4361
commit
2490e21207
|
|
@ -146,10 +146,9 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
||||||
final activitySelector =
|
final activitySelector =
|
||||||
_activityId == null || (kIsWeb && state.prefState.enableNativeBrowser)
|
_activityId == null || (kIsWeb && state.prefState.enableNativeBrowser)
|
||||||
? SizedBox()
|
? SizedBox()
|
||||||
: Padding(
|
: Expanded(
|
||||||
padding: const EdgeInsets.only(left: 17),
|
child: Padding(
|
||||||
child: SizedBox(
|
padding: const EdgeInsets.only(left: 17),
|
||||||
width: 350,
|
|
||||||
child: IgnorePointer(
|
child: IgnorePointer(
|
||||||
ignoring: _isLoading,
|
ignoring: _isLoading,
|
||||||
child: AppDropdownButton<String>(
|
child: AppDropdownButton<String>(
|
||||||
|
|
@ -183,10 +182,9 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
||||||
!hasDesignTemplatesForEntityType(
|
!hasDesignTemplatesForEntityType(
|
||||||
state.designState.map, invoice.entityType!)
|
state.designState.map, invoice.entityType!)
|
||||||
? SizedBox()
|
? SizedBox()
|
||||||
: Padding(
|
: Expanded(
|
||||||
padding: const EdgeInsets.only(left: 17),
|
child: Padding(
|
||||||
child: SizedBox(
|
padding: const EdgeInsets.only(left: 17),
|
||||||
width: 200,
|
|
||||||
child: IgnorePointer(
|
child: IgnorePointer(
|
||||||
ignoring: _isLoading,
|
ignoring: _isLoading,
|
||||||
child: DesignPicker(
|
child: DesignPicker(
|
||||||
|
|
@ -205,8 +203,7 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final deliveryNote = Container(
|
final deliveryNote = Flexible(
|
||||||
width: 200,
|
|
||||||
child: CheckboxListTile(
|
child: CheckboxListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
localization.deliveryNote,
|
localization.deliveryNote,
|
||||||
|
|
@ -277,35 +274,38 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
body: Column(children: [
|
body: Column(
|
||||||
Material(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
Material(
|
||||||
if (supportsDesignTemplates()) designSelector,
|
child: Row(
|
||||||
activitySelector,
|
children: [
|
||||||
if (invoice.isInvoice && _activityId == null) deliveryNote,
|
if (supportsDesignTemplates()) designSelector,
|
||||||
],
|
activitySelector,
|
||||||
|
if (invoice.isInvoice && _activityId == null) deliveryNote,
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: _isLoading || _response == null
|
||||||
child: _isLoading || _response == null
|
? LoadingIndicator()
|
||||||
? LoadingIndicator()
|
: (kIsWeb && state.prefState.enableNativeBrowser)
|
||||||
: (kIsWeb && state.prefState.enableNativeBrowser)
|
? HtmlElementView(viewType: _pdfString!)
|
||||||
? HtmlElementView(viewType: _pdfString!)
|
: PdfPreview(
|
||||||
: PdfPreview(
|
build: (format) => _response!.bodyBytes,
|
||||||
build: (format) => _response!.bodyBytes,
|
canChangeOrientation: false,
|
||||||
canChangeOrientation: false,
|
canChangePageFormat: false,
|
||||||
canChangePageFormat: false,
|
canDebug: false,
|
||||||
canDebug: false,
|
maxPageWidth: 600,
|
||||||
maxPageWidth: 600,
|
pdfFileName:
|
||||||
pdfFileName:
|
localization.lookup(invoice.entityType!.snakeCase) +
|
||||||
localization.lookup(invoice.entityType!.snakeCase) +
|
'_' +
|
||||||
'_' +
|
invoice.number +
|
||||||
invoice.number +
|
'.pdf',
|
||||||
'.pdf',
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
]),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue