refactor: update providers to use keepAlive for enhanced state management

- Changed multiple provider annotations to `@Riverpod(keepAlive: true)` to improve state retention and management across the application.
- This update aligns with recent enhancements in state management practices, ensuring better performance and user experience throughout the app.
This commit is contained in:
cogwheel0
2025-10-01 18:32:16 +05:30
parent 28dc16a6e3
commit 8a8ba76298
8 changed files with 23 additions and 60 deletions

View File

@@ -5,14 +5,14 @@ import 'package:conduit/core/services/tools_service.dart';
part 'tools_providers.g.dart';
@riverpod
@Riverpod(keepAlive: true)
Future<List<Tool>> toolsList(Ref ref) async {
final toolsService = ref.watch(toolsServiceProvider);
if (toolsService == null) return [];
return await toolsService.getTools();
}
@riverpod
@Riverpod(keepAlive: true)
class SelectedToolIds extends _$SelectedToolIds {
@override
List<String> build() => [];