From 27b165669063fde2da615672cb4546c72e04c880 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 25 Apr 2025 12:56:23 +0300 Subject: [PATCH] feat(avatar): task 394 placeholder empty avatar --- .../presentation/pages/blog_post_screen.dart | 14 +++++++++++--- .../widgets/bottom_navigation_bar_widget.dart | 3 ++- .../chat/presentation/pages/chat_screen.dart | 1 + .../presentation/widgets/chat_entry_widget.dart | 3 ++- .../presentation/widgets/blog_post_widget.dart | 1 + .../feed/presentation/widgets/comments_widget.dart | 1 + .../presentation/widgets/consultant_widget.dart | 1 + .../profile/presentation/pages/profile_screen.dart | 3 ++- .../widgets/profile_blog_post_widget.dart | 1 + .../profile/presentation/widgets/sub_widget.dart | 3 ++- 10 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/features/blog_post/presentation/pages/blog_post_screen.dart b/lib/features/blog_post/presentation/pages/blog_post_screen.dart index 4f6a0ad0..63f87233 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -104,8 +104,10 @@ class _BlogPostScreenState extends State { height: 1.2, ), decoration: InputDecoration( - isDense: false, // убираем true, чтобы padding учитывался корректно - contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен + isDense: false, + // убираем true, чтобы padding учитывался корректно + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + // вертикальный паддинг увеличен hintText: 'Комментарий', hintStyle: const TextStyle( fontSize: 16, @@ -209,7 +211,13 @@ class _BlogPostScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ - CircleAvatar(radius: 16, backgroundImage: NetworkImage(widget.blogPost.author.authorProfileIcon)), + CircleAvatar( + radius: 16, + foregroundImage: NetworkImage( + widget.blogPost.author.authorProfileIcon, + ), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), + ), const SizedBox(width: 8), Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index 5fdf10c0..c0b5e16a 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -81,7 +81,8 @@ class _BottomNavigationBarWidgetState extends State { BottomNavigationBarItem( label: '', icon: CircleAvatar( - backgroundImage: NetworkImage(widget.profileModel.profilePhotoUrl), + foregroundImage: NetworkImage(widget.profileModel.profilePhotoUrl), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), radius: 16, ), ), diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 5f14e0bf..6cf7c9da 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -128,6 +128,7 @@ class _ChatScreenState extends State { CircleAvatar( radius: 20, foregroundImage: NetworkImage(state.chatRoom.users.receiver.profilePhotoUrl!), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), ), if (state.chatRoom.users.receiver.profilePhotoUrl == null) Container( diff --git a/lib/features/chat/presentation/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/widgets/chat_entry_widget.dart index bde4f8fd..1338c60b 100644 --- a/lib/features/chat/presentation/widgets/chat_entry_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_entry_widget.dart @@ -40,9 +40,10 @@ class _ChatEntryWidgetState extends State { children: [ CircleAvatar( radius: 24, - backgroundImage: NetworkImage( + foregroundImage: NetworkImage( widget.chatRoom.users.toChatUser.profilePhotoUrl, ), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), backgroundColor: Colors.white, ), const SizedBox(width: 12), diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index 819d8c62..605df679 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -81,6 +81,7 @@ class _BlogPostWidgetState extends State { foregroundImage: NetworkImage( state.feedBlogPostList[widget.index].author.authorProfileIcon, ), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), ), const SizedBox(width: 8), Column( diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index 784a77c5..338e4f5a 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -61,6 +61,7 @@ class _CommentsWidgetState extends State { children: [ CircleAvatar( foregroundImage: NetworkImage(comment.authorProfileIcon), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), radius: radius, ), const SizedBox(width: 8), diff --git a/lib/features/feed/presentation/widgets/consultant_widget.dart b/lib/features/feed/presentation/widgets/consultant_widget.dart index c9d26e47..60b84dc9 100644 --- a/lib/features/feed/presentation/widgets/consultant_widget.dart +++ b/lib/features/feed/presentation/widgets/consultant_widget.dart @@ -64,6 +64,7 @@ class ConsultantWidget extends StatelessWidget { const SizedBox(width: 8), CircleAvatar( foregroundImage: NetworkImage(consultant.photo), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), ), const SizedBox(width: 8), Column( diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 12e4c4ea..74c2903a 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -799,9 +799,10 @@ class _ProfileScreenState extends State { widthFactor: 0.8, child: CircleAvatar( radius: 14, - backgroundImage: NetworkImage( + foregroundImage: NetworkImage( urls[i], ), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), ), ), ], diff --git a/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart b/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart index 06bcc85d..ab920ea2 100644 --- a/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart +++ b/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart @@ -68,6 +68,7 @@ class _ProfileBlogPostWidgetState extends State { foregroundImage: NetworkImage( state.blogPosts[widget.index].author.authorProfileIcon, ), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), ), const SizedBox(width: 8), Column( diff --git a/lib/features/profile/presentation/widgets/sub_widget.dart b/lib/features/profile/presentation/widgets/sub_widget.dart index 429772d3..c8342077 100644 --- a/lib/features/profile/presentation/widgets/sub_widget.dart +++ b/lib/features/profile/presentation/widgets/sub_widget.dart @@ -35,7 +35,8 @@ class _SubWidgetState extends State { child: Row( children: [ CircleAvatar( - backgroundImage: NetworkImage(widget.subModel.profilePhotoUrl), + foregroundImage: NetworkImage(widget.subModel.profilePhotoUrl), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), radius: 28, ), const SizedBox(width: 12),