v1.0.0uri_to_file
समर्थित URI को फ़ाइल में बदलने के लिए एक Flutter प्लगइन। Android और iOS का समर्थन करता है।
44लाइक 3.6 हज़ार30-दिन डाउनलोड160Pub अंक
AndroidiOS
URI को फ़ाइल में बदलने के लिए एक Flutter प्लगइन।
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
A Flutter plugin for converting supported uri to file. Supports Android & iOS.
Supported Uri Schema
dependencies:
uri_to_file: ^1.0.0
import 'dart:io';
import 'package:uri_to_file/uri_to_file.dart';
Future<void> convertUriToFile() async {
try {
String uriString = 'content://sample.txt'; // Uri string
// Don't pass uri parameter using [Uri] object via uri.toString().
// Because uri.toString() changes the string to lowercase which causes this package to misbehave
// If you are using uni_links package for deep linking purpose.
// Pass the uri string using getInitialLink() or linkStream
File file = await toFile(uriString); // Converting uri to file
} catch (e) {
print(e); // Exception
}
}
Working example
content:// (Android Only) uri_to_file creates a temporary file using the content:// uri with the help of native channel that stores this file in the application directory.
All the others uri are handled by flutter sdk itself with the help of File.fromUri(uri)
MIT License
Please file feature requests and bugs at the issue tracker.