mirror of
https://github.com/gskinnerTeam/flutter-wonderous-app.git
synced 2025-08-06 09:39:31 +08:00
Add support for latest l10n implementation
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:wonders/common_libs.dart';
|
||||
import 'package:wonders/logic/common/string_utils.dart';
|
||||
import 'package:wonders/logic/common/http_client.dart';
|
||||
import 'package:wonders/logic/data/artifact_data.dart';
|
||||
import 'package:wonders/logic/met_api_service.dart';
|
||||
|
||||
import 'package:wonders/logic/common/http_client.dart';
|
||||
|
||||
class MetAPILogic {
|
||||
final HashMap<String, ArtifactData?> _artifactCache = HashMap();
|
||||
|
||||
@ -16,7 +14,7 @@ class MetAPILogic {
|
||||
Future<ArtifactData?> getArtifactByID(String id) async {
|
||||
if (_artifactCache.containsKey(id)) return _artifactCache[id];
|
||||
ServiceResult<ArtifactData?> result = (await service.getObjectByID(id));
|
||||
if (!result.success) throw StringUtils.supplant($strings.artifactDetailsErrorNotFound, {'{artifactId}': id});
|
||||
if (!result.success) throw $strings.artifactDetailsErrorNotFound(id);
|
||||
ArtifactData? artifact = result.content;
|
||||
return _artifactCache[id] = artifact;
|
||||
}
|
||||
|
Reference in New Issue
Block a user