I want to concat two TextStyle like react or react-native.
style={[styles.firstStyle, styles.secondStyle]}
but i don't know how to do this in flutter. How to result like below?
TextStyle(color: Colors.white, fontFamily: CUSTOM)
This concatenate with:
TextStyle(color: Colors.black, fontSize: 17)
result is below.
TextStyle(color: Colors.black, fontFamily: CUSTOM, fontSize: 17)
You can use the merge method.
var firstStyle = TextStyle(color: Colors.white, fontFamily: CUSTOM);
var secondStyle = TextStyle(color: Colors.black, fontSize: 17);
var mergedStyle = firstStyle.merge(secondStyle);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With