conflict resolved
This commit is contained in:
BIN
assets/images/png/ion_add.png
Normal file
BIN
assets/images/png/ion_add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 226 B |
1
devtools_options.yaml
Normal file
1
devtools_options.yaml
Normal file
@@ -0,0 +1 @@
|
||||
extensions:
|
||||
@@ -12,8 +12,7 @@ Widget commonGlassContainer({
|
||||
double opacity2 = 0.05,
|
||||
Color borderColor = const Color(0xff434A53),
|
||||
}) {
|
||||
return
|
||||
GlassmorphicContainer(
|
||||
return GlassmorphicContainer(
|
||||
width: width,
|
||||
height: height,
|
||||
borderRadius: borderradius,
|
||||
@@ -83,7 +82,7 @@ Widget commonGlassContainerblue({
|
||||
|
||||
Widget commonGlassUIBlue({
|
||||
required double width,
|
||||
required double height,
|
||||
required double? height,
|
||||
required Widget customWidget,
|
||||
// required double border,
|
||||
double mainOpacity = 1,
|
||||
@@ -114,7 +113,7 @@ Widget commonGlassUIBlue({
|
||||
|
||||
Widget commonGlassUI({
|
||||
required double width,
|
||||
required double height,
|
||||
required double? height,
|
||||
// required double border,
|
||||
double mainOpacity = 1,
|
||||
double opacity1 = 0.04,
|
||||
@@ -148,7 +147,7 @@ Widget commonGlassUI({
|
||||
|
||||
Widget commonContainer({
|
||||
required double width,
|
||||
required double height,
|
||||
required double? height,
|
||||
// required double border,
|
||||
// double mainOpacity = 1,
|
||||
double opacity1 = 0.04,
|
||||
|
||||
@@ -1,401 +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/CommonWidget.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class CommonPostUI extends StatefulWidget {
|
||||
CommonPostUI(
|
||||
{super.key,
|
||||
required this.containerTitle,
|
||||
required this.mainImg,
|
||||
required this.profileImg,
|
||||
required this.title});
|
||||
|
||||
String profileImg = "";
|
||||
String title = "";
|
||||
String mainImg = "";
|
||||
List<String> containerTitle = [];
|
||||
|
||||
@override
|
||||
State<CommonPostUI> createState() => _CommonPostUIState();
|
||||
}
|
||||
|
||||
class _CommonPostUIState extends State<CommonPostUI> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return postCards(
|
||||
containerTitle: widget.containerTitle,
|
||||
profileImg: widget.profileImg,
|
||||
title: widget.title,
|
||||
mainImg: widget.mainImg,
|
||||
);
|
||||
}
|
||||
|
||||
Widget postCards({
|
||||
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(0),
|
||||
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),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
const Spacer(),
|
||||
commonGlassUI(
|
||||
width: 72.w,
|
||||
height: 26.h,
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget:
|
||||
Center(child: text14400white("Follow")),
|
||||
borderwidth: 1),
|
||||
sizedBoxWidth(6.w),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
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'),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 163.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.tagdetailscreen);
|
||||
},
|
||||
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: [
|
||||
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.9,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular(100.r),
|
||||
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.9,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular(100.r),
|
||||
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),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
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')
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,6 @@ class ApiUrls {
|
||||
|
||||
static const postrejectinvite = "${baseUrl}reject-invite-to-join-community";
|
||||
|
||||
|
||||
static const getusercertificates = "${baseUrl}my-certificates";
|
||||
|
||||
static const postnotification = "${baseUrl}update-notification-settings";
|
||||
@@ -193,7 +192,10 @@ class ApiUrls {
|
||||
|
||||
static const getactivitieslist = "${baseUrl}get_activity";
|
||||
|
||||
static const getcommunitymanagegroups = "${baseUrl}fetch-community-all-groups-list";
|
||||
|
||||
static const postremovegroupscommunity = "${baseUrl}remove-groups-from-community";
|
||||
|
||||
static const postmanageaddgroupscommunity = "${baseUrl}add-groups-in-community";
|
||||
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class NormalCardTile extends StatefulWidget {
|
||||
bool? coachbool;
|
||||
|
||||
int currentIndex;
|
||||
NormalCardTile({
|
||||
Key? key,
|
||||
NormalCardTile(
|
||||
{Key? key,
|
||||
required this.tags,
|
||||
this.createAt,
|
||||
required this.forWhichTab,
|
||||
@@ -38,15 +38,14 @@ class NormalCardTile extends StatefulWidget {
|
||||
required this.reactions,
|
||||
required this.selectedReactions,
|
||||
required this.currentIndex,
|
||||
this.coachbool
|
||||
}) : super(key: key);
|
||||
this.coachbool})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NormalCardTileState createState() => _NormalCardTileState();
|
||||
}
|
||||
|
||||
class _NormalCardTileState extends State<NormalCardTile> {
|
||||
|
||||
RxString mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
||||
final CountersHelper countersHelper = Get.find<CountersHelper>();
|
||||
int saveCount = 0;
|
||||
@@ -175,9 +174,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
.split(
|
||||
"https://regroup.betadelivery.com/storage/app/public/uploads/post_image/")
|
||||
.last;
|
||||
return commonGlassUI(
|
||||
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: 750.h),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 765.h,
|
||||
height: 600.h,
|
||||
mainOpacity: 1,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
customWidget: Column(
|
||||
@@ -189,13 +191,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: widget
|
||||
.commonObj.iamPrincipal?.profilePhoto !=
|
||||
null
|
||||
? NetworkImage(
|
||||
widget.commonObj.iamPrincipal!.profilePhoto!)
|
||||
as ImageProvider<Object>
|
||||
: const AssetImage('assets/images/default_profile.png')
|
||||
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,
|
||||
),
|
||||
@@ -219,9 +220,10 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
width: 1.w,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
|
||||
),
|
||||
child:
|
||||
Center(child: text12w400_FCFCFC("Coach")),
|
||||
child: Center(
|
||||
child: text12w400_FCFCFC("Coach")),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
@@ -236,7 +238,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text12w400_FCFCFC(
|
||||
widget.commonObj.community!.communityName ?? ""),
|
||||
widget.commonObj.community!.communityName ??
|
||||
""),
|
||||
sizedBoxWidth(7.w),
|
||||
Icon(
|
||||
Icons.circle,
|
||||
@@ -317,7 +320,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
countersHelper.pinButtonPopular[widget.currentIndex]
|
||||
countersHelper
|
||||
.pinButtonPopular[widget.currentIndex]
|
||||
? Text(
|
||||
'Unpin',
|
||||
style: TextStyle(
|
||||
@@ -335,6 +339,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
const Spacer(),
|
||||
countersHelper
|
||||
@@ -413,7 +419,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
padding: EdgeInsets.only(right: 12.w),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.tagdetailscreen, arguments: {
|
||||
Get.toNamed(RouteName.tagdetailscreen,
|
||||
arguments: {
|
||||
'tagid': manageTag.id,
|
||||
'tagname': manageTag.name,
|
||||
'ispinnedtag': manageTag.isPinned,
|
||||
@@ -448,12 +455,20 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
SizedBox(
|
||||
height: 80.h,
|
||||
width: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
child: text16w400_FCFCFC(widget.commonObj.caption ?? "")),
|
||||
child: Text(
|
||||
widget.commonObj.caption ?? "",
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
maxLines: 2, // Set the maximum number of lines
|
||||
overflow: TextOverflow
|
||||
.ellipsis, // Truncate the text with an ellipsis
|
||||
),
|
||||
),
|
||||
// sizedBoxHeight(20.h),
|
||||
Row(children: [
|
||||
Obx(
|
||||
() => InkWell(
|
||||
@@ -543,8 +558,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
fit: BoxFit.cover),
|
||||
))
|
||||
.toList(),
|
||||
selectedReaction: widget
|
||||
.selectedReactions[widget.commonObj.id] !=
|
||||
selectedReaction: widget.selectedReactions[
|
||||
widget.commonObj.id] !=
|
||||
null
|
||||
? Reaction<String>(
|
||||
value: widget
|
||||
@@ -553,7 +568,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
.toString(),
|
||||
icon: Image.network(
|
||||
widget
|
||||
.selectedReactions[widget.commonObj.id]!
|
||||
.selectedReactions[
|
||||
widget.commonObj.id]!
|
||||
.image,
|
||||
width: 24,
|
||||
height: 24,
|
||||
@@ -573,11 +589,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
itemAnimationDuration:
|
||||
const Duration(milliseconds: 500),
|
||||
hoverDuration: const Duration(milliseconds: 700),
|
||||
child: widget
|
||||
.selectedReactions[widget.commonObj.id] !=
|
||||
child: widget.selectedReactions[
|
||||
widget.commonObj.id] !=
|
||||
null
|
||||
? Image.network(
|
||||
widget.selectedReactions[widget.commonObj.id]!
|
||||
widget
|
||||
.selectedReactions[widget.commonObj.id]!
|
||||
.image,
|
||||
width: 24,
|
||||
height: 24,
|
||||
@@ -657,6 +674,7 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
]),
|
||||
),
|
||||
],
|
||||
));
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
|
||||
|
||||
class Communitygetmethod {
|
||||
getTagsdata(id) {}
|
||||
|
||||
|
||||
}
|
||||
@@ -494,34 +494,6 @@ class _FeedTabState extends State<FeedTab> {
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
|
||||
Widget containertile({required String text}) {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
width: 130.w,
|
||||
height: 30.h,
|
||||
borderradius: 30.r,
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
|
||||
Widget containertile2({required String text}) {
|
||||
return 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(text)),
|
||||
));
|
||||
}
|
||||
|
||||
class PopularTab extends StatefulWidget {
|
||||
const PopularTab({super.key});
|
||||
|
||||
@@ -94,23 +94,9 @@ class _PostScreenState extends State<PostScreen> {
|
||||
List<int> selectedabilityid = [];
|
||||
int? communityid;
|
||||
|
||||
// void getCatIdFromName(List<String> selectedAbilities) {
|
||||
// selectedabilityid.clear(); // Clear existing selections
|
||||
// for (var name in selectedAbilities) {
|
||||
// for (var i = 0; i < postcommunity.length; i++) {
|
||||
// if (name == postcommunity[i].community!.communityName) {
|
||||
// selectedabilityid.add(postcommunity[i].community!.id!);
|
||||
// communityid = postcommunity[i].community!.id!;
|
||||
// // fetchPopularlist(postcommunity[i].id!);
|
||||
// fetchPopularTags(communityid!);
|
||||
// _isSecondDropdownEnabled = true;
|
||||
|
||||
// break; // Assuming each name is unique, we break after finding a match
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// print('Selected IDs: $selectedabilityid');
|
||||
// }
|
||||
String? _selectedPostType;
|
||||
int? posttagtype;
|
||||
bool isCommunitySelected = false;
|
||||
|
||||
void getCatIdFromName(List<String> selectedAbilities) {
|
||||
selectedabilityid.clear(); // Clear existing selections
|
||||
@@ -119,9 +105,17 @@ class _PostScreenState extends State<PostScreen> {
|
||||
if (name == postcommunity[i].community!.communityName) {
|
||||
selectedabilityid.add(postcommunity[i].community!.id!);
|
||||
communityid = postcommunity[i].community!.id!;
|
||||
setState(() {
|
||||
_selectedPostType = null;
|
||||
_isSecondDropdownEnabled = false;
|
||||
});
|
||||
// Fetch tags for the selected community
|
||||
fetchPopularTags(communityid!);
|
||||
_isSecondDropdownEnabled = true;
|
||||
// fetchPopularTags(communityid!, tagtype!);
|
||||
// _isSecondDropdownEnabled = true;
|
||||
// if (tagtype != null) {
|
||||
// fetchPopularTags(communityid!, tagtype!);
|
||||
// _isSecondDropdownEnabled = true;
|
||||
// }
|
||||
break; // Assuming each name is unique, we break after finding a match
|
||||
}
|
||||
}
|
||||
@@ -131,7 +125,7 @@ class _PostScreenState extends State<PostScreen> {
|
||||
|
||||
List<Data> tags = []; // Change the type to List<Data>
|
||||
|
||||
Future<void> fetchPopularTags(int communityId) async {
|
||||
Future<void> fetchPopularTags(int communityId, int tagtype) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
token = prefs.getString('access-token');
|
||||
String basicAuth = 'Basic ' +
|
||||
@@ -141,7 +135,7 @@ class _PostScreenState extends State<PostScreen> {
|
||||
try {
|
||||
final response = await Dio().get(
|
||||
// 'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&name=',
|
||||
'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&name=',
|
||||
'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&is_special=$tagtype&name=',
|
||||
options: Options(
|
||||
headers: {'authorization': basicAuth, 'access-token': token},
|
||||
));
|
||||
@@ -340,6 +334,7 @@ class _PostScreenState extends State<PostScreen> {
|
||||
"post_in": communityid,
|
||||
"manage_tags_xids": selectedtags,
|
||||
"post_as": _selectedPostas,
|
||||
"is_announcement": posttagtype
|
||||
});
|
||||
final data = await Communitypostmethod().postUpload(formdata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
@@ -379,6 +374,7 @@ class _PostScreenState extends State<PostScreen> {
|
||||
"post_as": _selectedPostas,
|
||||
"cta_title": ctatitilecontroller.text,
|
||||
"cta_link": ctalinkcontroller.text,
|
||||
"is_announcement": posttagtype
|
||||
});
|
||||
final data = await Communitypostmethod().postUpload(formdata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
@@ -426,15 +422,67 @@ class _PostScreenState extends State<PostScreen> {
|
||||
title: "",
|
||||
listData: _postindrop,
|
||||
|
||||
onItemSelected: getCatIdFromName,
|
||||
onItemSelected:
|
||||
// getCatIdFromName,
|
||||
(List<String> selectedAbilities) {
|
||||
getCatIdFromName(selectedAbilities);
|
||||
isCommunitySelected = true;
|
||||
},
|
||||
// (p0) {},
|
||||
images: _postindropimages,
|
||||
|
||||
leadingImage: const SizedBox(),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Caption"),
|
||||
// sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Post type"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomRadioListTile(
|
||||
title: 'Regular',
|
||||
subtitle:
|
||||
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
|
||||
value: 'Regular',
|
||||
groupValue: _selectedPostType,
|
||||
onChanged: (String? value) {
|
||||
if (isCommunitySelected && communityid != null) {
|
||||
setState(() {
|
||||
_selectedPostType = value!;
|
||||
posttagtype = 0;
|
||||
fetchPopularTags(communityid!,
|
||||
posttagtype!); // Call the API after both selections
|
||||
_isSecondDropdownEnabled = true;
|
||||
});
|
||||
} else {
|
||||
utils.showToast('Please select a community first.');
|
||||
}
|
||||
},
|
||||
activeColor: Color(0XFFD90B2E),
|
||||
),
|
||||
CustomRadioListTile(
|
||||
title: 'Announcement',
|
||||
subtitle:
|
||||
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
|
||||
value: 'Announcement',
|
||||
groupValue: _selectedPostType,
|
||||
onChanged: (String? value) {
|
||||
if (isCommunitySelected && communityid != null) {
|
||||
setState(() {
|
||||
_selectedPostType = value!;
|
||||
posttagtype = 1;
|
||||
fetchPopularTags(communityid!,
|
||||
posttagtype!); // Call the API after both selections
|
||||
_isSecondDropdownEnabled = true;
|
||||
});
|
||||
} else {
|
||||
utils.showToast('Please select a community first.');
|
||||
}
|
||||
},
|
||||
activeColor: Color(0XFFD90B2E),
|
||||
),
|
||||
|
||||
sizedBoxHeight(38.h),
|
||||
// text16w400_FCFCFC("Caption"),
|
||||
// sizedBoxHeight(18.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter caption",
|
||||
@@ -454,17 +502,62 @@ class _PostScreenState extends State<PostScreen> {
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Media"),
|
||||
sizedBoxHeight(18.h),
|
||||
GestureDetector(
|
||||
DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 339.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
borderColor: Colors.transparent,
|
||||
customWidget: bannerPath.isNotEmpty && isbannerAdded
|
||||
? Stack(children: [
|
||||
Image.file(
|
||||
bannerPath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
bannerPath.clear();
|
||||
isbannerAdded = false;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
width: 27,
|
||||
height: 27,
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
if (result != null && result.isNotEmpty) {
|
||||
if (result != null &&
|
||||
result.isNotEmpty) {
|
||||
var file = File(result);
|
||||
|
||||
// Check if the file size exceeds 10 MB
|
||||
int fileSizeInBytes = file.lengthSync();
|
||||
int fileSizeInBytes =
|
||||
file.lengthSync();
|
||||
double fileSizeInMB =
|
||||
fileSizeInBytes / (1024 * 1024);
|
||||
|
||||
@@ -492,52 +585,7 @@ class _PostScreenState extends State<PostScreen> {
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 339.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
borderColor: Colors.transparent,
|
||||
customWidget: bannerPath.isNotEmpty &&
|
||||
isbannerAdded
|
||||
? Stack(children: [
|
||||
Image.file(
|
||||
bannerPath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
bannerPath.clear();
|
||||
isbannerAdded = false;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
width: 27,
|
||||
height: 27,
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Center(
|
||||
@@ -560,11 +608,11 @@ class _PostScreenState extends State<PostScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Tags"),
|
||||
text16w400_FCFCFC("Interest"),
|
||||
sizedBoxHeight(18.h),
|
||||
_isSecondDropdownEnabled == true
|
||||
? CustomDropDownPopularTag(
|
||||
@@ -578,7 +626,15 @@ class _PostScreenState extends State<PostScreen> {
|
||||
},
|
||||
isFirstDropdownSelected: _isSecondDropdownEnabled,
|
||||
)
|
||||
: Center(child: text14400white('Select community')),
|
||||
:
|
||||
// SizedBox(),
|
||||
Center(
|
||||
child:
|
||||
// isCommunitySelected == true
|
||||
// ? text14400white('Select post type')
|
||||
// :
|
||||
text14400white('No Interests')),
|
||||
|
||||
sizedBoxHeight(25.h),
|
||||
_isSecondDropdownEnabled == true
|
||||
? Column(
|
||||
@@ -679,14 +735,16 @@ class _PostScreenState extends State<PostScreen> {
|
||||
// Condition for account type 1
|
||||
if (selectedabilityid.isEmpty ||
|
||||
selectedpopularid.isEmpty ||
|
||||
bannerPath.isEmpty ||
|
||||
captioncontroller.text.isEmpty ||
|
||||
_selectedPostas.isEmpty) {
|
||||
_selectedPostas.isEmpty ||
|
||||
posttagtype.isBlank!) {
|
||||
print('Tags selected are $selectedpopularid');
|
||||
print(
|
||||
'Community selected are $selectedabilityid');
|
||||
print('Post as selected are $_selectedPostas');
|
||||
utils.showToast('Please fill all fields');
|
||||
} else if (bannerPath.isEmpty) {
|
||||
utils.showToast('Please add a media image');
|
||||
} else {
|
||||
print('Tags selected are $selectedpopularid');
|
||||
print(
|
||||
@@ -700,15 +758,17 @@ class _PostScreenState extends State<PostScreen> {
|
||||
// You can define different validation criteria here for account type 2
|
||||
if (selectedabilityid.isEmpty ||
|
||||
selectedpopularid.isEmpty ||
|
||||
bannerPath.isEmpty ||
|
||||
captioncontroller.text.isEmpty ||
|
||||
_selectedPostas.isEmpty ||
|
||||
ctalinkcontroller.text.isEmpty ||
|
||||
ctatitilecontroller.text.isEmpty) {
|
||||
ctatitilecontroller.text.isEmpty ||
|
||||
posttagtype.isBlank!) {
|
||||
print('Tags selected are $selectedpopularid');
|
||||
print(
|
||||
'Community selected are $selectedabilityid');
|
||||
utils.showToast('Please fill all fields');
|
||||
} else if (bannerPath.isEmpty) {
|
||||
utils.showToast('Please add a media image');
|
||||
} else {
|
||||
print('Tags selected are $selectedpopularid');
|
||||
print(
|
||||
@@ -955,6 +1015,7 @@ class _CustomDropDownCheckBoxPostNewState
|
||||
if (onDropTap.value)
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 250.h,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius:
|
||||
@@ -987,6 +1048,7 @@ class _CustomDropDownCheckBoxPostNewState
|
||||
)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
itemCount: widget.listData.length,
|
||||
itemBuilder: (context, index) {
|
||||
String item = widget.listData[index];
|
||||
@@ -1197,6 +1259,7 @@ class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
||||
// Dropdown List
|
||||
if (onDropTap.value && filteredTags.isNotEmpty)
|
||||
Container(
|
||||
height: 250.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
@@ -1207,6 +1270,7 @@ class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
||||
),
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
itemCount: filteredTags.length,
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
@@ -1281,220 +1345,55 @@ class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
||||
}
|
||||
}
|
||||
|
||||
// class CustomDropDownPopularTag extends StatefulWidget {
|
||||
// final List<Data> tags;
|
||||
// final Function(List<Data>) onItemSelected;
|
||||
// final bool isFirstDropdownSelected;
|
||||
|
||||
// CustomDropDownPopularTag({
|
||||
// required this.tags,
|
||||
// required this.onItemSelected,
|
||||
// required this.isFirstDropdownSelected,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// _CustomDropDownPopularTagState createState() =>
|
||||
// _CustomDropDownPopularTagState();
|
||||
// }
|
||||
|
||||
// class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
||||
// RxBool onDropTap = false.obs;
|
||||
// RxList<Data> selectedTags = <Data>[].obs;
|
||||
// RxList<Data> filteredTags = <Data>[].obs;
|
||||
// TextEditingController textEditingController = TextEditingController();
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// filteredTags.value = widget.tags;
|
||||
// textEditingController.addListener(() {
|
||||
// filterTags();
|
||||
// });
|
||||
// }
|
||||
|
||||
// void _handleDropdownTap() {
|
||||
// if (widget.isFirstDropdownSelected) {
|
||||
// onDropTap.value = !onDropTap.value;
|
||||
// } else {
|
||||
// utils.showToast('Please select an item from the first dropdown.');
|
||||
// }
|
||||
// }
|
||||
|
||||
// void filterTags() {
|
||||
// String query = textEditingController.text.toLowerCase();
|
||||
// if (query.isNotEmpty) {
|
||||
// filteredTags.value = widget.tags
|
||||
// .where((tag) =>
|
||||
// tag.name!.toLowerCase().contains(query) &&
|
||||
// !selectedTags.contains(tag))
|
||||
// .toList();
|
||||
// } else {
|
||||
// filteredTags.value =
|
||||
// widget.tags.where((tag) => !selectedTags.contains(tag)).toList();
|
||||
// }
|
||||
// onDropTap.value = filteredTags.isNotEmpty;
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Obx(
|
||||
// () => Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// // Dropdown Search Input
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// height: 50,
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
// decoration: BoxDecoration(
|
||||
// color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
// borderRadius: onDropTap.value && filteredTags.isNotEmpty
|
||||
// ? const BorderRadius.vertical(
|
||||
// top: Radius.circular(30),
|
||||
// )
|
||||
// : BorderRadius.circular(30),
|
||||
// border: Border.all(color: const Color(0xFF434A53)),
|
||||
// ),
|
||||
// child: Center(
|
||||
// child: TextFormField(
|
||||
// controller: textEditingController,
|
||||
// style: const TextStyle(
|
||||
// fontSize: 16,
|
||||
// color: Colors.white,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// cursorColor: Colors.red,
|
||||
// obscureText: false,
|
||||
// decoration: InputDecoration(
|
||||
// hintText: 'Search Tags',
|
||||
// hintStyle: const TextStyle(
|
||||
// fontSize: 16,
|
||||
// color: Colors.white,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// suffixIcon: GestureDetector(
|
||||
// onTap: _handleDropdownTap,
|
||||
// // () {
|
||||
// // onDropTap.value = !onDropTap.value;
|
||||
|
||||
// // },
|
||||
// child: SizedBox(
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// child: Center(
|
||||
// child: Icon(
|
||||
// onDropTap.value
|
||||
// ? Icons.arrow_drop_up
|
||||
// : Icons.arrow_drop_down,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// border: InputBorder.none,
|
||||
// ),
|
||||
// onTap: _handleDropdownTap
|
||||
// // () {
|
||||
// // onDropTap.value = !onDropTap.value;
|
||||
// // },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// // Dropdown List
|
||||
// if (onDropTap.value && filteredTags.isNotEmpty)
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
// borderRadius: const BorderRadius.vertical(
|
||||
// bottom: Radius.circular(30),
|
||||
// ),
|
||||
// border: Border.all(color: const Color(0xFF434A53)),
|
||||
// ),
|
||||
// child: ListView.builder(
|
||||
// shrinkWrap: true,
|
||||
// itemCount: filteredTags.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return InkWell(
|
||||
// onTap: () {
|
||||
// Data selectedItem = filteredTags[index];
|
||||
// if (selectedTags.contains(selectedItem)) {
|
||||
// selectedTags.remove(selectedItem);
|
||||
// } else {
|
||||
// selectedTags.add(selectedItem);
|
||||
// }
|
||||
// textEditingController.clear();
|
||||
// widget.onItemSelected(selectedTags.toList());
|
||||
// filterTags(); // Update the filtered list
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(10.0),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Text(
|
||||
// filteredTags[index].name!,
|
||||
// style: const TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer(),
|
||||
// Text(
|
||||
// 'Popularity: ${filteredTags[index].tagPopularity}',
|
||||
// style: const TextStyle(
|
||||
// color: Colors.white70,
|
||||
// fontSize: 12,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// sizedBoxHeight(20.h),
|
||||
|
||||
// // Selected Tags Displayed as Chips
|
||||
// if (selectedTags.isNotEmpty)
|
||||
// Wrap(
|
||||
// spacing: 8.0,
|
||||
// runSpacing: 4.0,
|
||||
// children: selectedTags.map((tag) {
|
||||
// return Chip(
|
||||
// label: Text('#${tag.name!}',
|
||||
// style: const TextStyle(color: Colors.white)),
|
||||
// backgroundColor: const Color(0xFFD90B2E).withOpacity(0.9),
|
||||
// // Color(0xFFD90B2E).withOpacity(0.90),
|
||||
|
||||
// // Colors.transparent, // Make Chip background transparent
|
||||
// side: BorderSide(color: Colors.black),
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(30.r),
|
||||
// side: BorderSide(width: 1, color: Colors.white)),
|
||||
// onDeleted: () {
|
||||
// selectedTags.remove(tag);
|
||||
// widget.onItemSelected(selectedTags.toList());
|
||||
// filterTags(); // Update the filtered list after removing a tag
|
||||
// },
|
||||
// materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
class CreateData {
|
||||
final int id;
|
||||
final String name;
|
||||
|
||||
CreateData({required this.id, required this.name});
|
||||
}
|
||||
|
||||
class CustomRadioListTile extends StatelessWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String value;
|
||||
final String? groupValue;
|
||||
final ValueChanged<String?> onChanged;
|
||||
final Color activeColor;
|
||||
|
||||
const CustomRadioListTile({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.value,
|
||||
required this.groupValue,
|
||||
required this.onChanged,
|
||||
required this.activeColor,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onChanged(value);
|
||||
},
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: Transform.translate(
|
||||
offset: Offset(0, -10),
|
||||
child: Transform.scale(
|
||||
scale: 1.5,
|
||||
child: Radio<String>(
|
||||
value: value,
|
||||
groupValue: groupValue,
|
||||
onChanged: onChanged,
|
||||
activeColor: activeColor,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
),
|
||||
),
|
||||
title: text18w400white(title),
|
||||
subtitle: text14400white(subtitle),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,424 +127,6 @@ class _TagdetailScreenState extends State<TagdetailScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
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.tagdetailscreen);
|
||||
},
|
||||
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')
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
class PopularTab extends StatefulWidget {
|
||||
PopularTab({super.key, required this.id});
|
||||
|
||||
@@ -592,13 +174,15 @@ class _PopularTabState extends State<PopularTab> {
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
if (_isDataInitialized) {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_setModel();
|
||||
countersHelper.setListstagPopular();
|
||||
await _fetchIcons();
|
||||
countersHelper.setListsPopular();
|
||||
_fetchIcons();
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
_isDataInitialized = false;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
@@ -698,7 +282,7 @@ class _PopularTabState extends State<PopularTab> {
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
),
|
||||
tagpopulardetailobj!.data.isEmpty
|
||||
commonobjmodel!.data.isEmpty
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -726,7 +310,7 @@ class _PopularTabState extends State<PopularTab> {
|
||||
itemBuilder: (context, index) {
|
||||
var timeAgo = ConvertServerDateToUserDate()
|
||||
.convertServerDateToReadableFormate(
|
||||
tagpopulardetailobj!.data[index].createdAt
|
||||
commonobjmodel!.data[index].createdAt
|
||||
.toString());
|
||||
|
||||
return Column(
|
||||
@@ -821,13 +405,15 @@ class _LatestTabState extends State<LatestTab> {
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
if (_isDataInitialized) {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_setModel();
|
||||
countersHelper.setListstagtagLatest();
|
||||
await _fetchIcons();
|
||||
countersHelper.setListsPopular();
|
||||
_fetchIcons();
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
_isDataInitialized = false;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
@@ -927,7 +513,7 @@ class _LatestTabState extends State<LatestTab> {
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
),
|
||||
tagdetailobj!.data.isEmpty
|
||||
commonobjmodel!.data.isEmpty
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -955,7 +541,7 @@ class _LatestTabState extends State<LatestTab> {
|
||||
itemBuilder: (context, index) {
|
||||
var timeAgo = ConvertServerDateToUserDate()
|
||||
.convertServerDateToReadableFormate(
|
||||
tagdetailobj!.data[index].createdAt
|
||||
commonobjmodel!.data[index].createdAt
|
||||
.toString());
|
||||
|
||||
return Column(
|
||||
|
||||
@@ -29,79 +29,4 @@ List<bool> pinButtonPopular = <bool>[];
|
||||
.add(commonobjmodel?.data[i].iamPrincipal?.isUserPinned ?? false);
|
||||
}
|
||||
}
|
||||
|
||||
RxList<int> likesCounterFeed = <int>[].obs;
|
||||
RxList<int> commentsCounterFeed = <int>[].obs;
|
||||
RxList<int> savePostCounterFeed = <int>[].obs;
|
||||
|
||||
setListsFeed() {
|
||||
for (var i = 0; i < combinedListGlobal.length; i++) {
|
||||
likesCounterLatest.add(combinedListGlobal[i].likecount ?? 0);
|
||||
commentsCounterLatest.add(combinedListGlobal[i].totalCommentCount ?? 0);
|
||||
savePostCounterLatest.add(combinedListGlobal[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
RxList<int> likesCounterLatest = <int>[].obs;
|
||||
RxList<int> commentsCounterLatest = <int>[].obs;
|
||||
RxList<int> savePostCounterLatest = <int>[].obs;
|
||||
|
||||
setListsLatest() {
|
||||
for (var i = 0; i < latestpostobj!.data.length; i++) {
|
||||
likesCounterFeed.add(latestpostobj!.data[i].likecount ?? 0);
|
||||
commentsCounterFeed.add(latestpostobj!.data[i].totalCommentCount ?? 0);
|
||||
savePostCounterFeed.add(latestpostobj!.data[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
//ComPosts
|
||||
RxList<int> likesCounterComPosts= <int>[].obs;
|
||||
RxList<int> commentsCounterComPosts = <int>[].obs;
|
||||
RxList<int> savePostCounterComPosts = <int>[].obs;
|
||||
RxList<bool> saveButtonComPosts = <bool>[].obs;
|
||||
// RxList<bool> pinButtonComPosts = <bool>[].obs;
|
||||
|
||||
setListsComPosts() {
|
||||
likesCounterComPosts.clear();
|
||||
commentsCounterComPosts.clear();
|
||||
savePostCounterComPosts.clear();
|
||||
saveButtonComPosts.clear();
|
||||
|
||||
for (var i = 0; i < commonobjmodel!.data.length; i++) {
|
||||
likesCounterComPosts.add(commonobjmodel?.data[i].likecount ?? 0);
|
||||
commentsCounterComPosts
|
||||
.add(commonobjmodel?.data[i].totalCommentCount ?? 0);
|
||||
savePostCounterComPosts.add(commonobjmodel?.data[i].totalSave ?? 0);
|
||||
saveButtonComPosts.add(commonobjmodel?.data[i].isISaved ?? false);
|
||||
// pinButtonComPosts
|
||||
// .add(commonobjmodel?.data[i].iamPrincipal?.isUserPinned ?? false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//tagPostPopular
|
||||
RxList<int> likesCountertagPopular = <int>[].obs;
|
||||
RxList<int> commentsCountertagPopular = <int>[].obs;
|
||||
RxList<int> savePostCountertagPopular = <int>[].obs;
|
||||
|
||||
setListstagPopular() {
|
||||
for (var i = 0; i < combinedListGlobal.length; i++) {
|
||||
likesCounterLatest.add(combinedListGlobal[i].likecount ?? 0);
|
||||
commentsCounterLatest.add(combinedListGlobal[i].totalCommentCount ?? 0);
|
||||
savePostCounterLatest.add(combinedListGlobal[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
//tagPostLatest
|
||||
RxList<int> likesCountertagLatest = <int>[].obs;
|
||||
RxList<int> commentsCountertagLatest = <int>[].obs;
|
||||
RxList<int> savePostCountertagLatest = <int>[].obs;
|
||||
|
||||
setListstagtagLatest() {
|
||||
for (var i = 0; i < combinedListGlobal.length; i++) {
|
||||
likesCounterLatest.add(combinedListGlobal[i].likecount ?? 0);
|
||||
commentsCounterLatest.add(combinedListGlobal[i].totalCommentCount ?? 0);
|
||||
savePostCounterLatest.add(combinedListGlobal[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,19 @@ class _CommunitySettingState extends State<CommunitySetting> {
|
||||
int communityid = Get.arguments['communityid'];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return WillPopScope(
|
||||
onWillPop: () async{
|
||||
Get.back(result: true);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Community settings",
|
||||
customBack: true,
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
@@ -52,7 +58,11 @@ class _CommunitySettingState extends State<CommunitySetting> {
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.managegroups);
|
||||
Get.toNamed(RouteName.managegroups,
|
||||
arguments: {
|
||||
'communityid' : communityid,
|
||||
}
|
||||
);
|
||||
},
|
||||
child: rowTile(text: 'Manage groups')),
|
||||
commonDivider(),
|
||||
@@ -65,7 +75,8 @@ class _CommunitySettingState extends State<CommunitySetting> {
|
||||
child: rowTile(text: 'Manage interest')),
|
||||
sizedBoxHeight(20.h),
|
||||
])
|
||||
]));
|
||||
])),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/postmethod.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class ManageGroups extends StatefulWidget {
|
||||
const ManageGroups({super.key});
|
||||
@@ -16,37 +30,52 @@ class ManageGroups extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ManageGroupsState extends State<ManageGroups> {
|
||||
List groupData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img45.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 25.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Fit fusion squad",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Power pulse posse",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Wellness warriors collective",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
int communityid = Get.arguments['communityid'];
|
||||
StreamController<CommunityManageGroupsModel> searchcontroller =
|
||||
StreamController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
print(communityid);
|
||||
var updata = communityid;
|
||||
var updata2 = "";
|
||||
Getcommunity().getCommunityManageGroupssearch(updata, updata2,
|
||||
streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int? removeid;
|
||||
|
||||
RemoveUploadata(int remove) async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"manage_community_xid": communityid,
|
||||
"manage_group_xid": removeid,
|
||||
};
|
||||
final data = await PostMethodCommunity().postGroupsRemove(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("remove done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("remove not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
@@ -81,8 +110,7 @@ class _ManageGroupsState extends State<ManageGroups> {
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
@@ -102,6 +130,14 @@ class _ManageGroupsState extends State<ManageGroups> {
|
||||
),
|
||||
),
|
||||
hintText: "Search groups",
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
Getcommunity().getCommunityManageGroupssearch(
|
||||
communityid, value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
@@ -130,29 +166,264 @@ class _ManageGroupsState extends State<ManageGroups> {
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
List<File?> filePath = [];
|
||||
List<File?> bannerPath = [];
|
||||
var result =
|
||||
await Get.toNamed(RouteName.addgroup, arguments: {
|
||||
'communityname': "",
|
||||
'communitylocation': "",
|
||||
'communitydescription': "",
|
||||
'communitytype': 0,
|
||||
'activityid': 0,
|
||||
'communityprofilephoto': filePath,
|
||||
'communitybannerimage': bannerPath,
|
||||
'isedited': true,
|
||||
'communityid': communityid.toString(),
|
||||
});
|
||||
if (result != null && result) {
|
||||
setState(() {
|
||||
Getcommunity().getCommunityManageGroupssearch(
|
||||
communityid, '',
|
||||
streamController: searchcontroller);
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/ion_add.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
)),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(8.w),
|
||||
text18w400_FCFCFC("Add existing groups"),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 14.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text18w700white("Groups"),
|
||||
sizedBoxHeight(20.h),
|
||||
]),
|
||||
),
|
||||
ListView.builder(
|
||||
Expanded(
|
||||
child: StreamBuilder<CommunityManageGroupsModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return communitymanagegroupsobj!.data.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: groupData.length,
|
||||
itemCount: communitymanagegroupsobj!.data.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
var mainGroupsData =
|
||||
communitymanagegroupsobj!.data[index];
|
||||
return Column(
|
||||
children: [
|
||||
groupWidget(
|
||||
imagePath: groupData[index]["imagePath"],
|
||||
title: groupData[index]["title"],
|
||||
subtitle: groupData[index]["subtitle"]),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
mainGroupsData.groupsData!
|
||||
.groupImage ==
|
||||
null ||
|
||||
mainGroupsData.groupsData!
|
||||
.groupImage!.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
'assets/images/png/img45.png'),
|
||||
radius: 20.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage:
|
||||
CachedNetworkImageProvider(
|
||||
mainGroupsData.groupsData!
|
||||
.groupImage!,
|
||||
),
|
||||
radius: 25.r,
|
||||
child: CachedNetworkImage(
|
||||
cacheKey: mainGroupsData
|
||||
.groupsData!.id
|
||||
.toString(),
|
||||
maxHeightDiskCache: 100,
|
||||
maxWidthDiskCache: 100,
|
||||
imageUrl: mainGroupsData
|
||||
.groupsData!
|
||||
.groupImage!,
|
||||
placeholder:
|
||||
(context, url) =>
|
||||
Container(),
|
||||
errorWidget:
|
||||
(context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
imageBuilder: (context,
|
||||
imageProvider) =>
|
||||
CircleAvatar(
|
||||
backgroundImage:
|
||||
imageProvider,
|
||||
radius: 25.r,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
sizedBoxWidth(10.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
mainGroupsData.groupsData!
|
||||
.title ==
|
||||
null ||
|
||||
mainGroupsData
|
||||
.groupsData!
|
||||
.title!
|
||||
.isEmpty
|
||||
? text16w400_FCFCFC(
|
||||
'ReGroup')
|
||||
:
|
||||
// text16w400_FCFCFC( mainGroupsData.groupsData!.title!),
|
||||
Text(
|
||||
mainGroupsData
|
||||
.groupsData!.title!,
|
||||
overflow: TextOverflow
|
||||
.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: const Color(
|
||||
0xFFFCFCFC),
|
||||
fontFamily:
|
||||
'Helvetica',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w400),
|
||||
),
|
||||
sizedBoxHeight(4.h),
|
||||
mainGroupsData.groupsData!
|
||||
.description ==
|
||||
null ||
|
||||
mainGroupsData
|
||||
.groupsData!
|
||||
.description!
|
||||
.isEmpty
|
||||
? text12w400_FCFCFC_blur(
|
||||
'ReGroup')
|
||||
: Text(
|
||||
mainGroupsData
|
||||
.groupsData!
|
||||
.description!,
|
||||
overflow: TextOverflow
|
||||
.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: const Color(
|
||||
0xFFFCFCFC)
|
||||
.withOpacity(
|
||||
0.8),
|
||||
fontFamily:
|
||||
'Helvetica',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
removeid =
|
||||
communitymanagegroupsobj!
|
||||
.data[index]
|
||||
.manageGroupXid ??
|
||||
0;
|
||||
communitymanagegroupsobj!.data
|
||||
.removeWhere((item) =>
|
||||
item.manageGroupXid ==
|
||||
removeid);
|
||||
print(removeid.toString());
|
||||
|
||||
RemoveUploadata(removeid!);
|
||||
});
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/Group 1000004149.png',
|
||||
),
|
||||
)
|
||||
// Icon(
|
||||
// Icons.clear,
|
||||
// color: Color(0xFFFFFFFF),
|
||||
// weight: 1.88,
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
])
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Groups Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget groupWidget({
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart';
|
||||
import 'package:regroup/sidemenu/view_model/getmethod.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/sidemenu/Community/MyCommunity/view_model/getmethod.dart';
|
||||
import 'package:regroup/sidemenu/view_model/getmethod.dart';
|
||||
|
||||
class Group extends StatefulWidget {
|
||||
const Group({super.key});
|
||||
@@ -562,7 +560,7 @@ class _GroupState extends State<Group> {
|
||||
"Make primary"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/leave group.png",
|
||||
"assets/images/png/group.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
|
||||
@@ -46,7 +46,9 @@ class _CommunityMembersState extends State<CommunityMembers> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
@@ -244,6 +246,7 @@ class _CommunityMembersState extends State<CommunityMembers> {
|
||||
]),
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
String communitydescription = Get.arguments["communitydescription"];
|
||||
List<File?> filepath = Get.arguments['communityprofilephoto'];
|
||||
List<File?> bannerPath = Get.arguments['communitybannerimage'];
|
||||
bool edited = Get.arguments['isedited'];
|
||||
String communityid = Get.arguments['communityid'];
|
||||
|
||||
StreamController<CommunityAddgroupsModel> searchcontroller =
|
||||
StreamController();
|
||||
@@ -72,8 +74,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
@override
|
||||
void initState() {
|
||||
var updata = "";
|
||||
Getcommunity()
|
||||
.getCommunityAddGroupsearch(updata, streamController: searchcontroller);
|
||||
Getcommunity().getCommunityAddGroupsearch(updata, communityid,
|
||||
streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
@@ -141,7 +143,9 @@ class _AddGroupState extends State<AddGroup> {
|
||||
print("community created");
|
||||
// Get.toNamed(RouteName.mycommunity);
|
||||
Get.back();
|
||||
Get.back();
|
||||
Get.back(
|
||||
result: true
|
||||
);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
@@ -150,9 +154,37 @@ class _AddGroupState extends State<AddGroup> {
|
||||
}
|
||||
}
|
||||
|
||||
ManageGroupsUploadata() async {
|
||||
utils.loader();
|
||||
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
|
||||
print('Selected Indices: $selectedIndicesString');
|
||||
Map<String, dynamic> updata = {
|
||||
"manage_community_xid": communityid,
|
||||
"manage_groups_xid": selectedIndicesString,
|
||||
};
|
||||
print('updata is ${updata.toString()}');
|
||||
log('log is ${updata.toString()}');
|
||||
final data = await PostMethodCommunity().postmanageaddgroupscommunity(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("groups added");
|
||||
// Get.back();
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("groups not added");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
edited == true ? Get.back(result: true) : Get.back();
|
||||
return true;
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
@@ -169,7 +201,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.mycommunity);
|
||||
print('selected groups are ${_selectedIndices.toString()}');
|
||||
Uploadata();
|
||||
|
||||
edited == true ? ManageGroupsUploadata() : Uploadata();
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -202,7 +235,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
),
|
||||
hintText: "Search groups",
|
||||
onInput: (value) {
|
||||
Getcommunity().getCommunityAddGroupsearch(value,
|
||||
Getcommunity().getCommunityAddGroupsearch(
|
||||
value, communityid,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
@@ -241,7 +275,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
StreamBuilder<CommunityAddgroupsModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@@ -271,8 +306,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
return Column(
|
||||
children: [
|
||||
groupWidget(
|
||||
index:
|
||||
communityaddgroupobj!.data[index].id!,
|
||||
index: communityaddgroupobj!
|
||||
.data[index].id!,
|
||||
imagePath: communityaddgroupobj!
|
||||
.data[index].groupImage ??
|
||||
'',
|
||||
@@ -284,7 +319,8 @@ class _AddGroupState extends State<AddGroup> {
|
||||
// isCheckedList[index],
|
||||
onCheckedChanged: (bool? value) {
|
||||
// isCheckedList[index] = value ?? false;
|
||||
_onContainerTap(communityaddgroupobj!
|
||||
_onContainerTap(
|
||||
communityaddgroupobj!
|
||||
.data[index].id!);
|
||||
},
|
||||
),
|
||||
@@ -299,6 +335,7 @@ class _AddGroupState extends State<AddGroup> {
|
||||
]),
|
||||
)
|
||||
])),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
|
||||
|
||||
|
||||
class CommunityAllDetailsModel {
|
||||
CommunityAllDetailsModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
required this.message,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
final String? status;
|
||||
final int? statusCode;
|
||||
final String? message;
|
||||
final Data? data;
|
||||
|
||||
factory CommunityAllDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
return CommunityAllDetailsModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
message: json["message"],
|
||||
data: json["data"] == null ? null : Data.fromJson(json["data"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
Data({
|
||||
required this.id,
|
||||
required this.isCommunityPinned,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.communityLocation,
|
||||
required this.communityDescription,
|
||||
required this.communityTypeXid,
|
||||
required this.userLinkInCommunity,
|
||||
required this.accessType,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final bool? isCommunityPinned;
|
||||
final int? totalGroup;
|
||||
final int? totalAnnouncements;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityBannerImage;
|
||||
final String? communityName;
|
||||
final String? communityLocation;
|
||||
final String? communityDescription;
|
||||
final int? communityTypeXid;
|
||||
final dynamic userLinkInCommunity;
|
||||
final AccessType? accessType;
|
||||
|
||||
factory Data.fromJson(Map<String, dynamic> json) {
|
||||
return Data(
|
||||
id: json["id"],
|
||||
isCommunityPinned: json["is_community_pinned"],
|
||||
totalGroup: json["total_group"],
|
||||
totalAnnouncements: json["total_announcements"],
|
||||
communityProfilePhoto: json["community_profile_photo"],
|
||||
communityBannerImage: json["community_banner_image"],
|
||||
communityName: json["community_name"],
|
||||
communityLocation: json["community_location"],
|
||||
communityDescription: json["community_description"],
|
||||
communityTypeXid: json["community_type_xid"],
|
||||
userLinkInCommunity: json["user_link_in_community"],
|
||||
accessType: json["access_type"] == null
|
||||
? null
|
||||
: AccessType.fromJson(json["access_type"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AccessType {
|
||||
AccessType({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? name;
|
||||
|
||||
factory AccessType.fromJson(Map<String, dynamic> json) {
|
||||
return AccessType(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
class CommunityManageGroupsModel {
|
||||
CommunityManageGroupsModel({
|
||||
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 CommunityManageGroupsModel.fromJson(Map<String, dynamic> json){
|
||||
return CommunityManageGroupsModel(
|
||||
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.manageCommunityXid,
|
||||
required this.manageGroupXid,
|
||||
required this.groupsData,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? manageCommunityXid;
|
||||
final int? manageGroupXid;
|
||||
final GroupsData? groupsData;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json){
|
||||
return Datum(
|
||||
id: json["id"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
manageGroupXid: json["manage_group_xid"],
|
||||
groupsData: json["groups_data"] == null ? null : GroupsData.fromJson(json["groups_data"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GroupsData {
|
||||
GroupsData({
|
||||
required this.id,
|
||||
required this.manageGroupTypeXid,
|
||||
required this.title,
|
||||
required this.backgroundImage,
|
||||
required this.groupImage,
|
||||
required this.description,
|
||||
required this.totalMember,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? manageGroupTypeXid;
|
||||
final String? title;
|
||||
final String? backgroundImage;
|
||||
final String? groupImage;
|
||||
final String? description;
|
||||
final int? totalMember;
|
||||
|
||||
factory GroupsData.fromJson(Map<String, dynamic> json){
|
||||
return GroupsData(
|
||||
id: json["id"],
|
||||
manageGroupTypeXid: json["manage_group_type_xid"],
|
||||
title: json["title"],
|
||||
backgroundImage: json["background_image"],
|
||||
groupImage: json["group_image"],
|
||||
description: json["description"],
|
||||
totalMember: json["total_member"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,7 +151,12 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
return WillPopScope(
|
||||
onWillPop: () async{
|
||||
Get.back(result: true);
|
||||
return true;
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
@@ -160,6 +165,7 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "New community",
|
||||
customBack: true,
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
@@ -339,6 +345,7 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
sizedBoxHeight(25.h),
|
||||
|
||||
text16w400_FCFCFC("Community name*"),
|
||||
@@ -467,6 +474,6 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
]),
|
||||
))
|
||||
])),
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:regroup/Common/controller/NormalPostCard.dart';
|
||||
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/view_model/CountersHelper.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
@@ -19,9 +18,11 @@ import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart';
|
||||
import 'package:regroup/sidemenu/view_model/postmethod.dart';
|
||||
|
||||
var CommunityId;
|
||||
int? ismute;
|
||||
var communitypinid;
|
||||
|
||||
class CommunityDetails extends StatefulWidget {
|
||||
const CommunityDetails({super.key});
|
||||
@@ -33,6 +34,8 @@ class CommunityDetails extends StatefulWidget {
|
||||
class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
var additionalContent = false.obs;
|
||||
|
||||
bool? iscommunitypin = false;
|
||||
|
||||
late Future myfuture;
|
||||
|
||||
@override
|
||||
@@ -43,6 +46,32 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void refreshData() {
|
||||
setState(() {
|
||||
myfuture = CommunityDetail().getCommunityDetail(CommunityId);
|
||||
});
|
||||
}
|
||||
|
||||
pinunpinCommunity(String communitypinid) async {
|
||||
// utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"manage_communities_xid": communitypinid,
|
||||
};
|
||||
final data = await SidebarTags().postUserpin(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
print("success");
|
||||
// Get.back();
|
||||
setState(() {
|
||||
iscommunitypin = !iscommunitypin!;
|
||||
CommunityDetail().getCommunityDetail(CommunityId);
|
||||
});
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
// Get.back();
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
leaveCommunity() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {};
|
||||
@@ -184,14 +213,41 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
onTap: () async {
|
||||
await pinunpinCommunity(
|
||||
comdetailobj!.data!.id.toString());
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400white("Pin"),
|
||||
iscommunitypin == true
|
||||
? Text(
|
||||
'Unpin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Pin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
iscommunitypin == true
|
||||
? Image.asset(
|
||||
"assets/images/png/PinnedIcon.png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
@@ -709,16 +765,16 @@ class _PostsTabState extends State<PostsTab> {
|
||||
}
|
||||
}
|
||||
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
if (_isDataInitialized) {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_setModel();
|
||||
countersHelper.setListsPopular();
|
||||
await _fetchIcons();
|
||||
_fetchIcons();
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
_isDataInitialized = false;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
@@ -757,7 +813,6 @@ class _PostsTabState extends State<PostsTab> {
|
||||
likeIcon: LikeIcon1(
|
||||
likeIcon: LikeIconClass1(
|
||||
id: e.likeIcon?.likeIcon?.id,
|
||||
// likeIcon?.id,
|
||||
image: e.likeIcon?.likeIcon?.image),
|
||||
likeIconsXid: e.likeIcon?.likeIconsXid,
|
||||
),
|
||||
@@ -823,7 +878,7 @@ class _PostsTabState extends State<PostsTab> {
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
),
|
||||
compostobj!.data.isEmpty
|
||||
commonobjmodel!.data.isEmpty
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -851,7 +906,7 @@ class _PostsTabState extends State<PostsTab> {
|
||||
itemBuilder: (context, index) {
|
||||
var timeAgo = ConvertServerDateToUserDate()
|
||||
.convertServerDateToReadableFormate(
|
||||
compostobj!.data[index].createdAt
|
||||
commonobjmodel!.data[index].createdAt
|
||||
.toString());
|
||||
|
||||
return Column(
|
||||
@@ -864,7 +919,6 @@ class _PostsTabState extends State<PostsTab> {
|
||||
reactions: _reactions,
|
||||
selectedReactions: _selectedReactions,
|
||||
currentIndex: index,
|
||||
coachbool: true,
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
@@ -886,367 +940,3 @@ Widget eventstab() {
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
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 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: 163.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.tagdetailscreen);
|
||||
},
|
||||
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: [
|
||||
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(30.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')
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
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')
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget containertile({required String text}) {
|
||||
return commonGlassUI(
|
||||
borderwidth: 1,
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -8,22 +8,24 @@ import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersMode
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityeditpageModel.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart';
|
||||
|
||||
CommunityAddgroupsModel? communityaddgroupobj;
|
||||
CommunitygroupsModel? communitygroupspobj;
|
||||
CommunityMembersModel? communitymembersobj;
|
||||
CommunityinfopageEditModel? communityeditobj;
|
||||
CommunityManageGroupsModel? communitymanagegroupsobj;
|
||||
|
||||
|
||||
|
||||
|
||||
class Getcommunity {
|
||||
|
||||
Future<ResponseData<dynamic>> getCommunityAddGroupsearch(updata,
|
||||
Future<ResponseData<dynamic>> getCommunityAddGroupsearch(updata,community,
|
||||
{required StreamController<CommunityAddgroupsModel> streamController}) async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getcommunityaddgroups}?search=$updata",
|
||||
"${ApiUrls.getcommunityaddgroups}?manage_community_xid=$community&search=$updata",
|
||||
|
||||
);
|
||||
|
||||
@@ -73,4 +75,19 @@ class Getcommunity {
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getCommunityManageGroupssearch(updata,updata2,
|
||||
{required StreamController<CommunityManageGroupsModel> streamController}) async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getcommunitymanagegroups}?manage_community_xid=$updata&search=$updata2",
|
||||
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
communitymanagegroupsobj = CommunityManageGroupsModel.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(communitymanagegroupsobj!);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,4 +26,23 @@ class PostMethodCommunity {
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postGroupsRemove(updata) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postremovegroupscommunity,
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postmanageaddgroupscommunity(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postmanageaddgroupscommunity,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user