Truvideo Image SDK
This plugin integrates TruvideoImageSdk for handling image files, including browsing, editing, and displaying images.
Supported Platforms
- ✅ Android
- ✅ iOS
Features
- Loads and displays images from a directory
- Edits images using the SDK
Requirements
- TruvideoImageSdk Plugin
Setup
- Add TruvideoImageSdk Plugin to your project.
- Install dependencies:
flutter pub get - Ensure proper permissions in
AndroidManifest.xml&Info.plist. - Run the app:
flutter run
Usage
- Load images from a directory:
List<String> getAllImagePathsInDirectory(String directoryPath) {
final directory = Directory(directoryPath);
List<String> imagePaths = [];
if (directory.existsSync()) {
directory.listSync(recursive: true).forEach((file) {
if (file is File && ['png', 'jpeg', 'jpg'].contains(file.path.split('.').last.toLowerCase())) {
imagePaths.add(file.path);
}
});
}
return imagePaths;
}
- Edit an image:
void editImage(String inputPath, String outputPath) async {
TruvideoImageSdk.editImage(
inputPath: imagePath,
outputPath: outputPath,
onResult: (String? result) {
print("Image edited successfully: \$result");
},
onError: (String? message) {
print("Image editing failed: \$message");
},
);
}
License
MIT
Support
If you have any questions or suggestions regarding the SDK, please contact us at [email protected].