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
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
 
import 'package:json_annotation/json_annotation.dart';
 
part 'strict_keys_object.g.dart';
 
@JsonSerializable(
    disallowUnrecognizedKeys: true, anyMap: true, generateToJsonFunction: false)
class StrictKeysObject extends Object with _$StrictKeysObjectSerializerMixin {
  @override
  @JsonKey(required: true)
  final int value;
 
  @override
  @JsonKey(name: 'custom_field', required: true)
  final String customField;
 
  StrictKeysObject(this.value, this.customField);
 
  factory StrictKeysObject.fromJson(Map json) =>
      _$StrictKeysObjectFromJson(json);
}