refactor: Enable lint use_build_context_synchronously
This commit is contained in:
parent
a3fc1bff01
commit
3296c0d92d
50 changed files with 490 additions and 293 deletions
|
|
@ -189,6 +189,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
});
|
||||
} catch (e, s) {
|
||||
Logs().v('Could not download audio file', e, s);
|
||||
if (!mounted) rethrow;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(e.toLocalizedString(context))));
|
||||
|
|
@ -208,6 +209,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
),
|
||||
);
|
||||
}
|
||||
if (!mounted) return;
|
||||
|
||||
audioPlayer.play().onError(
|
||||
ErrorReporter(context, 'Unable to play audio message').onErrorCallback,
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class _CuteContentState extends State<CuteContent> {
|
|||
Future<void> addOverlay() async {
|
||||
_isOverlayShown = true;
|
||||
await Future.delayed(const Duration(milliseconds: 50));
|
||||
if (!mounted) return;
|
||||
|
||||
OverlayEntry? overlay;
|
||||
overlay = OverlayEntry(
|
||||
|
|
|
|||
|
|
@ -61,9 +61,11 @@ class MessageContent extends StatelessWidget {
|
|||
final client = Matrix.of(context).client;
|
||||
final state = await client.getCryptoIdentityState();
|
||||
if (!state.connected) {
|
||||
if (!context.mounted) return;
|
||||
final success = await context.push('/backup');
|
||||
if (success != true) return;
|
||||
}
|
||||
if (!context.mounted) return;
|
||||
event.requestKey();
|
||||
final sender = event.senderFromMemoryOrFallback;
|
||||
await showAdaptiveBottomSheet(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue