Eliminate direct access of Typography.black/white in manual tests (#6640)
This commit is contained in:
parent
58630cc209
commit
16ce090fde
@ -32,8 +32,6 @@ class CardCollectionState extends State<CardCollection> {
|
||||
static const double kCardMargins = 8.0;
|
||||
static const double kFixedCardHeight = 100.0;
|
||||
|
||||
final TextStyle backgroundTextStyle = Typography.white.title;
|
||||
|
||||
Map<int, Color> _primaryColor = Colors.deepPurple;
|
||||
List<CardModel> _cardModels;
|
||||
DismissDirection _dismissDirection = DismissDirection.horizontal;
|
||||
@ -358,6 +356,9 @@ class CardCollectionState extends State<CardCollection> {
|
||||
if (_dismissDirection == DismissDirection.endToStart)
|
||||
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
|
||||
// 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
|
||||
@ -369,7 +370,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
child: new Viewport(
|
||||
child: new Container(
|
||||
height: cardModel.height,
|
||||
decoration: new BoxDecoration(backgroundColor: Theme.of(context).primaryColor),
|
||||
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
leftArrowIcon,
|
||||
|
@ -186,7 +186,7 @@ class MovableBall extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget ball = new DefaultTextStyle(
|
||||
style: Typography.white.body1,
|
||||
style: Theme.of(context).primaryTextTheme.body1,
|
||||
textAlign: TextAlign.center,
|
||||
child: new Dot(
|
||||
key: kBallKey,
|
||||
|
@ -41,6 +41,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
bool focused = Focus.at(context);
|
||||
Widget child;
|
||||
if (!focused) {
|
||||
@ -49,12 +50,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
Focus.moveTo(config.key);
|
||||
},
|
||||
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) {
|
||||
child = new Center(
|
||||
child: new Text('Press a key', style: Typography.black.display1),
|
||||
child: new Text('Press a key', style: textTheme.display1),
|
||||
);
|
||||
} else {
|
||||
int codePoint;
|
||||
@ -67,9 +68,9 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
child = new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text('${_event.runtimeType}', style: Typography.black.body2),
|
||||
new Text('codePoint: $codePoint', style: Typography.black.display4),
|
||||
new Text('keyCode: $keyCode', style: Typography.black.display4),
|
||||
new Text('${_event.runtimeType}', style: textTheme.body2),
|
||||
new Text('codePoint: $codePoint', style: textTheme.display4),
|
||||
new Text('keyCode: $keyCode', style: textTheme.display4),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user