Commit 7ba19605 authored by Adam Barth's avatar Adam Barth

[rename fixit] ThemeData#text -> textTheme

Fixes #1278
parent b5923f92
...@@ -90,7 +90,7 @@ class ExampleDragSource extends StatelessComponent { ...@@ -90,7 +90,7 @@ class ExampleDragSource extends StatelessComponent {
size *= kHeavyMultiplier; size *= kHeavyMultiplier;
Widget contents = new DefaultTextStyle( Widget contents = new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith(textAlign: TextAlign.center), style: Theme.of(context).textTheme.body1.copyWith(textAlign: TextAlign.center),
child: new Dot( child: new Dot(
color: color, color: color,
size: size, size: size,
...@@ -174,7 +174,7 @@ class MovableBall extends StatelessComponent { ...@@ -174,7 +174,7 @@ class MovableBall extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget ball = new DefaultTextStyle( Widget ball = new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith( style: Theme.of(context).textTheme.body1.copyWith(
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white color: Colors.white
), ),
......
...@@ -177,7 +177,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -177,7 +177,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildTabView(_ButtonDemo demo) { Widget buildTabView(_ButtonDemo demo) {
return new Builder( return new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
final TextStyle textStyle = Theme.of(context).text.caption.copyWith(fontSize: 16.0); final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0);
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
children: <Widget>[ children: <Widget>[
......
...@@ -45,9 +45,9 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -45,9 +45,9 @@ class TravelDestinationItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData theme = Theme.of(context); ThemeData theme = Theme.of(context);
TextStyle titleStyle = theme.text.headline.copyWith(color: Colors.white); TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white);
TextStyle descriptionStyle = theme.text.subhead; TextStyle descriptionStyle = theme.textTheme.subhead;
TextStyle buttonStyle = theme.text.button.copyWith(color: theme.primaryColor); TextStyle buttonStyle = theme.textTheme.button.copyWith(color: theme.primaryColor);
return new Card( return new Card(
child: new SizedBox( child: new SizedBox(
......
...@@ -76,7 +76,7 @@ class DialogDemoState extends State<DialogDemo> { ...@@ -76,7 +76,7 @@ class DialogDemoState extends State<DialogDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new Scaffold( return new Scaffold(
key: scaffoldKey, key: scaffoldKey,
......
...@@ -103,7 +103,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> { ...@@ -103,7 +103,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
), ),
new Padding( new Padding(
padding: new EdgeDims.only(top: 20.0), padding: new EdgeDims.only(top: 20.0),
child: new Text("JUMPING JACKS", style: Theme.of(context).text.title) child: new Text("JUMPING JACKS", style: Theme.of(context).textTheme.title)
), ),
new Padding( new Padding(
padding: new EdgeDims.only(top: 20.0, bottom: 20.0), padding: new EdgeDims.only(top: 20.0, bottom: 20.0),
......
...@@ -18,7 +18,7 @@ class _ContactCategory extends StatelessComponent { ...@@ -18,7 +18,7 @@ class _ContactCategory extends StatelessComponent {
border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor)) border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor))
), ),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new SizedBox( new SizedBox(
...@@ -43,7 +43,7 @@ class _ContactItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class _ContactItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList(); List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList();
columnChildren.add(new Text(lines.last, style: Theme.of(context).text.caption)); columnChildren.add(new Text(lines.last, style: Theme.of(context).textTheme.caption));
List<Widget> rowChildren = <Widget>[ List<Widget> rowChildren = <Widget>[
new Column( new Column(
......
...@@ -31,7 +31,7 @@ class DateTimeItem extends StatelessComponent { ...@@ -31,7 +31,7 @@ class DateTimeItem extends StatelessComponent {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return new DefaultTextStyle( return new DefaultTextStyle(
style: theme.text.subhead, style: theme.textTheme.subhead,
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
...@@ -109,7 +109,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -109,7 +109,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
} }
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
showDialog( showDialog(
context: context, context: context,
...@@ -149,7 +149,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -149,7 +149,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
center: new Text('New Event'), center: new Text('New Event'),
right: <Widget> [ right: <Widget> [
new FlatButton( new FlatButton(
child: new Text('SAVE', style: theme.text.body1.copyWith(color: Colors.white)), child: new Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
onPressed: () { onPressed: () {
Navigator.pop(context, DismissDialogAction.save); Navigator.pop(context, DismissDialogAction.save);
} }
...@@ -170,7 +170,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -170,7 +170,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
), ),
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
child: new Text('Event name', style: theme.text.display2) child: new Text('Event name', style: theme.textTheme.display2)
) )
), ),
new Container( new Container(
...@@ -180,14 +180,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -180,14 +180,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
), ),
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
child: new Text('Location', style: theme.text.title.copyWith(color: Colors.black54)) child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54))
) )
), ),
new Column( new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.end, justifyContent: FlexJustifyContent.end,
children: <Widget>[ children: <Widget>[
new Text('From', style: theme.text.caption), new Text('From', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
dateTime: fromDateTime, dateTime: fromDateTime,
onChanged: (DateTime value) { onChanged: (DateTime value) {
...@@ -203,7 +203,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -203,7 +203,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.end, justifyContent: FlexJustifyContent.end,
children: <Widget>[ children: <Widget>[
new Text('To', style: theme.text.caption), new Text('To', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
dateTime: toDateTime, dateTime: toDateTime,
onChanged: (DateTime value) { onChanged: (DateTime value) {
......
...@@ -63,7 +63,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -63,7 +63,7 @@ class IconsDemoState extends State<IconsDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle textStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle textStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new Scaffold( return new Scaffold(
toolBar: new ToolBar( toolBar: new ToolBar(
......
...@@ -85,7 +85,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> { ...@@ -85,7 +85,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Progress Indicators')), toolBar: new ToolBar(center: new Text('Progress Indicators')),
body: new DefaultTextStyle( body: new DefaultTextStyle(
style: Theme.of(context).text.title, style: Theme.of(context).textTheme.title,
child: new GestureDetector( child: new GestureDetector(
onTap: _handleTap, onTap: _handleTap,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
......
...@@ -26,7 +26,7 @@ class _BarGraphic extends StatelessComponent { ...@@ -26,7 +26,7 @@ class _BarGraphic extends StatelessComponent {
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeDims.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color), decoration: new BoxDecoration(backgroundColor: color),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith(color: Colors.white), style: Theme.of(context).textTheme.body1.copyWith(color: Colors.white),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, justifyContent: FlexJustifyContent.spaceBetween,
children: <Widget>[ children: <Widget>[
...@@ -120,7 +120,7 @@ class ScrollingTechniquesDemo extends StatelessComponent { ...@@ -120,7 +120,7 @@ class ScrollingTechniquesDemo extends StatelessComponent {
children: <Widget>[ children: <Widget>[
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0, vertical: 32.0), padding: const EdgeDims.symmetric(horizontal: 16.0, vertical: 32.0),
child: new Text(_introText, style: Theme.of(context).text.caption) child: new Text(_introText, style: Theme.of(context).textTheme.caption)
), ),
new _TechniqueItem( new _TechniqueItem(
builder: (BuildContext context) => new FlexibleSpaceDemo(), builder: (BuildContext context) => new FlexibleSpaceDemo(),
......
...@@ -60,7 +60,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> { ...@@ -60,7 +60,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
), ),
child: new Padding( child: new Padding(
padding: const EdgeDims.all(32.0), padding: const EdgeDims.all(32.0),
child: new Text(_explanatoryText, style: Theme.of(context).text.subhead) child: new Text(_explanatoryText, style: Theme.of(context).textTheme.subhead)
) )
); );
}); });
......
...@@ -21,10 +21,10 @@ class TooltipDemo extends StatelessComponent { ...@@ -21,10 +21,10 @@ class TooltipDemo extends StatelessComponent {
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
children: <Widget>[ children: <Widget>[
new Text(_introText, style: theme.text.subhead), new Text(_introText, style: theme.textTheme.subhead),
new Row( new Row(
children: <Widget>[ children: <Widget>[
new Text('Long press the ', style: theme.text.subhead), new Text('Long press the ', style: theme.textTheme.subhead),
new Tooltip( new Tooltip(
message: 'call icon', message: 'call icon',
child: new Icon( child: new Icon(
...@@ -33,7 +33,7 @@ class TooltipDemo extends StatelessComponent { ...@@ -33,7 +33,7 @@ class TooltipDemo extends StatelessComponent {
color: theme.primaryColor color: theme.primaryColor
) )
), ),
new Text(' icon', style: theme.text.subhead) new Text(' icon', style: theme.textTheme.subhead)
] ]
), ),
new Center( new Center(
......
...@@ -18,7 +18,7 @@ class TextStyleItem extends StatelessComponent { ...@@ -18,7 +18,7 @@ class TextStyleItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle nameStyle = theme.text.body1.copyWith(color: theme.text.caption.color); final TextStyle nameStyle = theme.textTheme.body1.copyWith(color: theme.textTheme.caption.color);
return new Padding( return new Padding(
padding: const EdgeDims.symmetric(horizontal: 8.0, vertical: 16.0), padding: const EdgeDims.symmetric(horizontal: 8.0, vertical: 16.0),
child: new Row( child: new Row(
...@@ -39,7 +39,7 @@ class TextStyleItem extends StatelessComponent { ...@@ -39,7 +39,7 @@ class TextStyleItem extends StatelessComponent {
class TypographyDemo extends StatelessComponent { class TypographyDemo extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).text; final TextTheme textTheme = Theme.of(context).textTheme;
final List<Widget> styleItems = <Widget>[ final List<Widget> styleItems = <Widget>[
new TextStyleItem(name: 'display3', style: textTheme.display3, text: 'Regular 56sp'), new TextStyleItem(name: 'display3', style: textTheme.display3, text: 'Regular 56sp'),
new TextStyleItem(name: 'display2', style: textTheme.display2, text: 'Regular 45sp'), new TextStyleItem(name: 'display2', style: textTheme.display2, text: 'Regular 45sp'),
......
...@@ -66,7 +66,7 @@ class GallerySection extends StatelessComponent { ...@@ -66,7 +66,7 @@ class GallerySection extends StatelessComponent {
brightness: Theme.of(context).brightness, brightness: Theme.of(context).brightness,
primarySwatch: colors primarySwatch: colors
); );
final TextStyle titleTextStyle = theme.text.title.copyWith( final TextStyle titleTextStyle = theme.textTheme.title.copyWith(
color: Colors.white color: Colors.white
); );
return new Flexible( return new Flexible(
......
...@@ -19,7 +19,7 @@ class StockSymbolView extends StatelessComponent { ...@@ -19,7 +19,7 @@ class StockSymbolView extends StatelessComponent {
if (stock.percentChange > 0) if (stock.percentChange > 0)
changeInPrice = "+" + changeInPrice; changeInPrice = "+" + changeInPrice;
TextStyle headings = Theme.of(context).text.body2; TextStyle headings = Theme.of(context).textTheme.body2;
return new Container( return new Container(
padding: new EdgeDims.all(20.0), padding: new EdgeDims.all(20.0),
child: new Column( child: new Column(
...@@ -28,7 +28,7 @@ class StockSymbolView extends StatelessComponent { ...@@ -28,7 +28,7 @@ class StockSymbolView extends StatelessComponent {
children: <Widget>[ children: <Widget>[
new Text( new Text(
'${stock.symbol}', '${stock.symbol}',
style: Theme.of(context).text.display2 style: Theme.of(context).textTheme.display2
), ),
new Hero( new Hero(
key: new ObjectKey(stock), key: new ObjectKey(stock),
......
...@@ -123,7 +123,7 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> { ...@@ -123,7 +123,7 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
) )
) )
); );
TextStyle style = Theme.of(context).text.button.copyWith(color: getTextColor(context)); TextStyle style = Theme.of(context).textTheme.button.copyWith(color: getTextColor(context));
int elevation = this.elevation; int elevation = this.elevation;
Color color = getColor(context); Color color = getColor(context);
if (elevation > 0 || color != null) { if (elevation > 0 || color != null) {
......
...@@ -183,7 +183,7 @@ class DayPicker extends StatelessComponent { ...@@ -183,7 +183,7 @@ class DayPicker extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context); ThemeData themeData = Theme.of(context);
TextStyle headerStyle = themeData.text.caption.copyWith(fontWeight: FontWeight.w700); TextStyle headerStyle = themeData.textTheme.caption.copyWith(fontWeight: FontWeight.w700);
TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0); TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0);
TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500); TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500);
DateFormat dateFormat = new DateFormat(); DateFormat dateFormat = new DateFormat();
...@@ -376,7 +376,7 @@ class _YearPickerState extends State<YearPicker> { ...@@ -376,7 +376,7 @@ class _YearPickerState extends State<YearPicker> {
static const double _itemExtent = 50.0; static const double _itemExtent = 50.0;
List<Widget> buildItems(BuildContext context, int start, int count) { List<Widget> buildItems(BuildContext context, int start, int count) {
TextStyle style = Theme.of(context).text.body1.copyWith(color: Colors.black54); TextStyle style = Theme.of(context).textTheme.body1.copyWith(color: Colors.black54);
List<Widget> items = new List<Widget>(); List<Widget> items = new List<Widget>();
for (int i = start; i < start + count; i++) { for (int i = start; i < start + count; i++) {
int year = config.firstDate.year + i; int year = config.firstDate.year + i;
......
...@@ -65,7 +65,7 @@ class Dialog extends StatelessComponent { ...@@ -65,7 +65,7 @@ class Dialog extends StatelessComponent {
dialogBody.add(new Padding( dialogBody.add(new Padding(
padding: padding, padding: padding,
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.title, style: Theme.of(context).textTheme.title,
child: title child: title
) )
)); ));
...@@ -78,7 +78,7 @@ class Dialog extends StatelessComponent { ...@@ -78,7 +78,7 @@ class Dialog extends StatelessComponent {
dialogBody.add(new Padding( dialogBody.add(new Padding(
padding: padding, padding: padding,
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: content child: content
) )
)); ));
......
...@@ -38,7 +38,7 @@ class DrawerHeader extends StatelessComponent { ...@@ -38,7 +38,7 @@ class DrawerHeader extends StatelessComponent {
new Container( new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeDims.symmetric(horizontal: 16.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.body2, style: Theme.of(context).textTheme.body2,
child: child child: child
) )
) )
......
...@@ -43,7 +43,7 @@ class DrawerItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class DrawerItem extends StatelessComponent {
} }
TextStyle _getTextStyle(ThemeData themeData) { TextStyle _getTextStyle(ThemeData themeData) {
TextStyle result = themeData.text.body2; TextStyle result = themeData.textTheme.body2;
if (selected) { if (selected) {
switch (themeData.brightness) { switch (themeData.brightness) {
case ThemeBrightness.light: case ThemeBrightness.light:
......
...@@ -212,7 +212,7 @@ class DropDownMenuItem<T> extends StatelessComponent { ...@@ -212,7 +212,7 @@ class DropDownMenuItem<T> extends StatelessComponent {
height: _kMenuItemHeight, height: _kMenuItemHeight,
padding: const EdgeDims.only(left: 8.0, right: 8.0, top: 6.0), padding: const EdgeDims.only(left: 8.0, right: 8.0, top: 6.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: new Baseline( child: new Baseline(
baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom, baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom,
child: child child: child
......
...@@ -84,7 +84,7 @@ class _InputState extends State<Input> { ...@@ -84,7 +84,7 @@ class _InputState extends State<Input> {
BuildContext focusContext = focusKey.currentContext; BuildContext focusContext = focusKey.currentContext;
bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus); bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus);
TextStyle textStyle = config.style ?? themeData.text.subhead; TextStyle textStyle = config.style ?? themeData.textTheme.subhead;
Color activeColor = themeData.hintColor; Color activeColor = themeData.hintColor;
if (focused) { if (focused) {
switch (themeData.brightness) { switch (themeData.brightness) {
...@@ -104,10 +104,10 @@ class _InputState extends State<Input> { ...@@ -104,10 +104,10 @@ class _InputState extends State<Input> {
if (config.labelText != null) { if (config.labelText != null) {
TextStyle labelStyle = hasInlineLabel ? TextStyle labelStyle = hasInlineLabel ?
themeData.text.subhead.copyWith(color: themeData.hintColor) : themeData.textTheme.subhead.copyWith(color: themeData.hintColor) :
themeData.text.caption.copyWith(color: activeColor); themeData.textTheme.caption.copyWith(color: activeColor);
double topPaddingIncrement = themeData.text.caption.fontSize + (config.isDense ? 4.0 : 8.0); double topPaddingIncrement = themeData.textTheme.caption.fontSize + (config.isDense ? 4.0 : 8.0);
double top = topPadding; double top = topPadding;
if (hasInlineLabel) if (hasInlineLabel)
top += topPaddingIncrement + textStyle.fontSize - labelStyle.fontSize; top += topPaddingIncrement + textStyle.fontSize - labelStyle.fontSize;
...@@ -124,7 +124,7 @@ class _InputState extends State<Input> { ...@@ -124,7 +124,7 @@ class _InputState extends State<Input> {
} }
if (config.hintText != null && config.value.text.isEmpty && !hasInlineLabel) { if (config.hintText != null && config.value.text.isEmpty && !hasInlineLabel) {
TextStyle hintStyle = themeData.text.subhead.copyWith(color: themeData.hintColor); TextStyle hintStyle = themeData.textTheme.subhead.copyWith(color: themeData.hintColor);
stackChildren.add(new Positioned( stackChildren.add(new Positioned(
left: 0.0, left: 0.0,
top: topPadding + textStyle.fontSize - hintStyle.fontSize, top: topPadding + textStyle.fontSize - hintStyle.fontSize,
...@@ -174,7 +174,7 @@ class _InputState extends State<Input> { ...@@ -174,7 +174,7 @@ class _InputState extends State<Input> {
)); ));
if (config.errorText != null && !config.isDense) { if (config.errorText != null && !config.isDense) {
TextStyle errorStyle = themeData.text.caption.copyWith(color: themeData.errorColor); TextStyle errorStyle = themeData.textTheme.caption.copyWith(color: themeData.errorColor);
stackChildren.add(new Positioned( stackChildren.add(new Positioned(
left: 0.0, left: 0.0,
bottom: 0.0, bottom: 0.0,
......
...@@ -69,7 +69,7 @@ class ListItem extends StatelessComponent { ...@@ -69,7 +69,7 @@ class ListItem extends StatelessComponent {
TextStyle primaryTextStyle(BuildContext context) { TextStyle primaryTextStyle(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle style = theme.text.subhead; final TextStyle style = theme.textTheme.subhead;
if (!enabled) { if (!enabled) {
final Color color = theme.disabledColor; final Color color = theme.disabledColor;
return dense ? style.copyWith(fontSize: 13.0, color: color) : style.copyWith(color: color); return dense ? style.copyWith(fontSize: 13.0, color: color) : style.copyWith(color: color);
...@@ -79,8 +79,8 @@ class ListItem extends StatelessComponent { ...@@ -79,8 +79,8 @@ class ListItem extends StatelessComponent {
TextStyle secondaryTextStyle(BuildContext context) { TextStyle secondaryTextStyle(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final Color color = theme.text.caption.color; final Color color = theme.textTheme.caption.color;
final TextStyle style = theme.text.body1; final TextStyle style = theme.textTheme.body1;
return dense ? style.copyWith(color: color, fontSize: 12.0) : style.copyWith(color: color); return dense ? style.copyWith(color: color, fontSize: 12.0) : style.copyWith(color: color);
} }
......
...@@ -130,7 +130,7 @@ class _MaterialState extends State<Material> { ...@@ -130,7 +130,7 @@ class _MaterialState extends State<Material> {
Widget contents = config.child; Widget contents = config.child;
if (contents != null) { if (contents != null) {
contents = new DefaultTextStyle( contents = new DefaultTextStyle(
style: config.textStyle ?? Theme.of(context).text.body1, style: config.textStyle ?? Theme.of(context).textTheme.body1,
child: contents child: contents
); );
} }
......
...@@ -75,7 +75,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> { ...@@ -75,7 +75,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
TextStyle style = theme.text.subhead; TextStyle style = theme.textTheme.subhead;
if (!config.enabled) if (!config.enabled)
style = style.copyWith(color: theme.disabledColor); style = style.copyWith(color: theme.disabledColor);
......
...@@ -126,7 +126,7 @@ class SnackBar extends StatelessComponent { ...@@ -126,7 +126,7 @@ class SnackBar extends StatelessComponent {
brightness: ThemeBrightness.dark, brightness: ThemeBrightness.dark,
accentColor: theme.accentColor, accentColor: theme.accentColor,
accentColorBrightness: theme.accentColorBrightness, accentColorBrightness: theme.accentColorBrightness,
text: Typography.white textTheme: Typography.white
), ),
child: new FadeTransition( child: new FadeTransition(
opacity: fadeAnimation, opacity: fadeAnimation,
......
...@@ -52,7 +52,7 @@ class ThemeData { ...@@ -52,7 +52,7 @@ class ThemeData {
Color hintColor, Color hintColor,
double hintOpacity, double hintOpacity,
Color errorColor, Color errorColor,
TextTheme text, TextTheme textTheme,
TextTheme primaryTextTheme, TextTheme primaryTextTheme,
IconThemeData primaryIconTheme IconThemeData primaryIconTheme
}) { }) {
...@@ -77,7 +77,7 @@ class ThemeData { ...@@ -77,7 +77,7 @@ class ThemeData {
hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000); hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000);
hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30; hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30;
errorColor ??= Colors.red[700]; errorColor ??= Colors.red[700];
text ??= isDark ? Typography.white : Typography.black; textTheme ??= isDark ? Typography.white : Typography.black;
primaryTextTheme ??= primaryColorBrightness == ThemeBrightness.dark ? Typography.white : Typography.black; primaryTextTheme ??= primaryColorBrightness == ThemeBrightness.dark ? Typography.white : Typography.black;
primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
return new ThemeData.raw( return new ThemeData.raw(
...@@ -100,7 +100,7 @@ class ThemeData { ...@@ -100,7 +100,7 @@ class ThemeData {
hintColor: hintColor, hintColor: hintColor,
hintOpacity: hintOpacity, hintOpacity: hintOpacity,
errorColor: errorColor, errorColor: errorColor,
text: text, textTheme: textTheme,
primaryTextTheme: primaryTextTheme, primaryTextTheme: primaryTextTheme,
primaryIconTheme: primaryIconTheme primaryIconTheme: primaryIconTheme
); );
...@@ -126,7 +126,7 @@ class ThemeData { ...@@ -126,7 +126,7 @@ class ThemeData {
this.hintColor, this.hintColor,
this.hintOpacity, this.hintOpacity,
this.errorColor, this.errorColor,
this.text, this.textTheme,
this.primaryTextTheme, this.primaryTextTheme,
this.primaryIconTheme this.primaryIconTheme
}) { }) {
...@@ -149,7 +149,7 @@ class ThemeData { ...@@ -149,7 +149,7 @@ class ThemeData {
assert(hintColor != null); assert(hintColor != null);
assert(hintOpacity != null); assert(hintOpacity != null);
assert(errorColor != null); assert(errorColor != null);
assert(text != null); assert(textTheme != null);
assert(primaryTextTheme != null); assert(primaryTextTheme != null);
assert(primaryIconTheme != null); assert(primaryIconTheme != null);
} }
...@@ -207,7 +207,7 @@ class ThemeData { ...@@ -207,7 +207,7 @@ class ThemeData {
final Color errorColor; final Color errorColor;
/// Text with a color that contrasts with the card and canvas colors. /// Text with a color that contrasts with the card and canvas colors.
final TextTheme text; final TextTheme textTheme;
/// A text theme that contrasts with the primary color. /// A text theme that contrasts with the primary color.
final TextTheme primaryTextTheme; final TextTheme primaryTextTheme;
...@@ -235,7 +235,7 @@ class ThemeData { ...@@ -235,7 +235,7 @@ class ThemeData {
hintColor: Color.lerp(begin.hintColor, end.hintColor, t), hintColor: Color.lerp(begin.hintColor, end.hintColor, t),
hintOpacity: lerpDouble(begin.hintOpacity, end.hintOpacity, t), hintOpacity: lerpDouble(begin.hintOpacity, end.hintOpacity, t),
errorColor: Color.lerp(begin.errorColor, end.errorColor, t), errorColor: Color.lerp(begin.errorColor, end.errorColor, t),
text: TextTheme.lerp(begin.text, end.text, t), textTheme: TextTheme.lerp(begin.textTheme, end.textTheme, t),
primaryTextTheme: TextTheme.lerp(begin.primaryTextTheme, end.primaryTextTheme, t), primaryTextTheme: TextTheme.lerp(begin.primaryTextTheme, end.primaryTextTheme, t),
primaryIconTheme: IconThemeData.lerp(begin.primaryIconTheme, end.primaryIconTheme, t) primaryIconTheme: IconThemeData.lerp(begin.primaryIconTheme, end.primaryIconTheme, t)
); );
...@@ -264,7 +264,7 @@ class ThemeData { ...@@ -264,7 +264,7 @@ class ThemeData {
(otherData.hintColor == hintColor) && (otherData.hintColor == hintColor) &&
(otherData.hintOpacity == hintOpacity) && (otherData.hintOpacity == hintOpacity) &&
(otherData.errorColor == errorColor) && (otherData.errorColor == errorColor) &&
(otherData.text == text) && (otherData.textTheme == textTheme) &&
(otherData.primaryTextTheme == primaryTextTheme) && (otherData.primaryTextTheme == primaryTextTheme) &&
(otherData.primaryIconTheme == primaryIconTheme); (otherData.primaryIconTheme == primaryIconTheme);
} }
...@@ -290,7 +290,7 @@ class ThemeData { ...@@ -290,7 +290,7 @@ class ThemeData {
hintColor, hintColor,
hintOpacity, hintOpacity,
errorColor, errorColor,
text, textTheme,
primaryTextTheme, primaryTextTheme,
primaryIconTheme primaryIconTheme
) )
......
...@@ -132,7 +132,7 @@ class _TooltipState extends State<Tooltip> { ...@@ -132,7 +132,7 @@ class _TooltipState extends State<Tooltip> {
RenderBox box = context.findRenderObject(); RenderBox box = context.findRenderObject();
Point target = box.localToGlobal(box.size.center(Point.origin)); Point target = box.localToGlobal(box.size.center(Point.origin));
_entry = new OverlayEntry(builder: (BuildContext context) { _entry = new OverlayEntry(builder: (BuildContext context) {
TextStyle textStyle = (config.style ?? Theme.of(context).text.body1).copyWith(color: config.textColor ?? Colors.white); TextStyle textStyle = (config.style ?? Theme.of(context).textTheme.body1).copyWith(color: config.textColor ?? Colors.white);
return new _TooltipOverlay( return new _TooltipOverlay(
message: config.message, message: config.message,
backgroundColor: config.backgroundColor ?? Colors.grey[700], backgroundColor: config.backgroundColor ?? Colors.grey[700],
......
...@@ -110,7 +110,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> { ...@@ -110,7 +110,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
onTap: _handleOnTap, onTap: _handleOnTap,
left: config.left, left: config.left,
center: new DefaultTextStyle( center: new DefaultTextStyle(
style: Theme.of(context).text.subhead.copyWith(color: _headerColor.evaluate(_easeInAnimation)), style: Theme.of(context).textTheme.subhead.copyWith(color: _headerColor.evaluate(_easeInAnimation)),
child: config.center child: config.center
), ),
right: new RotationTransition( right: new RotationTransition(
...@@ -136,7 +136,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> { ...@@ -136,7 +136,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
_borderColor.end = theme.dividerColor; _borderColor.end = theme.dividerColor;
_headerColor _headerColor
..begin = theme.text.subhead.color ..begin = theme.textTheme.subhead.color
..end = theme.accentColor; ..end = theme.accentColor;
_iconColor _iconColor
..begin = theme.unselectedColor ..begin = theme.unselectedColor
......
...@@ -12,21 +12,21 @@ class MarkdownStyle extends MarkdownStyleRaw{ ...@@ -12,21 +12,21 @@ class MarkdownStyle extends MarkdownStyleRaw{
/// Creates a [MarkdownStyle] from the [TextStyle]s in the provided [theme]. /// Creates a [MarkdownStyle] from the [TextStyle]s in the provided [theme].
MarkdownStyle.defaultFromTheme(ThemeData theme) : super( MarkdownStyle.defaultFromTheme(ThemeData theme) : super(
a: new TextStyle(color: Colors.blue[500]), a: new TextStyle(color: Colors.blue[500]),
p: theme.text.body1, p: theme.textTheme.body1,
code: new TextStyle( code: new TextStyle(
color: Colors.grey[700], color: Colors.grey[700],
fontFamily: "monospace", fontFamily: "monospace",
fontSize: theme.text.body1.fontSize * 0.85 fontSize: theme.textTheme.body1.fontSize * 0.85
), ),
h1: theme.text.headline, h1: theme.textTheme.headline,
h2: theme.text.title, h2: theme.textTheme.title,
h3: theme.text.subhead, h3: theme.textTheme.subhead,
h4: theme.text.body2, h4: theme.textTheme.body2,
h5: theme.text.body2, h5: theme.textTheme.body2,
h6: theme.text.body2, h6: theme.textTheme.body2,
em: new TextStyle(fontStyle: FontStyle.italic), em: new TextStyle(fontStyle: FontStyle.italic),
strong: new TextStyle(fontWeight: FontWeight.bold), strong: new TextStyle(fontWeight: FontWeight.bold),
blockquote: theme.text.body1, blockquote: theme.textTheme.body1,
blockSpacing: 8.0, blockSpacing: 8.0,
listIndent: 32.0, listIndent: 32.0,
blockquotePadding: 8.0, blockquotePadding: 8.0,
...@@ -46,21 +46,21 @@ class MarkdownStyle extends MarkdownStyleRaw{ ...@@ -46,21 +46,21 @@ class MarkdownStyle extends MarkdownStyleRaw{
/// [MarkdownStyle.defaultFromTheme]. /// [MarkdownStyle.defaultFromTheme].
MarkdownStyle.largeFromTheme(ThemeData theme) : super ( MarkdownStyle.largeFromTheme(ThemeData theme) : super (
a: new TextStyle(color: Colors.blue[500]), a: new TextStyle(color: Colors.blue[500]),
p: theme.text.body1, p: theme.textTheme.body1,
code: new TextStyle( code: new TextStyle(
color: Colors.grey[700], color: Colors.grey[700],
fontFamily: "monospace", fontFamily: "monospace",
fontSize: theme.text.body1.fontSize * 0.85 fontSize: theme.textTheme.body1.fontSize * 0.85
), ),
h1: theme.text.display3, h1: theme.textTheme.display3,
h2: theme.text.display2, h2: theme.textTheme.display2,
h3: theme.text.display1, h3: theme.textTheme.display1,
h4: theme.text.headline, h4: theme.textTheme.headline,
h5: theme.text.title, h5: theme.textTheme.title,
h6: theme.text.subhead, h6: theme.textTheme.subhead,
em: new TextStyle(fontStyle: FontStyle.italic), em: new TextStyle(fontStyle: FontStyle.italic),
strong: new TextStyle(fontWeight: FontWeight.bold), strong: new TextStyle(fontWeight: FontWeight.bold),
blockquote: theme.text.body1, blockquote: theme.textTheme.body1,
blockSpacing: 8.0, blockSpacing: 8.0,
listIndent: 32.0, listIndent: 32.0,
blockquotePadding: 8.0, blockquotePadding: 8.0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment