built_bloc icon indicating copy to clipboard operation
built_bloc copied to clipboard

Another case of dynamic generated

Open jaumard opened this issue 5 years ago • 6 comments

@sink
@Bind('_handleColorModification')
final PublishSubject<Color> _changeColor = PublishSubject();  

Is generated to :

Sink<dynamic> get changeColor => this._parent._changeColor.sink;

jaumard avatar Feb 05 '19 11:02 jaumard

The issue is about code generation in general. Generators don't have access to dart:ui

rrousselGit avatar Feb 05 '19 11:02 rrousselGit

Ho didn't know that ! That explain why I also have it for Locale ^^ Thanks for the explanation @rrousselGit ! Is it something the dart team is working on ? Look like a small limitation but can by quite annoying... Wondering why generators can't have access to this one

jaumard avatar Feb 05 '19 11:02 jaumard

Because dart:ui is flutter only. While generators are using the real dart sdk

rrousselGit avatar Feb 05 '19 11:02 rrousselGit

Any tip to fix that @rrousselGit ? If I remember well you encountered the same issue with functional_widget.

aloisdeniel avatar Feb 13 '19 08:02 aloisdeniel

I manually extracted the type name through computeNode when a DartType has isUnknown.

But this is not even remotely close to covering all scenarios.

rrousselGit avatar Feb 13 '19 08:02 rrousselGit

Okay, thanks @rrousselGit.

Just looked the computeNode declaration and it is now deprecated. :/

And it looks like it will be funny to get the parameter type token from the original type from that...

aloisdeniel avatar Feb 20 '19 12:02 aloisdeniel