Manuel Unterhofer11/16/2023, 10:20 AM
, etc.? It’ll limit user-space options now
Casey Brooks11/16/2023, 4:02 PM
shikasd11/16/2023, 5:57 PM
functions and state objects. Using a class to store those values is much better for performance, as 95% of cases can be handled by providing the color as parameter. What's the use-case that it restricted for you?
Manuel Unterhofer11/17/2023, 7:20 AM
though, with a non-
, couldn’t it? That should yield the same performance? I’m currently designing a custom theme system and we’re trying to decide between the
approach for us. The scenario we have in mind would be to set up custom animated transitions between the colors for arbitrary states or even to add additional states on any
which are more complex than what `Indication`s can offer. For example, changing the border color on hover. For that purpose, we’d be passing an
into all color state factories, like it is already done in most of
, even if not used by default. With a class, this option isn’t there anymore.
shikasd11/17/2023, 12:17 PM
Manuel Unterhofer11/17/2023, 12:19 PM
shikasd11/17/2023, 12:22 PM
Manuel Unterhofer11/17/2023, 12:23 PM
shikasd11/17/2023, 12:28 PM
Manuel Unterhofer11/17/2023, 12:29 PM
shikasd11/17/2023, 12:33 PM
, as Material already handles many interactions internally. I assume that you are not really interested in some material aspects, so for you it might be easier to just customize
+ text or even
+ text. Ideally, you'd avoid creating and memoizing intermediate states and just have state for color that is later used to invalidate draw pass
Manuel Unterhofer11/17/2023, 1:15 PM
you collect and update interactions at composition time, while creating extra states.I’m trying to understand this all the way. Am I right that the actual issue is that the color state will be read during composition, while passing it to the corresponding modifier as a parameter? Because setting up some state on initial composition is the only way to do that, isn’t it? And such a problem could be avoided with a draw modifier that takes a lambda for determining its inputs, including the color?
shikasd11/17/2023, 1:18 PM
in a draw modifier instead of invalidating composition with modifier
. If you are switching between discrete values, it should be fine though.
Manuel Unterhofer11/17/2023, 1:31 PM