Commit b298bdc8 authored by Dragoș Tiselice's avatar Dragoș Tiselice Committed by GitHub

Fixed expansion panels demo text in dark theme. (#5809)

Changed the text styling to make use of the current theme so that
it doesn't break when the user selects the dark theme.
parent 85ac22e4
...@@ -10,15 +10,6 @@ enum _Location { ...@@ -10,15 +10,6 @@ enum _Location {
Bermuda Bermuda
} }
const TextStyle text54 = const TextStyle(
color: Colors.black54,
fontSize: 15.0
);
const TextStyle text87 = const TextStyle(
color: Colors.black87,
fontSize: 15.0
);
typedef Widget DemoItemBodyBuilder(DemoItem<dynamic> item); typedef Widget DemoItemBodyBuilder(DemoItem<dynamic> item);
typedef String ValueToString<T>(T value); typedef String ValueToString<T>(T value);
...@@ -49,13 +40,16 @@ class DualHeaderWithHint extends StatelessWidget { ...@@ -49,13 +40,16 @@ class DualHeaderWithHint extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final TextTheme textTheme = theme.textTheme;
return new Row( return new Row(
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
flex: 2, flex: 2,
child: new Container( child: new Container(
margin: const EdgeInsets.only(left: 24.0), margin: const EdgeInsets.only(left: 24.0),
child: new Text(name, style: text87) child: new Text(name, style: textTheme.body1.copyWith(fontSize: 15.0))
) )
), ),
new Flexible( new Flexible(
...@@ -63,8 +57,8 @@ class DualHeaderWithHint extends StatelessWidget { ...@@ -63,8 +57,8 @@ class DualHeaderWithHint extends StatelessWidget {
child: new Container( child: new Container(
margin: const EdgeInsets.only(left: 24.0), margin: const EdgeInsets.only(left: 24.0),
child: _crossFade( child: _crossFade(
new Text(value, style: text54), new Text(value, style: textTheme.caption.copyWith(fontSize: 15.0)),
new Text(hint, style: text54), new Text(hint, style: textTheme.caption.copyWith(fontSize: 15.0)),
showHint showHint
) )
) )
...@@ -89,6 +83,9 @@ class CollapsibleBody extends StatelessWidget { ...@@ -89,6 +83,9 @@ class CollapsibleBody extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final TextTheme textTheme = theme.textTheme;
return new Column( return new Column(
children: <Widget>[ children: <Widget>[
new Container( new Container(
...@@ -99,7 +96,7 @@ class CollapsibleBody extends StatelessWidget { ...@@ -99,7 +96,7 @@ class CollapsibleBody extends StatelessWidget {
) - margin, ) - margin,
child: new Center( child: new Center(
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: text54, style: textTheme.caption.copyWith(fontSize: 15.0),
child: child child: child
) )
) )
......
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