diff --git a/assets/images/png/background.png b/assets/images/png/background.png new file mode 100644 index 0000000..3e27684 Binary files /dev/null and b/assets/images/png/background.png differ diff --git a/lib/Main_Screens/Community_HomePage/Community.dart b/lib/Main_Screens/Community_HomePage/Community.dart index 71b9309..79c1a5d 100644 --- a/lib/Main_Screens/Community_HomePage/Community.dart +++ b/lib/Main_Screens/Community_HomePage/Community.dart @@ -253,21 +253,40 @@ class _FeedTabState extends State { ), ), combinedList.isEmpty - ? Expanded( - child: Center( - child: Column( - children: [ - Text( - "No Data Found", - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w600), - ) - ], - ), - ), - ) + ? + + // Expanded( + // child: Center( + // child: Column( + // children: [ + // Text( + // "No Data Found", + // style: TextStyle( + // color: Colors.white, + // fontSize: 16.sp, + // fontWeight: FontWeight.w600), + // ) + // ], + // ), + // ), + // ) + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) : Column( children: [ sizedBoxHeight(16.h), @@ -336,8 +355,7 @@ class _FeedTabState extends State { .community! .communityName .toString(), - RecationId: - combinedList[index].id.toString(), + postId: combinedList[index].id.toString(), ), sizedBoxHeight(20.h) ], @@ -368,7 +386,7 @@ Widget normalcardtile2({ required String total_likes, required String total_save, required String? create_at, - required String? RecationId, + required String? postId, }) { var mainImage = 'assets/images/png/uiw_like-o.png'.obs; void updateImage(String reaction) { @@ -580,7 +598,7 @@ Widget normalcardtile2({ InkWell( onTap: () { Get.toNamed(RouteName.reactionview, arguments: { - 'reactionId': RecationId, + 'postId': postId, }); }, child: stackReaction(number: total_likes, containerImages: [ @@ -1231,17 +1249,18 @@ Widget popularTab() { return Column( children: [ normalcardtile2( - profileImg: popularTabData[index]["profileImg"], - title: popularTabData[index]["title"], - mainImg: popularTabData[index]["mainImg"], - containerTitle: popularTabData[index]["containerTitle"], - description: 'test', - create_at: '1 hour', - total_comments: '20', - total_likes: '20', - total_save: '10', - community_name: 'text', - RecationId: ''), + profileImg: popularTabData[index]["profileImg"], + title: popularTabData[index]["title"], + mainImg: popularTabData[index]["mainImg"], + containerTitle: popularTabData[index]["containerTitle"], + description: 'test', + create_at: '1 hour', + total_comments: '20', + total_likes: '20', + total_save: '10', + community_name: 'text', + postId: '', + ), sizedBoxHeight(20.h) ], ); @@ -1403,7 +1422,7 @@ class _LatestTabState extends State { } } - pinunpinUser(int userid) async { + pinunpinUser(int userid) async { // utils.loader(); Map updata = { "pin_iam_principal_xid": userid, @@ -1411,7 +1430,7 @@ class _LatestTabState extends State { final data = await SidebarTags().postUserpin(updata); if (data.status == ResponseStatus.SUCCESS) { // Get.back(); - LatespostApi().getLatestPostApi().then((value) { + LatespostApi().getLatestPostApi().then((value) { _initializeData(); setState(() {}); }); @@ -1460,1208 +1479,604 @@ class _LatestTabState extends State { fit: BoxFit.fill), ), ), - Column( - children: [ - sizedBoxHeight(16.h), - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: latestpostobj!.data.length, - itemBuilder: (context, index) { - var timeAgo = ConvertServerDateToUserDate() - .convertServerDateToReadableFormate(latestpostobj! - .data[index].createdAt - .toString()); - var postId = latestpostobj!.data[index].id; - var selectedReaction = _selectedReactions[postId]; - if (index == 1) { - return - // announcecardtile( - // profileImg: latestpostobj! - // .data[index].iamPrincipal!.profilePhoto ?? - // '', - // title: latestpostobj! - // .data[index].iamPrincipal!.fullName ?? - // '', - // mainImg: latestpostobj!.data[index].image ?? '', - // containerTitle: - // latestpostobj!.data[index].tagNames ?? [''], - // create_at: timeAgo, - // community_name: latestpostobj! - // .data[index].community!.communityName ?? - // '', - // totalcomments: latestpostobj! - // .data[index].totalComment - // .toString(), - // description: - // latestpostobj!.data[index].caption ?? '', - // totalSave: - // latestpostobj!.data[index].totalSave.toString(), - // ); + latestpostobj!.data.isEmpty + ? Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ], + ), + ) + : Column( + children: [ + sizedBoxHeight(16.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: latestpostobj!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + latestpostobj!.data[index].createdAt + .toString()); + var postId = latestpostobj!.data[index].id; + var selectedReaction = _selectedReactions[postId]; + if (index == 1) { + return + // announcecardtile( + // profileImg: latestpostobj! + // .data[index].iamPrincipal!.profilePhoto ?? + // '', + // title: latestpostobj! + // .data[index].iamPrincipal!.fullName ?? + // '', + // mainImg: latestpostobj!.data[index].image ?? '', + // containerTitle: + // latestpostobj!.data[index].tagNames ?? [''], + // create_at: timeAgo, + // community_name: latestpostobj! + // .data[index].community!.communityName ?? + // '', + // totalcomments: latestpostobj! + // .data[index].totalComment + // .toString(), + // description: + // latestpostobj!.data[index].caption ?? '', + // totalSave: + // latestpostobj!.data[index].totalSave.toString(), + // ); - Column( - children: [ - commonGlassUIBlue( - width: double.infinity, - height: 780.h, - borderRadius: BorderRadius.circular(1), - customWidget: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: - text16w700_FCFCFC("#Announcement"), - ), - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Row( + Column( + children: [ + commonGlassUIBlue( + width: double.infinity, + height: 780.h, + borderRadius: BorderRadius.circular(1), + customWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CircleAvatar( - foregroundImage: NetworkImage( - latestpostobj! - .data[index] - .iamPrincipal! - .profilePhoto ?? - ''), - radius: 25.r, + sizedBoxHeight(25.h), + Padding( + padding: + EdgeInsets.only(left: 16.w), + child: text16w700_FCFCFC( + "#Announcement"), ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(latestpostobj! - .data[index] - .iamPrincipal! - .fullName ?? - ''), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC( - latestpostobj! - .data[index] - .community! - .communityName ?? - '', - ), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color( - 0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC(timeAgo), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: - const Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: - (BuildContext context) => - [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: - FontWeight.w800, - fontFamily: - "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: - FontWeight.w800, - fontFamily: - "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - // const PopupMenuDivider(), - // PopupMenuItem( - // onTap: () {}, - // child: Padding( - // padding: - // EdgeInsets.symmetric( - // horizontal: 12.w), - // child: Row( - // children: [ - // Text( - // 'Pin', - // style: TextStyle( - // fontSize: 16.sp, - // color: Colors.white, - // fontWeight: - // FontWeight.w800, - // fontFamily: - // "Nunito Sans", - // ), - // ), - // const Spacer(), - // Image.asset( - // "assets/images/png/f7_pin-fill (2).png", - // height: 25.h, - // width: 25.w, - // ) - // ], - // ), - // ), - // ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed( - RouteName.postdetailsScreen); - }, - child: Container( - height: 390.h, - decoration: BoxDecoration( - image: DecorationImage( - image: NetworkImage( - latestpostobj!.data[index] - .image ?? - ''))), - ), - ), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - width: double.infinity, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - // Filter the tags to include only those with a non-null and non-empty name - itemCount: latestpostobj! - .data[index].attachTags - .where((tag) => - tag.manageTag?.name - ?.isNotEmpty ?? - false) - .length, - itemBuilder: (context, tagIndex) { - // Filtered list of tags - var filteredTags = - latestpostobj! - .data[index].attachTags - .where((tag) => - tag.manageTag?.name - ?.isNotEmpty ?? - false) - .toList(); - - // Safely get the manageTag object - var manageTag = - filteredTags[tagIndex] - .manageTag; - - // Get the tag name, ensuring it's not null or empty - String tagName = - manageTag?.name ?? ''; - - return Padding( - padding: EdgeInsets.only( - right: 12.w, left: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed( - RouteName - .tagdetailscreen, - arguments: { - 'tagid': - // filteredTags[ - // tagIndex] - // .manageTagXid, - latestpostobj! - .data[index] - .attachTags[ - tagIndex] - .manageTag! - .id, - 'tagname': tagName, - 'ispinnedtag': - filteredTags[ - tagIndex] - .manageTag! - .isPinned - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - commonContainer( - width: 130.w, - height: 30.h, - borderRadius: - BorderRadius - .circular( - 30.r), - borderColor: - const Color( - 0xFFD90B2E), - opacity1: 0.04, - opacity2: 0.05, - customWidget: Padding( - padding: EdgeInsets - .symmetric( - horizontal: - 10.w), - child: Center( - child: text14w400_FCFCFC( - '#${tagName}'), - ), - ), - ), - ], - ), - ), - ); - }, - ), - ), - sizedBoxHeight(20.h), - SizedBox( - width: double.infinity, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(latestpostobj! - .data[index].caption ?? - ''), - ], - ), - ), - Row(children: [ - InkWell( - onTap: () {}, - child: stackReaction( - number: latestpostobj! - .data[index].likecount - .toString(), - containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: - const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC(latestpostobj! - .data[index].totalComment - .toString()), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: - const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC(latestpostobj! - .data[index].totalSave - .toString()), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.center, + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Column( - children: [ - ReactionButton( - onReactionChanged: - (reaction) async { - if (selectedReaction != - null && - reaction?.value == - selectedReaction - .id - .toString()) { - // User tapped on the currently selected reaction, so remove it - await _handleReactionChange( - selectedReaction, - latestpostobj! - .data[index] - .id!); - } else { - // User selected a new reaction - var newSelectedReaction = - _reactions - .firstWhere( - (r) => - r.id.toString() == - reaction - ?.value, - orElse: () => - _reactions - .first, // Default reaction if not found - ); - await _handleReactionChange( - newSelectedReaction, - latestpostobj! - .data[index] - .id!); - } - debugPrint( - 'Selected value: ${reaction?.value}'); - }, - reactions: _reactions - .map((reaction) => - Reaction< - String>( - value: reaction - .id - .toString(), - previewIcon: Image.network( - reaction - .image, - width: 24, - height: - 24, - fit: BoxFit - .cover), - icon: Image.network( - reaction - .image, - width: 24, - height: - 24, - fit: BoxFit - .cover), - )) - .toList(), - selectedReaction: - selectedReaction != - null - ? Reaction< - String>( - value: selectedReaction - .id - .toString(), - icon: Image - .network( - selectedReaction - .image, - width: 24, - height: - 24, - fit: BoxFit - .cover, - ), - ) - : Reaction< - String>( - value: '', - icon: Image - .asset( - 'assets/images/png/uiw_like-o.png', - width: 24, - height: - 24, - fit: BoxFit - .cover, - ), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: - const Size(30, 30), - boxPadding: - const EdgeInsets - .all(8), - boxAnimationDuration: - const Duration( - milliseconds: - 200), - itemAnimationDuration: - const Duration( - milliseconds: - 500), - hoverDuration: - const Duration( - milliseconds: - 700), - child: - selectedReaction != - null - ? Image.network( - selectedReaction - .image, - width: 24, - height: 24, - fit: BoxFit - .cover, - ) - : Image.asset( - 'assets/images/png/uiw_like-o.png', - width: 24, - height: 24, - fit: BoxFit - .cover, - ), - ), - sizedBoxHeight(2.h), - text11w400_FCFCFC('Like'), - ], - ) - ], - ), - GestureDetector( - onTap: () {}, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - GestureDetector( - onTap: () async { - int latestpostid = - latestpostobj! - .data[index].id!; - await saveunsavepost( - latestpostid); - }, - child: latestpostobj! - .data[index] - .isISaved == - true - ? Image.asset( - 'assets/images/png/postSaved.png', - height: 19.h, - width: 19.w, - ) - : Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - ), - // Image.asset( - // 'assets/images/png/Frame 1000004089.png', - // height: 19.h, - // width: 19.w, - // ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )), - sizedBoxHeight(20.h), - ], - ); - } else { - return Column( - children: [ - // normalcardtile2( - // profileImg: latestpostobj!.data[index] - // .iamPrincipal!.profilePhoto ?? - // '', - // title: latestpostobj! - // .data[index].iamPrincipal!.fullName ?? - // '', - // mainImg: latestpostobj!.data[index].image ?? '', - // containerTitle: - // latestpostobj!.data[index].tagNames ?? [''], - // description: - // latestpostobj!.data[index].caption ?? '', - // create_at: timeAgo, - // total_comments: latestpostobj! - // .data[index].totalComment - // .toString(), - // total_likes: latestpostobj! - // .data[index].likecount - // .toString(), - // total_save: latestpostobj!.data[index].totalSave - // .toString(), - // community_name: latestpostobj! - // .data[index].community!.communityName - // .toString(), - // ), - commonGlassUI( - width: double.infinity, - height: 760.h, - mainOpacity: 1, - borderRadius: BorderRadius.circular(1), - customWidget: Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: NetworkImage( - latestpostobj! - .data[index] - .iamPrincipal! - .profilePhoto ?? - ''), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(latestpostobj! - .data[index] - .iamPrincipal! - .fullName ?? - ''), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC( + CircleAvatar( + foregroundImage: NetworkImage( latestpostobj! - .data[index] - .community! - .communityName - .toString()), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color( - 0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC(timeAgo!), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: - const Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: - (BuildContext context) => - [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: - FontWeight.w800, - fontFamily: - "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: - FontWeight.w800, - fontFamily: - "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () async { - int pinPospostid = - latestpostobj! .data[index] .iamPrincipal! - .id!; - await pinunpinUser( - pinPospostid); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - Text( + .profilePhoto ?? + ''), + radius: 25.r, + ), + sizedBoxWidth(12.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16w400_FCFCFC( latestpostobj! - .data[ - index] - .iamPrincipal! - .isUserPinned == - true - ? 'Unpin' - : 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: - FontWeight.w800, - fontFamily: - "Nunito Sans", + .data[index] + .iamPrincipal! + .fullName ?? + ''), + sizedBoxHeight(5.h), + Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + height: 14.w, + width: 14.w, + ), + sizedBoxWidth(7.w), + text12w400_FCFCFC( + latestpostobj! + .data[index] + .community! + .communityName ?? + '', + ), + sizedBoxWidth(7.w), + Icon( + Icons.circle, + color: const Color( + 0xFFFCFCFC), + size: 4.sp, + ), + sizedBoxWidth(6.w), + text12w400_FCFCFC( + timeAgo), + ], + ) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: const Offset(0, 50), + color: + const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + Text( + 'Report Post', + style: + TextStyle( + fontSize: + 16.sp, + color: Colors + .white, + fontWeight: + FontWeight + .w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 15.h, + width: 15.w, + ) + ], ), ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + Text( + 'Share post', + style: + TextStyle( + fontSize: + 16.sp, + color: Colors + .white, + fontWeight: + FontWeight + .w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + // const PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // Text( + // 'Pin', + // style: TextStyle( + // fontSize: 16.sp, + // color: Colors.white, + // fontWeight: + // FontWeight.w800, + // fontFamily: + // "Nunito Sans", + // ), + // ), + // const Spacer(), + // Image.asset( + // "assets/images/png/f7_pin-fill (2).png", + // height: 25.h, + // width: 25.w, + // ) + // ], + // ), + // ), + // ), + ], + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + width: 16.w, + height: 18.h, ), ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, + sizedBoxWidth(5.w) + ], ), ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed( - RouteName.postdetailsScreen); - }, - child: Container( - height: 360, - width: double.infinity, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.cover, - image: NetworkImage( - latestpostobj! - .data[index].image ?? - '', + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName + .postdetailsScreen); + }, + child: Container( + height: 390.h, + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage( + latestpostobj! + .data[index] + .image ?? + ''))), ), ), - ), - ), - ), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Column(children: [ - // SizedBox( - // height: 30.h, - // child: ListView.builder( - // scrollDirection: Axis.horizontal, - // shrinkWrap: true, - // itemCount: latestpostobj! - // .data[index].attachTags.length, - // itemBuilder: (context, tagIndex) { - // print( - // 'tags id are ${latestpostobj!.data[index].attachTags[tagIndex].manageTag!.id}'); - // print( - // 'tags name are ${latestpostobj!.data[index].attachTags[tagIndex].manageTag!.name}'); - // return Padding( - // padding: EdgeInsets.only( - // right: 12.w), - // child: GestureDetector( - // onTap: () { - // Get.toNamed( - // RouteName - // .tagdetailscreen, - // arguments: { - // 'tagid': - // latestpostobj! - // .data[ - // index] - // .attachTags[ - // tagIndex].manageTag! - // .id, - // 'tagname': - // latestpostobj! - // .data[ - // index] - // .attachTags[ - // tagIndex].manageTag! - // .name, - // }); - // }, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment - // .start, - // children: [ - // // containertile2( - // // text: latestpostobj! - // // .data[index] - // // .tagsData[ - // // tagIndex] - // // .name!), - // commonContainer( - // width: 130.w, - // height: 30.h, - // borderRadius: - // BorderRadius - // .circular( - // 30.r), - // borderColor: - // const Color( - // 0xFFD90B2E), - // opacity1: 0.04, - // opacity2: 0.05, - // customWidget: - // Padding( - // padding: EdgeInsets - // .symmetric( - // horizontal: - // 10.w), - // child: Center( - // child: text14w400_FCFCFC(latestpostobj! - // .data[ - // index] - // .attachTags[ - // tagIndex].manageTag! - // .name!)), - // )), - // ], - // )), - // ); - // }, - // ), - // ), - SizedBox( - height: 30.h, - width: double.infinity, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - // Filter the tags to include only those with a non-null and non-empty name - itemCount: latestpostobj! - .data[index].attachTags - .where((tag) => - tag.manageTag?.name - ?.isNotEmpty ?? - false) - .length, - itemBuilder: (context, tagIndex) { - // Filtered list of tags - var filteredTags = - latestpostobj! + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Column(children: [ + SizedBox( + height: 30.h, + width: double.infinity, + child: ListView.builder( + scrollDirection: + Axis.horizontal, + shrinkWrap: true, + // Filter the tags to include only those with a non-null and non-empty name + itemCount: latestpostobj! .data[index].attachTags .where((tag) => tag.manageTag?.name ?.isNotEmpty ?? false) - .toList(); + .length, + itemBuilder: + (context, tagIndex) { + // Filtered list of tags + var filteredTags = + latestpostobj! + .data[index] + .attachTags + .where((tag) => + tag + .manageTag + ?.name + ?.isNotEmpty ?? + false) + .toList(); - // Safely get the manageTag object - var manageTag = - filteredTags[tagIndex] - .manageTag; + // Safely get the manageTag object + var manageTag = + filteredTags[tagIndex] + .manageTag; - // Get the tag name, ensuring it's not null or empty - String tagName = - manageTag?.name ?? ''; + // Get the tag name, ensuring it's not null or empty + String tagName = + manageTag?.name ?? ''; - return Padding( - padding: EdgeInsets.only( - right: 12.w, left: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed( - RouteName - .tagdetailscreen, - arguments: { - 'tagid': - latestpostobj! - .data[index] - .attachTags[ - tagIndex] - .manageTag! - .id, - 'tagname': tagName, - 'ispinnedtag': - filteredTags[ - tagIndex] - .manageTag! - .isPinned - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - commonContainer( - width: 130.w, - height: 30.h, - borderRadius: - BorderRadius - .circular( - 30.r), - borderColor: - const Color( - 0xFFD90B2E), - opacity1: 0.04, - opacity2: 0.05, - customWidget: Padding( - padding: EdgeInsets - .symmetric( - horizontal: - 10.w), - child: Center( - child: text14w400_FCFCFC( - '#${tagName}'), - ), + return Padding( + padding: + EdgeInsets.only( + right: 12.w, + left: 12.w), + child: GestureDetector( + onTap: () { + Get.toNamed( + RouteName + .tagdetailscreen, + arguments: { + 'tagid': + // filteredTags[ + // tagIndex] + // .manageTagXid, + latestpostobj! + .data[ + index] + .attachTags[ + tagIndex] + .manageTag! + .id, + 'tagname': + tagName, + 'ispinnedtag': filteredTags[ + tagIndex] + .manageTag! + .isPinned + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + commonContainer( + width: 130.w, + height: 30.h, + borderRadius: + BorderRadius + .circular( + 30.r), + borderColor: + const Color( + 0xFFD90B2E), + opacity1: 0.04, + opacity2: 0.05, + customWidget: + Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 10.w), + child: Center( + child: text14w400_FCFCFC( + '#${tagName}'), + ), + ), + ), + ], ), ), - ], + ); + }, + ), + ), + sizedBoxHeight(20.h), + SizedBox( + width: double.infinity, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16w400_FCFCFC( + latestpostobj! + .data[index] + .caption ?? + ''), + ], + ), + ), + Row(children: [ + InkWell( + onTap: () {}, + child: stackReaction( + number: latestpostobj! + .data[index] + .likecount + .toString(), + containerImages: [ + 'assets/images/png/f7_hand-thumbsup.png', + 'assets/images/png/heart 2.png', + 'assets/images/png/party-popper 2.png' + ]), + ), + const Spacer(), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: + const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 13.h, + width: 13.w, + ), ), ), - ); - }, - ), - ), - sizedBoxHeight(20.h), - SizedBox( - width: double.infinity, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(latestpostobj! - .data[index].caption ?? - ''), - ], - ), - ), - Row(children: [ - InkWell( - onTap: () { - Get.toNamed( - RouteName.reactionview); - }, - child: stackReaction( - number: latestpostobj! - .data[index].likecount - .toString(), - containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: - const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC(latestpostobj! - .data[index].totalComment - .toString()), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: - const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC(latestpostobj! - .data[index].totalSave - .toString()), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Column( - children: [ - ReactionButton( - onReactionChanged: - (reaction) async { - if (selectedReaction != - null && - reaction?.value == - selectedReaction - .id - .toString()) { - // User tapped on the currently selected reaction, so remove it - await _handleReactionChange( - selectedReaction, - latestpostobj! - .data[index] - .id!); - } else { - // User selected a new reaction - var newSelectedReaction = - _reactions - .firstWhere( - (r) => - r.id.toString() == - reaction - ?.value, - orElse: () => + sizedBoxWidth(12.w), + text14w400_FCFCFC( + latestpostobj!.data[index] + .totalComment + .toString()), + sizedBoxWidth(20.w), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: + const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Vector (1).png', + height: 12.h, + width: 12.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC( + latestpostobj! + .data[index].totalSave + .toString()), + ]), + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Column( + children: [ + ReactionButton< + String>( + onReactionChanged: + (reaction) async { + if (selectedReaction != + null && + reaction?.value == + selectedReaction + .id + .toString()) { + // User tapped on the currently selected reaction, so remove it + await _handleReactionChange( + selectedReaction, + latestpostobj! + .data[ + index] + .id!); + } else { + // User selected a new reaction + var newSelectedReaction = + _reactions + .firstWhere( + (r) => + r.id.toString() == + reaction + ?.value, + orElse: () => + _reactions + .first, // Default reaction if not found + ); + await _handleReactionChange( + newSelectedReaction, + latestpostobj! + .data[ + index] + .id!); + } + debugPrint( + 'Selected value: ${reaction?.value}'); + }, + reactions: _reactions - .first, // Default reaction if not found - ); - await _handleReactionChange( - newSelectedReaction, - latestpostobj! - .data[index] - .id!); - } - debugPrint( - 'Selected value: ${reaction?.value}'); - }, - reactions: _reactions - .map((reaction) => - Reaction< - String>( - value: reaction - .id - .toString(), - previewIcon: Image.network( - reaction - .image, - width: 24, - height: - 24, - fit: BoxFit - .cover), - icon: Image.network( - reaction - .image, - width: 24, - height: - 24, - fit: BoxFit - .cover), - )) - .toList(), - selectedReaction: - selectedReaction != - null - ? Reaction< - String>( - value: selectedReaction - .id - .toString(), - icon: Image - .network( + .map((reaction) => + Reaction< + String>( + value: + reaction.id.toString(), + previewIcon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + icon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + )) + .toList(), + selectedReaction: + selectedReaction != + null + ? Reaction< + String>( + value: selectedReaction + .id + .toString(), + icon: + Image.network( + selectedReaction.image, + width: + 24, + height: + 24, + fit: + BoxFit.cover, + ), + ) + : Reaction< + String>( + value: + '', + icon: + Image.asset( + 'assets/images/png/uiw_like-o.png', + width: + 24, + height: + 24, + fit: + BoxFit.cover, + ), + ), + boxColor: + Colors.white, + boxElevation: 9, + boxRadius: 30, + itemsSpacing: 8, + itemScale: 0.4, + itemSize: + const Size( + 30, 30), + boxPadding: + const EdgeInsets + .all(8), + boxAnimationDuration: + const Duration( + milliseconds: + 200), + itemAnimationDuration: + const Duration( + milliseconds: + 500), + hoverDuration: + const Duration( + milliseconds: + 700), + child: selectedReaction != + null + ? Image + .network( selectedReaction .image, width: 24, @@ -2669,13 +2084,8 @@ class _LatestTabState extends State { 24, fit: BoxFit .cover, - ), - ) - : Reaction< - String>( - value: '', - icon: Image - .asset( + ) + : Image.asset( 'assets/images/png/uiw_like-o.png', width: 24, height: @@ -2683,127 +2093,843 @@ class _LatestTabState extends State { fit: BoxFit .cover, ), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: - const Size(30, 30), - boxPadding: - const EdgeInsets - .all(8), - boxAnimationDuration: - const Duration( - milliseconds: - 200), - itemAnimationDuration: - const Duration( - milliseconds: - 500), - hoverDuration: - const Duration( - milliseconds: - 700), - child: - selectedReaction != - null - ? Image.network( - selectedReaction - .image, - width: 24, - height: 24, - fit: BoxFit - .cover, - ) - : Image.asset( - 'assets/images/png/uiw_like-o.png', - width: 24, - height: 24, - fit: BoxFit - .cover, - ), + ), + sizedBoxHeight(2.h), + text11w400_FCFCFC( + 'Like'), + ], + ) + ], + ), + GestureDetector( + onTap: () {}, + child: Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC( + 'Comment') + ], ), - sizedBoxHeight(2.h), - text11w400_FCFCFC('Like'), + ), + Column( + children: [ + GestureDetector( + onTap: () async { + int latestpostid = + latestpostobj! + .data[index] + .id!; + await saveunsavepost( + latestpostid); + }, + child: latestpostobj! + .data[ + index] + .isISaved == + true + ? Image.asset( + 'assets/images/png/postSaved.png', + height: 19.h, + width: 19.w, + ) + : Image.asset( + 'assets/images/png/Frame 1000004089.png', + height: 19.h, + width: 19.w, + ), + ), + // Image.asset( + // 'assets/images/png/Frame 1000004089.png', + // height: 19.h, + // width: 19.w, + // ), + sizedBoxHeight(8.h), + text11w400_FCFCFC( + 'Save') + ], + ) + ], + ), + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + ]), + ), + ], + )), + sizedBoxHeight(20.h), + ], + ); + } else { + return Column( + children: [ + // normalcardtile2( + // profileImg: latestpostobj!.data[index] + // .iamPrincipal!.profilePhoto ?? + // '', + // title: latestpostobj! + // .data[index].iamPrincipal!.fullName ?? + // '', + // mainImg: latestpostobj!.data[index].image ?? '', + // containerTitle: + // latestpostobj!.data[index].tagNames ?? [''], + // description: + // latestpostobj!.data[index].caption ?? '', + // create_at: timeAgo, + // total_comments: latestpostobj! + // .data[index].totalComment + // .toString(), + // total_likes: latestpostobj! + // .data[index].likecount + // .toString(), + // total_save: latestpostobj!.data[index].totalSave + // .toString(), + // community_name: latestpostobj! + // .data[index].community!.communityName + // .toString(), + // ), + commonGlassUI( + width: double.infinity, + height: 760.h, + mainOpacity: 1, + borderRadius: BorderRadius.circular(1), + customWidget: Column( + children: [ + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CircleAvatar( + foregroundImage: NetworkImage( + latestpostobj! + .data[index] + .iamPrincipal! + .profilePhoto ?? + ''), + radius: 25.r, + ), + sizedBoxWidth(12.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16w400_FCFCFC( + latestpostobj! + .data[index] + .iamPrincipal! + .fullName ?? + ''), + sizedBoxHeight(5.h), + Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + height: 14.w, + width: 14.w, + ), + sizedBoxWidth(7.w), + text12w400_FCFCFC( + latestpostobj! + .data[index] + .community! + .communityName + .toString()), + sizedBoxWidth(7.w), + Icon( + Icons.circle, + color: const Color( + 0xFFFCFCFC), + size: 4.sp, + ), + sizedBoxWidth(6.w), + text12w400_FCFCFC( + timeAgo!), + ], + ) ], - ) + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: const Offset(0, 50), + color: + const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + Text( + 'Report Post', + style: + TextStyle( + fontSize: + 16.sp, + color: Colors + .white, + fontWeight: + FontWeight + .w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + Text( + 'Share post', + style: + TextStyle( + fontSize: + 16.sp, + color: Colors + .white, + fontWeight: + FontWeight + .w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + int pinPospostid = + latestpostobj! + .data[index] + .iamPrincipal! + .id!; + await pinunpinUser( + pinPospostid); + }, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + Text( + latestpostobj! + .data[index] + .iamPrincipal! + .isUserPinned == + true + ? 'Unpin' + : 'Pin', + style: + TextStyle( + fontSize: + 16.sp, + color: Colors + .white, + fontWeight: + FontWeight + .w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + width: 16.w, + height: 18.h, + ), + ), + sizedBoxWidth(5.w) ], ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName - .postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName + .postdetailsScreen); + }, + child: Container( + height: 360, + width: double.infinity, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: NetworkImage( + latestpostobj!.data[index] + .image ?? + '', ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], + ), ), ), - InkWell( - onTap: () {}, - child: Column( - children: [ - GestureDetector( - onTap: () async { - int latestpostid = - latestpostobj! - .data[index] - .id!; - await saveunsavepost( - latestpostid); - }, - child: latestpostobj! + ), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Column(children: [ + // SizedBox( + // height: 30.h, + // child: ListView.builder( + // scrollDirection: Axis.horizontal, + // shrinkWrap: true, + // itemCount: latestpostobj! + // .data[index].attachTags.length, + // itemBuilder: (context, tagIndex) { + // print( + // 'tags id are ${latestpostobj!.data[index].attachTags[tagIndex].manageTag!.id}'); + // print( + // 'tags name are ${latestpostobj!.data[index].attachTags[tagIndex].manageTag!.name}'); + // return Padding( + // padding: EdgeInsets.only( + // right: 12.w), + // child: GestureDetector( + // onTap: () { + // Get.toNamed( + // RouteName + // .tagdetailscreen, + // arguments: { + // 'tagid': + // latestpostobj! + // .data[ + // index] + // .attachTags[ + // tagIndex].manageTag! + // .id, + // 'tagname': + // latestpostobj! + // .data[ + // index] + // .attachTags[ + // tagIndex].manageTag! + // .name, + // }); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment + // .start, + // children: [ + // // containertile2( + // // text: latestpostobj! + // // .data[index] + // // .tagsData[ + // // tagIndex] + // // .name!), + // commonContainer( + // width: 130.w, + // height: 30.h, + // borderRadius: + // BorderRadius + // .circular( + // 30.r), + // borderColor: + // const Color( + // 0xFFD90B2E), + // opacity1: 0.04, + // opacity2: 0.05, + // customWidget: + // Padding( + // padding: EdgeInsets + // .symmetric( + // horizontal: + // 10.w), + // child: Center( + // child: text14w400_FCFCFC(latestpostobj! + // .data[ + // index] + // .attachTags[ + // tagIndex].manageTag! + // .name!)), + // )), + // ], + // )), + // ); + // }, + // ), + // ), + SizedBox( + height: 30.h, + width: double.infinity, + child: ListView.builder( + scrollDirection: + Axis.horizontal, + shrinkWrap: true, + // Filter the tags to include only those with a non-null and non-empty name + itemCount: latestpostobj! + .data[index].attachTags + .where((tag) => + tag.manageTag?.name + ?.isNotEmpty ?? + false) + .length, + itemBuilder: + (context, tagIndex) { + // Filtered list of tags + var filteredTags = + latestpostobj! + .data[index] + .attachTags + .where((tag) => + tag + .manageTag + ?.name + ?.isNotEmpty ?? + false) + .toList(); + + // Safely get the manageTag object + var manageTag = + filteredTags[tagIndex] + .manageTag; + + // Get the tag name, ensuring it's not null or empty + String tagName = + manageTag?.name ?? ''; + + return Padding( + padding: + EdgeInsets.only( + right: 12.w, + left: 12.w), + child: GestureDetector( + onTap: () { + Get.toNamed( + RouteName + .tagdetailscreen, + arguments: { + 'tagid': latestpostobj! + .data[ + index] + .attachTags[ + tagIndex] + .manageTag! + .id, + 'tagname': + tagName, + 'ispinnedtag': filteredTags[ + tagIndex] + .manageTag! + .isPinned + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + commonContainer( + width: 130.w, + height: 30.h, + borderRadius: + BorderRadius + .circular( + 30.r), + borderColor: + const Color( + 0xFFD90B2E), + opacity1: 0.04, + opacity2: 0.05, + customWidget: + Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 10.w), + child: Center( + child: text14w400_FCFCFC( + '#${tagName}'), + ), + ), + ), + ], + ), + ), + ); + }, + ), + ), + sizedBoxHeight(20.h), + SizedBox( + width: double.infinity, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16w400_FCFCFC( + latestpostobj! .data[index] - .isISaved == - true - ? Image.asset( - 'assets/images/png/postSaved.png', - height: 19.h, - width: 19.w, - ) - : Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), + .caption ?? + ''), + ], + ), + ), + Row(children: [ + InkWell( + onTap: () { + Get.toNamed( + RouteName + .reactionview, + arguments: { + 'postId': postId + .toString(), + }); + }, + child: stackReaction( + number: latestpostobj! + .data[index] + .likecount + .toString(), + containerImages: [ + 'assets/images/png/f7_hand-thumbsup.png', + 'assets/images/png/heart 2.png', + 'assets/images/png/party-popper 2.png' + ]), + ), + const Spacer(), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: + const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 13.h, + width: 13.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC( + latestpostobj!.data[index] + .totalComment + .toString()), + sizedBoxWidth(20.w), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: + const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Vector (1).png', + height: 12.h, + width: 12.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC( + latestpostobj! + .data[index].totalSave + .toString()), + ]), + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Column( + children: [ + ReactionButton< + String>( + onReactionChanged: + (reaction) async { + if (selectedReaction != + null && + reaction?.value == + selectedReaction + .id + .toString()) { + // User tapped on the currently selected reaction, so remove it + await _handleReactionChange( + selectedReaction, + latestpostobj! + .data[ + index] + .id!); + } else { + // User selected a new reaction + var newSelectedReaction = + _reactions + .firstWhere( + (r) => + r.id.toString() == + reaction + ?.value, + orElse: () => + _reactions + .first, // Default reaction if not found + ); + await _handleReactionChange( + newSelectedReaction, + latestpostobj! + .data[ + index] + .id!); + } + debugPrint( + 'Selected value: ${reaction?.value}'); + }, + reactions: + _reactions + .map((reaction) => + Reaction< + String>( + value: + reaction.id.toString(), + previewIcon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + icon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + )) + .toList(), + selectedReaction: + selectedReaction != + null + ? Reaction< + String>( + value: selectedReaction + .id + .toString(), + icon: + Image.network( + selectedReaction.image, + width: + 24, + height: + 24, + fit: + BoxFit.cover, + ), + ) + : Reaction< + String>( + value: + '', + icon: + Image.asset( + 'assets/images/png/uiw_like-o.png', + width: + 24, + height: + 24, + fit: + BoxFit.cover, + ), + ), + boxColor: + Colors.white, + boxElevation: 9, + boxRadius: 30, + itemsSpacing: 8, + itemScale: 0.4, + itemSize: + const Size( + 30, 30), + boxPadding: + const EdgeInsets + .all(8), + boxAnimationDuration: + const Duration( + milliseconds: + 200), + itemAnimationDuration: + const Duration( + milliseconds: + 500), + hoverDuration: + const Duration( + milliseconds: + 700), + child: selectedReaction != + null + ? Image + .network( + selectedReaction + .image, + width: 24, + height: + 24, + fit: BoxFit + .cover, + ) + : Image.asset( + 'assets/images/png/uiw_like-o.png', + width: 24, + height: + 24, + fit: BoxFit + .cover, + ), + ), + sizedBoxHeight(2.h), + text11w400_FCFCFC( + 'Like'), + ], + ) + ], + ), + GestureDetector( + onTap: () { + Get.toNamed(RouteName + .postdetailsScreen); + }, + child: Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC( + 'Comment') + ], + ), + ), + InkWell( + onTap: () {}, + child: Column( + children: [ + GestureDetector( + onTap: () async { + int latestpostid = + latestpostobj! + .data[ + index] + .id!; + await saveunsavepost( + latestpostid); + }, + child: latestpostobj! + .data[ + index] + .isISaved == + true + ? Image.asset( + 'assets/images/png/postSaved.png', + height: + 19.h, + width: 19.w, + ) + : Image.asset( + 'assets/images/png/Frame 1000004089.png', + height: + 19.h, + width: 19.w, + ), + ), + // Image.asset( + // 'assets/images/png/Frame 1000004089.png', + // height: 19.h, + // width: 19.w, + // ), + sizedBoxHeight(8.h), + text11w400_FCFCFC( + 'Save') + ], + ), ), - // Image.asset( - // 'assets/images/png/Frame 1000004089.png', - // height: 19.h, - // width: 19.w, - // ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') ], ), - ), - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )), - sizedBoxHeight(20.h) - ], - ); - } - }, + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + ]), + ), + ], + )), + sizedBoxHeight(20.h) + ], + ); + } + }, + ), + ), + ], ), - ), - ], - ), ], ); } diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart index b8c5ecb..0c6bbdb 100644 --- a/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart @@ -9,7 +9,7 @@ import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; -var recationid = Get.arguments['reactionId']; +String? postId; class ReactionView extends StatefulWidget { const ReactionView({super.key}); @@ -149,7 +149,9 @@ class _AllTabsState extends State { @override void initState() { - alltabfuture = LikePostApi().postLike({'manage_posts_xid': recationid}); + postId = Get.arguments['postId']; + + alltabfuture = LikePostApi().postLike({'manage_posts_xid': postId}); super.initState(); } @@ -224,8 +226,9 @@ class _LikeTabsState extends State { @override void initState() { - liketabfuture = LikePostApi() - .postLike({'manage_posts_xid': recationid, 'like_icons_xid': 1}); + postId = Get.arguments['postId']; + + liketabfuture = LikePostApi() .postLike({'manage_posts_xid': postId, 'like_icons_xid': 1}); super.initState(); } @@ -300,8 +303,9 @@ class _FavouriteTabsState extends State { @override void initState() { - favouritetabfuture = LikePostApi() - .postLike({'manage_posts_xid': recationid, 'like_icons_xid': 2}); + postId = Get.arguments['postId']; + + favouritetabfuture = LikePostApi() .postLike({'manage_posts_xid': postId, 'like_icons_xid': 2}); super.initState(); } @@ -376,8 +380,8 @@ class _PartyTabsState extends State { @override void initState() { - partytabfuture = LikePostApi() - .postLike({'manage_posts_xid': recationid, 'like_icons_xid': 3}); + postId = Get.arguments['postId']; + partytabfuture = LikePostApi().postLike({'manage_posts_xid': postId, 'like_icons_xid': 3}); super.initState(); } diff --git a/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart index 6f8796d..449af88 100644 --- a/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart +++ b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart @@ -190,8 +190,7 @@ class _BusSignUpScreenState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: - AssetImage("assets/images/png/Choice screen.png"), + image: AssetImage("assets/images/png/background.png"), fit: BoxFit.fill)), ), Column(