Skip to content

Commit 5af6c88

Browse files
authored
Merge pull request #3 from mwcbrent/0.9.0
Updates dependencies
2 parents 99805d4 + 44f62ba commit 5af6c88

File tree

5 files changed

+298
-176
lines changed

5 files changed

+298
-176
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## [0.9.0] - March 27th, 2024
4+
5+
- Upgrade dependencies
6+
37
## [0.8.0] - November 22nd, 2022
48

59
- Upgrade dependencies

lib/flutter_data_json_api_adapter.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mixin JSONAPIAdapter<T extends DataModel<T>> on RemoteAdapter<T> {
4747
map = map.filterNulls;
4848

4949
// relationships
50-
final relationships = <String, Relationship>{};
50+
final relationships = <String, NewRelationship>{};
5151

5252
for (final relEntry in localAdapter.relationshipMetas.entries) {
5353
final key = relEntry.key;
@@ -57,9 +57,9 @@ mixin JSONAPIAdapter<T extends DataModel<T>> on RemoteAdapter<T> {
5757
final identifiers = (map[key] as Iterable<Object>).map((id) {
5858
return Identifier(type, id.toString());
5959
}).toList();
60-
relationships[key] = ToMany(identifiers);
60+
relationships[key] = NewToMany(identifiers);
6161
} else if (map[key] != null) {
62-
relationships[key] = ToOne(Identifier(type, map[key].toString()));
62+
relationships[key] = NewToOne(Identifier(type, map[key].toString()));
6363
}
6464
map.remove(key);
6565
}
@@ -73,7 +73,7 @@ mixin JSONAPIAdapter<T extends DataModel<T>> on RemoteAdapter<T> {
7373
);
7474

7575
// assemble type, id, attributes, relationships in `Resource`
76-
final resource = NewResource(_typeFor(internalType), id?.toString());
76+
final resource = NewResource(_typeFor(internalType), id: id?.toString());
7777
resource.attributes.addAll(attributes);
7878
resource.relationships.addAll(relationships);
7979

@@ -89,7 +89,7 @@ mixin JSONAPIAdapter<T extends DataModel<T>> on RemoteAdapter<T> {
8989
@override
9090
Future<DeserializedData<T>> deserialize(Object? data, {String? key}) async {
9191
final result = DeserializedData<T>([], included: []);
92-
final collection = ResourceCollection();
92+
final collection = <Resource>[];
9393

9494
if (data is! Iterable<Resource>) {
9595
// if data is not already formatted, parse

0 commit comments

Comments
 (0)