Description
When downloading a video for offline use, the UI does not show progress and the CircularProgressIndicator spins infinitely without a percentage.
This happens for two reasons:
- In
lib/services/offline_service.dart (~line 63), the download loop writes progress directly to Hive via _box.put. However, OfflineVideosNotifier does not use box.watch() or a ValueListenableBuilder, so it doesn't rebuild the UI when the box changes.
- In
lib/providers/offline_provider.dart (~line 38), offlineProgressProvider is defined as a static empty map (Map<String, double> build() => {};). There are no functions exposed to update this map, so VideoListTile always reads null for the progress value.
Suggested Fix
- Either emit progress updates to the
offlineProgressProvider explicitly during the onReceiveProgress callback.
- Or listen to Hive box changes directly using a stream/listener in the notifier.
File Paths
lib/services/offline_service.dart
lib/providers/offline_provider.dart
lib/widgets/video_list_tile.dart
Description
When downloading a video for offline use, the UI does not show progress and the
CircularProgressIndicatorspins infinitely without a percentage.This happens for two reasons:
lib/services/offline_service.dart(~line 63), the download loop writes progress directly to Hive via_box.put. However,OfflineVideosNotifierdoes not usebox.watch()or aValueListenableBuilder, so it doesn't rebuild the UI when the box changes.lib/providers/offline_provider.dart(~line 38),offlineProgressProvideris defined as a static empty map (Map<String, double> build() => {};). There are no functions exposed to update this map, soVideoListTilealways readsnullfor the progress value.Suggested Fix
offlineProgressProviderexplicitly during theonReceiveProgresscallback.File Paths
lib/services/offline_service.dartlib/providers/offline_provider.dartlib/widgets/video_list_tile.dart