adjust to a flutter api change
diff --git a/changelog.md b/changelog.md
index d9034de..0d5a5d7 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,8 @@
# Changelog
+## 2.2.2
+- adjust the Flutter usage client to Flutter API changes
+
## 2.2.1
- improve the user agent string for the CLI client
diff --git a/lib/src/usage_impl_flutter.dart b/lib/src/usage_impl_flutter.dart
index 756d726..58f90a3 100644
--- a/lib/src/usage_impl_flutter.dart
+++ b/lib/src/usage_impl_flutter.dart
@@ -19,10 +19,10 @@
String applicationVersion, {
String analyticsUrl
}) async {
- String dataPath = await getFilesDir();
+ Directory dataDirectory = await PathProvider.getTemporaryDirectory();
String fileName = '.${applicationName.replaceAll(' ', '_')}';
- File file = new File(path.join(dataPath, fileName));
+ File file = new File(path.join(dataDirectory.path, fileName));
await file.create();
String contents = await file.readAsString();
if (contents.isEmpty) contents = '{}';
diff --git a/pubspec.yaml b/pubspec.yaml
index 5f55f75..74705d9 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@
# BSD-style license that can be found in the LICENSE file.
name: usage
-version: 2.2.1
+version: 2.2.2
description: A Google Analytics wrapper for both command-line, web, and Flutter apps.
homepage: https://github.com/dart-lang/usage
author: Dart Team <misc@dartlang.org>