From a32fd296c7ded2641eb7a482d56d49c5f14c52f1 Mon Sep 17 00:00:00 2001 From: Gold87 Date: Fri, 23 Feb 2024 20:30:27 -0500 Subject: [PATCH] Removed deprecated mounted methods in mjpeg --- lib/widgets/mjpeg.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/mjpeg.dart b/lib/widgets/mjpeg.dart index 23261cf8..585578d3 100644 --- a/lib/widgets/mjpeg.dart +++ b/lib/widgets/mjpeg.dart @@ -84,7 +84,7 @@ class Mjpeg extends HookWidget { final state = useMemoized(() => _MjpegStateNotifier()); final visible = useListenable(state); final errorState = useState?>(null); - final isMounted = useIsMounted(); + isMounted() => context.mounted; final manager = useMemoized( () => _manager = _StreamManager( @@ -219,7 +219,7 @@ class _StreamManager { return; } try { - final request = Request("GET", Uri.parse(stream)); + final request = Request('GET', Uri.parse(stream)); request.headers.addAll(headers); final response = await _httpClient.send(request).timeout( _timeout); //timeout is to prevent process to hang forever in some case