diff --git a/lib/background/actions/calendar_action_handler.dart b/lib/background/actions/calendar_action_handler.dart index 0e5f1a54..73d34956 100644 --- a/lib/background/actions/calendar_action_handler.dart +++ b/lib/background/actions/calendar_action_handler.dart @@ -215,6 +215,6 @@ final calendarActionHandlerProvider = Provider((ref) => ref.read(timelinePinDaoProvider), ref.read(calendarSyncerProvider), ref.read(watchTimelineSyncerProvider), - ref.read(calendarListProvider), + ref.read(calendarListProvider.notifier), ref.read(deviceCalendarPluginProvider), )); diff --git a/lib/background/actions/master_action_handler.dart b/lib/background/actions/master_action_handler.dart index 4d17949a..823db25f 100644 --- a/lib/background/actions/master_action_handler.dart +++ b/lib/background/actions/master_action_handler.dart @@ -6,7 +6,7 @@ import 'package:cobble/domain/db/dao/timeline_pin_dao.dart'; import 'package:cobble/domain/db/models/timeline_pin.dart'; import 'package:cobble/domain/timeline/timeline_action_response.dart'; import 'package:cobble/infrastructure/pigeons/pigeons.g.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:uuid_type/uuid_type.dart'; class MasterActionHandler { diff --git a/lib/background/main_background.dart b/lib/background/main_background.dart index dc5d6cde..eb990617 100644 --- a/lib/background/main_background.dart +++ b/lib/background/main_background.dart @@ -56,7 +56,7 @@ class BackgroundReceiver implements TimelineCallbacks { masterActionHandler = container.read(masterActionHandlerProvider); connectionSubscription = container.listen( - connectionStateProvider.state, + connectionStateProvider, mayHaveChanged: (sub) { final currentConnectedWatch = sub.read().currentConnectedWatch; if (isConnectedToWatch()! && currentConnectedWatch!.name!.isNotEmpty) { diff --git a/lib/background/modules/apps_background.dart b/lib/background/modules/apps_background.dart index a81e4eb4..67c3a0a9 100644 --- a/lib/background/modules/apps_background.dart +++ b/lib/background/modules/apps_background.dart @@ -35,7 +35,7 @@ class AppsBackground implements BackgroundAppInstallCallbacks { BackgroundAppInstallCallbacks.setup(this); connectionSubscription = container.listen( - connectionStateProvider.state, + connectionStateProvider, ); } diff --git a/lib/background/modules/calendar_background.dart b/lib/background/modules/calendar_background.dart index 58cc4b58..460113fd 100644 --- a/lib/background/modules/calendar_background.dart +++ b/lib/background/modules/calendar_background.dart @@ -28,7 +28,7 @@ class CalendarBackground implements CalendarCallbacks { CalendarCallbacks.setup(this); connectionSubscription = container.listen( - connectionStateProvider.state, + connectionStateProvider, ); } diff --git a/lib/domain/api/appstore/locker_sync.dart b/lib/domain/api/appstore/locker_sync.dart index 819a6d62..4009ed71 100644 --- a/lib/domain/api/appstore/locker_sync.dart +++ b/lib/domain/api/appstore/locker_sync.dart @@ -59,8 +59,8 @@ class LockerSync extends StateNotifier?> { } } -final lockerSyncProvider = AutoDisposeStateNotifierProvider((ref) { +final lockerSyncProvider = AutoDisposeStateNotifierProvider?>((ref) { final appstoreFuture = ref.watch(appstoreServiceProvider.future); final lockerCacheDao = ref.watch(lockerCacheDaoProvider); return LockerSync(appstoreFuture, lockerCacheDao); -}); \ No newline at end of file +}); diff --git a/lib/domain/apps/app_install_status.dart b/lib/domain/apps/app_install_status.dart index 0f4b2a85..e5e49b1d 100644 --- a/lib/domain/apps/app_install_status.dart +++ b/lib/domain/apps/app_install_status.dart @@ -27,7 +27,7 @@ AppInstallStatus _getDefault() { } final appInstallStatusProvider = - AutoDisposeStateNotifierProvider((ref) { + AutoDisposeStateNotifierProvider((ref) { final notifier = AppInstallStatusStateNotifier(); ref.onDispose(() { diff --git a/lib/domain/apps/app_manager.dart b/lib/domain/apps/app_manager.dart index 1b69a2ca..ecb26649 100644 --- a/lib/domain/apps/app_manager.dart +++ b/lib/domain/apps/app_manager.dart @@ -176,9 +176,9 @@ class AppManager extends StateNotifier> { } } -final appManagerProvider = AutoDisposeStateNotifierProvider((ref) { +final appManagerProvider = AutoDisposeStateNotifierProvider>((ref) { final dao = ref.watch(appDaoProvider); final rpc = ref.read(backgroundRpcProvider); - final lockerSync = ref.watch(lockerSyncProvider); + final lockerSync = ref.watch(lockerSyncProvider.notifier); return AppManager(dao, rpc, lockerSync); }); diff --git a/lib/domain/calendar/calendar_list.dart b/lib/domain/calendar/calendar_list.dart index c1becf37..12245faa 100644 --- a/lib/domain/calendar/calendar_list.dart +++ b/lib/domain/calendar/calendar_list.dart @@ -72,8 +72,8 @@ class CalendarList extends StateNotifier>> { } } -final AutoDisposeStateNotifierProvider calendarListProvider = - StateNotifierProvider.autoDispose((ref) { +final AutoDisposeStateNotifierProvider>> calendarListProvider = + StateNotifierProvider.autoDispose>>((ref) { // Use auto-dispose to ensure calendar list is reloaded every time user // re-opens the screen since we cannot propagate change notifications // between background and UI isolate diff --git a/lib/domain/calendar/calendar_syncer.db.dart b/lib/domain/calendar/calendar_syncer.db.dart index 0300fe87..a4ab02a7 100644 --- a/lib/domain/calendar/calendar_syncer.db.dart +++ b/lib/domain/calendar/calendar_syncer.db.dart @@ -139,7 +139,7 @@ class _EventInCalendar { final AutoDisposeProvider calendarSyncerProvider = Provider.autoDispose((ref) { - final calendarList = ref.watch(calendarListProvider); + final calendarList = ref.watch(calendarListProvider.notifier); final deviceCalendar = ref.watch(deviceCalendarPluginProvider); final dateTimeProvider = ref.watch(currentDateTimeProvider); final timelinePinDao = ref.watch(timelinePinDaoProvider); diff --git a/lib/domain/calendar/device_calendar_plugin_provider.dart b/lib/domain/calendar/device_calendar_plugin_provider.dart index 32a7d505..01d04cac 100644 --- a/lib/domain/calendar/device_calendar_plugin_provider.dart +++ b/lib/domain/calendar/device_calendar_plugin_provider.dart @@ -1,6 +1,6 @@ import 'package:cobble/infrastructure/pigeons/pigeons.g.dart'; import 'package:device_calendar/device_calendar.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; final deviceCalendarPluginProvider = Provider((ref) => DeviceCalendarPlugin()); diff --git a/lib/domain/calendar/result_converter.dart b/lib/domain/calendar/result_converter.dart index c5ed3e3c..aa006666 100644 --- a/lib/domain/calendar/result_converter.dart +++ b/lib/domain/calendar/result_converter.dart @@ -1,5 +1,5 @@ import 'package:device_calendar/device_calendar.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; extension ResultConverter on Result { AsyncValue toAsyncValue() { diff --git a/lib/domain/connection/connection_state_provider.dart b/lib/domain/connection/connection_state_provider.dart index 84721b43..5912d560 100644 --- a/lib/domain/connection/connection_state_provider.dart +++ b/lib/domain/connection/connection_state_provider.dart @@ -37,9 +37,9 @@ class ConnectionCallbacksStateNotifier } } -final AutoDisposeStateNotifierProvider +final AutoDisposeStateNotifierProvider connectionStateProvider = - StateNotifierProvider.autoDispose((ref) { + StateNotifierProvider.autoDispose((ref) { final notifier = ConnectionCallbacksStateNotifier(); ref.onDispose(notifier.dispose); return notifier; diff --git a/lib/domain/connection/pair_provider.dart b/lib/domain/connection/pair_provider.dart index df96b3e3..fa1f2ab1 100644 --- a/lib/domain/connection/pair_provider.dart +++ b/lib/domain/connection/pair_provider.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:cobble/infrastructure/pigeons/pigeons.g.dart' as pigeon; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; class PairCallbacks implements pigeon.PairCallbacks { final StreamController streamController; diff --git a/lib/domain/connection/scan_provider.dart b/lib/domain/connection/scan_provider.dart index 2ff4afa3..c02a2667 100644 --- a/lib/domain/connection/scan_provider.dart +++ b/lib/domain/connection/scan_provider.dart @@ -1,6 +1,6 @@ import 'package:cobble/domain/entities/pebble_scan_device.dart'; import 'package:cobble/infrastructure/pigeons/pigeons.g.dart' as pigeon; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; /// Stores state of current scan operation. Devices can be empty array but /// will never be null. @@ -40,7 +40,7 @@ class ScanCallbacks extends StateNotifier } } -final scanProvider = StateNotifierProvider((ref) { +final scanProvider = StateNotifierProvider((ref) { final notifier = ScanCallbacks(); pigeon.ScanCallbacks.setup(notifier); ref.onDispose(() { diff --git a/lib/domain/date/date_providers.dart b/lib/domain/date/date_providers.dart index 994bcc61..63535f01 100644 --- a/lib/domain/date/date_providers.dart +++ b/lib/domain/date/date_providers.dart @@ -1,4 +1,4 @@ -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; typedef DateTimeProvider = DateTime Function(); diff --git a/lib/domain/db/dao/active_notification_dao.dart b/lib/domain/db/dao/active_notification_dao.dart index 3f7a1eb1..dacd8799 100644 --- a/lib/domain/db/dao/active_notification_dao.dart +++ b/lib/domain/db/dao/active_notification_dao.dart @@ -1,5 +1,5 @@ import 'package:cobble/domain/db/models/active_notification.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sqflite/sqflite.dart'; import 'package:uuid_type/uuid_type.dart'; @@ -70,4 +70,4 @@ class ActiveNotificationDao { final AutoDisposeProvider activeNotifDaoProvider = Provider.autoDispose((ref) { final dbFuture = ref.watch(databaseProvider.future); return ActiveNotificationDao(dbFuture); -}); \ No newline at end of file +}); diff --git a/lib/domain/local_notifications.dart b/lib/domain/local_notifications.dart index cd6b421d..2ed4f8a9 100644 --- a/lib/domain/local_notifications.dart +++ b/lib/domain/local_notifications.dart @@ -1,5 +1,5 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; final localNotificationsPluginProvider = FutureProvider( diff --git a/lib/domain/permissions.dart b/lib/domain/permissions.dart index ec882540..16b20c77 100644 --- a/lib/domain/permissions.dart +++ b/lib/domain/permissions.dart @@ -1,5 +1,5 @@ import 'package:cobble/infrastructure/pigeons/pigeons.g.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; final permissionControlProvider = Provider((ref) => PermissionControl()); final permissionCheckProvider = Provider((ref) => PermissionCheck()); diff --git a/lib/domain/preferences.dart b/lib/domain/preferences.dart index d1218993..6bc6d0ef 100644 --- a/lib/domain/preferences.dart +++ b/lib/domain/preferences.dart @@ -1,4 +1,4 @@ -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; final sharedPreferencesProvider = diff --git a/lib/domain/timeline/watch_apps_syncer.dart b/lib/domain/timeline/watch_apps_syncer.dart index 18d77713..c57ed0c0 100644 --- a/lib/domain/timeline/watch_apps_syncer.dart +++ b/lib/domain/timeline/watch_apps_syncer.dart @@ -20,7 +20,7 @@ import '../logging.dart'; class WatchAppsSyncer { final AppDao appDao; final AppInstallControl appInstallControl; - final ConnectionCallbacksStateNotifier connectionStateProvider; + final WatchConnectionState connectionStateProvider; final Future preferences; WatchAppsSyncer(this.appDao, this.appInstallControl, @@ -56,7 +56,7 @@ class WatchAppsSyncer { } Future _performSync() async { - final connectedWatch = connectionStateProvider.state.currentConnectedWatch; + final connectedWatch = connectionStateProvider.currentConnectedWatch; if (connectedWatch == null) { return statusWatchDisconnected; } diff --git a/lib/infrastructure/datasources/dev_connection.dart b/lib/infrastructure/datasources/dev_connection.dart index 0df6d627..04f8f030 100644 --- a/lib/infrastructure/datasources/dev_connection.dart +++ b/lib/infrastructure/datasources/dev_connection.dart @@ -158,9 +158,9 @@ class DevConnState { DevConnState(this.running, this.connected, this.localIp); } -final devConnectionProvider = StateNotifierProvider((ref) { +final devConnectionProvider = StateNotifierProvider((ref) { final incomingPacketsStream = ref.read(rawPacketStreamProvider); - final appManager = ref.read(appManagerProvider); + final appManager = ref.read(appManagerProvider.notifier); return DevConnection(incomingPacketsStream, appManager); }); diff --git a/lib/infrastructure/datasources/paired_storage.dart b/lib/infrastructure/datasources/paired_storage.dart index e6d2b59a..4c67cba6 100644 --- a/lib/infrastructure/datasources/paired_storage.dart +++ b/lib/infrastructure/datasources/paired_storage.dart @@ -85,13 +85,13 @@ class PairedStorage extends StateNotifier> { } } -final pairedStorageProvider = StateNotifierProvider((ref) => PairedStorage()); +final pairedStorageProvider = StateNotifierProvider>((ref) => PairedStorage()); final defaultWatchProvider = Provider((ref) => ref - .watch(pairedStorageProvider.state) + .watch(pairedStorageProvider) .firstWhereOrNull((element) => element.isDefault!) ?.device); final ProviderFamily? specificWatchProvider = Provider.family(((ref, dynamic address) => ref - .watch(pairedStorageProvider.state) + .watch(pairedStorageProvider) .firstWhereOrNull((element) => element.device.address == address) ?.device) as PebbleScanDevice Function(ProviderReference, dynamic)); diff --git a/lib/infrastructure/datasources/workarounds.dart b/lib/infrastructure/datasources/workarounds.dart index 28ff33e0..44bb75ea 100644 --- a/lib/infrastructure/datasources/workarounds.dart +++ b/lib/infrastructure/datasources/workarounds.dart @@ -1,7 +1,7 @@ import 'package:cobble/infrastructure/datasources/preferences.dart'; import 'package:cobble/infrastructure/pigeons/pigeons.g.dart'; import 'package:flutter/material.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:rxdart/rxdart.dart'; class Workaround { @@ -35,4 +35,4 @@ final neededWorkaroundsProvider = StreamProvider>((ref) { return ZipStream(streams, (e) => e as List); }); -}); \ No newline at end of file +}); diff --git a/lib/ui/devoptions/dev_options_page.dart b/lib/ui/devoptions/dev_options_page.dart index bdfe0e39..096c9701 100644 --- a/lib/ui/devoptions/dev_options_page.dart +++ b/lib/ui/devoptions/dev_options_page.dart @@ -22,12 +22,12 @@ enum ActionItem { debugOptions } class DevOptionsPage extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final devConControl = useProvider(devConnectionProvider); - final devConnState = useProvider(devConnectionProvider.state); + final devConControl = useProvider(devConnectionProvider.notifier); + final devConnState = useProvider(devConnectionProvider); - final connectionState = useProvider(connectionStateProvider.state); + final connectionState = useProvider(connectionStateProvider); final ConnectionControl connectionControl = ConnectionControl(); - final pairedStorage = useProvider(pairedStorageProvider); + final pairedStorage = useProvider(pairedStorageProvider.notifier); void _onDisconnectPressed(bool inSettings) { connectionControl.disconnect(); diff --git a/lib/ui/devoptions/test_logs_page.dart b/lib/ui/devoptions/test_logs_page.dart index 7c95878b..f8752d76 100644 --- a/lib/ui/devoptions/test_logs_page.dart +++ b/lib/ui/devoptions/test_logs_page.dart @@ -7,7 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; class TestLogsPage extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final logs = useProvider(recievedLogsProvider.state); + final logs = useProvider(recievedLogsProvider); return ListView.builder( itemBuilder: (context, index) { diff --git a/lib/ui/home/tabs/locker_tab.dart b/lib/ui/home/tabs/locker_tab.dart index 951aa127..a0a840b3 100644 --- a/lib/ui/home/tabs/locker_tab.dart +++ b/lib/ui/home/tabs/locker_tab.dart @@ -21,12 +21,12 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; class LockerTab extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final connectionState = useProvider(connectionStateProvider.state); + final connectionState = useProvider(connectionStateProvider); final currentWatch = connectionState.currentConnectedWatch; - final appManager = useProvider(appManagerProvider); - List allPackages = useProvider(appManagerProvider.state); + final appManager = useProvider(appManagerProvider.notifier); + List allPackages = useProvider(appManagerProvider); List incompatibleApps = allPackages.where((element) => !element.isWatchface).toList(); List incompatibleFaces = diff --git a/lib/ui/home/tabs/watches_tab.dart b/lib/ui/home/tabs/watches_tab.dart index ad0df5bd..cd944f74 100644 --- a/lib/ui/home/tabs/watches_tab.dart +++ b/lib/ui/home/tabs/watches_tab.dart @@ -36,10 +36,10 @@ class MyWatchesTab extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final connectionState = useProvider(connectionStateProvider.state); + final connectionState = useProvider(connectionStateProvider); final defaultWatch = useProvider(defaultWatchProvider); - final pairedStorage = useProvider(pairedStorageProvider); - final allWatches = useProvider(pairedStorageProvider.state); + final pairedStorage = useProvider(pairedStorageProvider.notifier); + final allWatches = useProvider(pairedStorageProvider); final preferencesFuture = useProvider(preferencesProvider.future); List allWatchesList = diff --git a/lib/ui/screens/calendar.dart b/lib/ui/screens/calendar.dart index 57142578..f0952765 100644 --- a/lib/ui/screens/calendar.dart +++ b/lib/ui/screens/calendar.dart @@ -18,8 +18,8 @@ class Calendar extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final calendars = useProvider(calendarListProvider.state); - final calendarSelector = useProvider(calendarListProvider); + final calendars = useProvider(calendarListProvider); + final calendarSelector = useProvider(calendarListProvider.notifier); final calendarControl = useProvider(calendarControlProvider); final backgroundRpc = useProvider(backgroundRpcProvider); diff --git a/lib/ui/screens/install_prompt.dart b/lib/ui/screens/install_prompt.dart index c1060c23..d99b030c 100644 --- a/lib/ui/screens/install_prompt.dart +++ b/lib/ui/screens/install_prompt.dart @@ -23,9 +23,9 @@ class InstallPrompt extends HookWidget implements CobbleScreen { final userInitiatedInstall = useState(false); final watchUploadHasStarted = useState(false); - final installStatus = useProvider(appInstallStatusProvider.state); - final appManager = useProvider(appManagerProvider); - final connectionStatus = useProvider(connectionStateProvider.state); + final installStatus = useProvider(appInstallStatusProvider); + final appManager = useProvider(appManagerProvider.notifier); + final connectionStatus = useProvider(connectionStateProvider); final connectedWatch = connectionStatus.currentConnectedWatch; diff --git a/lib/ui/setup/pair_page.dart b/lib/ui/setup/pair_page.dart index 620ce955..e66a5cc6 100644 --- a/lib/ui/setup/pair_page.dart +++ b/lib/ui/setup/pair_page.dart @@ -49,8 +49,8 @@ class PairPage extends HookWidget implements CobbleScreen { @override Widget build(BuildContext context) { - final pairedStorage = useProvider(pairedStorageProvider); - final scan = useProvider(scanProvider.state); + final pairedStorage = useProvider(pairedStorageProvider.notifier); + final scan = useProvider(scanProvider); final pair = useProvider(pairProvider).data?.value; final preferences = useProvider(preferencesProvider); @@ -83,14 +83,14 @@ class PairPage extends HookWidget implements CobbleScreen { final _refreshDevicesBle = () { if (!scan.scanning) { - context.refresh(scanProvider).onScanStarted(); + context.refresh(scanProvider.notifier).onScanStarted(); scanControl.startBleScan(); } }; final _refreshDevicesClassic = () { if (!scan.scanning) { - context.refresh(scanProvider).onScanStarted(); + context.refresh(scanProvider.notifier).onScanStarted(); scanControl.startClassicScan(); } }; diff --git a/lib/util/container_extensions.dart b/lib/util/container_extensions.dart index d168f4bb..452f95f4 100644 --- a/lib/util/container_extensions.dart +++ b/lib/util/container_extensions.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'stream_extensions.dart'; diff --git a/lib/util/state_provider_extension.dart b/lib/util/state_provider_extension.dart index 6aab1629..397b2c97 100644 --- a/lib/util/state_provider_extension.dart +++ b/lib/util/state_provider_extension.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; extension StateProviderExtension on StateNotifier { /// Variant of StateNotifier.stream that also returns existing value diff --git a/lib/util/stream_extensions.dart b/lib/util/stream_extensions.dart index c17e969c..04844f93 100644 --- a/lib/util/stream_extensions.dart +++ b/lib/util/stream_extensions.dart @@ -1,4 +1,4 @@ -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; extension StreamExtension on Stream?> { Future?> firstSuccessOrError() { diff --git a/pubspec.lock b/pubspec.lock index c05fdf3f..f13516b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -318,7 +318,7 @@ packages: name: flutter_riverpod url: "https://pub.dartlang.org" source: hosted - version: "0.13.1+1" + version: "0.14.0+3" flutter_secure_storage: dependency: "direct main" description: @@ -426,7 +426,7 @@ packages: name: hooks_riverpod url: "https://pub.dartlang.org" source: hosted - version: "0.13.1+1" + version: "0.14.0+3" http: dependency: transitive description: @@ -762,7 +762,7 @@ packages: name: riverpod url: "https://pub.dartlang.org" source: hosted - version: "0.13.1" + version: "0.14.0+3" rxdart: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 8cbe3156..c5d881fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: sqflite: ^2.0.0+2 package_info: ^2.0.0 state_notifier: ^0.7.0 - hooks_riverpod: ^0.13.0 + hooks_riverpod: ^0.14.0 flutter_hooks: ^0.16.0 device_calendar: ^4.2.0 uuid_type: ^2.0.0 diff --git a/test/domain/calendar/calendar_list_test.dart b/test/domain/calendar/calendar_list_test.dart index 0c99f23b..d0ea1b80 100644 --- a/test/domain/calendar/calendar_list_test.dart +++ b/test/domain/calendar/calendar_list_test.dart @@ -8,7 +8,7 @@ import 'package:cobble/domain/preferences.dart'; import 'package:cobble/util/container_extensions.dart'; import 'package:device_calendar/device_calendar.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import '../../fakes/fake_device_calendar_plugin.dart'; import '../../fakes/fake_permissions_check.dart'; @@ -38,7 +38,7 @@ void main() { ]; final receivedCalendars = (await container - .readUntilFirstSuccessOrError(calendarListProvider.state)) + .readUntilFirstSuccessOrError(calendarListProvider)) .data ?.value; @@ -66,7 +66,7 @@ void main() { permissionCheck.reportedCalendarPermission = false; final receivedCalendars = await container - .readUntilFirstSuccessOrError(calendarListProvider.state); + .readUntilFirstSuccessOrError(calendarListProvider); expect(receivedCalendars, isA()); }); @@ -88,7 +88,7 @@ void main() { ]; await container - .listen(calendarListProvider) + .listen(calendarListProvider.notifier .read() .setCalendarEnabled("22", false); @@ -99,7 +99,7 @@ void main() { ]; final receivedCalendars = (await container - .readUntilFirstSuccessOrError(calendarListProvider.state)) + .readUntilFirstSuccessOrError(calendarListProvider)) .data ?.value; @@ -123,11 +123,11 @@ void main() { ]; await container - .listen(calendarListProvider) + .listen(calendarListProvider.notifier) .read() .setCalendarEnabled("22", false); await container - .listen(calendarListProvider) + .listen(calendarListProvider.notifier) .read() .setCalendarEnabled("22", true); @@ -138,7 +138,7 @@ void main() { ]; final receivedCalendars = (await container - .readUntilFirstSuccessOrError(calendarListProvider.state)) + .readUntilFirstSuccessOrError(calendarListProvider)) .data ?.value; diff --git a/test/domain/calendar/calendar_syncer_test.dart b/test/domain/calendar/calendar_syncer_test.dart index 33c50de0..b5d363a3 100644 --- a/test/domain/calendar/calendar_syncer_test.dart +++ b/test/domain/calendar/calendar_syncer_test.dart @@ -15,7 +15,7 @@ import 'package:cobble/domain/permissions.dart'; import 'package:cobble/domain/preferences.dart'; import 'package:device_calendar/device_calendar.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:uuid_type/uuid_type.dart'; import '../../fakes/fake_database.dart'; @@ -1185,7 +1185,7 @@ void main() async { ]); final pinDao = container.read(timelinePinDaoProvider); - final calendarList = container.read(calendarListProvider); + final calendarList = container.read(calendarListProvider.notifier); calendarPlugin.reportedCalendars = [ Calendar(id: "22", name: "Calendar A"), diff --git a/test/domain/setup/pair_page_test.dart b/test/domain/setup/pair_page_test.dart index fdd4b5d4..67f95c46 100644 --- a/test/domain/setup/pair_page_test.dart +++ b/test/domain/setup/pair_page_test.dart @@ -8,7 +8,7 @@ import 'package:cobble/ui/common/icons/watch_icon.dart'; import 'package:cobble/ui/setup/pair_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hooks_riverpod/all.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:mockito/mockito.dart'; final device = PebbleScanDevice( @@ -51,7 +51,7 @@ Widget wrapper( Observer navigatorObserver}) => ProviderScope( overrides: [ - scan_provider.scanProvider.overrideWithValue( + scan_provider.scanProvider.notifier.overrideWithValue( scanMock ?? ScanCallbacks(), ), pair_provider.pairProvider.overrideWithProvider(