Files
iiEsaywebUIapp/lib/features/prompts/providers/prompts_providers.dart

23 lines
694 B
Dart
Raw Normal View History

2025-09-20 23:22:57 +05:30
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();
});
2025-09-21 22:31:44 +05:30
final activePromptCommandProvider =
NotifierProvider<ActivePromptCommandNotifier, String?>(
ActivePromptCommandNotifier.new,
);
class ActivePromptCommandNotifier extends Notifier<String?> {
@override
String? build() => null;
void set(String? command) => state = command;
}