-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/styled icon supporting decorators #159
Conversation
@@ -62,6 +62,9 @@ class RenderWidgetDecorators extends StatelessWidget { | |||
final decorator = decoratorMap.remove(decoratorType); | |||
if (decorator == null) continue; | |||
current = decorator.build(mix, current); | |||
|
|||
// Remove the decorator from the MixData, because it can be applied only once. | |||
mix.removeType(decoratorType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tilucasoli I believe we might have to take another approach than mutating the attributes of the MixData; I think we might have to create an immutable class and pass it down to the child.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it's really important to remember!
Thinking about possible solutions, I identified two. The first one is to propagate a new value in RenderWidgetDecorators
using MixProvider
. The second possibility is to create a new MixData
without the decorator attributes when the existing MixData
is inherited from MixProvider
. My favorite solution is the second one, because adding a new widget to the widget tree unnecessarily doesn't seem like a good ideia.
Create a where constructor in MixData
remove RenderWidgetDecorators when there isnt decorators attributes in style
lib/src/specs/icon/icon_widget.dart
Outdated
import '../../factory/mix_provider_data.dart'; | ||
import 'icon_attribute.dart'; | ||
import 'icon_spec.dart'; | ||
import '../../../mix.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just be aware of this, vscode does this all the time to consolidate the exports. I wonder if there is a way to make sure it does not use mix.dart as an import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue ticket number
closes #156
Describe your changes
isInheritable
, in theAttribute
class;isInheritable
property returns false;Type of change
Checklist before requesting a review