@@ -4,14 +4,13 @@ import 'package:flutter/material.dart';
44import 'package:flutter_gen/gen_l10n/app_localizations.dart' ;
55import 'package:hooks_riverpod/hooks_riverpod.dart' ;
66import 'package:intl/intl.dart' ;
7- import 'package:run_flutter_run/presentation/common/activity/widgets/ activty_like.dart' ;
7+ import 'activty_like.dart' ;
88
99import '../../../../domain/entities/activity.dart' ;
10- import '../../../../main.dart' ;
1110import '../../core/utils/activity_utils.dart' ;
1211import '../../core/utils/color_utils.dart' ;
1312import '../../core/utils/ui_utils.dart' ;
14- import '../../user/screens/profile_screen .dart' ;
13+ import '../../core/utils/user_utils .dart' ;
1514import '../view_model/activity_item_view_model.dart' ;
1615import 'activity_comments.dart' ;
1716
@@ -99,7 +98,7 @@ class ActivityItem extends HookConsumerWidget {
9998 child: Center (
10099 child: Icon (
101100 ActivityUtils .getActivityTypeIcon (activity.type),
102- color: Colors .white,
101+ color: ColorUtils .white,
103102 size: 40 ,
104103 ),
105104 ),
@@ -145,9 +144,9 @@ class ActivityItem extends HookConsumerWidget {
145144 ),
146145 ),
147146 if (canOpenActivity)
148- const Icon (
147+ Icon (
149148 Icons .navigate_next,
150- color: Colors .black,
149+ color: ColorUtils .black,
151150 size: 30 ,
152151 ),
153152 ],
@@ -169,26 +168,14 @@ class ActivityItem extends HookConsumerWidget {
169168 decoration: BoxDecoration (
170169 border: Border (
171170 bottom: BorderSide (
172- color: Colors .grey.shade300 ,
171+ color: ColorUtils .greyLight ,
173172 width: 0.5 ,
174173 ),
175174 ),
176175 ),
177176 child: TextButton (
178177 onPressed: () {
179- navigatorKey.currentState? .push (
180- PageRouteBuilder (
181- transitionDuration: const Duration (milliseconds: 500 ),
182- pageBuilder: (context, animation, secondaryAnimation) =>
183- SlideTransition (
184- position: Tween <Offset >(
185- begin: const Offset (1.0 , 0.0 ),
186- end: Offset .zero,
187- ).animate (animation),
188- child: ProfileScreen (user: activity.user),
189- ),
190- ),
191- );
178+ UserUtils .goToProfile (activity.user);
192179 },
193180 child: Row (
194181 children: [
@@ -205,22 +192,22 @@ class ActivityItem extends HookConsumerWidget {
205192 profilePicture,
206193 fit: BoxFit .cover,
207194 )
208- : const Icon (
195+ : Icon (
209196 Icons .person,
210197 size: 50 ,
211- color: Colors .black,
198+ color: ColorUtils .black,
212199 ),
213200 ),
214201 );
215202 },
216203 loading: () {
217- return const Center (child: UIUtils .loader);
204+ return Center (child: UIUtils .loader);
218205 },
219206 error: (error, stackTrace) {
220- return const Icon (
207+ return Icon (
221208 Icons .person,
222209 size: 50 ,
223- color: Colors .black,
210+ color: ColorUtils .black,
224211 );
225212 },
226213 ),
@@ -233,7 +220,7 @@ class ActivityItem extends HookConsumerWidget {
233220 activity.user.lastname != null
234221 ? '${activity .user .firstname } ${activity .user .lastname }'
235222 : activity.user.username,
236- style: const TextStyle (color: Colors .black),
223+ style: TextStyle (color: ColorUtils .black),
237224 overflow: TextOverflow .ellipsis,
238225 maxLines: 1 ,
239226 ),
@@ -257,7 +244,7 @@ class ActivityItem extends HookConsumerWidget {
257244 Text (
258245 '${appLocalizations .date_pronoun } $formattedDate ${appLocalizations .hours_pronoun } $formattedTime ' ,
259246 style: TextStyle (
260- color: Colors .grey.shade700 ,
247+ color: ColorUtils .greyDarker ,
261248 fontFamily: 'Avenir' ,
262249 ),
263250 ),
@@ -266,14 +253,14 @@ class ActivityItem extends HookConsumerWidget {
266253 children: [
267254 Icon (
268255 Icons .location_on,
269- color: Colors .grey.shade600 ,
256+ color: ColorUtils .grey,
270257 size: 16 ,
271258 ),
272259 const SizedBox (width: 8 ),
273260 Text (
274261 '${activity .distance .toStringAsFixed (2 )} km' ,
275262 style: TextStyle (
276- color: Colors .grey.shade600 ,
263+ color: ColorUtils .grey,
277264 fontFamily: 'Avenir' ,
278265 ),
279266 ),
@@ -283,14 +270,14 @@ class ActivityItem extends HookConsumerWidget {
283270 children: [
284271 Icon (
285272 Icons .speed,
286- color: Colors .grey.shade600 ,
273+ color: ColorUtils .grey,
287274 size: 16 ,
288275 ),
289276 const SizedBox (width: 8 ),
290277 Text (
291278 '${activity .speed .toStringAsFixed (2 )} km/h' ,
292279 style: TextStyle (
293- color: Colors .grey.shade600 ,
280+ color: ColorUtils .grey,
294281 fontFamily: 'Avenir' ,
295282 ),
296283 ),
@@ -315,9 +302,9 @@ class ActivityItem extends HookConsumerWidget {
315302 children: [
316303 Row (children: [
317304 IconButton (
318- icon: const Icon (
305+ icon: Icon (
319306 Icons .comment_outlined,
320- color: Colors .black,
307+ color: ColorUtils .black,
321308 size: 24 ,
322309 ),
323310 onPressed: () {
0 commit comments