enum_string_value_generator

Last updated:

0 purchases

enum_string_value_generator Image
enum_string_value_generator Images
Add to Cart

Description:

enum string value generator

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
copied to clipboard
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
copied to clipboard
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,
}
copied to clipboard
Run build_runner on your project.
for pure Dart project:
$ pub run build_runner build
copied to clipboard
for Flutter project
$ flutter packages pub run build_runner build
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.