leancode_contracts_generator 0.11.0 copy "leancode_contracts_generator: ^0.11.0" to clipboard
leancode_contracts_generator: ^0.11.0 copied to clipboard

Dart contracts client generator for a CQRS API.

example/lib/example.dart

import 'dart:io';

import 'package:leancode_contracts_generator/leancode_contracts_generator.dart';

Future<void> main(List<String> arguments) async {
  final generator = ContractsGenerator(
    ContractsGeneratorConfig(
      input: GeneratorScript.path(['ExampleContracts/**']),
      name: 'cool_name',
      output: Directory('lib'),
      directives: "export 'my_extensions.dart';",
      extra: '// :)',
      include: RegExp(r'\w+(\.\w+)*'),
    ),
  );

  await generator.writeAll();
}