Either is fine / works, it’s basically the same thing.
Text
by default will use the value in
LocalTextStyle
, which is provided by
ProvideTextStyle
- it just depends at what layer you want to customize this.
If you want to in one specific place change the text style, then you should just do
style = newTextStyle
If you want to customize it multiple places and share it across your application, then creating
MyBottomNavigationItem
and using
ProvideTextStyle
lets you do that, then you can just write:
MyBottomNavigationItem {
Text(...)
}
And this will automatically use
newTextStyle
without you needing to change anything. It also means that if you want to change it in the future, you only need to edit one function, instead of multiple call sites