Rename DefaultTextStyle constructor to explicit (#3920)
To make it clear that this constructor requires an explicit style. Also throw a descriptive error recommending the inherit constructor for styles with the inherit bit set. Fixes #3842
This commit is contained in:
@@ -97,7 +97,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
if (heavy)
|
||||
size *= kHeavyMultiplier;
|
||||
|
||||
Widget contents = new DefaultTextStyle(
|
||||
Widget contents = new DefaultTextStyle.explicit(
|
||||
style: Theme.of(context).textTheme.body1,
|
||||
textAlign: TextAlign.center,
|
||||
child: new Dot(
|
||||
@@ -185,7 +185,7 @@ class MovableBall extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget ball = new DefaultTextStyle(
|
||||
Widget ball = new DefaultTextStyle.explicit(
|
||||
style: Typography.white.body1,
|
||||
textAlign: TextAlign.center,
|
||||
child: new Dot(
|
||||
|
||||
Reference in New Issue
Block a user