conflict resolved

This commit is contained in:
Dakshesh42
2024-08-16 19:52:53 +05:30
3 changed files with 502 additions and 231 deletions

View File

@@ -2,13 +2,12 @@
import 'dart:developer';
import 'package:async/src/future_group.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:regroup/Common/CommonBottomNavigationBar.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonTabBar.dart';
@@ -16,7 +15,6 @@ import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/ConvertServerDateToUserDate.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/MainScreen.dart';
import 'package:regroup/Feed%20Module/Main_Screens/Community/view_model/getApi.dart';
import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart';
import 'package:regroup/Main_Screens/Community/Model/FeedPostModel.dart'
as feedobj;
@@ -37,7 +35,6 @@ import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:regroup/sidemenu/sidemenu.dart';
import 'package:async/src/future_group.dart';
import 'package:regroup/sidemenu/view_model/postmethod.dart';
import 'view_model/CountersHelper.dart';
@@ -207,7 +204,7 @@ class FeedTab extends StatefulWidget {
class _FeedTabState extends State<FeedTab> {
late Future feedfuture;
List<ReactionData> _reactions = [];
Map<int, ReactionData?> _selectedReactions = {};
final Map<int, ReactionData?> _selectedReactions = {};
final CountersHelper countersHelper = Get.find<CountersHelper>();
int? likeIconIdnew;
List<feedobj.PinnedPost> combinedList = [];
@@ -673,8 +670,14 @@ class _NormalCardTileState extends State<NormalCardTile> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
foregroundImage: NetworkImage(
widget.commonObj.iamPrincipal!.profilePhoto!),
backgroundImage: widget
.commonObj.iamPrincipal?.profilePhoto !=
null
? NetworkImage(
widget.commonObj.iamPrincipal!.profilePhoto!)
as ImageProvider<Object>
: const AssetImage('assets/images/default_profile.png')
as ImageProvider<Object>,
radius: 25.r,
),
sizedBoxWidth(12.w),
@@ -837,9 +840,7 @@ class _NormalCardTileState extends State<NormalCardTile> {
'currentIndex': widget.currentIndex
});
if (result) {
setState(() {
});
setState(() {});
}
},
child: SizedBox(
@@ -1158,7 +1159,7 @@ class PopularTab extends StatefulWidget {
class _PopularTabState extends State<PopularTab> {
late Future popularfuture;
List<ReactionData> _reactions = [];
Map<int, ReactionData?> _selectedReactions = {};
final Map<int, ReactionData?> _selectedReactions = {};
final CountersHelper countersHelper = Get.find<CountersHelper>();
int? likeIconIdnew;
@override
@@ -1373,7 +1374,7 @@ class _LatestTabState extends State<LatestTab> {
}
List<ReactionData> _reactions = [];
Map<int, ReactionData?> _selectedReactions = {};
final Map<int, ReactionData?> _selectedReactions = {};
final CountersHelper countersHelper = Get.find<CountersHelper>();
int? likeIconIdnew;

View File

@@ -1,200 +1,485 @@
class ComPostModel {
ComPostModel({
required this.status,
required this.statusCode,
required this.message,
required this.data,
});
ComPostModel({
required this.status,
required this.statusCode,
required this.message,
required this.data,
});
final String? status;
final int? statusCode;
final String? message;
final List<Datum> data;
factory ComPostModel.fromJson(Map<String, dynamic> json){
return ComPostModel(
status: json["status"],
statusCode: json["status_code"],
message: json["message"],
data: json["data"] == null ? [] : List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
);
}
final String? status;
final int? statusCode;
final String? message;
final List<Datum> data;
factory ComPostModel.fromJson(Map<String, dynamic> json) {
return ComPostModel(
status: json["status"],
statusCode: json["status_code"],
message: json["message"],
data: json["data"] == null
? []
: List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
);
}
}
class Datum {
Datum({
required this.id,
required this.iamPrincipalXid,
required this.postIn,
required this.caption,
required this.image,
required this.manageTagsXids,
required this.postAs,
required this.isUploadedByBussinessUser,
required this.ctaTitle,
required this.ctaLink,
required this.isActive,
required this.createdBy,
required this.modifiedBy,
required this.deletedAt,
required this.createdAt,
required this.updatedAt,
required this.likecount,
required this.isILiked,
required this.isIFollow,
required this.isISaved,
required this.likeIcon,
required this.totalComment,
required this.totalSave,
required this.tagsXid,
required this.totalViewCount,
required this.totalReactionCount,
required this.totalCommentCount,
required this.totalImpressionCount,
required this.totalPopularScore,
required this.totalHoursAgo,
required this.userDetail,
required this.attachTags,
});
Datum({
required this.id,
required this.iamPrincipalXid,
required this.postIn,
required this.caption,
required this.image,
required this.manageTagsXids,
required this.postAs,
required this.isUploadedByBussinessUser,
required this.ctaTitle,
required this.ctaLink,
required this.isActive,
required this.createdBy,
required this.modifiedBy,
required this.deletedAt,
required this.createdAt,
required this.updatedAt,
required this.likecount,
required this.isILiked,
required this.isIFollow,
required this.isISaved,
required this.likeIcon,
required this.totalComment,
required this.totalSave,
required this.tagsXid,
required this.totalViewCount,
required this.totalReactionCount,
required this.totalCommentCount,
required this.totalImpressionCount,
required this.totalPopularScore,
required this.totalHoursAgo,
required this.iamPrincipal,
required this.community,
required this.attachTags,
});
final int? id;
final int? iamPrincipalXid;
final int? postIn;
final String? caption;
final String? image;
final String? manageTagsXids;
final String? postAs;
final int? isUploadedByBussinessUser;
final String? ctaTitle;
final String? ctaLink;
final int? isActive;
final dynamic createdBy;
final dynamic modifiedBy;
final dynamic deletedAt;
final DateTime? createdAt;
final DateTime? updatedAt;
final int? likecount;
final bool? isILiked;
final bool? isIFollow;
final bool? isISaved;
final dynamic likeIcon;
final int? totalComment;
final int? totalSave;
final List<int> tagsXid;
final int? totalViewCount;
final int? totalReactionCount;
final int? totalCommentCount;
final int? totalImpressionCount;
final int? totalPopularScore;
final int? totalHoursAgo;
final UserDetail? userDetail;
final List<AttachTag> attachTags;
factory Datum.fromJson(Map<String, dynamic> json){
return Datum(
id: json["id"],
iamPrincipalXid: json["iam_principal_xid"],
postIn: json["post_in"],
caption: json["caption"],
image: json["image"],
manageTagsXids: json["manage_tags_xids"],
postAs: json["post_as"],
isUploadedByBussinessUser: json["is_uploaded_by_bussiness_user"],
ctaTitle: json["cta_title"],
ctaLink: json["cta_link"],
isActive: json["is_active"],
createdBy: json["created_by"],
modifiedBy: json["modified_by"],
deletedAt: json["deleted_at"],
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
updatedAt: DateTime.tryParse(json["updated_at"] ?? ""),
likecount: json["likecount"],
isILiked: json["is_i_liked"],
isIFollow: json["is_i_follow"],
isISaved: json["is_i_saved"],
likeIcon: json["likeIcon"],
totalComment: json["total_comment"],
totalSave: json["total_save"],
tagsXid: json["tags_xid"] == null ? [] : List<int>.from(json["tags_xid"]!.map((x) => x)),
totalViewCount: json["totalViewCount"],
totalReactionCount: json["totalReactionCount"],
totalCommentCount: json["totalCommentCount"],
totalImpressionCount: json["totalImpressionCount"],
totalPopularScore: json["totalPopularScore"],
totalHoursAgo: json["totalHoursAgo"],
userDetail: json["user_detail"] == null ? null : UserDetail.fromJson(json["user_detail"]),
attachTags: json["attach_tags"] == null ? [] : List<AttachTag>.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))),
);
}
final int? id;
final int? iamPrincipalXid;
final int? postIn;
final String? caption;
final String? image;
final String? manageTagsXids;
final String? postAs;
final int? isUploadedByBussinessUser;
final String? ctaTitle;
final String? ctaLink;
final int? isActive;
final dynamic createdBy;
final dynamic modifiedBy;
final dynamic deletedAt;
final DateTime? createdAt;
final DateTime? updatedAt;
final int? likecount;
final bool? isILiked;
final bool? isIFollow;
final bool? isISaved;
final dynamic likeIcon;
final int? totalComment;
final int? totalSave;
final List<int> tagsXid;
final int? totalViewCount;
final int? totalReactionCount;
final int? totalCommentCount;
final int? totalImpressionCount;
final int? totalPopularScore;
final int? totalHoursAgo;
final IamPrincipal? iamPrincipal;
final Community? community;
final List<AttachTag> attachTags;
factory Datum.fromJson(Map<String, dynamic> json) {
return Datum(
id: json["id"],
iamPrincipalXid: json["iam_principal_xid"],
postIn: json["post_in"],
caption: json["caption"],
image: json["image"],
manageTagsXids: json["manage_tags_xids"],
postAs: json["post_as"],
isUploadedByBussinessUser: json["is_uploaded_by_bussiness_user"],
ctaTitle: json["cta_title"],
ctaLink: json["cta_link"],
isActive: json["is_active"],
createdBy: json["created_by"],
modifiedBy: json["modified_by"],
deletedAt: json["deleted_at"],
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
updatedAt: DateTime.tryParse(json["updated_at"] ?? ""),
likecount: json["likecount"],
isILiked: json["is_i_liked"],
isIFollow: json["is_i_follow"],
isISaved: json["is_i_saved"],
likeIcon: json["likeIcon"],
totalComment: json["total_comment"],
totalSave: json["total_save"],
tagsXid: json["tags_xid"] == null
? []
: List<int>.from(json["tags_xid"]!.map((x) => x)),
totalViewCount: json["totalViewCount"],
totalReactionCount: json["totalReactionCount"],
totalCommentCount: json["totalCommentCount"],
totalImpressionCount: json["totalImpressionCount"],
totalPopularScore: json["totalPopularScore"],
totalHoursAgo: json["totalHoursAgo"],
iamPrincipal: json["iam_principal"] == null
? null
: IamPrincipal.fromJson(json["iam_principal"]),
community: json["community"] == null
? null
: Community.fromJson(json["community"]),
attachTags: json["attach_tags"] == null
? []
: List<AttachTag>.from(
json["attach_tags"]!.map((x) => AttachTag.fromJson(x))),
);
}
}
class AttachTag {
AttachTag({
required this.managePostXid,
required this.manageTagXid,
required this.manageTag,
});
AttachTag({
required this.managePostXid,
required this.manageTagXid,
required this.manageTag,
});
final int? managePostXid;
final int? manageTagXid;
final ManageTag? manageTag;
factory AttachTag.fromJson(Map<String, dynamic> json){
return AttachTag(
managePostXid: json["manage_post_xid"],
manageTagXid: json["manage_tag_xid"],
manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]),
);
}
final int? managePostXid;
final int? manageTagXid;
final ManageTag? manageTag;
factory AttachTag.fromJson(Map<String, dynamic> json) {
return AttachTag(
managePostXid: json["manage_post_xid"],
manageTagXid: json["manage_tag_xid"],
manageTag: json["manage_tag"] == null
? null
: ManageTag.fromJson(json["manage_tag"]),
);
}
}
class ManageTag {
ManageTag({
required this.id,
required this.isPinned,
required this.name,
});
ManageTag({
required this.id,
required this.isPinned,
required this.name,
});
final int? id;
final bool? isPinned;
final String? name;
factory ManageTag.fromJson(Map<String, dynamic> json){
return ManageTag(
id: json["id"],
isPinned: json["is_pinned"],
name: json["name"],
);
}
final int? id;
final bool? isPinned;
final String? name;
factory ManageTag.fromJson(Map<String, dynamic> json) {
return ManageTag(
id: json["id"],
isPinned: json["is_pinned"],
name: json["name"],
);
}
}
class UserDetail {
UserDetail({
required this.id,
required this.principalTypeXid,
required this.userName,
required this.profilePhoto,
required this.isUserPinned,
});
class Community {
Community({
required this.id,
required this.communityProfilePhoto,
required this.communityBannerImage,
required this.communityName,
required this.totalGroup,
required this.totalAnnouncements,
});
final int? id;
final int? principalTypeXid;
final String? userName;
final String? profilePhoto;
final bool? isUserPinned;
factory UserDetail.fromJson(Map<String, dynamic> json){
return UserDetail(
id: json["id"],
principalTypeXid: json["principal_type_xid"],
userName: json["user_name"],
profilePhoto: json["profile_photo"],
isUserPinned: json["is_user_pinned"],
);
}
final int? id;
final String? communityProfilePhoto;
final String? communityBannerImage;
final String? communityName;
final int? totalGroup;
final int? totalAnnouncements;
factory Community.fromJson(Map<String, dynamic> json) {
return Community(
id: json["id"],
communityProfilePhoto: json["community_profile_photo"],
communityBannerImage: json["community_banner_image"],
communityName: json["community_name"],
totalGroup: json["total_group"],
totalAnnouncements: json["total_announcements"],
);
}
}
class IamPrincipal {
IamPrincipal({
required this.id,
required this.principalTypeXid,
required this.userName,
required this.fullName,
required this.profilePhoto,
required this.isUserPinned,
});
final int? id;
final int? principalTypeXid;
final String? userName;
final String? fullName;
final String? profilePhoto;
final bool? isUserPinned;
factory IamPrincipal.fromJson(Map<String, dynamic> json) {
return IamPrincipal(
id: json["id"],
principalTypeXid: json["principal_type_xid"],
userName: json["user_name"],
fullName: json["full_name"],
profilePhoto: json["profile_photo"],
isUserPinned: json["is_user_pinned"],
);
}
}
/*
{
"status": "success",
"status_code": 200,
"message": "Data Fetched Successfully.",
"data": [
{
"id": 1,
"iam_principal_xid": 24,
"post_in": 1,
"caption": "test",
"image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66a88f43ac269.png?d=1723806586",
"manage_tags_xids": "[2,1,3]",
"post_as": "Individual",
"is_uploaded_by_bussiness_user": 1,
"cta_title": "test",
"cta_link": "test",
"is_active": 1,
"created_by": null,
"modified_by": null,
"deleted_at": null,
"created_at": "2024-07-30T06:59:15.000000Z",
"updated_at": "2024-07-30T06:59:15.000000Z",
"likecount": 6,
"is_i_liked": false,
"is_i_follow": false,
"is_i_saved": true,
"likeIcon": null,
"total_comment": 6,
"total_save": 2,
"tags_xid": [
2,
1,
3
],
"totalViewCount": 10,
"totalReactionCount": 6,
"totalCommentCount": 6,
"totalImpressionCount": 0,
"totalPopularScore": 0,
"totalHoursAgo": 412,
"iam_principal": {
"id": 24,
"principal_type_xid": 1,
"user_name": "kishansjsj",
"full_name": "kishan",
"profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586",
"is_user_pinned": false
},
"community": {
"id": 1,
"community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586",
"community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586",
"community_name": "Flutter Community",
"total_group": 5,
"total_announcements": 3
},
"attach_tags": [
{
"manage_post_xid": 1,
"manage_tag_xid": 2,
"manage_tag": {
"id": 2,
"is_pinned": false,
"name": "Test 1"
}
},
{
"manage_post_xid": 1,
"manage_tag_xid": 1,
"manage_tag": {
"id": 1,
"is_pinned": false,
"name": "Test 2"
}
},
{
"manage_post_xid": 1,
"manage_tag_xid": 3,
"manage_tag": {
"id": 3,
"is_pinned": false,
"name": "another test 1"
}
}
]
},
{
"id": 2,
"iam_principal_xid": 24,
"post_in": 1,
"caption": "test",
"image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66ab5b2a52291.png?d=1723806586",
"manage_tags_xids": "[2,1,3]",
"post_as": "Individual",
"is_uploaded_by_bussiness_user": 0,
"cta_title": null,
"cta_link": null,
"is_active": 1,
"created_by": null,
"modified_by": null,
"deleted_at": null,
"created_at": "2024-08-01T09:53:46.000000Z",
"updated_at": "2024-08-01T09:53:46.000000Z",
"likecount": 0,
"is_i_liked": false,
"is_i_follow": false,
"is_i_saved": false,
"likeIcon": null,
"total_comment": 1,
"total_save": 0,
"tags_xid": [
2,
1,
3
],
"totalViewCount": 8,
"totalReactionCount": 0,
"totalCommentCount": 1,
"totalImpressionCount": 0,
"totalPopularScore": 0,
"totalHoursAgo": 361,
"iam_principal": {
"id": 24,
"principal_type_xid": 1,
"user_name": "kishansjsj",
"full_name": "kishan",
"profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586",
"is_user_pinned": false
},
"community": {
"id": 1,
"community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586",
"community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586",
"community_name": "Flutter Community",
"total_group": 5,
"total_announcements": 3
},
"attach_tags": [
{
"manage_post_xid": 2,
"manage_tag_xid": 2,
"manage_tag": {
"id": 2,
"is_pinned": false,
"name": "Test 1"
}
},
{
"manage_post_xid": 2,
"manage_tag_xid": 1,
"manage_tag": {
"id": 1,
"is_pinned": false,
"name": "Test 2"
}
},
{
"manage_post_xid": 2,
"manage_tag_xid": 3,
"manage_tag": {
"id": 3,
"is_pinned": false,
"name": "another test 1"
}
}
]
},
{
"id": 3,
"iam_principal_xid": 10,
"post_in": 1,
"caption": "this is individual caption",
"image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66ab5ceb8ddb5.jpg?d=1723806586",
"manage_tags_xids": "[5,7]",
"post_as": "Individual",
"is_uploaded_by_bussiness_user": 0,
"cta_title": null,
"cta_link": null,
"is_active": 1,
"created_by": null,
"modified_by": null,
"deleted_at": null,
"created_at": "2024-08-01T10:01:15.000000Z",
"updated_at": "2024-08-01T10:01:15.000000Z",
"likecount": 2,
"is_i_liked": false,
"is_i_follow": false,
"is_i_saved": false,
"likeIcon": null,
"total_comment": 0,
"total_save": 0,
"tags_xid": [
5,
7
],
"totalViewCount": 1,
"totalReactionCount": 2,
"totalCommentCount": 0,
"totalImpressionCount": 0,
"totalPopularScore": 0,
"totalHoursAgo": 361,
"iam_principal": {
"id": 10,
"principal_type_xid": 1,
"user_name": "shubham shirva",
"full_name": "Shubham",
"profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586",
"is_user_pinned": false
},
"community": {
"id": 1,
"community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586",
"community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586",
"community_name": "Flutter Community",
"total_group": 5,
"total_announcements": 3
},
"attach_tags": [
{
"manage_post_xid": 3,
"manage_tag_xid": 5,
"manage_tag": {
"id": 5,
"is_pinned": false,
"name": "Test new"
}
},
{
"manage_post_xid": 3,
"manage_tag_xid": 7,
"manage_tag": {
"id": 7,
"is_pinned": false,
"name": "Test new 2"
}
}
]
}
]
}*/

View File

@@ -1,6 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -13,10 +11,8 @@ import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart';
import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart';
import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart';
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/PostDetailApi.dart';
import 'package:regroup/Main_Screens/Community_HomePage/view_model/CountersHelper.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/texts.dart';
@@ -39,7 +35,6 @@ class _CommunityDetailsState extends State<CommunityDetails> {
@override
void initState() {
// TODO: implement initState
CommunityId = Get.arguments["CommunityID"];
myfuture = CommunityDetail().getCommunityDetail(CommunityId);
@@ -580,45 +575,35 @@ class PostsTab extends StatefulWidget {
class _PostsTabState extends State<PostsTab> {
late Future postDetailfuture;
List<ReactionData> _reactions = [];
Map<int, ReactionData?> _selectedReactions = {};
final Map<int, ReactionData?> _selectedReactions = {};
final CountersHelper countersHelper = Get.find<CountersHelper>();
int? likeIconIdnew;
@override
void initState() {
// TODO: implement initState
CommunityId = Get.arguments["CommunityID"];
postDetailfuture = CommunityDetail().getComPostApi(CommunityId);
super.initState();
}
Future<void> _fetchIcons() async {
var response = await Communityallgetmethod().getLikeicons();
if (response.status == ResponseStatus.SUCCESS) {
var responseData = response.data as Map<String, dynamic>;
FetchlikeIconsModel fetchlikeIconsModel =
FetchlikeIconsModel.fromJson(responseData);
_fetchIcons() {
_reactions = fetchlikeIconsModel!.data ?? [];
for (var post in commonobjmodel!.data) {
//Check if post as a like icon
if (post.likeIcon?.likeIcon?.id != null) {
likeIconIdnew = post.likeIcon!.likeIconsXid;
_reactions = fetchlikeIconsModel.data ?? [];
for (var post in compostobj!.data) {
//Check if post as a like icon
if (post.likeIcon != null) {
likeIconIdnew = post.likeIcon!.likeIconsXid;
final selectedReaction = _reactions.firstWhere(
(r) => r.id == likeIconIdnew,
orElse: () => _reactions.first,
);
final selectedReaction = _reactions.firstWhere(
(r) => r.id == likeIconIdnew,
orElse: () => _reactions.first,
);
_selectedReactions[post.id!] =
selectedReaction; // Set selected reaction for this post
} else {
_selectedReactions[post.id!] = null; // No reaction selected
print('No reaction selected for post $CommunityId');
}
_selectedReactions[post.id!] =
selectedReaction; // Set selected reaction for this post
} else {
_selectedReactions[post.id!] = null; // No reaction selected
}
setState(() {});
}
}
@@ -679,17 +664,17 @@ class _PostsTabState extends State<PostsTab> {
totalImpressionCount: e.totalImpressionCount,
totalPopularScore: e.totalPopularScore,
totalHoursAgo: e.totalHoursAgo,
// iamPrincipal: IamPrincipal(
// id: e.iamPrincipal!.id,
// isUserPinned: e.iamPrincipal!.isUserPinned,
// principalTypeXid: e.iamPrincipal!.principalTypeXid,
// userName: e.iamPrincipal!.userName,
// fullName: e.iamPrincipal!.fullName,
// profilePhoto: e.iamPrincipal!.profilePhoto),
// community: Community(
// id: e.community!.id,
// communityProfilePhoto: e.community!.communityProfilePhoto,
// communityName: e.community!.communityName),
iamPrincipal: IamPrincipal(
id: e.iamPrincipal!.id,
isUserPinned: e.iamPrincipal!.isUserPinned,
principalTypeXid: e.iamPrincipal!.principalTypeXid,
userName: e.iamPrincipal!.userName,
fullName: e.iamPrincipal!.fullName,
profilePhoto: e.iamPrincipal!.profilePhoto),
community: Community(
id: e.community!.id,
communityProfilePhoto: e.community!.communityProfilePhoto,
communityName: e.community!.communityName),
attachTags: e.attachTags
.map((e) => AttachTag1(
managePostXid: e.managePostXid,
@@ -955,7 +940,7 @@ Widget normalcardtile({
onTap: () {
Get.toNamed(RouteName.postdetailsScreen);
},
child: Container(
child: SizedBox(
height: 163.h,
width: double.infinity,
child: Image.asset(