File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ typedef http.Client HttpClientFactory();
1616class JsonApiClient {
1717 static const contentType = 'application/vnd.api+json' ;
1818
19- final JsonApiParser _parser = const JsonApiParser () ;
19+ final JsonApiParser _parser;
2020
2121 final HttpClientFactory _factory;
2222
2323 /// JSON:API client uses Dart's native Http Client internally.
24- /// To customize its behavior you can pass the [factory] function.
25- const JsonApiClient ({HttpClientFactory factory })
26- : _factory = factory ?? _defaultFactory;
24+ /// To customize its behavior you can pass the [factory] function and the [parser] .
25+ const JsonApiClient ({HttpClientFactory factory , JsonApiParser parser})
26+ : _factory = factory ?? _defaultFactory,
27+ _parser = parser ?? const JsonApiParser ();
2728
2829 /// Fetches a resource collection by sending a GET request to the [uri] .
2930 /// Use [headers] to pass extra HTTP headers.
You can’t perform that action at this time.
0 commit comments