mix icon indicating copy to clipboard operation
mix copied to clipboard

[Question] TextMix

Open Solido opened this issue 2 years ago • 2 comments

Reading the documentation

TextMix(
  'Mix is AWESOME!'
  mix: Mix(
    fontSize(16.0),
    textColor(Colors.black),
    bold(),
    textShadow(
      offset: const Offset(2.0, 2.0),
    ),
  ),
),

My understanding is that a mix passed as parameters will override any other inherited value but this is not reflected in my code. Not sure if it is a bug.

Thx!

Solido avatar Mar 09 '22 15:03 Solido

Looks like I need to play with inherit and the mix order matter a lot. I was expecting that the last Mix override the top but it seems to work at reverse.

When using apply on a parent Mix I get the expected result. Set inherit to false will reset all attributes. But using mix inside TextMix will not override a parent Mix

Solido avatar Mar 09 '22 15:03 Solido

@Solido Can you explain the inherit false, resetting the attributes? It should ignore any inherited mixes, but still, apply attributes defined on its own context..

I am adding to the roadmap more tests on the factory and context.

PS. Did a PR addressing the inherited order.

leoafarias avatar Mar 09 '22 17:03 leoafarias