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
For consistency, perhaps it would be nice to update forge2d API to also support this pattern. For example, with shapes. We could:
final shape =CircleShape(radius: radius);
instead of
final shape =CircleShape()
..radius = radius;
Additional Context
Personally, both can be seen as equivalent. I think both APIs should be supported (cascading and optional parameters). Besides consistency with flame, one could also argue that using the positional parameter avoids setting/changing the value first unnecessary, since we already know its computed value and will change instantly after.
In addition, we also benefit from the analyser when we are setting default values.
This issue is open to discussion. If we decide to proceed I'm willing to contribute with this update.
The text was updated successfully, but these errors were encountered:
Description
From
flame
, one can instantiate a component as follows:See implementation here.
For consistency, perhaps it would be nice to update forge2d API to also support this pattern. For example, with shapes. We could:
instead of
Additional Context
Personally, both can be seen as equivalent. I think both APIs should be supported (cascading and optional parameters). Besides consistency with
flame
, one could also argue that using the positional parameter avoids setting/changing the value first unnecessary, since we already know its computed value and will change instantly after.In addition, we also benefit from the analyser when we are setting default values.
This issue is open to discussion. If we decide to proceed I'm willing to contribute with this update.
The text was updated successfully, but these errors were encountered: