Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt

Use this file to discover all available pages before exploring further.

Requirements

  • Dart SDK >=3.0.0
  • Works on Flutter (mobile, web, desktop) and Dart CLI

Install

Add to your pubspec.yaml:
dependencies:
  law4devs: ^1.0.0
Then run:
dart pub get
Or for Flutter projects:
flutter pub get

First Call

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"

Configuration

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
);
OptionTypeDefaultDescription
apiKeyString?nullYour API key (required for authenticated endpoints)
baseUrlStringProduction URLOverride for dev/staging environment
timeoutDurationDuration(seconds: 30)Per-request HTTP timeout
maxRetriesint3Retries on 429/5xx responses

Environment Variable

export LAW4DEVS_API_KEY="your-key"
final client = Law4DevsClient(
  apiKey: Platform.environment['LAW4DEVS_API_KEY'],
);
Never hardcode your API key in source code or commit it to version control.

Verify the Install

// 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