getAppExternalPath method

  1. @override
Future<String> getAppExternalPath()
override

Returns the external storage path of the app.

This method retrieves the app's external storage directory, which is useful for saving files that should be accessible outside the app's internal storage.

Platform-specific behavior:

  • On Android, it corresponds to getExternalFilesDir().
  • On Linux /home/[your pc name]
  • On iOS, external storage is not available in the same way.

Returns:

  • A Future<String?> resolving to the external storage path.
  • Throws an UnimplementedError if the method is not implemented.

Example:

String? path = await getAppExternalPath();
if (path != null) {
  print("External storage path: $path");
}

Implementation

@override
Future<String> getAppExternalPath() async {
  return await ThanPkg.android.app.getAppExternalPath();
}