Commit 16ce090f authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Eliminate direct access of Typography.black/white in manual tests (#6640)

parent 58630cc2
...@@ -32,8 +32,6 @@ class CardCollectionState extends State<CardCollection> { ...@@ -32,8 +32,6 @@ class CardCollectionState extends State<CardCollection> {
static const double kCardMargins = 8.0; static const double kCardMargins = 8.0;
static const double kFixedCardHeight = 100.0; static const double kFixedCardHeight = 100.0;
final TextStyle backgroundTextStyle = Typography.white.title;
Map<int, Color> _primaryColor = Colors.deepPurple; Map<int, Color> _primaryColor = Colors.deepPurple;
List<CardModel> _cardModels; List<CardModel> _cardModels;
DismissDirection _dismissDirection = DismissDirection.horizontal; DismissDirection _dismissDirection = DismissDirection.horizontal;
...@@ -358,6 +356,9 @@ class CardCollectionState extends State<CardCollection> { ...@@ -358,6 +356,9 @@ class CardCollectionState extends State<CardCollection> {
if (_dismissDirection == DismissDirection.endToStart) if (_dismissDirection == DismissDirection.endToStart)
rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon); rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon);
final ThemeData theme = Theme.of(context);
final TextStyle backgroundTextStyle = theme.primaryTextTheme.title;
// The background Widget appears behind the Dismissable card when the card // The background Widget appears behind the Dismissable card when the card
// moves to the left or right. The Positioned widget ensures that the // moves to the left or right. The Positioned widget ensures that the
// size of the background,card Stack will be based only on the card. The // size of the background,card Stack will be based only on the card. The
...@@ -369,7 +370,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -369,7 +370,7 @@ class CardCollectionState extends State<CardCollection> {
child: new Viewport( child: new Viewport(
child: new Container( child: new Container(
height: cardModel.height, height: cardModel.height,
decoration: new BoxDecoration(backgroundColor: Theme.of(context).primaryColor), decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
leftArrowIcon, leftArrowIcon,
......
...@@ -186,7 +186,7 @@ class MovableBall extends StatelessWidget { ...@@ -186,7 +186,7 @@ class MovableBall extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget ball = new DefaultTextStyle( Widget ball = new DefaultTextStyle(
style: Typography.white.body1, style: Theme.of(context).primaryTextTheme.body1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
child: new Dot( child: new Dot(
key: kBallKey, key: kBallKey,
......
...@@ -41,6 +41,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> { ...@@ -41,6 +41,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;
bool focused = Focus.at(context); bool focused = Focus.at(context);
Widget child; Widget child;
if (!focused) { if (!focused) {
...@@ -49,12 +50,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> { ...@@ -49,12 +50,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
Focus.moveTo(config.key); Focus.moveTo(config.key);
}, },
child: new Center( child: new Center(
child: new Text('Tap to focus', style: Typography.black.display1), child: new Text('Tap to focus', style: textTheme.display1),
), ),
); );
} else if (_event == null) { } else if (_event == null) {
child = new Center( child = new Center(
child: new Text('Press a key', style: Typography.black.display1), child: new Text('Press a key', style: textTheme.display1),
); );
} else { } else {
int codePoint; int codePoint;
...@@ -67,9 +68,9 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> { ...@@ -67,9 +68,9 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
child = new Column( child = new Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('${_event.runtimeType}', style: Typography.black.body2), new Text('${_event.runtimeType}', style: textTheme.body2),
new Text('codePoint: $codePoint', style: Typography.black.display4), new Text('codePoint: $codePoint', style: textTheme.display4),
new Text('keyCode: $keyCode', style: Typography.black.display4), new Text('keyCode: $keyCode', style: textTheme.display4),
], ],
); );
} }
......
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