Migrate TextTheme to 2018 APIs (#48547)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
77fb0c1ade
commit
bc5c46438a
@@ -446,7 +446,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
debugLabel: 'Scope',
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Actions Demo'),
|
||||
|
||||
@@ -240,7 +240,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
padding: const EdgeInsets.only(left: 72.0),
|
||||
height: 128.0,
|
||||
alignment: const Alignment(-1.0, 0.5),
|
||||
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title),
|
||||
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.headline6),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
rightArrowIcon = Opacity(opacity: 0.1, child: rightArrowIcon);
|
||||
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final TextStyle backgroundTextStyle = theme.primaryTextTheme.title;
|
||||
final TextStyle backgroundTextStyle = theme.primaryTextTheme.headline6;
|
||||
|
||||
// The background Widget appears behind the Dismissible card when the card
|
||||
// moves to the left or right. The Positioned widget ensures that the
|
||||
|
||||
@@ -100,7 +100,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
size *= kHeavyMultiplier;
|
||||
|
||||
final Widget contents = DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.body1,
|
||||
style: Theme.of(context).textTheme.bodyText2,
|
||||
textAlign: TextAlign.center,
|
||||
child: Dot(
|
||||
color: color,
|
||||
@@ -188,7 +188,7 @@ class MovableBall extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Widget ball = DefaultTextStyle(
|
||||
style: Theme.of(context).primaryTextTheme.body1,
|
||||
style: Theme.of(context).primaryTextTheme.bodyText2,
|
||||
textAlign: TextAlign.center,
|
||||
child: Dot(
|
||||
key: kBallKey,
|
||||
|
||||
@@ -149,7 +149,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
onKey: _handleKeyPress,
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Focus Demo'),
|
||||
|
||||
@@ -56,7 +56,7 @@ class _HoverDemoState extends State<HoverDemo> {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Hover Demo'),
|
||||
|
||||
@@ -79,12 +79,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
onTap: () {
|
||||
_focusNode.requestFocus();
|
||||
},
|
||||
child: Text('Tap to focus', style: textTheme.display1),
|
||||
child: Text('Tap to focus', style: textTheme.headline4),
|
||||
);
|
||||
}
|
||||
|
||||
if (_event == null) {
|
||||
return Text('Press a key', style: textTheme.display1);
|
||||
return Text('Press a key', style: textTheme.headline4);
|
||||
}
|
||||
|
||||
final RawKeyEventData data = _event.data;
|
||||
@@ -137,7 +137,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
}
|
||||
}
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.subhead,
|
||||
style: textTheme.subtitle1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: dataText,
|
||||
|
||||
Reference in New Issue
Block a user