File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:json_api/src/document/identifier.dart' ;
2
2
import 'package:json_api/src/document/relationship.dart' ;
3
3
4
- class ToMany extends Relationship {
4
+ class ToMany extends Relationship < Identifier > {
5
5
ToMany (Iterable <Identifier > identifiers) {
6
6
_ids.addAll (identifiers);
7
7
}
Original file line number Diff line number Diff line change 1
1
import 'package:json_api/src/document/identifier.dart' ;
2
2
import 'package:json_api/src/document/relationship.dart' ;
3
3
4
- class ToOne extends Relationship {
4
+ class ToOne extends Relationship < Identifier > {
5
5
ToOne (this .identifier);
6
6
7
7
ToOne .empty () : this (null );
@@ -13,5 +13,5 @@ class ToOne extends Relationship {
13
13
14
14
@override
15
15
Iterator <Identifier > get iterator =>
16
- identifier == null ? < Identifier > [] .iterator : [identifier! ].iterator;
16
+ identifier == null ? super .iterator : [identifier! ].iterator;
17
17
}
Original file line number Diff line number Diff line change 1
1
import 'dart:collection' ;
2
2
3
- import 'package:json_api/src/document/identifier.dart' ;
4
3
import 'package:json_api/src/document/link.dart' ;
5
4
6
- class Relationship with IterableMixin <Identifier > {
5
+ class Relationship < T > with IterableMixin <T > {
7
6
final links = < String , Link > {};
8
7
final meta = < String , Object ? > {};
9
8
@@ -13,5 +12,5 @@ class Relationship with IterableMixin<Identifier> {
13
12
};
14
13
15
14
@override
16
- Iterator <Identifier > get iterator => const < Identifier > [].iterator;
15
+ Iterator <T > get iterator => < T > [].iterator;
17
16
}
You can’t perform that action at this time.
0 commit comments