sealed_writer 1.13.0 copy "sealed_writer: ^1.13.0" to clipboard
sealed_writer: ^1.13.0 copied to clipboard

Dart and Flutter sealed or union class generator and annotations, with match methods and other utilities.

example/example.dart

import 'package:sealed_writer/sealed_writer.dart';

void main() {
  final source = Manifest(
    name: 'Weather',
    items: [
      ManifestItem(
        name: 'WeatherSunny',
        shortName: 'sunny',
        equality: ManifestEquality.data,
        fields: [],
      ),
      ManifestItem(
        name: 'WeatherRainy',
        shortName: 'rainy',
        equality: ManifestEquality.data,
        fields: [
          ManifestField(
            name: 'rain',
            type: ManifestType(
              name: 'int',
              isNullable: false,
            ),
          ),
        ],
      ),
    ],
    params: [],
    fields: [],
  );

  print('==============');
  print('FORWARD WRITER');
  print('==============');

  final forward = SourceWriter(source, referToManifest: false);
  print(forward.write());

  print('===============');
  print('BACKWARD WRITER');
  print('===============');

  final backward = BackwardWriter(source);
  print(backward.write());
}
0
likes
150
pub points
7%
popularity

Publisher

verified publisher6thsolution.com

Dart and Flutter sealed or union class generator and annotations, with match methods and other utilities.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on sealed_writer