enum_assist 0.1.0+1 copy "enum_assist: ^0.1.0+1" to clipboard
enum_assist: ^0.1.0+1 copied to clipboard

Seamlessly generate extension methods and json conversion classes for your enums using enum_assist

example/lib/enum_assist_example.dart

import 'package:enum_assist_annotation/enum_assist_annotation.dart';

part 'enum_assist_example.ge.dart';

@EnumAssist(
  createJsonConv: true, // default
  serializedFormat: SerializedFormat.none, // default
  useDocCommentAsDescription: true, // default
)
enum Example {
  @EnumValue(
    readable: 'One', // default
    description: 'one description', // default (uses doc comment)
    extensions: [], // default
    serializedValue: 'one', // default
    useDocCommentAsDescription: true, // default
  )

  /// one description
  one,

  @EnumValue(
    readable: 'Two', // default
    description:
        null, // default (uses nothing because [useDocCommentAsDescription] is false)
    extensions: [], // default
    serializedValue: 'two', // default
    useDocCommentAsDescription: false, // overridden
  )
  // two description
  two,

  @EnumValue(
    readable: 'Threeeeee', // overridden
    description: 'three is the best', // overridden
    extensions: [], // default
    serializedValue: '3', // overridden
    useDocCommentAsDescription: false, // overridden
  )

  /// three description
  three,
}
8
likes
110
pub points
0%
popularity

Publisher

verified publishermrgnhnt.com

Seamlessly generate extension methods and json conversion classes for your enums using enum_assist

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, build_config, change_case, enum_assist_annotation, json_annotation, meta, source_gen, source_helper

More

Packages that depend on enum_assist