修复白屏BUG、UI 边界溢出 BUG
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:arcx/app/app_theme.dart';
|
||||
import 'package:arcx/core/constants/app_defaults.dart';
|
||||
import 'package:arcx/data/local/models/models.dart';
|
||||
import 'package:arcx/features/profile/application/profile_controller.dart';
|
||||
import 'package:arcx/features/profile/presentation/avatar_image.dart';
|
||||
|
||||
class ProfileCard extends ConsumerWidget {
|
||||
const ProfileCard({super.key, required this.onEdit});
|
||||
@@ -65,17 +63,10 @@ class _Avatar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final source = profile.avatarSource;
|
||||
final image =
|
||||
source == AvatarSource.localFile &&
|
||||
profile.avatarLocalPath != null &&
|
||||
profile.avatarLocalPath!.isNotEmpty
|
||||
? FileImage(File(profile.avatarLocalPath!))
|
||||
: const AssetImage(AppDefaults.defaultAvatarAssetPath);
|
||||
return CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundColor: AppTheme.surfaceMuted,
|
||||
backgroundImage: image as ImageProvider,
|
||||
backgroundImage: resolveAvatarImage(profile),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user