Skip to content

Commit

Permalink
Fix analyser issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Aug 10, 2024
1 parent 8d90b11 commit 08a09eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core/catcher_2_screenshot_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Catcher2ScreenshotManager {
final boundary = findRenderObject as RenderRepaintBoundary;
final context = _containerKey.currentContext;
var pixelRatioValue = pixelRatio;
if (pixelRatioValue == null && context != null) {
if (pixelRatioValue == null && context != null && context.mounted) {
pixelRatioValue = MediaQuery.of(context).devicePixelRatio;
}
return await boundary.toImage(pixelRatio: pixelRatioValue ?? 1);
Expand Down
5 changes: 4 additions & 1 deletion lib/handlers/toast_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ class ToastHandler extends ReportHandler {
Future.delayed(
const Duration(milliseconds: 500),
() {
if (context == null || !context.mounted) {
return;
}
Navigator.push<void>(
context!,
context,
PageRouteBuilder(
opaque: false,
pageBuilder: (_, __, ___) => FlutterToastPage(
Expand Down

0 comments on commit 08a09eb

Please sign in to comment.