refactor: unify storage config keys and refresh local dev setup
This commit is contained in:
@@ -188,11 +188,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
width: 64,
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [AppColors.blue100, AppColors.blue50],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -207,11 +202,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.person,
|
||||
size: 28,
|
||||
color: AppColors.blue600,
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: _buildAvatarImage(_user?.avatarUrl),
|
||||
),
|
||||
const SizedBox(width: AppSpacing.lg),
|
||||
Expanded(
|
||||
@@ -307,6 +299,61 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAvatarImage(String? avatarUrl) {
|
||||
if (avatarUrl == null) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [AppColors.blue100, AppColors.blue50],
|
||||
),
|
||||
),
|
||||
child: const Icon(Icons.person, size: 28, color: AppColors.blue600),
|
||||
);
|
||||
}
|
||||
return Image.network(
|
||||
avatarUrl,
|
||||
fit: BoxFit.cover,
|
||||
width: 64,
|
||||
height: 64,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [AppColors.blue100, AppColors.blue50],
|
||||
),
|
||||
),
|
||||
child: const Icon(Icons.person, size: 28, color: AppColors.blue600),
|
||||
);
|
||||
},
|
||||
loadingBuilder: (context, child, loadingProgress) {
|
||||
if (loadingProgress == null) return child;
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [AppColors.blue100, AppColors.blue50],
|
||||
),
|
||||
),
|
||||
child: const Center(
|
||||
child: SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(AppColors.blue600),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
String _buildFriendsSubtitle() {
|
||||
if (_friendsCount == 0) {
|
||||
return '暂无联系人';
|
||||
|
||||
Reference in New Issue
Block a user