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:
@@ -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>()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user