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:
Adam Barth
2016-05-16 10:35:35 -07:00
parent 707fe582a6
commit 55f9145ef4
22 changed files with 52 additions and 30 deletions

View File

@@ -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(