2025-08-19 20:26:19 +05:30
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
import 'package:conduit/core/models/tool.dart';
|
|
|
|
|
import 'package:conduit/core/services/tools_service.dart';
|
|
|
|
|
|
|
|
|
|
final toolsListProvider = FutureProvider<List<Tool>>((ref) async {
|
|
|
|
|
final toolsService = ref.watch(toolsServiceProvider);
|
|
|
|
|
if (toolsService == null) return [];
|
|
|
|
|
return await toolsService.getTools();
|
|
|
|
|
});
|
|
|
|
|
|
2025-09-21 22:31:44 +05:30
|
|
|
final selectedToolIdsProvider =
|
|
|
|
|
NotifierProvider<SelectedToolIdsNotifier, List<String>>(
|
|
|
|
|
SelectedToolIdsNotifier.new,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
class SelectedToolIdsNotifier extends Notifier<List<String>> {
|
|
|
|
|
@override
|
|
|
|
|
List<String> build() => [];
|
|
|
|
|
|
|
|
|
|
void set(List<String> ids) => state = List<String>.from(ids);
|
|
|
|
|
}
|