This commit is contained in:
2026-06-28 14:55:41 +03:00
parent 6fdf4eedf1
commit 2b89545248
9 changed files with 234 additions and 111 deletions
@@ -97,6 +97,7 @@ class ExchangeRateService {
final fromRate = currentRates[from] ?? 1.0;
final toRate = currentRates[to] ?? 1.0;
if (fromRate == 0) return amount;
final amountInUsd = amount / fromRate;
return amountInUsd * toRate;
+2 -2
View File
@@ -59,7 +59,7 @@ class TranslationService {
for (final entry in _ruToEn.entries) entry.value.toLowerCase(): entry.key,
};
String? _dictionaryLookup(String input, TranslateDirection direction) {
String? dictionaryLookup(String input, TranslateDirection direction) {
final normalized = input.trim().toLowerCase();
if (normalized.isEmpty) return null;
final map = direction == TranslateDirection.ruToEn ? _ruToEn : _enToRu;
@@ -75,7 +75,7 @@ class TranslationService {
final trimmed = input.trim();
if (trimmed.isEmpty) return null;
final cached = _dictionaryLookup(trimmed, direction);
final cached = dictionaryLookup(trimmed, direction);
if (cached != null) {
return TranslationResult(cached, fromCache: true);
}