Files
iiEsaywebUIapp/lib/features/prompts/providers/prompts_providers.dart
2025-09-21 22:31:44 +05:30

23 lines
694 B
Dart

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:conduit/core/models/prompt.dart';
import 'package:conduit/core/services/prompts_service.dart';
final promptsListProvider = FutureProvider<List<Prompt>>((ref) async {
final promptsService = ref.watch(promptsServiceProvider);
if (promptsService == null) return const <Prompt>[];
return promptsService.getPrompts();
});
final activePromptCommandProvider =
NotifierProvider<ActivePromptCommandNotifier, String?>(
ActivePromptCommandNotifier.new,
);
class ActivePromptCommandNotifier extends Notifier<String?> {
@override
String? build() => null;
void set(String? command) => state = command;
}