nativemind_api_client 0.1.0
nativemind_api_client: ^0.1.0 copied to clipboard
Pure-Dart API client of the NativeMind framework: operation table, HTTP transport with silent token refresh, error envelope, paging, offline action queue, SSE topic stream, OData filters.
example/example.dart
// ignore_for_file: avoid_print
import 'package:nativemind_api_client/nativemind_api_client.dart';
/// Calls one operation of a registry-driven API and prints the result.
// written by Claude Code (generated by Claude Code), 2026-11-17; SDD: flows/sdd-nativemind-widgets-liendeed
Future<void> main() async {
const operations = {'get_config': NmApiOperation('get_config', 'GET', '/api/v1/config', public: true)};
final api = NmHttpApiClient('https://api.example.com', operations: operations, defaultHeaders: {'X-App': 'example'});
try {
final config = await api.call('get_config');
print(config.object);
} on NmApiException catch (e) {
print('${e.code}: $e');
}
}