dust_dart 0.1.0 copy "dust_dart: ^0.1.0" to clipboard
dust_dart: ^0.1.0 copied to clipboard

Annotations and runtime support for generating Dart code with dust.

example/dust_dart_example.dart

import 'package:dust_dart/dust_dart.dart';

Result<int, String> parseCount(String text) {
  final value = int.tryParse(text);
  return value == null ? const Err('invalid count') : Ok(value);
}

void main() {
  const derive = Derive([ToString()]);
  final label = parseCount(
    '42',
  ).match(ok: (value) => 'count=$value', err: (error) => error);

  print('${derive.traits.length} $label');
}
0
likes
160
points
336
downloads

Documentation

API reference

Publisher

verified publisherwidget-lab.dev

Weekly Downloads

Annotations and runtime support for generating Dart code with dust.

Repository (GitHub)
View/report issues
Contributing

Topics

#codegen #annotations #json #validation #http

License

MIT (license)

Dependencies

collection, dio, meta

More

Packages that depend on dust_dart