tp_open_file version: 10.0.9

Published 2023-05-22

n/a

sdk | dart flutter
repository | svn
platform | n/a
status | n/a
  • Readme
  • Changelog
  • Versions

open_filex

pub package

NOTICE: This package is forked from here to remove a dangerous permission in android

A plug-in that can call native APP to open files with string result in flutter, support iOS(DocumentInteraction) / android(intent) / PC(ffi) / web(dart:html)

Usage

To use this plugin, add open_filex as a dependency in your pubspec.yaml file.

dependencies:
  open_filex: ^lastVersion

Example

import 'package:open_filex/open_filex.dart';

OpenFilex.open("/sdcard/example.txt");
//OpenFilex.open("/sdcard/example.txt", type: "text/plain", uti: "public.plain-text");

Support

android

{
            {".3gp",    "video/3gpp"},
            {".torrent","application/x-bittorrent"},
            {".kml",    "application/vnd.google-earth.kml+xml"},
            {".gpx",    "application/gpx+xml"},
            {".csv",    "application/vnd.ms-excel"},
            {".apk",    "application/vnd.android.package-archive"},
            {".asf",    "video/x-ms-asf"},
            {".avi",    "video/x-msvideo"},
            {".bin",    "application/octet-stream"},
            {".bmp",    "image/bmp"},
            {".c",      "text/plain"},
            {".class",  "application/octet-stream"},
            {".conf",   "text/plain"},
            {".cpp",    "text/plain"},
            {".doc",    "application/msword"},
            {".docx",   "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
            {".xls",    "application/vnd.ms-excel"},
            {".xlsx",   "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
            {".exe",    "application/octet-stream"},
            {".gif",    "image/gif"},
            {".gtar",   "application/x-gtar"},
            {".gz",     "application/x-gzip"},
            {".h",      "text/plain"},
            {".htm",    "text/html"},
            {".html",   "text/html"},
            {".jar",    "application/java-archive"},
            {".java",   "text/plain"},
            {".jpeg",   "image/jpeg"},
            {".jpg",    "image/jpeg"},
            {".js",     "application/x-javascript"},
            {".log",    "text/plain"},
            {".m3u",    "audio/x-mpegurl"},
            {".m4a",    "audio/mp4a-latm"},
            {".m4b",    "audio/mp4a-latm"},
            {".m4p",    "audio/mp4a-latm"},
            {".m4u",    "video/vnd.mpegurl"},
            {".m4v",    "video/x-m4v"},
            {".mov",    "video/quicktime"},
            {".mp2",    "audio/x-mpeg"},
            {".mp3",    "audio/x-mpeg"},
            {".mp4",    "video/mp4"},
            {".mpc",    "application/vnd.mpohun.certificate"},
            {".mpe",    "video/mpeg"},
            {".mpeg",   "video/mpeg"},
            {".mpg",    "video/mpeg"},
            {".mpg4",   "video/mp4"},
            {".mpga",   "audio/mpeg"},
            {".msg",    "application/vnd.ms-outlook"},
            {".ogg",    "audio/ogg"},
            {".pdf",    "application/pdf"},
            {".png",    "image/png"},
            {".pps",    "application/vnd.ms-powerpoint"},
            {".ppt",    "application/vnd.ms-powerpoint"},
            {".pptx",   "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
            {".prop",   "text/plain"},
            {".rc",     "text/plain"},
            {".rmvb",   "audio/x-pn-realaudio"},
            {".rtf",    "application/rtf"},
            {".sh",     "text/plain"},
            {".tar",    "application/x-tar"},
            {".tgz",    "application/x-compressed"},
            {".txt",    "text/plain"},
            {".wav",    "audio/x-wav"},
            {".wma",    "audio/x-ms-wma"},
            {".wmv",    "audio/x-ms-wmv"},
            {".wps",    "application/vnd.ms-works"},
            {".xml",    "text/plain"},
            {".z",      "application/x-compress"},
            {".zip",    "application/x-zip-compressed"},
            {"",        "*/*"}
}

when Conflict with other plugins about FileProvider, add code below in your /android/app/src/main/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="xxx.xxx.xxxxx">
    <application>
        ...
        <provider
                android:name="androidx.core.content.FileProvider"
                android:authorities="${applicationId}.fileProvider"
                android:exported="false"
                android:grantUriPermissions="true"
                tools:replace="android:authorities">
            <meta-data
                    android:name="android.support.FILE_PROVIDER_PATHS"
                    android:resource="@xml/filepaths"
                    tools:replace="android:resource" />
        </provider>
    </application>
</manifest>

when Android dependency 'com.android.support:appcompat-v7' has different version for the compile error, add code below in your /android/build.gradle

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }
        }
    }
}

IOS with UTI (DocumentInteraction Auto)

{
            {".rtf",    "public.rtf"},
            {".txt",    "public.plain-text"},
            {".html",   "public.html"},
            {".htm",    "public.html"},
            {".xml",    "public.xml"},
            {".tar",    "public.tar-archive"},
            {".gz",     "org.gnu.gnu-zip-archive"},
            {".gzip",   "org.gnu.gnu-zip-archive"},
            {".tgz",    "org.gnu.gnu-zip-tar-archive"},
            {".jpg",    "public.jpeg"},
            {".jpeg",   "public.jpeg"},
            {".png",    "public.png"},
            {".avi",    "public.avi"},
            {".mpg",    "public.mpeg"},
            {".mpeg",   "public.mpeg"},
            {".mp4",    "public.mpeg-4"},
            {".3gpp",   "public.3gpp"},
            {".3gp",    "public.3gpp"},
            {".mp3",    "public.mp3"},
            {".zip",    "com.pkware.zip-archive"},
            {".gif",    "com.compuserve.gif"},
            {".bmp",    "com.microsoft.bmp"},
            {".ico",    "com.microsoft.ico"},
            {".doc",    "com.microsoft.word.doc"},
            {".xls",    "com.microsoft.excel.xls"},
            {".ppt",    "com.microsoft.powerpoint.​ppt"},
            {".wav",    "com.microsoft.waveform-​audio"},
            {".wm",     "com.microsoft.windows-​media-wm"},
            {".wmv",    "com.microsoft.windows-​media-wmv"},
            {".pdf",    "com.adobe.pdf"}
}

Changelog

10.0.9 - 2023-05-22

Changed

  • Version bump from 10.0.8 to 10.0.9.

10.0.8 - 2023-02-09

Changed

  • Version bump from 10.0.7 to 10.0.8 (Version confusion after compiler bug chaos).

10.0.7 - 2023-01-31

Changed

  • Version bump from 10.0.6 to 10.0.7.

10.0.6 - 2022-12-22

Changed

  • Version bump from 10.0.5 to 10.0.6.

10.0.5 - 2022-12-22

Changed

  • Version bump from 10.0.4 to 10.0.5 (Recompile due to installer optimizations).

10.0.4 - 2022-10-11

Changed

  • Version bump from 10.0.3 to 10.0.4 (Recompile due to wrong GetIt.instance syntax.).

10.0.3 - 2022-10-05

Changed

  • Version bump from 10.0.2 to 10.0.3 (fixed pdflib searchpath macos crash).

10.0.2 - 2022-10-01

Changed

  • Version bump from 10.0.1 to 10.0.2 (pkg_pdflib bundle macos dylib).

10.0.1 - 2022-09-29

Changed

  • Version bump from 10.0.0 to 10.0.1 (dependencies upgraded).

10.0.0 - 2022-08-15

1.0.2

  • Ios Support added and support android 7.0 or above

1.0.3

  • Just Support Dart2

1.0.4

  • Just Support Dart2

1.0.5

  • Just Support >=2.0.0-dev.28.0

1.0.6

  • resolve conflict with image_provider plugin

1.0.7

  • resolve conflict with other plugins about FileProvider and multi appcompat-v7 compile

1.1.0

  • fix ios open file

1.1.1

  • fix startActivity crash in android

1.2.0

  • Add custom parameters,"type" android,"uti" iOS

1.2.1

  • fix somethings

1.2.2

  • ask for permission when needed

1.2.2+1

  • migrate to androidx

1.2.2+2

  • fix crash when requestPermission

1.2.3

  • Optimize permission request logic on android

1.2.3+1

  • request READ_EXTERNAL_STORAGE when the file is not in the app directory

1.3.0

  • roll back support

2.0.1

  • migrate to androidx

2.0.1+1

  • Fixed crash caused by third party plug-in request permissions

2.0.1+2

  • fix android M FLAG_GRANT_READ_URI_PERMISSION

2.0.2

  • catch No Activity found to handle Intent exception
  • Optimize request REQUEST_INSTALL_PACKAGES permission on Android O

2.0.3

  • change use FileProvider from Android M to Android N

2.1.0-pre.1

  • add web support(beta)
  • add pc support(beta)

2.1.1

  • rollback 2.0.3

3.0.0

  • updated to the v2 Android Plugin APIs
  • Distinguish android errors (No APP found and others)
  • add web support
  • add pc support

3.0.1

  • fix web parameter error
  • Replace result value from String to OpenResult.

3.0.2

  • add storage compatibility mode for AndroidQ.
  • fix #106 #100 #74
  • fix multiple file providers. (thanks to @jawa0919)
  • Take file extension in lowercase for comparison.(thanks to @kluverua)
  • Fixed a typo in the error message for fileNotFound.(thanks to @sebas642)

3.0.3

  • upgrade compileSdkVersion

3.1.0

  • upgrade FFI 1.0.0 (thanks to @mit-mit)
  • add linuxByProcess parameter (thanks to @mx1up)
  • Migrate to Dart null safety system (thanks to @orevial)

3.2.0

  • add csv/kml/gpx/torrent support on Android
  • remove android:requestLegacyExternalStorage
  • fix Deprecated API warning when build on Android
  • delete uti, DocumentInteraction will be retrieved automatically on iOS (thanks to @std-c)
  • fix returns wrong reponse on Windows

3.2.1

  • Add command parser before create system call #144 (thanks to @mludovico)
  • Fix startActivity() might have NPE issue with filePath on Android (thanks to @AlexV525)
  • Add error type return when file path is nil on iOS

3.3.0

  • Remove dangerous permission REQUEST_INSTALL_PACKAGES in Android

3.4.0

  • Fix podspec in ios not resolved

Changed

  • @ruud copied from open_filex 3.4.0 which is a port of open_file 3.2.1. See (link)[https://github.com/crazecoder/open_file/issues/198]

10.0.9

2023-05-22 download

10.0.8

2023-02-09 download

10.0.7

2023-01-31 download

10.0.6

2022-12-22 download

10.0.5

2022-12-22 download

10.0.4

2022-10-11 download

10.0.3

2022-10-05 download

10.0.2

2022-10-01 download

10.0.1

2022-09-29 download

10.0.0

2022-08-15 download

3.4.0

-- download