tgtg_client 0.0.2 copy "tgtg_client: ^0.0.2" to clipboard
tgtg_client: ^0.0.2 copied to clipboard

outdated

Too Good To Go is a service that connects customers to restaurants and stores that have surplus unsold food. This is an unofficial client to access their API.

example/lib/main.dart

import "dart:developer";

import "package:tgtg_client/tgtg_client.dart";

Future<void> main() async {
  final settings = await TgTgSettings.instance(
    email: "batman@waynenterprises.com",
  );

  final client = TgTgClient(settings: settings);

  log(client.settings.credentials.toString());

  await client.login();

  log(client.settings.credentials.toString());

  final allItems = await client.items.getAll(
    favoritesOnly: false,
    latitude: 51.44,
    longitude: 5.46,
    radius: 10,
  );

  log(allItems.toString());

  try {
    final itemById = await client.items.getById(
      id: "741575eqe",
    );
    log(itemById.toString());
  } catch (e) {
    log(e.toString());
  }

  final inactiveOrders = await client.orders.getActive();

  log(inactiveOrders.toString());

  final setFavoriteItem = await client.items.setFavorite(
    id: "884134",
    isFavorite: true,
  );

  log(setFavoriteItem.toString());
}
6
likes
0
pub points
0%
popularity

Publisher

verified publisherfrancescocoppola.me

Too Good To Go is a service that connects customers to restaurants and stores that have surplus unsold food. This is an unofficial client to access their API.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

freezed_annotation, http, json_annotation

More

Packages that depend on tgtg_client