trphoenix
2018-11-14 86910df0578149bf09eb93cf00cc6e7ac83fa3b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
part of '_json_serializable_test_input.dart';
 
@ShouldGenerate(r'''
WithANonCtorGetterChecked _$WithANonCtorGetterCheckedFromJson(
    Map<String, dynamic> json) {
  return $checkedNew('WithANonCtorGetterChecked', json, () {
    $checkKeys(json,
        allowedKeys: const ['items'],
        requiredKeys: const ['items'],
        disallowNullValues: const ['items']);
    final val = WithANonCtorGetterChecked($checkedConvert(
        json, 'items', (v) => (v as List)?.map((e) => e as String)?.toList()));
    return val;
  });
}
''', checked: true)
@JsonSerializable(disallowUnrecognizedKeys: true, createToJson: false)
class WithANonCtorGetterChecked {
  @JsonKey(required: true, disallowNullValue: true)
  final List<String> items;
  int get legth => items.length;
 
  WithANonCtorGetterChecked(this.items);
}
 
@ShouldGenerate(r'''
WithANonCtorGetter _$WithANonCtorGetterFromJson(Map<String, dynamic> json) {
  $checkKeys(json,
      allowedKeys: const ['items'],
      requiredKeys: const ['items'],
      disallowNullValues: const ['items']);
  return WithANonCtorGetter(
      (json['items'] as List)?.map((e) => e as String)?.toList());
}
''')
@JsonSerializable(disallowUnrecognizedKeys: true, createToJson: false)
class WithANonCtorGetter {
  @JsonKey(required: true, disallowNullValue: true)
  final List<String> items;
  int get legth => items.length;
 
  WithANonCtorGetter(this.items);
}