पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv4.0.0

open_file

एक प्लगइन जो फ्लटर में नेटिव एपी कॉल कर सकता है फाइलों को खोलने के लिए और स्ट्रिंग परिणाम देता है, iOS (UTI) / Android (इंटेंट) / PC (FFI) / वेब (dart:html) का समर्थन करता है

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
4.6 लाख
लाइक
1.1 हज़ार
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add open_file

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

open_file पैकेज फ्लटर एप्लिकेशन को फ़ाइलों को खोलने के लिए प्लेटफ़ॉर्म-विशिष्ट तरीकों के साथ मूल एप्लिकेशन लॉन्च करने की अनुमति देता है। एंड्रॉइड पर, यह इंटेंट्स का उपयोग करता है; iOS पर, यह UTIs का उपयोग करता है; डेस्कटॉप प्लेटफ़ॉर्म (macOS, Windows, Linux) पर, यह FFI का उपयोग करता है; और वेब पर, यह dart:html का उपयोग करता है। यह सफलता या विफलता को दर्शाने वाला एक स्ट्रिंग परिणाम लौटाता है, जिससे यह PDF, छवियों और दस्तावेज़ जैसे फ़ाइल प्रकारों को कम बॉयलरप्लेट के साथ प्लेटफ़ॉर्म के बीच हैंडल करने के लिए आदर्श बनाता है।

उपयोग

  • पीडीएफ और दस्तावेज़ खोलें
  • फ़ाइल देखने के लिए बाहरी ऐप्स को लॉन्च करना
  • फ़ाइल साझाकरण कार्य प्रवाहों का समर्थन करना
  • क्रॉस-प्लेटफॉर्म फ़ाइल हैंडलिंग
  • फ़ाइल पिकर प्लगइन के साथ एकीकरण
  • एप्स में दस्तावेज़ पूर्वावलोकन सक्षम करें

मुख्य विशेषताएँ

  • क्रॉस-प्लेटफॉर्म फ़ाइल ओपनिंग
  • प्लेटफॉर्म चैनलों के माध्यम से नेटिव एकीकरण
  • स्ट्रिंग-आधारित परिणाम प्रतिक्रिया
  • iOS UTI और Android Intent के लिए समर्थन
  • FFI के माध्यम से डेस्कटॉप समर्थन
  • dart:html के साथ वेब सुसंगतता

इनके लिए उपयुक्त

  • फ़ाइल प्रीव्यू की आवश्यकता वाले ऐप्स
  • दस्तावेज प्रबंधन टूल्स
  • फ़ाइल पिकर एंटीग्रेशन
  • बहुपлатफॉर्म एप्लिकेशन
  • iOS, Android, Web और डेस्कटॉप के लिए विकासकर्ता

विचार योग्य बातें

  • सही फ़ाइल पथ हैंडलिंग की आवश्यकता होती है
  • ऑपरेटिंग सिस्टम द्वारा समर्थित फ़ाइल प्रकारों तक सीमित
  • कुछ प्लेटफॉर्म पर अतिरिक्त अनुमतियों की आवश्यकता हो सकती है
  • परिणाम के हैंडलिंग प्लेटफ़ॉर्म व्यवहार पर निर्भर करती है
  • फ़ाइल निर्माण या संपादन के लिए उपयुक्त नहीं

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

open_file

pub package Discord

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_file as a dependency in your pubspec.yaml file.

If you want to open an external file, You need to request permission start in 3.3.0, This is an example

dependencies:
  #androidx
  open_file: ^lastVersion 
  #support
  #open_file: ^1.3.0

Example

import 'package:open_file/open_file.dart';

OpenFile.open("/sdcard/example.txt");

//Support for custom add types
const types = {
  ".pdf": "application/pdf",
  ".dwg": "application/x-autocad"
};
_openOtherTypeFile() async {
  final filePath = "/sdcard/Download/R-C.dwg";
  final extension = path.extension(filePath);//import 'package:path/path.dart' as path;
  await OpenFile.open(filePath, type: types[extension]);
}
//OpenFile.open("/sdcard/example.txt", type: "text/plain", isIOSAppOpen: true);

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"}
}
MacOS

add this to the entitlements file

<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 7 आइटम

  • open_file_android^1.1.0
  • open_file_ios^1.1.0
  • open_file_linux^1.1.0
  • open_file_mac^1.1.0
  • open_file_platform_interface^1.1.0
  • open_file_web^1.1.0
  • open_file_windows^1.1.0

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

रैंकिंग