flutter_filereader 2.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

Flutter FileReader #

pub package

A local file reader tool,Support a variety of file types, such as Doc Eexcl PPT TXT and so on,Android is implemented by tencent x5,iOS is implemented by WKWebView #

Depend on it #

Add this to your package's pubspec.yaml file:

  flutter_filereader: ^1.0.0

Support File Type #

  • IOS docx,doc,xlsx,xls,pptx,ppt,pdf,txt,jpg,jpeg,png
  • Android docx,doc,xlsx,xls,pptx,ppt,pdf,txt

Usage #

iOS #

Make sure you add the following key to Info.plist for iOS


Example #

import 'package:flutter/material.dart';
import 'package:flutter_filereader/flutter_filereader.dart';

class FileReaderPage extends StatefulWidget {
  final String filePath;

  FileReaderPage({Key: Key, this.filePath});

  _FileReaderPageState createState() => _FileReaderPageState();

class _FileReaderPageState extends State<FileReaderPage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("doc"),
      body: FileReaderView(
        filePath: widget.filePath,

注意事项 #

  1. Android端不支持x86和64位arm(x5不支持),解决办法参考x5如何支持64位手机
  2. 因为问题1,所以在debug模式下,64位机器会显示x5内核加载不成功。主要是debug模式下,Flutter引擎会根据连接的机器打入对应的库,一但包含有arm-v8a,则无法加载x5内核所需的so库
  3. 因为问题1,demo在64位机器上以Fluter项目模式运行或者flutter run会闪退。可以使用Android项目模式下直接运行
  4. 为什么我本地Debug包可以正常加载内核,但是release包不可以?参考x5混淆
  5. 暫時不支持Android Q(还未测试,x5内核说还未支持)
  6. txt文档如果显示乱码,请将txt文档编码改成gbk

2.0.0 #

  • 插件支持1.12.x方式加载

1.0.0 #

  • 本地文件浏览的工具
  • IOS支持文件类型docx,doc,xlsx,xls,pptx,ppt,pdf,txt,jpg,jpeg,png
  • Android支持文件类型docx,doc,xlsx,xls,pptx,ppt,pdf,txt


flutter_filereader_example #

Getting Started #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_filereader: ^2.0.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_filereader/flutter_filereader.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/filereader.dart.

Run flutter format to format lib/filereader.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies