tgtg_client library

Classes

Address
The Address contains the relevant information about the Location of a Store.
AuthManager
Manages the authentication process with the JSON file.
Badge
The Badge gives information about the Item.
Country
The Country contains the isoCode and the name of a nation.
CoverImage
The CoverImage contains the pictureId and the currentUrl of a cover image.
GooglePlayScraper
A scraper for accessing the last number version of the Too Good To Go app.
Interval
The Interval contains the start and the end of an interval.
Items
The Items contains all the information about a product.
LatLng
The LatLng contains the latitude and the longitude of a Location.
Location
The Location contains the relevant like the Address and the LatLng.
Logger
A logger that logs messages to the console.
Order
The Order contains the relevant information about an Order.
Orders
The Orders contains all the information about an order.
Picture
The Picture contains the pictureId and the currentUrl of a picture.
Price
The Price contains the code, the minorUnits and the decimals of a Item.
Product
The Item contains all the information about a item itself.
Rating
The Rating contains the averageOverallRating, the ratingCount and the monthCount of a Item.
Request<T>
A request holds all the information necessary to make a request to the API.
Response<T>
The response to a Request.
SalesTax
The SalesTax contains the taxDescription and the taxPercentage of a sales tax.
Store
The Store contains the relevant information about a Store.
TgTgClient
A client for accessing the Too Good To Go API.
TgTgCredentials
Credentials for accessing the Too Good To Go API as a registered user.
TgTgItems
Provides access to resources related to Items.
TgTgOrders
Provides access to resources related to Orders.
TgTgSettings
The settings for the UnsplashClient.

Enums

Color
Colors for the logger.
Level
Levels of logging.

Extensions

RequestExtension on Request<T>
Extension on Request.

Constants

activeOrder → const String
The endpoint to fetch the active orders.
apiItem → const String
The endpoint for retrieving the list of items.
authByEmail → const String
The endpoint for authenticating.
authPolling → const String
The endpoint for the polling the authentication status.
baseUrlTgTg → const String
The base url of the API.
inactiveOrder → const String
The endpoint to fetch the inactive orders.
maxPollingTries → const int
Max attempts for a request.
playStoreUrl → const String
The url of the PlayStore page of the app.
pollingWaitTime → const Duration
Seconds for the polling wait time.
refresh → const String
The endpoint to refresh the token.
signUpByEmail → const String
The endpoint to sign up with an email.

Properties

regexScript RegExp
RegEx used to extract the version number from the PlayStore link.
final

Functions

getDefaultUserAgent() String
Get a random default user agent.
itemsFromJson(Map<String, dynamic> body) List<Items>
Deserializes the body into a list of Items.
ordersFromJson(Map<String, dynamic> body) Orders
Deserializes the body into a list of Orders.
publicActionAuthHeader(TgTgCredentials credentials, String cookie) Map<String, String>
Injection TgTgCredentials into the header.
userAgents({String? version = "22.5.5"}) List<String>
User agents for testing.

Typedefs

BodyDeserializer<T> = T Function(dynamic body)
Body deserializer as typedef.