mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 06:08:04 -06:00
fix: Adapt to new provider strucutre
This commit is contained in:
@@ -2,8 +2,6 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:pdfx/pdfx.dart';
|
||||
|
||||
class DocumentView extends StatefulWidget {
|
||||
final Future<Uint8List> documentBytes;
|
||||
|
||||
@@ -17,36 +15,37 @@ class DocumentView extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DocumentViewState extends State<DocumentView> {
|
||||
late PdfController _pdfController;
|
||||
// late PdfController _pdfController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_pdfController = PdfController(
|
||||
document: PdfDocument.openData(
|
||||
widget.documentBytes,
|
||||
),
|
||||
);
|
||||
// _pdfController = PdfController(
|
||||
// document: PdfDocument.openData(
|
||||
// widget.documentBytes,
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context)!.preview),
|
||||
),
|
||||
body: PdfView(
|
||||
builders: PdfViewBuilders<DefaultBuilderOptions>(
|
||||
options: const DefaultBuilderOptions(
|
||||
loaderSwitchDuration: Duration(milliseconds: 500),
|
||||
),
|
||||
pageLoaderBuilder: (context) => const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
controller: _pdfController,
|
||||
),
|
||||
);
|
||||
return Container();
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: Text(S.of(context)!.preview),
|
||||
// ),
|
||||
// body: PdfView(
|
||||
// builders: PdfViewBuilders<DefaultBuilderOptions>(
|
||||
// options: const DefaultBuilderOptions(
|
||||
// loaderSwitchDuration: Duration(milliseconds: 500),
|
||||
// ),
|
||||
// pageLoaderBuilder: (context) => const Center(
|
||||
// child: CircularProgressIndicator(),
|
||||
// ),
|
||||
// ),
|
||||
// scrollDirection: Axis.vertical,
|
||||
// controller: _pdfController,
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user