Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/path_provider/lib/path_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ Future<Directory> getTemporaryDirectory() async {
///
/// On Android, this returns the AppData directory.
Future<Directory> getApplicationDocumentsDirectory() async {
final String path =
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await _channel.invokeMethod('getApplicationDocumentsDirectory');
String path;
if (Platform.isMacOS || Platform.isLinux) {
path = '${Platform.environment['HOME']}/.config';
} else if (Platform.isWindows) {
path = '${Platform.environment['UserProfile']}\\.config';
} else {
path =
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await _channel.invokeMethod('getApplicationDocumentsDirectory');
}
if (path == null) {
return null;
}
Expand Down