You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally decided to upgrade to 3.x.x version. I'm using multidropdown in my own wrappers (for styling and convenience) and they all started throwing error:
'T' doesn't conform to the bound 'Object' of the type parameter 'T'. Try using a type that is or is a subclass of 'Object'.
It turns out, MultiDropdown widget specifies T as T extends Object. That's why T in my class becomes not compatible. It doesn't make sense to me, given that every class supposedly extends Object class anyway, but this is breaking widgets like mine. The solution is to add extends Object to the wrapper class:
(and in the State class as well for stateful widgets).
Not sure why MultDropdown needs this 'extends Object', but this solution worked for me.
PS. Upgrading library and renaming everything and hoping that it will just work for library users is simply nuts. 3.x.x should've been a new package as it has little to do with 2.x.x.
The text was updated successfully, but these errors were encountered:
@singgihmardianto yes, but why is it needed? Every type in dart already extending Object by definition.
The only reason I can think of is for not allowing null to be passed, but I'm struggling to undertand the real world scenario where this is something that real humans would write.
I have many custom wrappers around different widgets for my form fields, and this one is the only one that requires extends Object to be specified in order to compile (and it's not documented anywhere).
Finally decided to upgrade to 3.x.x version. I'm using multidropdown in my own wrappers (for styling and convenience) and they all started throwing error:
'T' doesn't conform to the bound 'Object' of the type parameter 'T'. Try using a type that is or is a subclass of 'Object'.
The simplest possible way to reproduce it:
It turns out, MultiDropdown widget specifies T as
T extends Object
. That's whyT
in my class becomes not compatible. It doesn't make sense to me, given that every class supposedly extends Object class anyway, but this is breaking widgets like mine. The solution is to addextends Object
to the wrapper class:(and in the State class as well for stateful widgets).
Not sure why MultDropdown needs this 'extends Object', but this solution worked for me.
PS. Upgrading library and renaming everything and hoping that it will just work for library users is simply nuts. 3.x.x should've been a new package as it has little to do with 2.x.x.
The text was updated successfully, but these errors were encountered: