From fcdc57493d7a40c733609209b93abf19a1b12eae Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 24 Mar 2025 14:07:52 +0300 Subject: [PATCH] feat: from plan to profile --- .../presentation/widgets/plan_widget.dart | 96 +++++++++++-------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/lib/features/feed/presentation/widgets/plan_widget.dart b/lib/features/feed/presentation/widgets/plan_widget.dart index 5d3f5bda..12ab8ec7 100644 --- a/lib/features/feed/presentation/widgets/plan_widget.dart +++ b/lib/features/feed/presentation/widgets/plan_widget.dart @@ -5,6 +5,7 @@ import 'package:eatvio_app/core/widgets/bookmark_button.dart'; import 'package:eatvio_app/core/widgets/info_row.dart'; import 'package:eatvio_app/core/widgets/feed_icon_button.dart'; import 'package:eatvio_app/features/diets/presentation/widgets/info_bouble.dart'; +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart'; import 'package:eatvio_app/core/theme/custom_text_style.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; @@ -127,50 +128,63 @@ class _PlanWidgetState extends State { ], ), SizedBox(height: 16), - Padding( - padding: const EdgeInsets.only(left: 16.0), - child: ListTile( - contentPadding: EdgeInsets.zero, - leading: Container( - width: 46, - height: 46, - decoration: BoxDecoration( - shape: BoxShape.circle, - image: DecorationImage( - image: NetworkImage(widget.plan.author.authorProfileIcon), - fit: BoxFit.cover, + GestureDetector( + onTap: () { + GoRouter.of(context).pushNamed( + 'profileScreen', + extra: Author( + authorSlug: widget.plan.author.authorSlug, + authorName: widget.plan.author.authorName, + authorProfileIcon: widget.plan.author.authorProfileIcon, + authorIsMe: widget.plan.author.authorIsMe, + ), + ); + }, + child: Padding( + padding: const EdgeInsets.only(left: 16.0), + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: Container( + width: 46, + height: 46, + decoration: BoxDecoration( + shape: BoxShape.circle, + image: DecorationImage( + image: NetworkImage(widget.plan.author.authorProfileIcon), + fit: BoxFit.cover, + ), ), ), - ), - subtitle: Row( - children: [ - InfoBouble( - radius: 12, - backgroundColor: appTheme.gray50, - padding: EdgeInsets.symmetric(vertical: 4, horizontal: 10), - children: [ - Text( - '${widget.plan.author.authorPlaceInRating}-й в рейтинге', - style: TextStyles.textXSSemibold.copyWith( - color: appTheme.blueA400, + subtitle: Row( + children: [ + InfoBouble( + radius: 12, + backgroundColor: appTheme.gray50, + padding: EdgeInsets.symmetric(vertical: 4, horizontal: 10), + children: [ + Text( + '${widget.plan.author.authorPlaceInRating}-й в рейтинге', + style: TextStyles.textXSSemibold.copyWith( + color: appTheme.blueA400, + ), ), - ), - ], - ), - Spacer(), - Text( - '${widget.plan.packetsCount == 1 ? widget.plan.packet1Options?.price : '${s.from} ${widget.plan.minPriceOfOptions.toStringAsFixed(0)}'}₽', - style: TextStyles.headingXLSemibold.copyWith(color: appTheme.greenA700), - ), - SizedBox(width: 16), - ], - ), - title: Padding( - padding: const EdgeInsets.only(bottom: 4.0), - child: Text( - widget.plan.author.authorName, - style: TextStyles.textSSemibold.copyWith( - color: appTheme.black, + ], + ), + Spacer(), + Text( + '${widget.plan.packetsCount == 1 ? widget.plan.packet1Options?.price : '${s.from} ${widget.plan.minPriceOfOptions.toStringAsFixed(0)}'}₽', + style: TextStyles.headingXLSemibold.copyWith(color: appTheme.greenA700), + ), + SizedBox(width: 16), + ], + ), + title: Padding( + padding: const EdgeInsets.only(bottom: 4.0), + child: Text( + widget.plan.author.authorName, + style: TextStyles.textSSemibold.copyWith( + color: appTheme.black, + ), ), ), ),