CitiesRequest class
- Inheritance
-
- Object
- ApiRequest<
List< City> > - CitiesRequest
Constructors
- CitiesRequest(String host, String apiPath, {String? appName, String? appVersion})
Properties
- apiPath → String
-
Path to the API on the host
finalinherited
- appName → String?
-
Name of the app which uses the API
finalinherited
- appVersion → String?
-
Version of the app which uses the API
finalinherited
- endpoint → String
-
The endpoint of the request, should be set by the subclass
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
Host domain of the API
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
baseRequest(
{Map< String, dynamic> ? parameters, List<String> values = const []}) → Future<String> -
blueprint for a request, should called in the implementation of the
formRequest method
inherited
-
formRequest(
[List< String> ? values]) → Future<String> -
is called by the request and requestWithValuesmethod to form the
request. Should be overridden by subclasses to add
parametersinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseResponse(
dynamic json) → List< City> -
Subclasses should implement this method to parse the response from the API.
Is used in the request method.
override
-
request(
) → Future< List< City> > -
Request without values Specified, therefore the whole response is returned in parsed form.
inherited
-
requestWithValues(
List< String> values) → Future<List< String> > -
A request with
valuesspecified, only the values of the given keys invaluesare in the responseinherited -
sendRequest(
Uri url) → Future< String> -
sends the request to the specified
urlinherited -
toString(
) → String -
A string representation of this object.
inherited
-
urlRequest(
Uri url) → Future< List< City> > -
Same parsed return as request but from the given
url. Can be used if the exact url for the request is provided externally. Should not be used ifvaluesare specified.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited