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

पैकेज विवरणv3.2.3

open_file_safe

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

AndroidiOS
30-दिन डाउनलोड
342
लाइक
56
Pub अंक
115

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

flutter pub add open_file_safe

पैकेज अवलोकन

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

open_file_safe एक Flutter प्लगइन है जो कई प्लेटफॉर्मों पर मूल सिस्टम क्षमताओं का उपयोग करके सुरक्षित रूप से फ़ाइलों को खोलता है। यह प्लेटफॉर्म-विशिष्ट तकनीकों—iOS पर UTI, Android पर Intents, PC पर FFI, और web पर dart:html—का उपयोग करता है ताकि विश्वसनीय फ़ाइल खोलने के साथ-साथ स्थिर तार्किक परिणाम प्राप्त किए जा सकें। क्रॉस-प्लेटफॉर्म संगतता के लिए डिज़ाइन किया गया, यह Flutter ऐप्स में फ़ाइल प्रबंधन को सरल बनाता है जिसमें मूल एकीकरण विवरणों को छिपाया गया है। यह पैकेज सुरक्षित और निर्भ्रम फ़ाइल लॉन्च के लिए समर्थन करता है बिना गहन प्लेटफॉर्म ज्ञान के आवश्यकता के।

उपयोग

  • एप्लिकेशन स्टोरेज से PDF, छवियाँ और दस्तावेज़ खोलें
  • फ़ाइलों को देखने या संपादित करने के लिए बाहरी ऐप्स को लॉन्च करना
  • दस्तावेज प्रबंधन एप्लिकेशन में फ़ाइल पूर्वावलोकन का एकीकरण
  • एप्स के बीच फ़ाइल साझाकरण का समर्थन करना
  • मोबाइल और डेस्कटॉप ऐप में ऑफलाइन फ़ाइल पहुंच सक्षम करें

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

  • क्रॉस-प्लेटफॉर्म फ़ाइल ओपनिंग (Android, iOS, PC, Web)
  • विश्वसनीय फ़ाइल हैंडलिंग के लिए मूल एपीआई का उपयोग करता है
  • त्रुटि ट्रैकिंग के लिए स्ट्रिंग परिणाम लौटाता है
  • सुरक्षित और सैंडबॉक्स निष्पादन
  • iOS पर UTI और Android पर Intents का समर्थन करता है

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

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

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

  • Android और iOS पर सही फ़ाइल पथ की अनुमतियाँ आवश्यक हैं
  • वेब समर्थन ब्राउज़र सुरक्षा नीतियों पर निर्भर करता है
  • PC समर्थन के लिए FFI सेटअप और नेटिव निर्भरता की आवश्यकता होती है
  • उपयोगकर्ता सहमति के बिना ऐप सैंडबॉक्स के बाहर के फ़ाइलों को खोलने के लिए अनुपयुक्त
  • कुछ प्लेटफॉर्मों पर मूल ऐप चयन पर सीमित नियंत्रण

मूल README

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

open_file_safe

pub package

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)

Note:

This package is same as open_file, but .apk file type is not supported. Thus, android.permission.REQUEST_INSTALL_PACKAGES permission is removed.

Usage

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

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

Example

import 'package:open_file_safe/open_file_safe.dart';

OpenFile.open("/sdcard/example.txt");
//OpenFile.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"},
            {".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"},
            {"",        "*/*"}
}
Not supported file types in android:
{
     {".apk",    "application/vnd.android.package-archive"},
}

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

श्रेणियाँ

निर्भरताएँ

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

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

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