equatable_gen 1.2.0 copy "equatable_gen: ^1.2.0" to clipboard
equatable_gen: ^1.2.0 copied to clipboard

Automatically creates 'props' getters for classes using the equatable package.

example/main.dart

import 'package:equatable_annotations/equatable_annotations.dart';
import 'package:equatable/equatable.dart';

part 'main.g.dart';

@generateProps
class Example1Class extends Equatable {
  Example1Class({required this.value, this.ignored, this.optional});

  final String value;
  final String? optional;

  @ignore
  final String? ignored;

  @override
  List<Object?> get props => _$props;
}

@generateProps
class Example2Class with EquatableMixin {
  const Example2Class({required this.value, this.ignored, this.optional});

  final String value;
  final String? optional;

  @ignore
  final String? ignored;

  @override
  List<Object?> get props => _$props;
}
3
likes
160
points
1.22k
downloads

Publisher

verified publishermrgnhnt.com

Weekly Downloads

Automatically creates 'props' getters for classes using the equatable package.

Homepage
View/report issues

Topics

#equatable #equality #equals #props #generator

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

analyzer, build, change_case, code_builder, dart_style, equatable, equatable_annotations, meta, path, source_gen, source_span, yaml

More

Packages that depend on equatable_gen