getStoragePaths static method
Gets the available storage paths for the app.
Returns a map containing paths to different storage locations:
- 'internal': App's internal storage directory
- 'cache': App's cache directory
- 'external': App's external storage directory (may be null)
- 'externalCache': App's external cache directory (may be null)
These paths can be used to save or load models.
Implementation
static Future<Map<String, String?>> getStoragePaths() async {
try {
final channel = ChannelConfig.createSingleImageChannel();
final result = await channel.invokeMethod('getStoragePaths');
if (result is Map) {
return Map<String, String?>.fromEntries(
result.entries.map(
(e) => MapEntry(e.key.toString(), e.value as String?),
),
);
}
return {};
} catch (e) {
return {};
}
}