fix(admin-app): fix 4 compile errors

- credit_page.dart: remove const from Padding containing context.t() call
- issuer_coupon_service/redemption_service/issuer_finance_service:
  cast inner['total'] to int? to match named record return type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-04 23:23:39 -08:00
parent 3d0223d10a
commit af5aba8efe
4 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class IssuerCouponService {
?.map((e) => IssuerCouponModel.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
return (items: items, total: inner['total'] ?? items.length);
return (items: items, total: (inner['total'] as int?) ?? items.length);
} catch (e) {
debugPrint('[IssuerCouponService] list 失败: $e');
rethrow;

View File

@ -54,7 +54,7 @@ class IssuerFinanceService {
?.map((e) => TransactionModel.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
return (items: items, total: inner['total'] ?? items.length);
return (items: items, total: (inner['total'] as int?) ?? items.length);
} catch (e) {
debugPrint('[IssuerFinanceService] getTransactions 失败: $e');
rethrow;

View File

@ -75,7 +75,7 @@ class RedemptionService {
?.map((e) => RedemptionRecord.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
return (items: items, total: inner['total'] ?? items.length);
return (items: items, total: (inner['total'] as int?) ?? items.length);
} catch (e) {
debugPrint('[RedemptionService] getHistory 失败: $e');
rethrow;

View File

@ -191,8 +191,8 @@ class _CreditPageState extends State<CreditPage> {
);
}),
if (factors.isEmpty)
const Padding(
padding: EdgeInsets.all(16),
Padding(
padding: const EdgeInsets.all(16),
child: Center(child: Text(context.t('credit_no_factors'), style: const TextStyle(color: AppColors.textTertiary))),
),
],