💄 Better way to switch focused realm

This commit is contained in:
2024-10-05 14:25:57 +08:00
parent ac60043ca7
commit f353c05cb5
5 changed files with 107 additions and 21 deletions

View File

@ -7,6 +7,7 @@ class AccountAvatar extends StatelessWidget {
final Color? bgColor;
final Color? feColor;
final double? radius;
final Widget? fallbackWidget;
const AccountAvatar({
super.key,
@ -14,6 +15,7 @@ class AccountAvatar extends StatelessWidget {
this.bgColor,
this.feColor,
this.radius,
this.fallbackWidget,
});
@override
@ -35,11 +37,12 @@ class AccountAvatar extends StatelessWidget {
backgroundColor: bgColor,
backgroundImage: !isEmpty ? AutoCacheImage.provider(url) : null,
child: isEmpty
? Icon(
Icons.account_circle,
size: radius != null ? radius! * 1.2 : 24,
color: feColor,
)
? (fallbackWidget ??
Icon(
Icons.account_circle,
size: radius != null ? radius! * 1.2 : 24,
color: feColor,
))
: null,
);
}