yago_cloud 1.2.5 copy "yago_cloud: ^1.2.5" to clipboard
yago_cloud: ^1.2.5 copied to clipboard

Yago Cloud API Client for Flutter & Dart

yago_cloud #

Augemented Reality Made Easy.

A generated Yago Cloud API Client for Flutter & Dart.

Requirements #

Dart 2.12 or later

Installation & Usage #

Install via pub.dev:

flutter pub add yago_cloud

Getting Started #

Here's a small example how to list all projects:

import 'dart:io';
import 'dart:developer';
import 'package:yago_cloud/api.dart';

listProjects() async {
  try {
    final authApi = AuthApi();
    final loginResult = await authApi.authLoginCreate(
      TokenObtainRequest(
        email: '<YAGO-ACCOUNT-EMAIL>',
        password: '<YAGO-ACCOUNT-PASSWORD>',
      ),
    );

    final accessToken = loginResult!.access;
    print('Login successful!');

    final bearerAuth = HttpBearerAuth();
    bearerAuth.accessToken = accessToken;
    final apiClient = ApiClient(authentication: bearerAuth);

    final projectsApi = ProjectsApi(apiClient);
    final projectList = await projectsApi.projectsList();
    projectList!.sort((project, other) => project.modified.compareTo(other.modified));

    print('## Yago projects list');
    for (final project in projectList) {
      print('- ${project.name}');
    }

    print('## Yago models list');
    final modelsApi = ModelsApi(apiClient);
    final modelsList = await modelsApi.modelsList(project: projectList.first.id);
    for (final model in modelsList ?? []) {
      print('- ${model.name}');
    }

  } on ApiException catch (error) {
    log('Login Failed: ', error: error);
  }
}

Future<void> main() async {
  await listProjects();
  exit(0);
}

API Authorization #

There 2 major ways to authenticate with Yago API:

jwtAuth #

Login with email address and password.

  • Type: HTTP Bearer authentication

tokenAuth #

Use a fixed API token pinned to a User.

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header
1
likes
0
pub points
12%
popularity

Publisher

verified publisheryago.cloud

Yago Cloud API Client for Flutter & Dart

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

collection, http, intl, meta

More

Packages that depend on yago_cloud