diff --git a/lib/features/video_calls/presentation/widgets/video_call_top_overlay.dart b/lib/features/video_calls/presentation/widgets/video_call_top_overlay.dart index 1f0bff71..85f2dd0e 100644 --- a/lib/features/video_calls/presentation/widgets/video_call_top_overlay.dart +++ b/lib/features/video_calls/presentation/widgets/video_call_top_overlay.dart @@ -2,12 +2,11 @@ import 'package:eatvio_app/core/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; - abstract final class VideoCallTopOverlay { - static const String poorConnectionSvg = 'assets/icons/video_call/poor_connection.svg'; + static const String poorConnectionSvg = + 'assets/icons/video_call/poor_connection.svg'; static const String warningSvg = 'assets/icons/video_call/warning.svg'; - static OverlayEntry insertBanner( BuildContext context, { required String message, @@ -15,7 +14,7 @@ abstract final class VideoCallTopOverlay { required String svgAsset, Duration? autoRemoveAfter, }) { - final overlayState = Overlay.of(context, rootOverlay: true); + final overlayState = Overlay.maybeOf(context, rootOverlay: true); late OverlayEntry entry; entry = OverlayEntry( builder: (ctx) => Positioned( @@ -50,6 +49,9 @@ abstract final class VideoCallTopOverlay { ), ), ); + if (overlayState == null) { + return entry; + } overlayState.insert(entry); if (autoRemoveAfter != null) { Future.delayed(autoRemoveAfter, () { diff --git a/pubspec.yaml b/pubspec.yaml index 209f5b05..96f67cf1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: eatvio_app description: A new Flutter project. -version: 1.3.27+112 +version: 1.3.27+113 publish_to: 'none' environment: