Improve documents
This commit is contained in:
parent
7f6f92a517
commit
c50a6e5bae
|
|
@ -3,8 +3,11 @@ import 'package:flutter/material.dart';
|
|||
|
||||
// Project imports:
|
||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/view_scaffold.dart';
|
||||
import 'package:invoiceninja_flutter/ui/document/view/document_view_vm.dart';
|
||||
import 'package:pinch_zoom/pinch_zoom.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
|
||||
class DocumentView extends StatefulWidget {
|
||||
const DocumentView({
|
||||
|
|
@ -29,8 +32,24 @@ class _DocumentViewState extends State<DocumentView> {
|
|||
return ViewScaffold(
|
||||
isFilter: widget.isFilter,
|
||||
entity: document,
|
||||
body: FormCard(children: [
|
||||
Text('${document.data?.length ?? ''}'),
|
||||
body: Column(children: [
|
||||
document.data == null
|
||||
? LoadingIndicator()
|
||||
: SizedBox(
|
||||
height: 600,
|
||||
child: document.isImage
|
||||
? PinchZoom(
|
||||
child: Image.memory(document.data),
|
||||
)
|
||||
: PdfPreview(
|
||||
build: (format) => document.data,
|
||||
canChangeOrientation: false,
|
||||
canChangePageFormat: false,
|
||||
allowPrinting: false,
|
||||
allowSharing: false,
|
||||
canDebug: false,
|
||||
),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue