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