refactor: unify storage config keys and refresh local dev setup

This commit is contained in:
qzl
2026-03-26 13:25:25 +08:00
parent b765b9e3e1
commit 5900993ee7
61 changed files with 1164 additions and 129 deletions
@@ -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 '暂无联系人';