@@ -19,21 +19,18 @@ class NotEquals {
19
19
20
20
void main () {
21
21
testWidgets ('Keys' , (WidgetTester tester) async {
22
- final int int3 = 3 ; // we want these instances to be separate instances so that we're not just checking with a single object
23
- expect (new ValueKey <int >(int3) == new ValueKey <int >(int3), isTrue);
24
- expect (new ValueKey <num >(int3) == new ValueKey <int >(int3), isFalse);
25
- final int int2 = 2 ; // we want these instances to be separate instances so that we're not just checking with a single object
26
- expect (new ValueKey <int >(int3) == new ValueKey <int >(int2), isFalse);
22
+ expect (new ValueKey <int >(nonconst (3 )) == new ValueKey <int >(nonconst (3 )), isTrue);
23
+ expect (new ValueKey <num >(nonconst (3 )) == new ValueKey <int >(nonconst (3 )), isFalse);
24
+ expect (new ValueKey <int >(nonconst (3 )) == new ValueKey <int >(nonconst (2 )), isFalse);
27
25
expect (const ValueKey <double >(double .NAN ) == const ValueKey <double >(double .NAN ), isFalse);
28
26
29
- final String empty = '' ; // we want these instances to be separate instances so that we're not just checking with a single object
30
- expect (new Key (empty) == new ValueKey <String >(empty), isTrue);
31
- expect (new ValueKey <String >(empty) == new ValueKey <String >(empty), isTrue);
32
- expect (new TestValueKey <String >(empty) == new ValueKey <String >(empty), isFalse);
33
- expect (new TestValueKey <String >(empty) == new TestValueKey <String >(empty), isTrue);
27
+ expect (new Key (nonconst ('' )) == new ValueKey <String >(nonconst ('' )), isTrue);
28
+ expect (new ValueKey <String >(nonconst ('' )) == new ValueKey <String >(nonconst ('' )), isTrue);
29
+ expect (new TestValueKey <String >(nonconst ('' )) == new ValueKey <String >(nonconst ('' )), isFalse);
30
+ expect (new TestValueKey <String >(nonconst ('' )) == new TestValueKey <String >(nonconst ('' )), isTrue);
34
31
35
- expect (new ValueKey <String >(empty) == new ValueKey <dynamic >(empty ), isFalse);
36
- expect (new TestValueKey <String >(empty) == new TestValueKey <dynamic >(empty ), isFalse);
32
+ expect (new ValueKey <String >(nonconst ( '' )) == new ValueKey <dynamic >(nonconst ( '' ) ), isFalse);
33
+ expect (new TestValueKey <String >(nonconst ( '' )) == new TestValueKey <dynamic >(nonconst ( '' ) ), isFalse);
37
34
38
35
expect (new UniqueKey () == new UniqueKey (), isFalse);
39
36
final LocalKey k = new UniqueKey ();
@@ -44,11 +41,11 @@ void main() {
44
41
expect (new ValueKey <LocalKey >(k) == new ValueKey <UniqueKey >(k), isFalse);
45
42
expect (new ObjectKey (k) == new ObjectKey (k), isTrue);
46
43
47
- final NotEquals constNotEquals = const NotEquals (); // we want these instances to be separate instances so that we're not just checking with a single object
44
+ final NotEquals constNotEquals = nonconst ( const NotEquals ());
48
45
expect (new ValueKey <NotEquals >(constNotEquals) == new ValueKey <NotEquals >(constNotEquals), isFalse);
49
46
expect (new ObjectKey (constNotEquals) == new ObjectKey (constNotEquals), isTrue);
50
47
51
- final Object constObject = const Object (); // we want these instances to be separate instances so that we're not just checking with a single object
48
+ final Object constObject = nonconst ( const Object ());
52
49
expect (new ObjectKey (constObject) == new ObjectKey (constObject), isTrue);
53
50
expect (new ObjectKey (new Object ()) == new ObjectKey (new Object ()), isFalse);
54
51
0 commit comments