OpenPricesAPIClient class

Client calls of the Open Prices API.

cf. https://prices.openfoodfacts.org/api/docs

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createPrice({required Price price, required String bearerToken, UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<Price>>
deletePrice({required int priceId, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) Future<MaybeError<bool>>
Deletes a price. A user can delete only owned prices. Returns true if successful.
deleteProof({required int proofId, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) Future<MaybeError<bool>>
Deletes a proof. A user can delete only owned proofs. Can delete only proofs that are not associated with prices. A moderator can delete not owned proofs. Returns true if successful.
deleteUserSession({UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) Future<MaybeError<bool>>
Deletes a user session.
getAuthenticationToken({required String username, required String password, bool setCookie = false, UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<String>>
Authentication: provide username/password and get a bearer token in return.
getLocation(int locationId, {UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<Location>>
getLocations(GetLocationsParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) Future<MaybeError<GetLocationsResult>>
getOSMLocation({required int locationOSMId, required LocationOSMType locationOSMType, UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<Location>>
getPriceProductByCode(String productCode, {UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<PriceProduct>>
getPriceProductById(int productId, {UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<PriceProduct>>
getPrices(GetPricesParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) Future<MaybeError<GetPricesResult>>
getStatus({UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<String>>
Returns the status of the server.
getUserSession({UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) Future<MaybeError<Session>>
Returns the session details related to this bearerToken.
uploadProof({required ProofType proofType, required bool isPublic, required Uri imageUri, required dynamic mediaType, required String bearerToken, UriProductHelper uriHelper = uriHelperFoodProd}) Future<MaybeError<Proof>>

Constants

statusRunning → const String
Status when the server is running (cf. getStatus).