Skip to content

Commit

Permalink
Fix strong mode issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dramos07 authored and nex3 committed Aug 9, 2016
1 parent d2b6da7 commit 0d6facd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkgs/json_rpc_2/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Client {
'parameters, was "$parameters".');
}

var message = {
var message = <String, dynamic>{
"jsonrpc": "2.0",
"method": method
};
Expand Down
14 changes: 8 additions & 6 deletions pkgs/json_rpc_2/lib/src/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ class Parameters {
///
/// If this is accessed for a [Parameter] that was not passed, the request
/// will be automatically rejected. To avoid this, use [Parameter.valueOr].
final value;
final _value;
get value => _value;

Parameters(this.method, this.value);
Parameters(this.method, this._value);

/// Returns a single parameter.
///
Expand Down Expand Up @@ -141,15 +142,16 @@ class Parameter extends Parameters {
}

var path = computePath(params._parent);
return params._key is int ?
"$path[${params._key}]" : "$path.${quoteKey(params._key)}";
return params._key is int
? "$path[${params._key}]"
: "$path.${quoteKey(params._key)}";
}

return computePath(this);
}

/// Whether this parameter exists.
final exists = true;
bool get exists => true;

Parameter._(String method, value, this._parent, this._key)
: super(method, value);
Expand Down Expand Up @@ -307,7 +309,7 @@ class _MissingParameter extends Parameter {
'missing required parameter $_path.');
}

final exists = false;
bool get exists => false;

_MissingParameter(String method, Parameters parent, key)
: super._(method, null, parent, key);
Expand Down

0 comments on commit 0d6facd

Please sign in to comment.