修复白屏BUG、UI 边界溢出 BUG

This commit is contained in:
2026-08-09 01:35:48 +08:00
parent 4a357024bc
commit 4385c6941e
24 changed files with 485 additions and 206 deletions
@@ -0,0 +1,19 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:arcx/core/constants/app_defaults.dart';
import 'package:arcx/data/local/models/models.dart';
/// Resolves a profile avatar to a local file when present, otherwise the
/// default asset. Missing local files fall back safely (no FileImage crash).
ImageProvider resolveAvatarImage(UserProfile? profile) {
final path = profile?.avatarLocalPath?.trim();
if (profile?.avatarSource == AvatarSource.localFile &&
path != null &&
path.isNotEmpty &&
File(path).existsSync()) {
return FileImage(File(path));
}
return const AssetImage(AppDefaults.defaultAvatarAssetPath);
}