FILE PREVIEWS. THE FLUTTER WAY.
File previews.
At home in your
Flutter app.
One Dart API for documents, spreadsheets, presentations and more. Bundled offline resources, with application-scoped warm-up for what comes next.
Flutter 3.47+ · Dart 3.13+ · No conversion server
BUILD SOMETHING THAT FITS.
The next document.
Inside your app.
Local rendering. Familiar controls. Ready to open.
FileViewer(source: document)</>A SMALL API. A COMPLETE START.
From dependency to document.
Configure the host once, then build with familiar Flutter widgets. Complete examples and platform details are in the docs.
Install from pub.dev
Matching assets and platform adapters arrive together.
dependencies:
file_viewer_flutter: 0.1.0-dev.1Warm up at the app root
Prepare after the first frame. Reuse sessions across routes.
runApp(
FileViewerHost(child: MyApp()),
);Put a preview on screen
Declare your document asset and give the viewer a bounded layout.
FileViewer(
source: FileViewerSource.asset(
'assets/report.pdf',
),
)YOUR DOCUMENTS. YOUR SOURCES.
Your documents.
Your choice of source.
An application asset, a device file, bytes in memory, or an authenticated endpoint. One component handles the source while paths and credentials stay in Dart.
Explore document sourcesWeb cannot access arbitrary native paths. Remote URLs still need a network and applicable CORS permissions.
const source = FileViewerSource.asset(
'assets/report.pdf',
);
FileViewer(source: source)const source = FileViewerSource.file(
'/path/to/report.docx',
name: 'report.docx',
);
FileViewer(source: source)final source = FileViewerSource.bytes(
documentBytes,
name: 'report.xlsx',
);
FileViewer(source: source)final source = FileViewerSource.url(
Uri.parse('https://your-api.example/document'),
name: 'contract.pdf',
headers: {'Authorization': 'Bearer <token>'},
);
FileViewer(source: source)READY BEFORE THE NEXT ROUTE.
Prepare now.
Open on the next route.
The Host warms up after the first frame. Preload when the next document is known. Keep one released session so reopening can reuse its document and view state.
Understand warm-up and lifecycleFileViewerHostPrepare shell and modules after the first frame
warmUp()A known upcoming documentOptionally parse ahead with matching source and options
preload()Leave and returnKeep at most one idle session; release it under memory pressure
reuseWarm-up readiness and first visible content are different. Background retention remains subject to OS suspension and reclamation.
BUILD WITH A CLEAR SCOPE.
Know the scope before you ship.
This is a development preview under active qualification. Mobile uses system WebViews, desktop delivery follows each platform, and Workers, WASM, fonts and resources ship with the app.
View platform setup and measured scopeBundled assets; Windows / Linux engines prepared at build time.
Size, deployment and licensesYOUR NEXT PREVIEW STARTS HERE.