-
-
Notifications
You must be signed in to change notification settings - Fork 892
Open
Labels
Description
What do you want implemented?
Using a type extension instead of a typedef is a good quality-of-life improvement, although breaking.
Here's what it could look like:
extension type LayerHitNotifier<R extends Object>._(
ValueNotifier<LayerHitResult<R>?> notifier)
implements ValueNotifier<LayerHitResult<R>?> {
LayerHitNotifier() : this._(ValueNotifier(null));
@internal
@redeclare
set value(LayerHitResult<R>? v) => notifier.value = v;
}Creating a notifier becomes more self explanatory:
- final LayerHitNotifier<Object> hitNotifier = ValueNotifier(null);
+ final hitNotifier = LayerHitNotifier<Object>();Trying to externally set its value (which is not necessary) can be discouraged by the @internal annotation which causes a linting warning.
What other alternatives are available?
No response
Can you provide any other information?
No response