Closed ened closed 4 years ago
Given I have a super_enum definition like this:
@superEnum enum _ContactUsAction { CallPhone, StartLiveChat }
Then the generated when method looks like this:
R when<R>( {@required FutureOr<R> Function(CallPhone) callPhone, @required FutureOr<R> Function(StartLiveChat) startLiveChat}) { ...
could this possibly be simplified to:
R when<R>( {@required FutureOr<R> Function() callPhone, @required FutureOr<R> Function() startLiveChat}) { ...
As from my point of view, the event has no associated values and thus does not need to be passed into the when method.
Yes, it can be done. @astralstriker what are your views on this?
@ened @xsahil03x yes looks redundant to me too, we should remove them.
Given I have a super_enum definition like this:
Then the generated when method looks like this:
could this possibly be simplified to:
As from my point of view, the event has no associated values and thus does not need to be passed into the when method.