Fix deprecations

This commit is contained in:
Christian Pauly 2020-05-06 18:43:30 +02:00
parent 2f79d4b5c7
commit 71e0d88205
9 changed files with 21 additions and 13 deletions

View file

@ -80,7 +80,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
child: Text( child: Text(
I18n.of(context).cancel.toUpperCase(), I18n.of(context).cancel.toUpperCase(),
style: TextStyle( style: TextStyle(
color: Theme.of(context).textTheme.body1.color.withAlpha(150), color: Theme.of(context).textTheme.bodyText2.color.withAlpha(150),
), ),
), ),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),

View file

@ -58,7 +58,7 @@ class Message extends StatelessWidget {
if (event.messageType == MessageTypes.Image) { if (event.messageType == MessageTypes.Image) {
color = Theme.of(context).scaffoldBackgroundColor.withOpacity(0.66); color = Theme.of(context).scaffoldBackgroundColor.withOpacity(0.66);
textColor = Theme.of(context).textTheme.body1.color; textColor = Theme.of(context).textTheme.bodyText2.color;
} else if (ownMessage) { } else if (ownMessage) {
color = event.status == -1 color = event.status == -1
? Colors.redAccent ? Colors.redAccent

View file

@ -24,7 +24,7 @@ class StateMessage extends StatelessWidget {
event.getLocalizedBody(I18n.of(context)), event.getLocalizedBody(I18n.of(context)),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Theme.of(context).textTheme.body1.color, color: Theme.of(context).textTheme.bodyText2.color,
decoration: event.redacted ? TextDecoration.lineThrough : null, decoration: event.redacted ? TextDecoration.lineThrough : null,
), ),
), ),

View file

@ -46,7 +46,7 @@ class ReplyContent extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: lightText color: lightText
? Colors.white ? Colors.white
: Theme.of(context).textTheme.body1.color), : Theme.of(context).textTheme.bodyText2.color),
), ),
], ],
), ),

View file

@ -33,7 +33,7 @@ final ThemeData lightTheme = ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
color: Colors.white, color: Colors.white,
textTheme: TextTheme( textTheme: TextTheme(
title: TextStyle( headline6: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 20, fontSize: 20,
), ),
@ -68,7 +68,7 @@ final ThemeData darkTheme = ThemeData.dark().copyWith(
brightness: Brightness.dark, brightness: Brightness.dark,
color: Color(0xff1D1D1D), color: Color(0xff1D1D1D),
textTheme: TextTheme( textTheme: TextTheme(
title: TextStyle( headline6: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20, fontSize: 20,
), ),
@ -103,7 +103,7 @@ final ThemeData amoledTheme = ThemeData.dark().copyWith(
brightness: Brightness.dark, brightness: Brightness.dark,
color: Color(0xff1D1D1D), color: Color(0xff1D1D1D),
textTheme: TextTheme( textTheme: TextTheme(
title: TextStyle( headline6: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20, fontSize: 20,
), ),

View file

@ -407,7 +407,7 @@ class _ChatState extends State<_Chat> {
child: Icon(Icons.arrow_downward, child: Icon(Icons.arrow_downward,
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
onPressed: () => _scrollController.jumpTo(0), onPressed: () => _scrollController.jumpTo(0),
foregroundColor: Theme.of(context).textTheme.body1.color, foregroundColor: Theme.of(context).textTheme.bodyText2.color,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
mini: true, mini: true,
), ),

View file

@ -186,8 +186,11 @@ class _ChatDetailsState extends State<ChatDetails> {
], ],
title: Text(widget.room.getLocalizedDisplayname(I18n.of(context)), title: Text(widget.room.getLocalizedDisplayname(I18n.of(context)),
style: TextStyle( style: TextStyle(
color: color: Theme.of(context)
Theme.of(context).appBarTheme.textTheme.title.color)), .appBarTheme
.textTheme
.headline6
.color)),
backgroundColor: Theme.of(context).appBarTheme.color, backgroundColor: Theme.of(context).appBarTheme.color,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
background: ContentBanner(widget.room.avatar, background: ContentBanner(widget.room.avatar,
@ -223,7 +226,7 @@ class _ChatDetailsState extends State<ChatDetails> {
linkStyle: TextStyle(color: Colors.blueAccent), linkStyle: TextStyle(color: Colors.blueAccent),
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 14, fontSize: 14,
color: Theme.of(context).textTheme.body1.color, color: Theme.of(context).textTheme.bodyText2.color,
), ),
), ),
onTap: widget.room.canSendEvent("m.room.topic") onTap: widget.room.canSendEvent("m.room.topic")

View file

@ -112,7 +112,8 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
.keys["ed25519:${deviceKeys[i].deviceId}"] .keys["ed25519:${deviceKeys[i].deviceId}"]
.beautified, .beautified,
style: TextStyle( style: TextStyle(
color: Theme.of(context).textTheme.body1.color), color:
Theme.of(context).textTheme.bodyText2.color),
), ),
value: deviceKeys[i].verified, value: deviceKeys[i].verified,
onChanged: (bool newVal) { onChanged: (bool newVal) {

View file

@ -149,7 +149,11 @@ class _SettingsState extends State<Settings> {
title: Text( title: Text(
I18n.of(context).settings, I18n.of(context).settings,
style: TextStyle( style: TextStyle(
color: Theme.of(context).appBarTheme.textTheme.title.color), color: Theme.of(context)
.appBarTheme
.textTheme
.headline6
.color),
), ),
background: ContentBanner( background: ContentBanner(
profile?.avatarUrl, profile?.avatarUrl,