Rework PromptService

- Use dependency injection and Get.find instead of manual singleton pattern
- Move from domain to data layer
- Prevents multiple API calls if the previous request hasn't finished
This commit is contained in:
Théo Poizat
2026-02-26 11:47:00 +01:00
committed by Dat H. Pham
parent 6d8d10cf26
commit 1982f199ac
8 changed files with 182 additions and 155 deletions
@@ -8,6 +8,7 @@ import 'package:dio/dio.dart';
import 'package:flutter_appauth/flutter_appauth.dart';
import 'package:get/get.dart';
import 'package:jmap_dart_client/http/http_client.dart';
import 'package:scribe/scribe/ai/data/service/prompt_service.dart';
import 'package:tmail_ui_user/features/contact/data/network/contact_api.dart';
import 'package:tmail_ui_user/features/email/data/network/email_api.dart';
import 'package:tmail_ui_user/features/email/data/network/mdn_api.dart';
@@ -146,5 +147,6 @@ class NetworkBindings extends Bindings {
void _bindingServices() {
Get.put(DnsLookupManager());
Get.put(PromptService(Get.find<DioClient>()));
}
}