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

22 lines
618 B
Dart
Raw Normal View History

import 'package:riverpod_annotation/riverpod_annotation.dart';
2025-09-20 23:22:57 +05:30
import 'package:conduit/core/models/prompt.dart';
import 'package:conduit/core/services/prompts_service.dart';
part 'prompts_providers.g.dart';
@Riverpod(keepAlive: true)
Future<List<Prompt>> promptsList(Ref ref) async {
2025-09-20 23:22:57 +05:30
final promptsService = ref.watch(promptsServiceProvider);
if (promptsService == null) return const <Prompt>[];
return promptsService.getPrompts();
}
2025-09-21 22:31:44 +05:30
@Riverpod(keepAlive: true)
class ActivePromptCommand extends _$ActivePromptCommand {
2025-09-21 22:31:44 +05:30
@override
String? build() => null;
void set(String? command) => state = command;
}