2025-09-30 14:39:22 +05:30
|
|
|
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';
|
|
|
|
|
|
2025-09-30 14:39:22 +05:30
|
|
|
part 'prompts_providers.g.dart';
|
|
|
|
|
|
2025-10-01 18:32:16 +05:30
|
|
|
@Riverpod(keepAlive: true)
|
2025-09-30 14:39:22 +05:30
|
|
|
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-30 14:39:22 +05:30
|
|
|
}
|
2025-09-21 22:31:44 +05:30
|
|
|
|
2025-10-01 18:32:16 +05:30
|
|
|
@Riverpod(keepAlive: true)
|
2025-09-30 14:39:22 +05:30
|
|
|
class ActivePromptCommand extends _$ActivePromptCommand {
|
2025-09-21 22:31:44 +05:30
|
|
|
@override
|
|
|
|
|
String? build() => null;
|
|
|
|
|
|
|
|
|
|
void set(String? command) => state = command;
|
|
|
|
|
}
|