rrousselGit / state_notifier

ValueNotifier, but outside Flutter and with some extra perks
MIT License
311 stars 28 forks source link

Getter for all class attributres #40

Closed peterhijma closed 3 years ago

peterhijma commented 3 years ago

Would it be possible to get all attributes of a freezed class. So the ones you define in the constructor?

Right now I use a custom getter, like so:

@freezed
abstract class Foo with _$Foo {
  factory Foo({
    String some_string,
    String some_other_string,
  }) = _Foo;

  List<String> get props => [
      some_string,
      some_other_string,
  ];
}

But this doesn't feel very DRY.

peterhijma commented 3 years ago

I was asking this in a completely wrong repo... I'm sorry.