dartactyl 1.1.5
dartactyl: ^1.1.5 copied to clipboard
An API client for Pterodactyl Panel
example/dartactyl_example.dart
import 'package:dartactyl/dartactyl.dart';
final panelUrl = 'https://panel.example.com';
String apiKey = '<API-Key>';
void main(List<String> args) async {
print('Starting!');
PteroClient client = PteroClient.generate(url: panelUrl, key: apiKey);
print('Getting Data!');
await client.getServers().then((response) {
Server? server = response.data?[0].attributes;
print('${server?.name} : ${server?.description}');
});
await client.getAccountInfo().then((response) {
User? accountInfo = response.attributes;
print('${accountInfo?.username} : ${accountInfo?.email}');
});
print('Done!');
}