has_is_getters 1.1.0 copy "has_is_getters: ^1.1.0" to clipboard
has_is_getters: ^1.1.0 copied to clipboard

discontinued

Annotations for generating getters for checking whether a field is null or checking the value of a field.

example/main.dart

// ignore_for_file: undefined_getter, uri_has_not_been_generated

import 'package:has_is_getters/has_is_getters.dart';

part 'main.g.dart';

enum Shape { round, curved }

class Fruit {
  @GenerateHasGetter(generateNegation: true)
  int number;

  @GenerateIsGetters(usePrefix: true, generateNegations: true)
  Shape theShape;

  Fruit(this.number, this.theShape);
}

void main() {
  var banana = Fruit(2, Shape.curved);

  print(banana.isTheShapeRound);
  print(banana.isTheShapeNotRound);
  print(banana.hasNumber);
  print(banana.hasNoNumber);

  if (banana.theShape == Shape.round) {
    print('The shape is round.');
  }
}
2
likes
30
points
47
downloads

Publisher

unverified uploader

Weekly Downloads

Annotations for generating getters for checking whether a field is null or checking the value of a field.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

build_config

More

Packages that depend on has_is_getters