Skip to content

Commit 97a71ea

Browse files
updted dart issue returning [value] instead of value
1 parent 04ac6ca commit 97a71ea

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

templates/dart/lib/query.dart.twig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ class Query {
99
Query._(this.method, [this.attribute = null, this.values = null]);
1010

1111
Map<String, dynamic> toJson() {
12-
final map = <String, dynamic>{'method': method};
13-
12+
final result = <String, dynamic>{};
13+
14+
result['method'] = method;
15+
1416
if(attribute != null) {
15-
map['attribute'] = attribute;
17+
result['attribute'] = attribute;
1618
}
1719

1820
if(values != null) {
19-
map['values'] = values is List ? values : [values];
21+
result['values'] = values is List ? values : [values];
2022
}
2123

22-
return map;
24+
return result;
2325
}
2426

2527
@override
@@ -35,7 +37,7 @@ class Query {
3537

3638
/// Filter resources where [attribute] is not equal to [value].
3739
static String notEqual(String attribute, dynamic value) =>
38-
Query._('notEqual', attribute, [value]).toString();
40+
Query._('notEqual', attribute, value).toString();
3941

4042
/// Filter resources where [attribute] is less than [value].
4143
static String lessThan(String attribute, dynamic value) =>

0 commit comments

Comments
 (0)