flutter_filereader 2.2.0
flutter_filereader: ^2.2.0

Flutter Android iOS

A local file view widget,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

Flutter FileReader #

pub package

A local file view widget,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:

1.9.1

dependencies:
  flutter_filereader: ^1.0.0

1.12.x

dependencies:
  flutter_filereader: ^2.2.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

<key>io.flutter.embedded_views_preview</key><true/>

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});

  @override
  _FileReaderPageState createState() => _FileReaderPageState();
}

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

注意事项 #

  1. 之前版本不支持arm64,目前已经支持
  2. txt文档如果显示乱码,请将txt文档编码改成gbk
20
likes
80
pub points
84%
popularity

A local file view widget,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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

shingohujk@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_filereader