feat(video_calls): fixed nullable overlay state handling

This commit is contained in:
misha
2026-06-16 22:57:17 +03:00
parent 895443e747
commit 95c1d40c79
2 changed files with 7 additions and 5 deletions

View File

@@ -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<void>.delayed(autoRemoveAfter, () {

View File

@@ -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: