trphoenix
2018-11-12 29fbfc5dd1d55d189f23eb6d32f000252f92985f
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 2017, 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:collection/collection.dart';
import 'simple_object.dart';
 
abstract class KitchenSink {
  int get ctorValidatedNo42;
  DateTime dateTime;
 
  Iterable get iterable;
  Iterable<dynamic> get dynamicIterable;
  Iterable<Object> get objectIterable;
  Iterable<int> get intIterable;
 
  Iterable<DateTime> get dateTimeIterable;
 
  List list;
  List<dynamic> dynamicList;
  List<Object> objectList;
  List<int> intList;
  List<DateTime> dateTimeList;
 
  Set set;
  Set<dynamic> dynamicSet;
  Set<Object> objectSet;
  Set<int> intSet;
  Set<DateTime> dateTimeSet;
 
  Map map;
  Map<String, String> stringStringMap;
  Map<dynamic, int> dynamicIntMap;
  Map<Object, DateTime> objectDateTimeMap;
 
  List<Map<String, Map<String, List<List<DateTime>>>>> crazyComplex;
 
  Map<String, bool> val;
  bool writeNotNull;
  String string;
 
  SimpleObject get simpleObject;
 
  int validatedPropertyNo42;
 
  Map<String, dynamic> toJson();
}
 
//TODO(kevmoo) - finish this...
bool sinkEquals(KitchenSink a, Object other) =>
    other is KitchenSink &&
    a.ctorValidatedNo42 == other.ctorValidatedNo42 &&
    a.dateTime == other.dateTime &&
    _deepEquals(a.iterable, other.iterable) &&
    _deepEquals(a.dynamicIterable, other.dynamicIterable) &&
    // objectIterable
    // intIterable
    _deepEquals(a.dateTimeIterable, other.dateTimeIterable) &&
    // list
    // dynamicList
    // objectList
    // intList
    _deepEquals(a.dateTimeList, other.dateTimeList) &&
    // map
    // stringStringMap
    // stringIntMap
    _deepEquals(a.objectDateTimeMap, other.objectDateTimeMap) &&
    _deepEquals(a.crazyComplex, other.crazyComplex) &&
    // val
    a.writeNotNull == other.writeNotNull &&
    a.string == other.string;
 
bool _deepEquals(Object a, Object b) =>
    const DeepCollectionEquality().equals(a, b);