File tree Expand file tree Collapse file tree 6 files changed +22
-19
lines changed Expand file tree Collapse file tree 6 files changed +22
-19
lines changed Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ ## 0.3.0
4
+
5
+ Null safety migration.
6
+
1
7
## 0.2.0
2
8
3
9
Added assertions for numerical values.
Original file line number Diff line number Diff line change 1
- import 'package:test/test.dart' ;
2
1
import 'package:fluent_assertions/fluent_assertions.dart' ;
2
+ import 'package:test/test.dart' ;
3
3
4
4
void main () {
5
5
const adult = Person (name: 'Karol' , age: 30 );
@@ -42,24 +42,23 @@ void main() {
42
42
});
43
43
}
44
44
45
-
46
45
class Person {
47
46
final String name;
48
47
final int age;
49
48
bool get isAdult => age >= 18 ;
50
49
51
50
const Person ({
52
- this .name,
53
- this .age,
51
+ required this .name,
52
+ required this .age,
54
53
});
55
54
56
55
@override
57
56
bool operator == (Object other) =>
58
57
identical (this , other) ||
59
- other is Person &&
60
- runtimeType == other.runtimeType &&
61
- name == other.name &&
62
- age == other.age;
58
+ other is Person &&
59
+ runtimeType == other.runtimeType &&
60
+ name == other.name &&
61
+ age == other.age;
63
62
64
63
@override
65
64
int get hashCode => name.hashCode ^ age.hashCode;
Original file line number Diff line number Diff line change 1
1
import 'package:test/test.dart' ;
2
2
3
- extension BasicAssertions <T > on T {
3
+ extension BasicAssertions <T > on T ? {
4
4
/// Asserts that the value is structurally equal to [expected] .
5
5
void shouldBeEqualTo (T expected) => expect (this , equals (expected));
6
6
Original file line number Diff line number Diff line change 1
1
name : fluent_assertions
2
2
description : Fluent Assertions library written in Dart.
3
- version : 0.2 .0
3
+ version : 0.3 .0
4
4
homepage : https://github.com/klisiewicz/fluent-assertions
5
5
6
6
environment :
7
- sdk : ' >=2.6 .0 <3.0.0'
7
+ sdk : ' >=2.12 .0 <3.0.0'
8
8
9
9
dependencies :
10
- test : ^1.14 .4
10
+ test : ^1.17 .4
11
11
12
12
dev_dependencies :
13
- lint : ^1.2.0
13
+ lint : ^1.5.3
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ void main() {
137
137
});
138
138
139
139
group ('nullability' , () {
140
- const Person nullPerson = null ;
140
+ const Person ? nullPerson = null ;
141
141
final me = Person (name: 'Karol' );
142
142
143
143
test ('should return normally when null' , () {
Original file line number Diff line number Diff line change 1
1
class Person {
2
2
final String name;
3
3
4
- Person ({
5
- this .name,
4
+ const Person ({
5
+ required this .name,
6
6
});
7
7
8
8
@override
9
9
bool operator == (Object other) =>
10
10
identical (this , other) ||
11
- other is Person &&
12
- runtimeType == other.runtimeType &&
13
- name == other.name;
11
+ other is Person && runtimeType == other.runtimeType && name == other.name;
14
12
15
13
@override
16
14
int get hashCode => name.hashCode;
You can’t perform that action at this time.
0 commit comments