Last updated:
0 purchases
flutter file view
Flutter File View #
Language: 中文 | English
At present, the plugin is only used by Android, iOS.
Android is implemented by Tencent X5.
iOS is implemented by WKWebView.
✅ Supported file type #
Android docx,doc,xlsx,xls,pptx,ppt,pdf,txt
iOS docx,doc,xlsx,xls,pptx,ppt,pdf,txt
⏰ Init #
FlutterFileView.init();
copied to clipboard
💼 2.0.x -> 2.1.0 #
Outdated scheme. #
@override
Widget build(BuildContext context) {
return LocalFileViewer(filePath: localPath ?? '');
}
copied to clipboard
Current scheme. #
@override
Widget build(BuildContext context) {
return FileView(
controller: FileViewController.asset('assets/files/$filePath'),
);
}
copied to clipboard
There are still many usages of FileViewController at present, such as the representation of some states and so on.
📲 Use of third-party plugins #
Use dio to make network requests.
⏳ Preparing for use #
Version constraints #
sdk: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
copied to clipboard
Rely #
Add flutter_file_view to pubspec.yaml dependencies.
dependencies:
flutter_file_view: ^latest_version
copied to clipboard
Get the package by executing the flutter command.
flutter pub get
copied to clipboard
Introduce
import 'package:flutter_file_view/flutter_file_view.dart';
copied to clipboard
Localized configuration #
Add in MaterialApp.
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
...
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
...
ViewerLocalizationsDelegate.delegate,
],
...
);
}
}
copied to clipboard
🤖 Android #
Android P Unable to download kernel Solution #
Add a piece of code in label application on AndroidManifst.xml file
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
copied to clipboard
Add a file named network_security_config.xml in res/xml directory, The content of the file is
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
copied to clipboard
READ #
Subsequent TBS upgrades will not be performed. For details, see TBS-文档接口TbsReaderView接口问题说明
Not Support Google Play, Reason: Issues 1.11.
Running on Android emulator is not supported.
If you like my project, please in the upper right corner of the project "Star". Your support is my biggest encouragement! ^_^
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.