fix: analyzer warnings

This commit is contained in:
Tien Do Nam
2024-09-26 02:46:57 +02:00
parent e0d105d759
commit e0db2ca61f
4 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ class _ProgressPageState extends State<ProgressPage> with Refena {
return PopScope(
onPopInvokedWithResult: (_, __) async {
if (await _onWillPop() && mounted) {
if (await _onWillPop() && context.mounted) {
context.pop();
}
},
+1 -1
View File
@@ -164,7 +164,7 @@ class _WebSendPageState extends State<WebSendPage> with Refena {
InkWell(
onTap: () async {
await Clipboard.setData(ClipboardData(text: url));
if (mounted && checkPlatformIsDesktop()) {
if (context.mounted && checkPlatformIsDesktop()) {
context.showSnackBar(t.general.copiedToClipboard);
}
},
+1 -2
View File
@@ -162,9 +162,8 @@ class SendNotifier extends Notifier<Map<String, SendSessionState>> {
// wait until animation is finished
await sleepAsync(500);
// ignore: use_build_context_synchronously
pin = await showDialog<String>(
context: Routerino.context,
context: Routerino.context, // ignore: use_build_context_synchronously
builder: (_) => PinDialog(
obscureText: true,
showInvalidPin: !pinFirstAttempt,
@@ -99,9 +99,9 @@ class _FavoriteEditDialogState extends State<FavoriteEditDialog> with Refena {
builder: (_) => FavoriteDeleteDialog(widget.favorite!),
);
if (mounted && result == true) {
if (context.mounted && result == true) {
await context.ref.redux(favoritesProvider).dispatchAsync(RemoveFavoriteAction(deviceFingerprint: widget.favorite!.fingerprint));
if (mounted) {
if (context.mounted) {
context.pop();
}
}
@@ -180,7 +180,7 @@ class _FavoriteEditDialogState extends State<FavoriteEditDialog> with Refena {
)));
}
if (mounted) {
if (context.mounted) {
context.pop();
}
},