Merge pull request #103 from WDI-Ideas/tagsdetails

tag detail page done only latest tab completed save and pin for lates…
This commit is contained in:
Shubham Shetty
2024-08-07 20:05:05 +05:30
committed by GitHub
16 changed files with 2976 additions and 578 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

View File

@@ -241,7 +241,7 @@ class _CommonPostUIState extends State<CommonPostUI> {
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.cyclescreen);
Get.toNamed(RouteName.tagdetailscreen);
},
child: containertile(text: containerTitle[index])),
);

View File

@@ -130,6 +130,10 @@ class ApiUrls {
static const postLike = "${baseUrl}like-post";
static const getTagsdetails = "${baseUrl}fetch-post-by-tag";
static const postusersave = "${baseUrl}save-post";
}

View File

@@ -26,6 +26,7 @@ class Datum {
Datum({
required this.id,
required this.likecount,
required this.isISaved,
required this.tagsXid,
required this.isILiked,
required this.totalComment,
@@ -39,14 +40,21 @@ class Datum {
required this.ctaTitle,
required this.ctaLink,
required this.createdAt,
required this.tagNames,
required this.likeIcon,
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? likecount;
final bool? isISaved;
final List<int> tagsXid;
final bool? isILiked;
final int? totalComment;
@@ -60,15 +68,22 @@ class Datum {
final String? ctaTitle;
final String? ctaLink;
final DateTime? createdAt;
final List<String> tagNames;
final LikeIcon? likeIcon;
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"],
likecount: json["likecount"],
isISaved: json["is_i_saved"],
tagsXid: json["tags_xid"] == null ? [] : List<int>.from(json["tags_xid"]!.map((x) => x)),
isILiked: json["is_i_liked"],
totalComment: json["total_comment"],
@@ -82,10 +97,58 @@ class Datum {
ctaTitle: json["cta_title"],
ctaLink: json["cta_link"],
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
tagNames: json["tag_names"] == null ? [] : List<String>.from(json["tag_names"]!.map((x) => x)),
likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]),
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,
});
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,
});
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"],
);
}
@@ -115,6 +178,7 @@ class Community {
class IamPrincipal {
IamPrincipal({
required this.id,
required this.isUserPinned,
required this.principalTypeXid,
required this.userName,
required this.fullName,
@@ -122,14 +186,16 @@ class IamPrincipal {
});
final int? id;
final bool? isUserPinned;
final int? principalTypeXid;
final String? userName;
final dynamic fullName;
final String? fullName;
final String? profilePhoto;
factory IamPrincipal.fromJson(Map<String, dynamic> json){
return IamPrincipal(
id: json["id"],
isUserPinned: json["is_user_pinned"],
principalTypeXid: json["principal_type_xid"],
userName: json["user_name"],
fullName: json["full_name"],

View File

@@ -20,6 +20,7 @@ import 'package:regroup/Main_Screens/Community/ViewModel/FeedPost.dart';
import 'package:regroup/Main_Screens/Community/ViewModel/LatestPost.dart';
import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart';
import 'package:regroup/Main_Screens/Community/ViewModel/postmethod.dart';
import 'package:regroup/Main_Screens/Community_HomePage/view_model/communitypostmethod.dart';
// import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/dialogs.dart';
@@ -27,6 +28,7 @@ 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';
class CommunityScreen extends StatefulWidget {
const CommunityScreen({super.key});
@@ -552,7 +554,11 @@ Widget normalcardtile2({
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.cyclescreen);
// Get.toNamed(RouteName.cyclescreen, );
// arguments: {
// 'tagid': latestpostobj!.data[index].tagsData[index].id,
// 'tagname' : latestpostobj!.data[index].tagsData[index].name,
// }
},
child: containertile2(
text: ("#${containerTitle[index]}"))),
@@ -1272,16 +1278,15 @@ class _LatestTabState extends State<LatestTab> {
List<ReactionData> _reactions = [];
Map<int, ReactionData?> _selectedReactions = {};
Future<void> _initializeData() async {
await _fetchIcons();
// _initializeSelectedReaction();
for (var post in latestpostobj!.data) {
if (post.likeIcon != null) {
likeIconIdnew = post.likeIcon!.likeIconsXid; // This is safe now
} else {
likeIconIdnew = 0; // Or handle it as needed
}
if (post.likeIcon != null) {
likeIconIdnew = post.likeIcon!.likeIconsXid; // This is safe now
} else {
likeIconIdnew = 0; // Or handle it as needed
}
_initializeSelectedReaction(post.id!); // Pass the post ID
}
}
@@ -1379,6 +1384,44 @@ class _LatestTabState extends State<LatestTab> {
}
}
saveunsavepost(int latestpostid) async {
// utils.loader();
Map<String, dynamic> updata = {
"manage_posts_xid": latestpostid,
};
final data = await Communitypostmethod().postUserSave(updata);
if (data.status == ResponseStatus.SUCCESS) {
LatespostApi().getLatestPostApi().then((value) {
_initializeData();
setState(() {});
});
return utils.showToast(data.message);
} else {
// Get.back();
return utils.showToast(data.message);
}
}
pinunpinUser(int userid) async {
// utils.loader();
Map<String, dynamic> updata = {
"pin_iam_principal_xid": userid,
};
final data = await SidebarTags().postUserpin(updata);
if (data.status == ResponseStatus.SUCCESS) {
// Get.back();
LatespostApi().getLatestPostApi().then((value) {
_initializeData();
setState(() {});
});
return utils.showToast(data.message);
} else {
// Get.back();
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
@@ -1600,36 +1643,36 @@ class _LatestTabState extends State<LatestTab> {
),
),
),
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,
)
],
),
),
),
// 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',
@@ -1664,31 +1707,96 @@ class _LatestTabState extends State<LatestTab> {
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].tagNames.length,
itemBuilder: (context, index) {
.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),
right: 12.w, left: 12.w),
child: GestureDetector(
onTap: () {
// Get.toNamed(RouteName.cyclescreen);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start,
children: [
containertile2(
text: latestpostobj!
.data[index]
.tagNames[
index]),
],
)),
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}'),
),
),
),
],
),
),
);
},
),
@@ -1934,11 +2042,34 @@ class _LatestTabState extends State<LatestTab> {
),
Column(
children: [
Image.asset(
'assets/images/png/Frame 1000004089.png',
height: 19.h,
width: 19.w,
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')
],
@@ -2119,7 +2250,15 @@ class _LatestTabState extends State<LatestTab> {
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
onTap: () async {
int pinPospostid =
latestpostobj!
.data[index]
.iamPrincipal!
.id!;
await pinunpinUser(
pinPospostid);
},
child: Padding(
padding:
EdgeInsets.symmetric(
@@ -2127,7 +2266,14 @@ class _LatestTabState extends State<LatestTab> {
child: Row(
children: [
Text(
'Pin',
latestpostobj!
.data[
index]
.iamPrincipal!
.isUserPinned ==
true
? 'Unpin'
: 'Pin',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
@@ -2184,27 +2330,175 @@ class _LatestTabState extends State<LatestTab> {
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].tagNames.length,
itemBuilder: (context, index) {
.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),
right: 12.w, left: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName
.cyclescreen);
},
child: containertile2(
text: (latestpostobj!
.data[index]
.tagNames[
index]))),
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}'),
),
),
),
],
),
),
);
},
),
@@ -2458,11 +2752,35 @@ class _LatestTabState extends State<LatestTab> {
onTap: () {},
child: Column(
children: [
Image.asset(
'assets/images/png/Frame 1000004089.png',
height: 19.h,
width: 19.w,
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')
],

View File

@@ -1,489 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonTabBar.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
class CycleScreen extends StatefulWidget {
const CycleScreen({super.key});
@override
State<CycleScreen> createState() => _CycleScreenState();
}
class _CycleScreenState extends State<CycleScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Cycle",
customActionWidget: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill.png",
height: 26.h,
width: 26.w,
)),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
Column(children: [
sizedBoxHeight(10.h),
DefaultTabController(
length: 2,
// initialIndex: selectedIndex.value,
child: Column(
children: [
const CommonTabBar(tabs: [
Tab(
text: 'Popular',
),
Tab(
text: 'Latest',
),
]),
SizedBox(
height: 670.h,
child: TabBarView(
children: [
cyclepopularTab(),
cyclelatestTab(),
],
),
),
],
))
])
]));
}
}
Widget cyclepopularTab() {
return SingleChildScrollView(
child: Column(children: [
sizedBoxHeight(20.h),
normalcardtile(
profileImg: 'assets/images/png/Ellipse 52.png',
title: 'Ryan Dorwat',
mainImg: 'assets/images/png/img322.png',
containerTitle: [
'Football',
'Teams player',
'Events',
'Marathon',
'Events'
]),
sizedBoxHeight(30.h),
normalcardtile(
profileImg: 'assets/images/png/Ellipse 43.png',
title: 'Edward Hackket',
mainImg: 'assets/images/png/Rectangle 24.png',
containerTitle: [
'Cycle',
'Marathon',
'Events',
'Marathon',
'Events'
]),
]),
);
}
Widget cyclelatestTab() {
return SingleChildScrollView(
child: Column(children: [
sizedBoxHeight(20.h),
normalcardtile(
profileImg: 'assets/images/png/Ellipse 43.png',
title: 'Edward Hackket',
mainImg: 'assets/images/png/Rectangle 24.png',
containerTitle: [
'Cycle',
'Marathon',
'Events',
'Marathon',
'Events'
]),
]),
);
}
Widget normalcardtile({
required String profileImg,
required String title,
required String mainImg,
required List<String> containerTitle,
}) {
var mainImage = 'assets/images/png/uiw_like-o.png'.obs;
void updateImage(String reaction) {
if (reaction == 'like') {
mainImage.value = 'assets/images/png/f7_hand-thumbsup.png';
} else if (reaction == 'heart') {
mainImage.value = 'assets/images/png/heart 2.png';
} else if (reaction == 'party') {
mainImage.value = 'assets/images/png/party-popper 2.png';
}
}
return commonGlassUI(
width: double.infinity,
height: 570.h,
borderwidth: 0,
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: AssetImage(profileImg),
radius: 25.r,
),
sizedBoxWidth(12.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
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('Active alliance network'),
sizedBoxWidth(7.w),
Icon(
Icons.circle,
color: const Color(0xFFFCFCFC),
size: 4.sp,
),
sizedBoxWidth(6.w),
text12w400_FCFCFC('1 Hour ago'),
],
)
],
),
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) => <PopupMenuEntry>[
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: SizedBox(
height: 360.h,
width: double.infinity,
child: Image.asset(
mainImg,
fit: BoxFit.cover,
),
)),
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: containerTitle.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.cyclescreen);
},
child: containertile(text: containerTitle[index])),
);
},
),
),
sizedBoxHeight(20.h),
text16w400_FCFCFC(
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
Row(children: [
InkWell(
onTap: () {
Get.toNamed(RouteName.reactionview);
},
child: stackReaction(number: '20', containerImages: [
'assets/images/png/f7_hand-thumbsup.png',
'assets/images/png/heart 2.png',
'assets/images/png/party-popper 2.png'
]),
),
const Spacer(),
commonGlassUI(
borderwidth: 0.43,
width: 30.w,
height: 30.h,
opacity1: 0.05,
opacity2: 0.06,
borderRadius: BorderRadius.circular( 100),
customWidget: Center(
child: Image.asset(
'assets/images/png/Frame 1000004088.png',
height: 13.h,
width: 13.w,
),
),
),
sizedBoxWidth(12.w),
text14w400_FCFCFC('20'),
sizedBoxWidth(20.w),
commonGlassUI(
borderwidth: 0.43,
width: 30.w,
height: 30.h,
borderRadius: BorderRadius.circular( 100),
opacity1: 0.05,
opacity2: 0.06,
customWidget: Center(
child: Image.asset(
'assets/images/png/Vector (1).png',
height: 12.h,
width: 12.w,
),
),
),
sizedBoxWidth(12.w),
text14w400_FCFCFC('10'),
]),
sizedBoxHeight(12.h),
commonDivider(),
sizedBoxHeight(12.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Obx(() {
return ReactionButton<String>(
onReactionChanged: (reaction) {
updateImage(reaction?.value ?? 'like');
debugPrint('Selected value: ${reaction?.value}');
},
reactions: <Reaction<String>?>[
Reaction<String>(
value: 'like',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/f7_hand-thumbsup.png'),
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
Reaction<String>(
value: 'heart',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/heart 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/heart 2.png'),
),
Reaction<String>(
value: 'party',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/party-popper 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/party-popper 2.png'),
),
],
selectedReaction: Reaction<String>(
value: 'like',
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
boxColor: Colors.white,
boxElevation: 9,
boxRadius: 30,
itemsSpacing: 8,
itemScale: 0.4,
itemSize: const Size(45, 45),
boxPadding: const EdgeInsets.all(8),
boxAnimationDuration:
const Duration(milliseconds: 200),
itemAnimationDuration:
const Duration(milliseconds: 500),
hoverDuration: const Duration(milliseconds: 700),
// toggle: false,
child: _buildReactionsIcon(mainImage.value),
);
})
],
),
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')
],
),
),
Column(
children: [
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),
]),
),
],
));
}
Widget _buildReactionsPreviewIcon(String assetPath) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
assetPath,
height: 40.h,
width: 40.w,
),
);
}
Widget _buildReactionsIcon(String assetPath) {
return Column(
children: [
Image.asset(
assetPath,
height: 19.h,
width: 19.w,
),
sizedBoxHeight(8.h),
text11w400_FCFCFC('Like')
],
);
}

View File

@@ -0,0 +1,242 @@
class TagdetailsModel {
TagdetailsModel({
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 TagdetailsModel.fromJson(Map<String, dynamic> json){
return TagdetailsModel(
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.likecount,
required this.isISaved,
required this.tagsXid,
required this.isILiked,
required this.totalComment,
required this.totalSave,
required this.iamPrincipalXid,
required this.postIn,
required this.caption,
required this.image,
required this.manageTagsXids,
required this.postAs,
required this.ctaTitle,
required this.ctaLink,
required this.createdAt,
required this.likeIcon,
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? likecount;
final bool? isISaved;
final List<int> tagsXid;
final bool? isILiked;
final int? totalComment;
final int? totalSave;
final int? iamPrincipalXid;
final int? postIn;
final String? caption;
final String? image;
final String? manageTagsXids;
final String? postAs;
final String? ctaTitle;
final String? ctaLink;
final DateTime? createdAt;
final LikeIcon? likeIcon;
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"],
likecount: json["likecount"],
isISaved: json["is_i_saved"],
tagsXid: json["tags_xid"] == null ? [] : List<int>.from(json["tags_xid"]!.map((x) => x)),
isILiked: json["is_i_liked"],
totalComment: json["total_comment"],
totalSave: json["total_save"],
iamPrincipalXid: json["iam_principal_xid"],
postIn: json["post_in"],
caption: json["caption"],
image: json["image"],
manageTagsXids: json["manage_tags_xids"],
postAs: json["post_as"],
ctaTitle: json["cta_title"],
ctaLink: json["cta_link"],
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]),
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,
});
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,
});
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 Community {
Community({
required this.id,
required this.communityProfilePhoto,
required this.communityName,
});
final int? id;
final String? communityProfilePhoto;
final String? communityName;
factory Community.fromJson(Map<String, dynamic> json){
return Community(
id: json["id"],
communityProfilePhoto: json["community_profile_photo"],
communityName: json["community_name"],
);
}
}
class IamPrincipal {
IamPrincipal({
required this.id,
required this.isUserPinned,
required this.principalTypeXid,
required this.userName,
required this.fullName,
required this.profilePhoto,
});
final int? id;
final bool? isUserPinned;
final int? principalTypeXid;
final String? userName;
final String? fullName;
final String? profilePhoto;
factory IamPrincipal.fromJson(Map<String, dynamic> json){
return IamPrincipal(
id: json["id"],
isUserPinned: json["is_user_pinned"],
principalTypeXid: json["principal_type_xid"],
userName: json["user_name"],
fullName: json["full_name"],
profilePhoto: json["profile_photo"],
);
}
}
class LikeIcon {
LikeIcon({
required this.likeIconsXid,
required this.likeIcon,
});
final int? likeIconsXid;
final LikeIconClass? likeIcon;
factory LikeIcon.fromJson(Map<String, dynamic> json){
return LikeIcon(
likeIconsXid: json["like_icons_xid"],
likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]),
);
}
}
class LikeIconClass {
LikeIconClass({
required this.id,
required this.image,
});
final int? id;
final String? image;
factory LikeIconClass.fromJson(Map<String, dynamic> json){
return LikeIconClass(
id: json["id"],
image: json["image"],
);
}
}

View File

@@ -521,7 +521,7 @@ class _PostDetailsScreenState extends State<PostDetailsScreen> {
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.cyclescreen);
Get.toNamed(RouteName.tagdetailscreen);
},
child: containertile(text: containerTitle[index])),
);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
import 'dart:developer';
import 'package:regroup/Common/api_urls.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart';
import 'package:regroup/Main_Screens/Community_HomePage/Model/tagdetailModel.dart';
TagdetailsModel? tagdetailobj;
class Communitygetmethod {
Future<ResponseData<dynamic>> getTagsdata(updata) async {
final response = await NetworkApiServices().getApi(
"${ApiUrls.getTagsdetails}?manage_tag_id=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
tagdetailobj = TagdetailsModel.fromJson(response.data);
log(tagdetailobj!.data.toString());
}
return response;
}
}

View File

@@ -0,0 +1,18 @@
import 'package:regroup/Common/api_urls.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart';
class Communitypostmethod {
Communitypostmethod();
Future<ResponseData<dynamic>> postUserSave(updata) async {
final response = await NetworkApiServices().postApi(
updata,
ApiUrls.postusersave,
);
return response;
}
}

View File

@@ -324,6 +324,7 @@ class _FollowersTabState extends State<FollowersTab> {
// onTap: () {},
onTap: () async {
setState(() {
removeid = followersobj!
.data![index]
.follower!

View File

@@ -121,7 +121,7 @@ class Profilegetmethod {
if (response.status == ResponseStatus.SUCCESS) {
certificateobj = CertificateuserModel.fromJson(response.data);
log(certificateobj!.data.toString());
}
}
return response;
}
}

View File

@@ -29,7 +29,7 @@ class RouteName {
static const String mainscreen = '/mainscreen';
static const String sidemenu = '/sidemenu';
static const String savedposts = '/savedposts';
static const String cyclescreen = '/cyclescreen';
static const String tagdetailscreen = '/tagdetailscreen';
static const String postscreen = '/postscreen';
static const String reactionview = '/reactionview';
static const String postdetailsScreen = '/postdetailsScreen';

View File

@@ -12,7 +12,7 @@ import 'package:regroup/Main_Screens/Chats/View/newchatpage.dart';
import 'package:regroup/Main_Screens/Chats/View/newgroup.dart';
import 'package:regroup/Main_Screens/Chats/View/userchat.dart';
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
import 'package:regroup/Main_Screens/Community_HomePage/CycleScreen.dart';
import 'package:regroup/Main_Screens/Community_HomePage/TagsdDetailScreen.dart';
import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart';
import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart';
import 'package:regroup/Main_Screens/Community_HomePage/PostScreen.dart';
@@ -165,8 +165,8 @@ class AppRoutes {
page: () => const SavedPosts(),
),
GetPage(
name: RouteName.cyclescreen,
page: () => const CycleScreen(),
name: RouteName.tagdetailscreen,
page: () => const TagdetailScreen(),
),
GetPage(
name: RouteName.postscreen,

View File

@@ -581,7 +581,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.cyclescreen);
Get.toNamed(RouteName.tagdetailscreen);
},
child: containertile(text: containerTitle[index])),
);