PlainFetcher<T> class
get result from service as is, without parsing actually
await for(final ok in PlainFetcher<bool>(client).fetch(checkSomeUrl)) {
if(ok) {
print("Good");
} else {
print("Bad");
}
};
- Inheritance
-
- Object
- JsonHttpFetcher<
T> - PlainFetcher
Constructors
- PlainFetcher(JsonHttpClient client)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fetch(
String url, {dynamic nocache = false, dynamic allowErrorWhenCacheExists = false, Map< String, String> ? headers, String? cacheUrl, String? body, bool usePost = false}) → Stream<T> -
by default, if cached version is available then errors will not be pushed to stream
nocache
skip cached versionallowErrorWhenCacheExists
throw errors even if cache is exists ifcacheUrl
is specified, then content will be cached under itinherited -
get(
String url, {Map< String, String> ? headers, String? body, bool usePost = false}) → Future<T> -
just get without caching
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String source) → T -
implement me: returns object parsed from json
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited