Requirements
- Dart SDK >=3.0.0
- Works on Flutter (mobile, web, desktop) and Dart CLI
Install
Add to yourpubspec.yaml:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install the Law4Devs Flutter/Dart SDK and make your first API call.
pubspec.yaml:
dependencies:
law4devs: ^1.0.0
dart pub get
flutter pub get
import 'package:law4devs/law4devs.dart';
final client = Law4DevsClient(
apiKey: Platform.environment['LAW4DEVS_API_KEY'],
);
final page = await client.frameworks.list();
print(page.data.first.name); // e.g. "Cyber Resilience Act"
final client = Law4DevsClient(
apiKey: Platform.environment['LAW4DEVS_API_KEY'],
baseUrl: 'https://api.law4devs.eu/v1', // default
timeout: const Duration(seconds: 30), // default
maxRetries: 3, // retries on 429/5xx
);
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | String? | null | Your API key (required for authenticated endpoints) |
baseUrl | String | Production URL | Override for dev/staging environment |
timeout | Duration | Duration(seconds: 30) | Per-request HTTP timeout |
maxRetries | int | 3 | Retries on 429/5xx responses |
export LAW4DEVS_API_KEY="your-key"
final client = Law4DevsClient(
apiKey: Platform.environment['LAW4DEVS_API_KEY'],
);
// verify_install.dart
import 'package:law4devs/law4devs.dart';
import 'dart:io';
void main() async {
final client = Law4DevsClient(
apiKey: Platform.environment['LAW4DEVS_API_KEY'],
);
final page = await client.frameworks.list();
print('${page.meta.total} frameworks');
}
LAW4DEVS_API_KEY=your-key dart run verify_install.dart
# → 19 frameworks
Was this page helpful?
