Type the callback parameter to addOption as Function (#84)
See flutter/flutter#13223
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f38fad..c026ae6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 1.2.0
+
+* Type the `callback` parameter to `ArgParser.addOption()` as `Function` rather
+ than `void Function(value)`. This allows strong-mode users to write `callback:
+ (String value) { ... }` rather than having to manually cast `value` to a
+ `String` (or a `List<String>` with `allowMultiple: true`).
+
## 1.1.0
* `ArgParser.parse()` now takes an `Iterable<String>` rather than a
diff --git a/lib/src/allow_anything_parser.dart b/lib/src/allow_anything_parser.dart
index 38daea5..58e4812 100644
--- a/lib/src/allow_anything_parser.dart
+++ b/lib/src/allow_anything_parser.dart
@@ -37,7 +37,7 @@
Iterable<String> allowed,
Map<String, String> allowedHelp,
String defaultsTo,
- void callback(value),
+ Function callback,
bool allowMultiple: false,
bool splitCommas,
bool hide: false}) {
diff --git a/lib/src/arg_parser.dart b/lib/src/arg_parser.dart
index e91276d..98312ec 100644
--- a/lib/src/arg_parser.dart
+++ b/lib/src/arg_parser.dart
@@ -114,7 +114,7 @@
Iterable<String> allowed,
Map<String, String> allowedHelp,
String defaultsTo,
- void callback(value),
+ Function callback,
bool allowMultiple: false,
bool splitCommas,
bool hide: false}) {
@@ -136,7 +136,7 @@
Iterable<String> allowed,
Map<String, String> allowedHelp,
defaultsTo,
- void callback(value),
+ Function callback,
OptionType type,
{bool negatable: false,
bool splitCommas,
diff --git a/pubspec.yaml b/pubspec.yaml
index 4e3311c..42a4718 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: args
-version: 1.1.0
+version: 1.2.0
author: "Dart Team <misc@dartlang.org>"
homepage: https://github.com/dart-lang/args
description: >