boltcart_sdk 0.1.0
boltcart_sdk: ^0.1.0 copied to clipboard
Type-safe Dart and Flutter SDK for the Boltcart backend.
example/boltcart_sdk_example.dart
import 'package:boltcart_sdk/boltcart_sdk.dart';
Future<void> main() async {
final sdk = BoltcartSdk(
baseUrl: Uri.parse('https://api.example.com'),
auth: BoltcartAuth.bearer('replace-with-access-token'),
);
final health = await sdk.system.getHealth();
switch (health) {
case ApiSuccess(:final data):
print('API is ${data.status}; uptime=${data.uptime}');
case ApiFailure(:final error):
print('API request failed: ${error.message}');
}
}