getAppFilePath method

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

Returns the file path where the app can store files.

This method retrieves the app's designated file storage directory, which may vary based on the platform.

Platform-specific behavior:

  • On Android, this could be the app's internal storage directory.

Returns:

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

Example Output

data/user/0/com.example.than_pkg_example/files

Example:

String? path = await getAppFilePath();
if (path != null) {
  print("App file path: $path");
}

Implementation

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