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

A client library for the Serverpod Ground Control API. Used to manage Serverpod Cloud projects.

example/main.dart

import 'package:ground_control_client/ground_control_client.dart';

// This is the URL to the server and should be replaced with the actual URL to
// the server.
var url = 'http://localhost:8080/';

Future<void> main() async {
  var client = Client(
    url,
    authenticationKeyManager: _SimpleAuthenticationKeyManager(),
  );

  var isSignedIn = await client.modules.auth.status.isSignedIn();
  print('Is signed in: $isSignedIn');

  client.close();
}

// Simple implementation for managing authentication keys.
class _SimpleAuthenticationKeyManager extends AuthenticationKeyManager {
  String? _key;

  @override
  Future<String?> get() async {
    return _key;
  }

  @override
  Future<void> put(String key) async {
    _key = key;
  }

  @override
  Future<void> remove() async {
    _key = null;
  }
}
1
likes
0
points
317
downloads

Publisher

verified publisherserverpod.dev

Weekly Downloads

A client library for the Serverpod Ground Control API. Used to manage Serverpod Cloud projects.

Homepage
Repository (GitHub)
View/report issues

Topics

#api #client

License

unknown (license)

Dependencies

http, mocktail, serverpod_auth_client, serverpod_client

More

Packages that depend on ground_control_client