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