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
Right now, our only way to get a specific widget in the widget tree is id-based methods.
This requires us to create widgets with pre-allocated IDs, which is cumbersome in a couple of ways. And because WidgetId carries no type information, we need to downcast the widget we retrieve this way.
A better API would be one based around a typed Selector<W> type; search methods could take that type as an input (which could have optional attributes like id, substring, etc), and would returned a typed WidgetRef/WidgetMut with the downcast done internally.
Doing so would probably make a lot of unit tests easier to read and write.
The text was updated successfully, but these errors were encountered:
Right now, our only way to get a specific widget in the widget tree is id-based methods.
This requires us to create widgets with pre-allocated IDs, which is cumbersome in a couple of ways. And because WidgetId carries no type information, we need to downcast the widget we retrieve this way.
A better API would be one based around a typed
Selector<W>
type; search methods could take that type as an input (which could have optional attributes likeid
,substring
, etc), and would returned a typedWidgetRef
/WidgetMut
with the downcast done internally.Doing so would probably make a lot of unit tests easier to read and write.
The text was updated successfully, but these errors were encountered: