refactor: Migrate to Flutter 3.7.0

This commit is contained in:
Christian Pauly 2023-01-26 09:47:30 +01:00
commit 35174cb859
54 changed files with 876 additions and 2124 deletions

View file

@ -1072,11 +1072,13 @@ class ChatController extends State<Chat> {
Matrix.of(context).voipPlugin!.voip.requestTurnServerCredentials());
if (success.result != null) {
final voipPlugin = Matrix.of(context).voipPlugin;
await voipPlugin!.voip.inviteToCall(room!.id, callType).catchError((e) {
try {
await voipPlugin!.voip.inviteToCall(room!.id, callType);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text((e as Object).toLocalizedString(context))),
SnackBar(content: Text(e.toLocalizedString(context))),
);
});
}
} else {
await showOkAlertDialog(
context: context,

View file

@ -69,7 +69,7 @@ class _CuteContentState extends State<CuteContent> {
},
),
);
Overlay.of(context)?.insert(overlay);
Overlay.of(context).insert(overlay);
}
generateLabel(User? user) {

View file

@ -52,7 +52,7 @@ class HtmlMessage extends StatelessWidget {
defaultTextStyle: defaultTextStyle,
emoteSize: emoteSize,
linkStyle: linkStyle ??
themeData.textTheme.bodyText2!.copyWith(
themeData.textTheme.bodyMedium!.copyWith(
color: themeData.colorScheme.secondary,
decoration: TextDecoration.underline,
),

View file

@ -303,8 +303,11 @@ class Message extends StatelessWidget {
child: Center(
child: Material(
color: displayTime
? Theme.of(context).backgroundColor
: Theme.of(context).backgroundColor.withOpacity(0.33),
? Theme.of(context).colorScheme.background
: Theme.of(context)
.colorScheme
.background
.withOpacity(0.33),
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
clipBehavior: Clip.antiAlias,
child: Padding(

View file

@ -37,7 +37,7 @@ class VerificationRequestContent extends StatelessWidget {
color: Theme.of(context).dividerColor,
),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
),
child: Row(
mainAxisSize: MainAxisSize.min,

View file

@ -232,7 +232,7 @@ class InputBar extends StatelessWidget {
hint,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.caption,
style: Theme.of(context).textTheme.bodySmall,
),
],
),

View file

@ -160,7 +160,7 @@ class RecordingDialogState extends State<RecordingDialog> {
style: TextStyle(
color: Theme.of(context)
.textTheme
.bodyText2
.bodyMedium
?.color
?.withAlpha(150),
),
@ -183,7 +183,7 @@ class RecordingDialogState extends State<RecordingDialog> {
L10n.of(context)!.cancel.toUpperCase(),
style: TextStyle(
color:
Theme.of(context).textTheme.bodyText2?.color?.withAlpha(150),
Theme.of(context).textTheme.bodyMedium?.color?.withAlpha(150),
),
),
),

View file

@ -80,7 +80,7 @@ class _EditContent extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).textTheme.bodyText2!.color,
color: Theme.of(context).textTheme.bodyMedium!.color,
),
);
}),

View file

@ -51,7 +51,7 @@ class SeenByRow extends StatelessWidget {
width: 16,
height: 16,
child: Material(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
borderRadius: BorderRadius.circular(32),
child: Center(
child: Text(

View file

@ -49,6 +49,7 @@ class SendFileDialogState extends State<SendFileDialog> {
scaffoldMessenger.showSnackBar(
SnackBar(content: Text(e.toLocalizedString())),
);
return null;
});
}
Navigator.of(context, rootNavigator: false).pop();