Improve documents
This commit is contained in:
parent
7f6f92a517
commit
c50a6e5bae
|
|
@ -3,8 +3,11 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
// Project imports:
|
// Project imports:
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
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/app/view_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/document/view/document_view_vm.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 {
|
class DocumentView extends StatefulWidget {
|
||||||
const DocumentView({
|
const DocumentView({
|
||||||
|
|
@ -29,8 +32,24 @@ class _DocumentViewState extends State<DocumentView> {
|
||||||
return ViewScaffold(
|
return ViewScaffold(
|
||||||
isFilter: widget.isFilter,
|
isFilter: widget.isFilter,
|
||||||
entity: document,
|
entity: document,
|
||||||
body: FormCard(children: [
|
body: Column(children: [
|
||||||
Text('${document.data?.length ?? ''}'),
|
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