feat(flutter/cache): connectivityProvider + cacheSettingsProvider
connectivityProvider — StreamProvider<bool>; true when any connectivity result is non-none. No Wi-Fi gate per operator decision. cacheSettingsProvider — AsyncNotifier<CacheSettings> persisting capBytes / prefetchWindow / cacheLikedTracks via flutter_secure_storage. Defaults: 5 GB cap, 5-track prefetch, cache liked = on. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:minstrel/cache/connectivity_provider.dart';
|
||||
|
||||
void main() {
|
||||
test('connectivityProvider is reachable from a ProviderContainer', () {
|
||||
// Smoke test: provider builds without throwing. Real connectivity
|
||||
// tests would need a connectivity_plus mock; defer to manual ops.
|
||||
final container = ProviderContainer();
|
||||
addTearDown(container.dispose);
|
||||
expect(container.read(connectivityProvider.future), isA<Future<bool>>());
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user