From f2ec7c98bdd0d0d9c4969cc7260ec5646d10629f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 10 Apr 2018 10:42:35 -0700 Subject: [PATCH] bump package:usage to 3.4.0 --- .gitignore | 1 + .idea/usage.iml | 6 +----- changelog.md | 4 ++++ lib/src/usage_impl_html.dart | 6 +++--- lib/src/usage_impl_io.dart | 4 ++-- pubspec.yaml | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index a9df6e6..fd4bf9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .packages .idea/ .pub/ +.dart_tool/ build/ doc/api/ pubspec.lock diff --git a/.idea/usage.iml b/.idea/usage.iml index 806a0eb..2c3b394 100644 --- a/.idea/usage.iml +++ b/.idea/usage.iml @@ -3,13 +3,9 @@ + - - - - - diff --git a/changelog.md b/changelog.md index 351cb38..e43adb3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 3.4.0 +- bump our minimum SDK constraint to `>=2.0.0-dev.30` +- change to using non-deprecated dart:convert constants + ## 3.3.0 - added a `close()` method to the `Analytics` class - change our minimum SDK from `1.24.0-dev` to `1.24.0` stable diff --git a/lib/src/usage_impl_html.dart b/lib/src/usage_impl_html.dart index c15cde6..010b508 100644 --- a/lib/src/usage_impl_html.dart +++ b/lib/src/usage_impl_html.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; -import 'dart:convert' show JSON; +import 'dart:convert' show jsonEncode, jsonDecode; import 'dart:html'; import 'usage_impl.dart'; @@ -64,7 +64,7 @@ class HtmlPersistentProperties extends PersistentProperties { HtmlPersistentProperties(String name) : super(name) { String str = window.localStorage[name]; if (str == null || str.isEmpty) str = '{}'; - _map = JSON.decode(str); + _map = jsonDecode(str); } @override @@ -78,7 +78,7 @@ class HtmlPersistentProperties extends PersistentProperties { _map[key] = value; } - window.localStorage[name] = JSON.encode(_map); + window.localStorage[name] = jsonEncode(_map); } @override diff --git a/lib/src/usage_impl_io.dart b/lib/src/usage_impl_io.dart index f7df057..53aa967 100644 --- a/lib/src/usage_impl_io.dart +++ b/lib/src/usage_impl_io.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; -import 'dart:convert' show JSON, JsonEncoder; +import 'dart:convert' show jsonDecode, JsonEncoder; import 'dart:io'; import 'package:path/path.dart' as path; @@ -153,7 +153,7 @@ class IOPersistentProperties extends PersistentProperties { try { String contents = _file.readAsStringSync(); if (contents.isEmpty) contents = '{}'; - _map = JSON.decode(contents); + _map = jsonDecode(contents); } catch (_) { _map = {}; } diff --git a/pubspec.yaml b/pubspec.yaml index 866eef7..b6f0f6e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,13 +3,13 @@ # BSD-style license that can be found in the LICENSE file. name: usage -version: 3.3.1-dev +version: 3.4.0 description: A Google Analytics wrapper for both command-line, web, and Flutter apps. homepage: https://github.com/dart-lang/usage author: Dart Team environment: - sdk: '>=1.24.0 <2.0.0' + sdk: '>=2.0.0-dev.30 <2.0.0' dependencies: path: ^1.4.0