Skip to content

Commit fa523f2

Browse files
authored
Migrate to analyzer 12 (#347)
1 parent 307e06a commit fa523f2

7 files changed

Lines changed: 20 additions & 14 deletions

File tree

packages/dart_mappable/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.8.0
2+
3+
- Bump `analyzer` to `>=10.0.0 <12.0.0`.
4+
15
# 4.7.0
26

37
- Added `firstWhere` to `ListCopyWith` for chaining copyWith calls on a list element based on a predicate function.

packages/dart_mappable/lib/src/mappers/default_mappers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PrimitiveMapper<T extends Object> extends MapperBase<T>
2121
return exactType != null ? v.runtimeType == exactType : super.isFor(v);
2222
}
2323

24-
static T _cast<T>(v) => v as T;
24+
static T _cast<T>(dynamic v) => v as T;
2525

2626
@override
2727
T decoder(Object value, DecodingContext context) {

packages/dart_mappable/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_mappable
22
description: Improved json serialization and data classes with full support for generics, inheritance, customization and more.
3-
version: 4.7.0
3+
version: 4.8.0
44
repository: https://github.com/schultek/dart_mappable
55
issue_tracker: https://github.com/schultek/dart_mappable/issues
66
documentation: https://pub.dev/documentation/dart_mappable/latest/topics/Introduction-topic.html
@@ -25,7 +25,7 @@ dependencies:
2525

2626
dev_dependencies:
2727
build_runner: ^2.4.14
28-
dart_mappable_builder: ^4.7.0
29-
lints: ^5.0.0
28+
dart_mappable_builder: ^4.8.0
29+
lints: ^6.1.0
3030
test: ^1.25.10
3131

packages/dart_mappable/test/polymorphism/custom_discriminator_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class A with AMappable {
1212
class B extends A with BMappable {
1313
B();
1414

15-
static bool checkType(value) {
15+
static bool checkType(dynamic value) {
1616
return value is Map && value['isB'] == true;
1717
}
1818
}
@@ -21,7 +21,7 @@ class B extends A with BMappable {
2121
class C extends A with CMappable {
2222
C();
2323

24-
static bool checkType(value) {
24+
static bool checkType(dynamic value) {
2525
return value is Map && value['isWhat'] == 'C';
2626
}
2727
}

packages/dart_mappable_builder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.8.0
2+
3+
- Bump `analyzer` to `>=10.0.0 <12.0.0`.
4+
15
## 4.7.0
26

37
- Allow `analyzer` 10.0.0.

packages/dart_mappable_builder/lib/src/elements/class/class_mapper_element.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,15 @@ abstract class ClassMapperElement extends InterfaceMapperElement<ClassElement>
139139
yield* extendsElement?._allFields ?? [];
140140

141141
for (var getter in element.getters) {
142-
// ignore: deprecated_member_use
143-
if (getter.isStatic || getter.isSynthetic) continue;
142+
if (getter.isStatic || !getter.isOriginDeclaration) continue;
144143

145144
if (fieldChecker.hasAnnotationOf(getter)) {
146145
yield getter.variable;
147146
}
148147
}
149148

150149
for (var field in element.fields) {
151-
// ignore: deprecated_member_use
152-
if (field.isStatic || field.isSynthetic) continue;
150+
if (field.isStatic || !field.isOriginDeclaration) continue;
153151

154152
if (field.isPublic || fieldChecker.hasAnnotationOf(field)) {
155153
yield field;

packages/dart_mappable_builder/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_mappable_builder
22
description: Improved json serialization and data classes with full support for generics, inheritance, customization and more.
3-
version: 4.7.0
3+
version: 4.8.0
44
repository: https://github.com/schultek/dart_mappable
55
issue_tracker: https://github.com/schultek/dart_mappable/issues
66
funding:
@@ -12,11 +12,11 @@ environment:
1212
resolution: workspace
1313

1414
dependencies:
15-
analyzer: '>=8.1.0 <11.0.0'
15+
analyzer: '>=10.0.0 <13.0.0'
1616
ansicolor: ^2.0.1
1717
build: ^4.0.0
1818
collection: ^1.15.0
19-
dart_mappable: ^4.7.0
19+
dart_mappable: ^4.8.0
2020
dart_style: ^3.0.1
2121
glob: ^2.1.0
2222
path: ^1.8.0
@@ -25,5 +25,5 @@ dependencies:
2525
dev_dependencies:
2626
build_runner: ^2.10.2
2727
build_test: ^3.3.0
28-
lints: '>=1.0.0 <6.0.0'
28+
lints: '>=1.0.0 <7.0.0'
2929
test: ^1.25.10

0 commit comments

Comments
 (0)