Fix scripts in tool/ to work with Dart 2 (#225)
Fix scripts in tool/ to work with Dart 2
diff --git a/lib/src/emojis.dart b/lib/src/emojis.dart
index cc3e0d6..c7e9bce 100644
--- a/lib/src/emojis.dart
+++ b/lib/src/emojis.dart
@@ -2,7 +2,7 @@
//
// This file was generated from emojilib's emoji data file:
// https://github.com/muan/emojilib/raw/master/emojis.json
-// at 2017-12-30 08:59:02.241410 by the script, tool/update_emojis.dart.
+// at 2018-07-02 15:07:49.422933 by the script, tool/update_emojis.dart.
const emojis = const <String, String>{
'grinning': 'đ',
@@ -624,6 +624,8 @@
'woman_playing_handball': 'đ¤žâď¸',
'man_playing_handball': 'đ¤žâď¸',
'ice_skate': 'â¸',
+ 'curling_stone': 'đĽ',
+ 'sled': 'đˇ',
'bow_and_arrow': 'đš',
'fishing_pole_and_fish': 'đŁ',
'boxing_glove': 'đĽ',
@@ -720,6 +722,7 @@
'metro': 'đ',
'tram': 'đ',
'station': 'đ',
+ 'flying_saucer': 'đ¸',
'helicopter': 'đ',
'small_airplane': 'đŠ',
'airplane': 'âď¸',
@@ -1488,6 +1491,9 @@
'ukraine': 'đşđŚ',
'united_arab_emirates': 'đŚđŞ',
'uk': 'đŹđ§',
+ 'england': 'đ´ó §ó ˘ó Ľó Žó §ó ż',
+ 'scotland': 'đ´ó §ó ˘ó łó Łó ´ó ż',
+ 'wales': 'đ´ó §ó ˘ó ˇó Źó łó ż',
'us': 'đşđ¸',
'us_virgin_islands': 'đťđŽ',
'uruguay': 'đşđž',
diff --git a/test/blns.dart b/test/blns.dart
index 7c3a14b..f515658 100644
--- a/test/blns.dart
+++ b/test/blns.dart
@@ -2,7 +2,7 @@
//
// This file was generated from big-list-of-naughty-strings's JSON file:
// https://github.com/minimaxir/big-list-of-naughty-strings/raw/master/blns.json
-// at 2018-04-11 08:45:24.766983 by the script, tool/update_blns.dart.
+// at 2018-07-02 12:53:34.521084 by the script, tool/update_blns.dart.
const blns = const <String>[
'',
diff --git a/tool/update_blns.dart b/tool/update_blns.dart
index 7e23fd7..744d87f 100644
--- a/tool/update_blns.dart
+++ b/tool/update_blns.dart
@@ -12,8 +12,8 @@
try {
var request = await client.getUrl(Uri.parse(_blnsJsonRawUrl));
var response = await request.close();
- json = jsonDecode(await response.transform(utf8.decoder).join(''))
- as List<String>;
+ json = (jsonDecode(await response.transform(utf8.decoder).join('')) as List)
+ .cast<String>();
} finally {
client.close();
}
diff --git a/tool/update_emojis.dart b/tool/update_emojis.dart
index beffc98..fa07c0a 100644
--- a/tool/update_emojis.dart
+++ b/tool/update_emojis.dart
@@ -11,7 +11,8 @@
var request = await client.getUrl(Uri.parse(_emojisJsonRawUrl));
var response = await request.close();
var json = jsonDecode(await response.transform(utf8.decoder).join(''))
- as Map<String, Map<String, dynamic>>;
+ .map((alias, info) => new MapEntry(alias, info.cast<String, dynamic>()))
+ .cast<String, Map<String, dynamic>>();
var emojisContent = new StringBuffer('''
// GENERATED FILE. DO NOT EDIT.
//