File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import '../../../../domain/entities/activity_comment.dart';
88import '../../../../core/utils/storage_utils.dart' ;
99import '../../../../domain/entities/user.dart' ;
1010import '../../core/utils/color_utils.dart' ;
11+ import '../../core/utils/user_utils.dart' ;
1112import '../view_model/activity_item_view_model.dart' ;
1213import 'package:flutter_gen/gen_l10n/app_localizations.dart' ;
1314
@@ -65,25 +66,13 @@ class ActivityComments extends HookConsumerWidget {
6566 return pic != null
6667 ? CircleAvatar (
6768 radius: 50 , backgroundImage: MemoryImage (pic))
68- : Icon (
69- Icons .person,
70- size: 50 ,
71- color: ColorUtils .black,
72- );
69+ : UserUtils .personIcon;
7370 },
7471 loading: () {
75- return Icon (
76- Icons .person,
77- size: 50 ,
78- color: ColorUtils .black,
79- );
72+ return UserUtils .personIcon;
8073 },
8174 error: (error, stackTrace) {
82- return Icon (
83- Icons .person,
84- size: 50 ,
85- color: ColorUtils .black,
86- );
75+ return UserUtils .personIcon;
8776 },
8877 ),
8978 ),
Original file line number Diff line number Diff line change @@ -192,23 +192,15 @@ class ActivityItem extends HookConsumerWidget {
192192 profilePicture,
193193 fit: BoxFit .cover,
194194 )
195- : Icon (
196- Icons .person,
197- size: 50 ,
198- color: ColorUtils .black,
199- ),
195+ : UserUtils .personIcon,
200196 ),
201197 );
202198 },
203199 loading: () {
204200 return Center (child: UIUtils .loader);
205201 },
206202 error: (error, stackTrace) {
207- return Icon (
208- Icons .person,
209- size: 50 ,
210- color: ColorUtils .black,
211- );
203+ return UserUtils .personIcon;
212204 },
213205 ),
214206 const SizedBox (
Original file line number Diff line number Diff line change @@ -3,9 +3,16 @@ import 'package:flutter/material.dart';
33import '../../../../domain/entities/user.dart' ;
44import '../../../../main.dart' ;
55import '../../user/screens/profile_screen.dart' ;
6+ import 'color_utils.dart' ;
67
78/// Utility class for user-related operations.
89class UserUtils {
10+ static final personIcon = Icon (
11+ Icons .person,
12+ size: 50 ,
13+ color: ColorUtils .black,
14+ );
15+
916 /// Go to user profile
1017 static void goToProfile (User user) {
1118 navigatorKey.currentState? .push (
You can’t perform that action at this time.
0 commit comments