Files
iiEsaywebUIapp/lib/features/tools/providers/tools_providers.dart
cogwheel0 8a8ba76298 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.
2025-10-01 18:32:16 +05:30

22 lines
601 B
Dart

import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:conduit/core/models/tool.dart';
import 'package:conduit/core/services/tools_service.dart';
part 'tools_providers.g.dart';
@Riverpod(keepAlive: true)
Future<List<Tool>> toolsList(Ref ref) async {
final toolsService = ref.watch(toolsServiceProvider);
if (toolsService == null) return [];
return await toolsService.getTools();
}
@Riverpod(keepAlive: true)
class SelectedToolIds extends _$SelectedToolIds {
@override
List<String> build() => [];
void set(List<String> ids) => state = List<String>.from(ids);
}