enum_string_value_generator 0.0.2+2
enum_string_value_generator: ^0.0.2+2

Dart native

It's append String expressions/values for your own enum classes!

Generator of enum_string_value.

Usage #

(See whole example project)

Put build.yaml on the root of your project.

targets:
  $default:
    builders:
      enum_string_value_generator|enum_string_value:
        generate_for:
          - lib/**/*.dart

Add packages to your pubspec.yaml.

dependencies:
  enum_string_value_lib: ^1.0.0+1

dev_dependencies:
  build_runner: ^1.7.2
  enum_string_value_generator: ^0.0.2+1

Add @Value annotation to your enum values and part directive for the generated file.

// os.dart
import 'package:enum_string_value_lib/enum_string_value_lib.dart';
part "os.value.g.dart";

enum OsKind {
  @Value("Android")
  android,
  @Value("iOS")
  ios,
}

Run build_runner on your project.

for pure Dart project:

$ pub run build_runner build

for Flutter project

$ flutter packages pub run build_runner build
0
likes
80
pub points
16%
popularity

It's append String expressions/values for your own enum classes!

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

kikuchy.h@gmail.com

License

BSD (LICENSE)

Dependencies

analyzer, build, code_builder, enum_string_value_lib, source_gen

More

Packages that depend on enum_string_value_generator