flutter-freaccess-hub/lib/features/documents/document_screen_viewer.dart

47 lines
1.1 KiB
Dart

part of 'index.dart';
class DocumentViewScreen extends StatefulScreen {
const DocumentViewScreen({
super.key,
required this.doc,
required this.uri,
});
final Document doc;
final Uri uri;
@override
ScreenState<DocumentViewScreen> createState() => _DocumentViewScreenState();
}
class _DocumentViewScreenState extends ScreenState<DocumentViewScreen> {
@override
Widget build(BuildContext context) {
action() {
context.read<DocumentPageBloc>().add(UnselectDocumentEvent());
}
final String title = widget.doc.description;
final theme = FlutterFlowTheme.of(context);
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, result) => action(),
child: Scaffold(
backgroundColor: theme.primaryBackground,
appBar: buildAppBar(title, context, action),
body: buildBody(context),
),
);
}
Widget buildBody(BuildContext context) {
// final PDFViewerKey _viewerKey = PDFViewerKey();
return ReadView(
// search: _viewerKey,
title: widget.doc.description,
url: widget.uri.toString(),
);
}
}