rpmtw_api_client 1.0.8-dev.2 copy "rpmtw_api_client: ^1.0.8-dev.2" to clipboard
rpmtw_api_client: ^1.0.8-dev.2 copied to clipboard

outdated

RPMTW api client library for Dart

RPMTW API Client (Dart) #

Install #

dart pub add rpmtw_api_client

Example #

import "package:rpmtw_api_client/rpmtw_api_client.dart";

void main() async {
  RPMTWApiClient.init(); // Initialize RPMTW API Client
  RPMTWApiClient apiClient = RPMTWApiClient.instance;
  print(apiClient.apiBaseUrl);

  // Valid password
  PasswordValidatedResult result =
      await apiClient.authResource.validPassword("12345");
  print(result.message);

  // Print hello world
  String message = await apiClient.otherResource.helloWorld();
  print(message);

  // Get client's IP address
  String ip = await apiClient.otherResource.getIP();
  print(ip);

  // Search for mods
  ListModelResponse modsResponse =
      await apiClient.minecraftResource.search(limit: 5);
  print(modsResponse.data);
  print(modsResponse.limit);
  print(modsResponse.skip);
  print(modsResponse.total);
}

Docs

Other Language #

Kotlin