fix(mobile-app): fix API response parsing for auto-create and wallet

- Extract 'data' field from API response before parsing
- Fix createAccount() to parse responseData['data']
- Fix getWalletInfo() to parse responseData['data']
- Resolves: type 'Null' is not a subtype of type 'int' in type cast

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-07 11:55:41 -08:00
parent 8e9eb0ef19
commit 72c49ffe7a
1 changed files with 6 additions and 6 deletions

View File

@ -301,9 +301,9 @@ class AccountService {
}
debugPrint('$_tag createAccount() - 解析响应数据');
final result = CreateAccountResponse.fromJson(
response.data as Map<String, dynamic>,
);
final responseData = response.data as Map<String, dynamic>;
final data = responseData['data'] as Map<String, dynamic>;
final result = CreateAccountResponse.fromJson(data);
debugPrint('$_tag createAccount() - 解析成功: $result');
//
@ -341,9 +341,9 @@ class AccountService {
}
debugPrint('$_tag getWalletInfo() - 解析响应数据');
final result = WalletInfoResponse.fromJson(
response.data as Map<String, dynamic>,
);
final responseData = response.data as Map<String, dynamic>;
final data = responseData['data'] as Map<String, dynamic>;
final result = WalletInfoResponse.fromJson(data);
debugPrint('$_tag getWalletInfo() - 解析成功: $result');
//