diff --git a/packages/path_provider/lib/path_provider.dart b/packages/path_provider/lib/path_provider.dart index 1875f7436d8b..e0e083373e56 100644 --- a/packages/path_provider/lib/path_provider.dart +++ b/packages/path_provider/lib/path_provider.dart @@ -39,11 +39,18 @@ Future getTemporaryDirectory() async { /// /// On Android, this returns the AppData directory. Future 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; }