lecle_flutter_absolute_path 0.0.1+2 lecle_flutter_absolute_path: ^0.0.1+2 copied to clipboard
A Flutter project to get the absolute path of a file on Android or iOS device.
lecle_flutter_absolute_path #
A Flutter project to get the absolute path of a file on Android and iOS device.
How to use #
-
Simply import lecle_flutter_absolute_path package on pub.dev or with the syntax below under dependencies in pubspec.yaml file and run flutter command flutter pub get in terminal
dependencies:
flutter:
sdk:flutter
lecle_flutter_absolute_path: <latest version>
iOS #
-
Add the following lines into your
Info.plist
.<key>NSPhotoLibraryUsageDescription</key>
<string>Replace with your permission description.</string>
Example #
import 'package:lecle_flutter_absolute_path/lecle_flutter_absolute_path.dart';
- Default use
String? filePath = await LecleFlutterAbsolutePath.getAbsolutePath(asset.path);
- You can use with multi_image_picker (Discontinued)
, wechat_assets_picker or image_picker to get the assets
from device and use
lecle_flutter_absolute_path
to get the picked assets's absolute path
-
Use with multi_image_picker (Old example, not recommend to use)
final filePath = await LecleFlutterAbsolutePath.getAbsolutePath(asset.identifier);
-
Use with wechat_assets_picker
AssetPicker.pickAssets(context).then((assets) async {
if (assets != null && assets.isNotEmpty) {
for (var asset in assets) {
final file = await asset.file;
if (file != null) {
final filePath = await LecleFlutterAbsolutePath.getAbsolutePath(file.path);
}
}
}
});
-
Use with image_picker
final filePath = await LecleFlutterAbsolutePath.getAbsolutePath(asset.path);