DefaultTextStyle.merge and IconTheme.merge improvements (#9358)
I can't figure out if this is genius or a giant hack. This lets you use DefaultTextStyle.merge and IconTheme.merge without specifying a BuildContext. It automatically merges in at the appropriate place in the tree using a Builder widget.
This commit is contained in:
@@ -248,8 +248,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
controller: cardModel.textController,
|
||||
),
|
||||
)
|
||||
: new DefaultTextStyle.merge(
|
||||
context: context,
|
||||
: DefaultTextStyle.merge(
|
||||
style: cardLabelStyle.copyWith(
|
||||
fontSize: _varyFontSizes ? 5.0 + index : null
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user