enum_string_value_generator 0.0.1+2

  • Readme
  • Changelog
  • Installing
  • new41

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|enumHasValueBuilder:
        generate_for:
          - lib/*.dart

Add packages to your pubspec.yaml.

dependencies:
  enum_string_value_lib: ^0.0.1

dev_dependencies:
  build_runner: ^1.7.2
  enum_string_value_generator: ^0.0.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.

$ pub run build_runner build

0.0.1+2 #

  • Configure dependencies for using with built_value

0.0.1+1 #

  • Configure dependencies for using with built_value

0.0.1 #

  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  enum_string_value_generator: ^0.0.1+2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:enum_string_value_generator/enum_string_value_generator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
1
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
52
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health issues and suggestions

Document public APIs. (-1 points)

2 out of 2 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/enum_has_value_generator.dart.

Run dartfmt to format lib/src/enum_has_value_generator.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (analyzer).

The package description is too short. (-18 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and enum_string_value_generator.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0-dev.0.0 <3.0.0
analyzer ^0.38.5 0.38.5 0.39.2+1
build ^1.2.2 1.2.2
code_builder ^3.2.1 3.2.1
enum_string_value_lib ^0.0.1 0.0.1
source_gen ^0.9.4+6 0.9.4+6
Transitive dependencies
args 1.5.2
async 2.4.0
built_collection 4.3.0
built_value 7.0.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
fixnum 0.10.11
front_end 0.1.27 0.1.29
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
kernel 0.3.27 0.3.29
logging 0.11.3+2
matcher 0.12.6
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pub_semver 1.4.2
quiver 2.1.2+1
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
pedantic ^1.8.0 1.9.0
test ^1.6.0