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,
|
double opacity2 = 0.05,
|
||||||
Color borderColor = const Color(0xff434A53),
|
Color borderColor = const Color(0xff434A53),
|
||||||
}) {
|
}) {
|
||||||
return
|
return GlassmorphicContainer(
|
||||||
GlassmorphicContainer(
|
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
borderRadius: borderradius,
|
borderRadius: borderradius,
|
||||||
@@ -83,7 +82,7 @@ Widget commonGlassContainerblue({
|
|||||||
|
|
||||||
Widget commonGlassUIBlue({
|
Widget commonGlassUIBlue({
|
||||||
required double width,
|
required double width,
|
||||||
required double height,
|
required double? height,
|
||||||
required Widget customWidget,
|
required Widget customWidget,
|
||||||
// required double border,
|
// required double border,
|
||||||
double mainOpacity = 1,
|
double mainOpacity = 1,
|
||||||
@@ -114,7 +113,7 @@ Widget commonGlassUIBlue({
|
|||||||
|
|
||||||
Widget commonGlassUI({
|
Widget commonGlassUI({
|
||||||
required double width,
|
required double width,
|
||||||
required double height,
|
required double? height,
|
||||||
// required double border,
|
// required double border,
|
||||||
double mainOpacity = 1,
|
double mainOpacity = 1,
|
||||||
double opacity1 = 0.04,
|
double opacity1 = 0.04,
|
||||||
@@ -148,7 +147,7 @@ Widget commonGlassUI({
|
|||||||
|
|
||||||
Widget commonContainer({
|
Widget commonContainer({
|
||||||
required double width,
|
required double width,
|
||||||
required double height,
|
required double? height,
|
||||||
// required double border,
|
// required double border,
|
||||||
// double mainOpacity = 1,
|
// double mainOpacity = 1,
|
||||||
double opacity1 = 0.04,
|
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 postrejectinvite = "${baseUrl}reject-invite-to-join-community";
|
||||||
|
|
||||||
|
|
||||||
static const getusercertificates = "${baseUrl}my-certificates";
|
static const getusercertificates = "${baseUrl}my-certificates";
|
||||||
|
|
||||||
static const postnotification = "${baseUrl}update-notification-settings";
|
static const postnotification = "${baseUrl}update-notification-settings";
|
||||||
@@ -193,7 +192,10 @@ class ApiUrls {
|
|||||||
|
|
||||||
static const getactivitieslist = "${baseUrl}get_activity";
|
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;
|
bool? coachbool;
|
||||||
|
|
||||||
int currentIndex;
|
int currentIndex;
|
||||||
NormalCardTile({
|
NormalCardTile(
|
||||||
Key? key,
|
{Key? key,
|
||||||
required this.tags,
|
required this.tags,
|
||||||
this.createAt,
|
this.createAt,
|
||||||
required this.forWhichTab,
|
required this.forWhichTab,
|
||||||
@@ -38,15 +38,14 @@ class NormalCardTile extends StatefulWidget {
|
|||||||
required this.reactions,
|
required this.reactions,
|
||||||
required this.selectedReactions,
|
required this.selectedReactions,
|
||||||
required this.currentIndex,
|
required this.currentIndex,
|
||||||
this.coachbool
|
this.coachbool})
|
||||||
}) : super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_NormalCardTileState createState() => _NormalCardTileState();
|
_NormalCardTileState createState() => _NormalCardTileState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _NormalCardTileState extends State<NormalCardTile> {
|
class _NormalCardTileState extends State<NormalCardTile> {
|
||||||
|
|
||||||
RxString mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
RxString mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
||||||
final CountersHelper countersHelper = Get.find<CountersHelper>();
|
final CountersHelper countersHelper = Get.find<CountersHelper>();
|
||||||
int saveCount = 0;
|
int saveCount = 0;
|
||||||
@@ -175,9 +174,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
.split(
|
.split(
|
||||||
"https://regroup.betadelivery.com/storage/app/public/uploads/post_image/")
|
"https://regroup.betadelivery.com/storage/app/public/uploads/post_image/")
|
||||||
.last;
|
.last;
|
||||||
return commonGlassUI(
|
|
||||||
|
return ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(minHeight: 750.h),
|
||||||
|
child: commonGlassUI(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 765.h,
|
height: 600.h,
|
||||||
mainOpacity: 1,
|
mainOpacity: 1,
|
||||||
borderRadius: BorderRadius.circular(1),
|
borderRadius: BorderRadius.circular(1),
|
||||||
customWidget: Column(
|
customWidget: Column(
|
||||||
@@ -189,13 +191,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
backgroundImage: widget
|
backgroundImage:
|
||||||
.commonObj.iamPrincipal?.profilePhoto !=
|
widget.commonObj.iamPrincipal?.profilePhoto != null
|
||||||
null
|
? NetworkImage(widget.commonObj.iamPrincipal!
|
||||||
? NetworkImage(
|
.profilePhoto!) as ImageProvider<Object>
|
||||||
widget.commonObj.iamPrincipal!.profilePhoto!)
|
: const AssetImage(
|
||||||
as ImageProvider<Object>
|
'assets/images/default_profile.png')
|
||||||
: const AssetImage('assets/images/default_profile.png')
|
|
||||||
as ImageProvider<Object>,
|
as ImageProvider<Object>,
|
||||||
radius: 25.r,
|
radius: 25.r,
|
||||||
),
|
),
|
||||||
@@ -219,9 +220,10 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
width: 1.w,
|
width: 1.w,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(5.r),
|
borderRadius: BorderRadius.circular(5.r),
|
||||||
|
|
||||||
),
|
),
|
||||||
child:
|
child: Center(
|
||||||
Center(child: text12w400_FCFCFC("Coach")),
|
child: text12w400_FCFCFC("Coach")),
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
],
|
],
|
||||||
@@ -236,7 +238,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
),
|
),
|
||||||
sizedBoxWidth(7.w),
|
sizedBoxWidth(7.w),
|
||||||
text12w400_FCFCFC(
|
text12w400_FCFCFC(
|
||||||
widget.commonObj.community!.communityName ?? ""),
|
widget.commonObj.community!.communityName ??
|
||||||
|
""),
|
||||||
sizedBoxWidth(7.w),
|
sizedBoxWidth(7.w),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.circle,
|
Icons.circle,
|
||||||
@@ -317,7 +320,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
countersHelper.pinButtonPopular[widget.currentIndex]
|
countersHelper
|
||||||
|
.pinButtonPopular[widget.currentIndex]
|
||||||
? Text(
|
? Text(
|
||||||
'Unpin',
|
'Unpin',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -335,6 +339,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
fontFamily: "Nunito Sans",
|
fontFamily: "Nunito Sans",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
countersHelper
|
countersHelper
|
||||||
@@ -413,7 +419,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
padding: EdgeInsets.only(right: 12.w),
|
padding: EdgeInsets.only(right: 12.w),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.tagdetailscreen, arguments: {
|
Get.toNamed(RouteName.tagdetailscreen,
|
||||||
|
arguments: {
|
||||||
'tagid': manageTag.id,
|
'tagid': manageTag.id,
|
||||||
'tagname': manageTag.name,
|
'tagname': manageTag.name,
|
||||||
'ispinnedtag': manageTag.isPinned,
|
'ispinnedtag': manageTag.isPinned,
|
||||||
@@ -448,12 +455,20 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
),
|
),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 80.h,
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: SingleChildScrollView(
|
child: Text(
|
||||||
child: text16w400_FCFCFC(widget.commonObj.caption ?? "")),
|
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: [
|
Row(children: [
|
||||||
Obx(
|
Obx(
|
||||||
() => InkWell(
|
() => InkWell(
|
||||||
@@ -543,8 +558,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
fit: BoxFit.cover),
|
fit: BoxFit.cover),
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
selectedReaction: widget
|
selectedReaction: widget.selectedReactions[
|
||||||
.selectedReactions[widget.commonObj.id] !=
|
widget.commonObj.id] !=
|
||||||
null
|
null
|
||||||
? Reaction<String>(
|
? Reaction<String>(
|
||||||
value: widget
|
value: widget
|
||||||
@@ -553,7 +568,8 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
.toString(),
|
.toString(),
|
||||||
icon: Image.network(
|
icon: Image.network(
|
||||||
widget
|
widget
|
||||||
.selectedReactions[widget.commonObj.id]!
|
.selectedReactions[
|
||||||
|
widget.commonObj.id]!
|
||||||
.image,
|
.image,
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
@@ -573,11 +589,12 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
|||||||
itemAnimationDuration:
|
itemAnimationDuration:
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
hoverDuration: const Duration(milliseconds: 700),
|
hoverDuration: const Duration(milliseconds: 700),
|
||||||
child: widget
|
child: widget.selectedReactions[
|
||||||
.selectedReactions[widget.commonObj.id] !=
|
widget.commonObj.id] !=
|
||||||
null
|
null
|
||||||
? Image.network(
|
? Image.network(
|
||||||
widget.selectedReactions[widget.commonObj.id]!
|
widget
|
||||||
|
.selectedReactions[widget.commonObj.id]!
|
||||||
.image,
|
.image,
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 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 {
|
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 {
|
class PopularTab extends StatefulWidget {
|
||||||
const PopularTab({super.key});
|
const PopularTab({super.key});
|
||||||
|
|||||||
@@ -94,23 +94,9 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
List<int> selectedabilityid = [];
|
List<int> selectedabilityid = [];
|
||||||
int? communityid;
|
int? communityid;
|
||||||
|
|
||||||
// void getCatIdFromName(List<String> selectedAbilities) {
|
String? _selectedPostType;
|
||||||
// selectedabilityid.clear(); // Clear existing selections
|
int? posttagtype;
|
||||||
// for (var name in selectedAbilities) {
|
bool isCommunitySelected = false;
|
||||||
// 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');
|
|
||||||
// }
|
|
||||||
|
|
||||||
void getCatIdFromName(List<String> selectedAbilities) {
|
void getCatIdFromName(List<String> selectedAbilities) {
|
||||||
selectedabilityid.clear(); // Clear existing selections
|
selectedabilityid.clear(); // Clear existing selections
|
||||||
@@ -119,9 +105,17 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
if (name == postcommunity[i].community!.communityName) {
|
if (name == postcommunity[i].community!.communityName) {
|
||||||
selectedabilityid.add(postcommunity[i].community!.id!);
|
selectedabilityid.add(postcommunity[i].community!.id!);
|
||||||
communityid = postcommunity[i].community!.id!;
|
communityid = postcommunity[i].community!.id!;
|
||||||
|
setState(() {
|
||||||
|
_selectedPostType = null;
|
||||||
|
_isSecondDropdownEnabled = false;
|
||||||
|
});
|
||||||
// Fetch tags for the selected community
|
// Fetch tags for the selected community
|
||||||
fetchPopularTags(communityid!);
|
// fetchPopularTags(communityid!, tagtype!);
|
||||||
_isSecondDropdownEnabled = true;
|
// _isSecondDropdownEnabled = true;
|
||||||
|
// if (tagtype != null) {
|
||||||
|
// fetchPopularTags(communityid!, tagtype!);
|
||||||
|
// _isSecondDropdownEnabled = true;
|
||||||
|
// }
|
||||||
break; // Assuming each name is unique, we break after finding a match
|
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>
|
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();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
token = prefs.getString('access-token');
|
token = prefs.getString('access-token');
|
||||||
String basicAuth = 'Basic ' +
|
String basicAuth = 'Basic ' +
|
||||||
@@ -141,7 +135,7 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
try {
|
try {
|
||||||
final response = await Dio().get(
|
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&name=',
|
'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&is_special=$tagtype&name=',
|
||||||
options: Options(
|
options: Options(
|
||||||
headers: {'authorization': basicAuth, 'access-token': token},
|
headers: {'authorization': basicAuth, 'access-token': token},
|
||||||
));
|
));
|
||||||
@@ -340,6 +334,7 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
"post_in": communityid,
|
"post_in": communityid,
|
||||||
"manage_tags_xids": selectedtags,
|
"manage_tags_xids": selectedtags,
|
||||||
"post_as": _selectedPostas,
|
"post_as": _selectedPostas,
|
||||||
|
"is_announcement": posttagtype
|
||||||
});
|
});
|
||||||
final data = await Communitypostmethod().postUpload(formdata);
|
final data = await Communitypostmethod().postUpload(formdata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
@@ -379,6 +374,7 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
"post_as": _selectedPostas,
|
"post_as": _selectedPostas,
|
||||||
"cta_title": ctatitilecontroller.text,
|
"cta_title": ctatitilecontroller.text,
|
||||||
"cta_link": ctalinkcontroller.text,
|
"cta_link": ctalinkcontroller.text,
|
||||||
|
"is_announcement": posttagtype
|
||||||
});
|
});
|
||||||
final data = await Communitypostmethod().postUpload(formdata);
|
final data = await Communitypostmethod().postUpload(formdata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
@@ -426,15 +422,67 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
title: "",
|
title: "",
|
||||||
listData: _postindrop,
|
listData: _postindrop,
|
||||||
|
|
||||||
onItemSelected: getCatIdFromName,
|
onItemSelected:
|
||||||
|
// getCatIdFromName,
|
||||||
|
(List<String> selectedAbilities) {
|
||||||
|
getCatIdFromName(selectedAbilities);
|
||||||
|
isCommunitySelected = true;
|
||||||
|
},
|
||||||
// (p0) {},
|
// (p0) {},
|
||||||
images: _postindropimages,
|
images: _postindropimages,
|
||||||
|
|
||||||
leadingImage: const SizedBox(),
|
leadingImage: const SizedBox(),
|
||||||
),
|
),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
text16w400_FCFCFC("Caption"),
|
// sizedBoxHeight(20.h),
|
||||||
|
text16w400_FCFCFC("Post type"),
|
||||||
sizedBoxHeight(18.h),
|
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(
|
CustomTextFormField2(
|
||||||
maxlines: 3,
|
maxlines: 3,
|
||||||
hintText: "Enter caption",
|
hintText: "Enter caption",
|
||||||
@@ -454,17 +502,62 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
text16w400_FCFCFC("Media"),
|
text16w400_FCFCFC("Media"),
|
||||||
sizedBoxHeight(18.h),
|
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: () {
|
onTap: () {
|
||||||
ImageUploadBottomSheet().showModal(
|
ImageUploadBottomSheet().showModal(
|
||||||
context,
|
context,
|
||||||
false,
|
false,
|
||||||
(result) {
|
(result) {
|
||||||
if (result != null && result.isNotEmpty) {
|
if (result != null &&
|
||||||
|
result.isNotEmpty) {
|
||||||
var file = File(result);
|
var file = File(result);
|
||||||
|
|
||||||
// Check if the file size exceeds 10 MB
|
// Check if the file size exceeds 10 MB
|
||||||
int fileSizeInBytes = file.lengthSync();
|
int fileSizeInBytes =
|
||||||
|
file.lengthSync();
|
||||||
double fileSizeInMB =
|
double fileSizeInMB =
|
||||||
fileSizeInBytes / (1024 * 1024);
|
fileSizeInBytes / (1024 * 1024);
|
||||||
|
|
||||||
@@ -492,52 +585,7 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: DottedBorder(
|
child: Padding(
|
||||||
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(
|
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(vertical: 16.h),
|
EdgeInsets.symmetric(vertical: 16.h),
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -560,11 +608,11 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
text16w400_FCFCFC("Tags"),
|
text16w400_FCFCFC("Interest"),
|
||||||
sizedBoxHeight(18.h),
|
sizedBoxHeight(18.h),
|
||||||
_isSecondDropdownEnabled == true
|
_isSecondDropdownEnabled == true
|
||||||
? CustomDropDownPopularTag(
|
? CustomDropDownPopularTag(
|
||||||
@@ -578,7 +626,15 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
},
|
},
|
||||||
isFirstDropdownSelected: _isSecondDropdownEnabled,
|
isFirstDropdownSelected: _isSecondDropdownEnabled,
|
||||||
)
|
)
|
||||||
: Center(child: text14400white('Select community')),
|
:
|
||||||
|
// SizedBox(),
|
||||||
|
Center(
|
||||||
|
child:
|
||||||
|
// isCommunitySelected == true
|
||||||
|
// ? text14400white('Select post type')
|
||||||
|
// :
|
||||||
|
text14400white('No Interests')),
|
||||||
|
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
_isSecondDropdownEnabled == true
|
_isSecondDropdownEnabled == true
|
||||||
? Column(
|
? Column(
|
||||||
@@ -679,14 +735,16 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
// Condition for account type 1
|
// Condition for account type 1
|
||||||
if (selectedabilityid.isEmpty ||
|
if (selectedabilityid.isEmpty ||
|
||||||
selectedpopularid.isEmpty ||
|
selectedpopularid.isEmpty ||
|
||||||
bannerPath.isEmpty ||
|
|
||||||
captioncontroller.text.isEmpty ||
|
captioncontroller.text.isEmpty ||
|
||||||
_selectedPostas.isEmpty) {
|
_selectedPostas.isEmpty ||
|
||||||
|
posttagtype.isBlank!) {
|
||||||
print('Tags selected are $selectedpopularid');
|
print('Tags selected are $selectedpopularid');
|
||||||
print(
|
print(
|
||||||
'Community selected are $selectedabilityid');
|
'Community selected are $selectedabilityid');
|
||||||
print('Post as selected are $_selectedPostas');
|
print('Post as selected are $_selectedPostas');
|
||||||
utils.showToast('Please fill all fields');
|
utils.showToast('Please fill all fields');
|
||||||
|
} else if (bannerPath.isEmpty) {
|
||||||
|
utils.showToast('Please add a media image');
|
||||||
} else {
|
} else {
|
||||||
print('Tags selected are $selectedpopularid');
|
print('Tags selected are $selectedpopularid');
|
||||||
print(
|
print(
|
||||||
@@ -700,15 +758,17 @@ class _PostScreenState extends State<PostScreen> {
|
|||||||
// You can define different validation criteria here for account type 2
|
// You can define different validation criteria here for account type 2
|
||||||
if (selectedabilityid.isEmpty ||
|
if (selectedabilityid.isEmpty ||
|
||||||
selectedpopularid.isEmpty ||
|
selectedpopularid.isEmpty ||
|
||||||
bannerPath.isEmpty ||
|
|
||||||
captioncontroller.text.isEmpty ||
|
captioncontroller.text.isEmpty ||
|
||||||
_selectedPostas.isEmpty ||
|
_selectedPostas.isEmpty ||
|
||||||
ctalinkcontroller.text.isEmpty ||
|
ctalinkcontroller.text.isEmpty ||
|
||||||
ctatitilecontroller.text.isEmpty) {
|
ctatitilecontroller.text.isEmpty ||
|
||||||
|
posttagtype.isBlank!) {
|
||||||
print('Tags selected are $selectedpopularid');
|
print('Tags selected are $selectedpopularid');
|
||||||
print(
|
print(
|
||||||
'Community selected are $selectedabilityid');
|
'Community selected are $selectedabilityid');
|
||||||
utils.showToast('Please fill all fields');
|
utils.showToast('Please fill all fields');
|
||||||
|
} else if (bannerPath.isEmpty) {
|
||||||
|
utils.showToast('Please add a media image');
|
||||||
} else {
|
} else {
|
||||||
print('Tags selected are $selectedpopularid');
|
print('Tags selected are $selectedpopularid');
|
||||||
print(
|
print(
|
||||||
@@ -955,6 +1015,7 @@ class _CustomDropDownCheckBoxPostNewState
|
|||||||
if (onDropTap.value)
|
if (onDropTap.value)
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
height: 250.h,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||||
borderRadius:
|
borderRadius:
|
||||||
@@ -987,6 +1048,7 @@ class _CustomDropDownCheckBoxPostNewState
|
|||||||
)
|
)
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
physics: ScrollPhysics(),
|
||||||
itemCount: widget.listData.length,
|
itemCount: widget.listData.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
String item = widget.listData[index];
|
String item = widget.listData[index];
|
||||||
@@ -1197,6 +1259,7 @@ class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
|||||||
// Dropdown List
|
// Dropdown List
|
||||||
if (onDropTap.value && filteredTags.isNotEmpty)
|
if (onDropTap.value && filteredTags.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
|
height: 250.h,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||||
@@ -1207,6 +1270,7 @@ class _CustomDropDownPopularTagState extends State<CustomDropDownPopularTag> {
|
|||||||
),
|
),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
physics: ScrollPhysics(),
|
||||||
itemCount: filteredTags.length,
|
itemCount: filteredTags.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return InkWell(
|
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 {
|
class CreateData {
|
||||||
final int id;
|
final int id;
|
||||||
final String name;
|
final String name;
|
||||||
|
|
||||||
CreateData({required this.id, required this.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 {
|
class PopularTab extends StatefulWidget {
|
||||||
PopularTab({super.key, required this.id});
|
PopularTab({super.key, required this.id});
|
||||||
|
|
||||||
@@ -592,13 +174,15 @@ class _PopularTabState extends State<PopularTab> {
|
|||||||
bool _isDataInitialized = true;
|
bool _isDataInitialized = true;
|
||||||
|
|
||||||
Future<void> setValues() async {
|
Future<void> setValues() async {
|
||||||
if (_isDataInitialized) {
|
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_setModel();
|
_setModel();
|
||||||
countersHelper.setListstagPopular();
|
countersHelper.setListsPopular();
|
||||||
await _fetchIcons();
|
_fetchIcons();
|
||||||
|
});
|
||||||
|
//if (mounted) {
|
||||||
|
|
||||||
_isDataInitialized = false;
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sortTags(index) {
|
_sortTags(index) {
|
||||||
@@ -698,7 +282,7 @@ class _PopularTabState extends State<PopularTab> {
|
|||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
tagpopulardetailobj!.data.isEmpty
|
commonobjmodel!.data.isEmpty
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -726,7 +310,7 @@ class _PopularTabState extends State<PopularTab> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var timeAgo = ConvertServerDateToUserDate()
|
var timeAgo = ConvertServerDateToUserDate()
|
||||||
.convertServerDateToReadableFormate(
|
.convertServerDateToReadableFormate(
|
||||||
tagpopulardetailobj!.data[index].createdAt
|
commonobjmodel!.data[index].createdAt
|
||||||
.toString());
|
.toString());
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
@@ -821,13 +405,15 @@ class _LatestTabState extends State<LatestTab> {
|
|||||||
bool _isDataInitialized = true;
|
bool _isDataInitialized = true;
|
||||||
|
|
||||||
Future<void> setValues() async {
|
Future<void> setValues() async {
|
||||||
if (_isDataInitialized) {
|
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_setModel();
|
_setModel();
|
||||||
countersHelper.setListstagtagLatest();
|
countersHelper.setListsPopular();
|
||||||
await _fetchIcons();
|
_fetchIcons();
|
||||||
|
});
|
||||||
|
//if (mounted) {
|
||||||
|
|
||||||
_isDataInitialized = false;
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sortTags(index) {
|
_sortTags(index) {
|
||||||
@@ -927,7 +513,7 @@ class _LatestTabState extends State<LatestTab> {
|
|||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
tagdetailobj!.data.isEmpty
|
commonobjmodel!.data.isEmpty
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -955,7 +541,7 @@ class _LatestTabState extends State<LatestTab> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var timeAgo = ConvertServerDateToUserDate()
|
var timeAgo = ConvertServerDateToUserDate()
|
||||||
.convertServerDateToReadableFormate(
|
.convertServerDateToReadableFormate(
|
||||||
tagdetailobj!.data[index].createdAt
|
commonobjmodel!.data[index].createdAt
|
||||||
.toString());
|
.toString());
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class CountersHelper extends GetxController {
|
|||||||
RxList<int> commentsCounterPopular = <int>[].obs;
|
RxList<int> commentsCounterPopular = <int>[].obs;
|
||||||
RxList<int> savePostCounterPopular = <int>[].obs;
|
RxList<int> savePostCounterPopular = <int>[].obs;
|
||||||
RxList<bool> saveButtonPopular = <bool>[].obs;
|
RxList<bool> saveButtonPopular = <bool>[].obs;
|
||||||
List<bool> pinButtonPopular = <bool>[];
|
List<bool> pinButtonPopular = <bool>[];
|
||||||
RxBool updateFeedsPage = false.obs;
|
RxBool updateFeedsPage = false.obs;
|
||||||
setListsPopular() {
|
setListsPopular() {
|
||||||
likesCounterPopular.clear();
|
likesCounterPopular.clear();
|
||||||
@@ -29,79 +29,4 @@ List<bool> pinButtonPopular = <bool>[];
|
|||||||
.add(commonobjmodel?.data[i].iamPrincipal?.isUserPinned ?? false);
|
.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'];
|
int communityid = Get.arguments['communityid'];
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return WillPopScope(
|
||||||
|
onWillPop: () async{
|
||||||
|
Get.back(result: true);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
backgroundColor: Color(0xFF222935),
|
backgroundColor: Color(0xFF222935),
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: CommonAppbar(
|
appBar: CommonAppbar(
|
||||||
titleTxt: "Community settings",
|
titleTxt: "Community settings",
|
||||||
|
customBack: true,
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -52,7 +58,11 @@ class _CommunitySettingState extends State<CommunitySetting> {
|
|||||||
commonDivider(),
|
commonDivider(),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.managegroups);
|
Get.toNamed(RouteName.managegroups,
|
||||||
|
arguments: {
|
||||||
|
'communityid' : communityid,
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: rowTile(text: 'Manage groups')),
|
child: rowTile(text: 'Manage groups')),
|
||||||
commonDivider(),
|
commonDivider(),
|
||||||
@@ -65,7 +75,8 @@ class _CommunitySettingState extends State<CommunitySetting> {
|
|||||||
child: rowTile(text: 'Manage interest')),
|
child: rowTile(text: 'Manage interest')),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
])
|
])
|
||||||
]));
|
])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget rowTile({
|
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/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||||
import 'package:regroup/Common/CommonWidget.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/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||||
|
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.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 {
|
class ManageGroups extends StatefulWidget {
|
||||||
const ManageGroups({super.key});
|
const ManageGroups({super.key});
|
||||||
@@ -16,37 +30,52 @@ class ManageGroups extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ManageGroupsState extends State<ManageGroups> {
|
class _ManageGroupsState extends State<ManageGroups> {
|
||||||
List groupData = [
|
int communityid = Get.arguments['communityid'];
|
||||||
{
|
StreamController<CommunityManageGroupsModel> searchcontroller =
|
||||||
"imagePath": "assets/images/png/img45.png",
|
StreamController();
|
||||||
"title": "Iron titans fitness crew",
|
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
@override
|
||||||
},
|
void initState() {
|
||||||
{
|
print(communityid);
|
||||||
"imagePath": "assets/images/png/Rectangle 25.png",
|
var updata = communityid;
|
||||||
"title": "Body blitz brigade",
|
var updata2 = "";
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
Getcommunity().getCommunityManageGroupssearch(updata, updata2,
|
||||||
},
|
streamController: searchcontroller);
|
||||||
{
|
|
||||||
"imagePath": "assets/images/png/img2.png",
|
super.initState();
|
||||||
"title": "Fit fusion squad",
|
}
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
|
||||||
},
|
@override
|
||||||
{
|
void dispose() {
|
||||||
"imagePath": "assets/images/png/img2.png",
|
searchcontroller.close();
|
||||||
"title": "Power pulse posse",
|
super.dispose();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
}
|
||||||
},
|
|
||||||
{
|
int? removeid;
|
||||||
"imagePath": "assets/images/png/img2.png",
|
|
||||||
"title": "Wellness warriors collective",
|
RemoveUploadata(int remove) async {
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
backgroundColor: Color(0xFF222935),
|
backgroundColor: Color(0xFF222935),
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
@@ -81,8 +110,7 @@ class _ManageGroupsState extends State<ManageGroups> {
|
|||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
fit: BoxFit.fill)),
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
SingleChildScrollView(
|
Column(children: [
|
||||||
child: Column(children: [
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -102,6 +130,14 @@ class _ManageGroupsState extends State<ManageGroups> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "Search groups",
|
hintText: "Search groups",
|
||||||
|
inputFormatters: [
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
],
|
||||||
|
onInput: (value) {
|
||||||
|
Getcommunity().getCommunityManageGroupssearch(
|
||||||
|
communityid, value,
|
||||||
|
streamController: searchcontroller);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
Row(
|
Row(
|
||||||
@@ -130,29 +166,264 @@ class _ManageGroupsState extends State<ManageGroups> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
sizedBoxHeight(30.h),
|
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"),
|
text18w700white("Groups"),
|
||||||
sizedBoxHeight(20.h),
|
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,
|
shrinkWrap: true,
|
||||||
itemCount: groupData.length,
|
itemCount: communitymanagegroupsobj!.data.length,
|
||||||
|
separatorBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return commonDivider();
|
||||||
|
},
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
var mainGroupsData =
|
||||||
|
communitymanagegroupsobj!.data[index];
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
groupWidget(
|
Padding(
|
||||||
imagePath: groupData[index]["imagePath"],
|
padding: EdgeInsets.symmetric(
|
||||||
title: groupData[index]["title"],
|
vertical: 16.h, horizontal: 16.w),
|
||||||
subtitle: groupData[index]["subtitle"]),
|
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(),
|
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({
|
Widget groupWidget({
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||||
import 'package:regroup/Common/CommonWidget.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/CommonAppbar.dart';
|
||||||
|
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/texts.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 {
|
class Group extends StatefulWidget {
|
||||||
const Group({super.key});
|
const Group({super.key});
|
||||||
@@ -562,7 +560,7 @@ class _GroupState extends State<Group> {
|
|||||||
"Make primary"),
|
"Make primary"),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/leave group.png",
|
"assets/images/png/group.png",
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ class _CommunityMembersState extends State<CommunityMembers> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
backgroundColor: const Color(0xFF222935),
|
backgroundColor: const Color(0xFF222935),
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
appBar: const CommonAppbar(
|
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"];
|
String communitydescription = Get.arguments["communitydescription"];
|
||||||
List<File?> filepath = Get.arguments['communityprofilephoto'];
|
List<File?> filepath = Get.arguments['communityprofilephoto'];
|
||||||
List<File?> bannerPath = Get.arguments['communitybannerimage'];
|
List<File?> bannerPath = Get.arguments['communitybannerimage'];
|
||||||
|
bool edited = Get.arguments['isedited'];
|
||||||
|
String communityid = Get.arguments['communityid'];
|
||||||
|
|
||||||
StreamController<CommunityAddgroupsModel> searchcontroller =
|
StreamController<CommunityAddgroupsModel> searchcontroller =
|
||||||
StreamController();
|
StreamController();
|
||||||
@@ -72,8 +74,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
var updata = "";
|
var updata = "";
|
||||||
Getcommunity()
|
Getcommunity().getCommunityAddGroupsearch(updata, communityid,
|
||||||
.getCommunityAddGroupsearch(updata, streamController: searchcontroller);
|
streamController: searchcontroller);
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
@@ -141,7 +143,9 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
print("community created");
|
print("community created");
|
||||||
// Get.toNamed(RouteName.mycommunity);
|
// Get.toNamed(RouteName.mycommunity);
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back(
|
||||||
|
result: true
|
||||||
|
);
|
||||||
return utils.showToast(data.message);
|
return utils.showToast(data.message);
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
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(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
@@ -169,7 +201,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Get.toNamed(RouteName.mycommunity);
|
// Get.toNamed(RouteName.mycommunity);
|
||||||
print('selected groups are ${_selectedIndices.toString()}');
|
print('selected groups are ${_selectedIndices.toString()}');
|
||||||
Uploadata();
|
|
||||||
|
edited == true ? ManageGroupsUploadata() : Uploadata();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -202,7 +235,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
),
|
),
|
||||||
hintText: "Search groups",
|
hintText: "Search groups",
|
||||||
onInput: (value) {
|
onInput: (value) {
|
||||||
Getcommunity().getCommunityAddGroupsearch(value,
|
Getcommunity().getCommunityAddGroupsearch(
|
||||||
|
value, communityid,
|
||||||
streamController: searchcontroller);
|
streamController: searchcontroller);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -241,7 +275,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
StreamBuilder<CommunityAddgroupsModel>(
|
StreamBuilder<CommunityAddgroupsModel>(
|
||||||
stream: searchcontroller.stream,
|
stream: searchcontroller.stream,
|
||||||
builder: (ctx, snapshot) {
|
builder: (ctx, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState ==
|
||||||
|
ConnectionState.waiting) {
|
||||||
return const Center(
|
return const Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -271,8 +306,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
groupWidget(
|
groupWidget(
|
||||||
index:
|
index: communityaddgroupobj!
|
||||||
communityaddgroupobj!.data[index].id!,
|
.data[index].id!,
|
||||||
imagePath: communityaddgroupobj!
|
imagePath: communityaddgroupobj!
|
||||||
.data[index].groupImage ??
|
.data[index].groupImage ??
|
||||||
'',
|
'',
|
||||||
@@ -284,7 +319,8 @@ class _AddGroupState extends State<AddGroup> {
|
|||||||
// isCheckedList[index],
|
// isCheckedList[index],
|
||||||
onCheckedChanged: (bool? value) {
|
onCheckedChanged: (bool? value) {
|
||||||
// isCheckedList[index] = value ?? false;
|
// isCheckedList[index] = value ?? false;
|
||||||
_onContainerTap(communityaddgroupobj!
|
_onContainerTap(
|
||||||
|
communityaddgroupobj!
|
||||||
.data[index].id!);
|
.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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return WillPopScope(
|
||||||
|
onWillPop: () async{
|
||||||
|
Get.back(result: true);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
child: GestureDetector(
|
||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
@@ -160,6 +165,7 @@ class _NewCommunityState extends State<NewCommunity> {
|
|||||||
resizeToAvoidBottomInset: true,
|
resizeToAvoidBottomInset: true,
|
||||||
appBar: CommonAppbar(
|
appBar: CommonAppbar(
|
||||||
titleTxt: "New community",
|
titleTxt: "New community",
|
||||||
|
customBack: true,
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -339,6 +345,7 @@ class _NewCommunityState extends State<NewCommunity> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
|
|
||||||
text16w400_FCFCFC("Community name*"),
|
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/CommonDatumObjModel.dart';
|
||||||
import 'package:regroup/Main_Screens/Community/Model/fetchicons.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/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/Main_Screens/Community_HomePage/view_model/CountersHelper.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.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/Utils/texts.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart';
|
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart';
|
||||||
|
import 'package:regroup/sidemenu/view_model/postmethod.dart';
|
||||||
|
|
||||||
var CommunityId;
|
var CommunityId;
|
||||||
int? ismute;
|
int? ismute;
|
||||||
|
var communitypinid;
|
||||||
|
|
||||||
class CommunityDetails extends StatefulWidget {
|
class CommunityDetails extends StatefulWidget {
|
||||||
const CommunityDetails({super.key});
|
const CommunityDetails({super.key});
|
||||||
@@ -33,6 +34,8 @@ class CommunityDetails extends StatefulWidget {
|
|||||||
class _CommunityDetailsState extends State<CommunityDetails> {
|
class _CommunityDetailsState extends State<CommunityDetails> {
|
||||||
var additionalContent = false.obs;
|
var additionalContent = false.obs;
|
||||||
|
|
||||||
|
bool? iscommunitypin = false;
|
||||||
|
|
||||||
late Future myfuture;
|
late Future myfuture;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -43,6 +46,32 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
|||||||
super.initState();
|
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 {
|
leaveCommunity() async {
|
||||||
utils.loader();
|
utils.loader();
|
||||||
Map<String, dynamic> updata = {};
|
Map<String, dynamic> updata = {};
|
||||||
@@ -184,14 +213,41 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
|||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
const PopupMenuDivider(),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
onTap: () async {
|
||||||
|
await pinunpinCommunity(
|
||||||
|
comdetailobj!.data!.id.toString());
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
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(),
|
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",
|
"assets/images/png/f7_pin-fill (2).png",
|
||||||
height: 25.h,
|
height: 25.h,
|
||||||
width: 25.w,
|
width: 25.w,
|
||||||
@@ -709,16 +765,16 @@ class _PostsTabState extends State<PostsTab> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isDataInitialized = true;
|
|
||||||
|
|
||||||
Future<void> setValues() async {
|
Future<void> setValues() async {
|
||||||
if (_isDataInitialized) {
|
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_setModel();
|
_setModel();
|
||||||
countersHelper.setListsPopular();
|
countersHelper.setListsPopular();
|
||||||
await _fetchIcons();
|
_fetchIcons();
|
||||||
|
});
|
||||||
|
//if (mounted) {
|
||||||
|
|
||||||
_isDataInitialized = false;
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sortTags(index) {
|
_sortTags(index) {
|
||||||
@@ -757,7 +813,6 @@ class _PostsTabState extends State<PostsTab> {
|
|||||||
likeIcon: LikeIcon1(
|
likeIcon: LikeIcon1(
|
||||||
likeIcon: LikeIconClass1(
|
likeIcon: LikeIconClass1(
|
||||||
id: e.likeIcon?.likeIcon?.id,
|
id: e.likeIcon?.likeIcon?.id,
|
||||||
// likeIcon?.id,
|
|
||||||
image: e.likeIcon?.likeIcon?.image),
|
image: e.likeIcon?.likeIcon?.image),
|
||||||
likeIconsXid: e.likeIcon?.likeIconsXid,
|
likeIconsXid: e.likeIcon?.likeIconsXid,
|
||||||
),
|
),
|
||||||
@@ -823,7 +878,7 @@ class _PostsTabState extends State<PostsTab> {
|
|||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
compostobj!.data.isEmpty
|
commonobjmodel!.data.isEmpty
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -851,7 +906,7 @@ class _PostsTabState extends State<PostsTab> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var timeAgo = ConvertServerDateToUserDate()
|
var timeAgo = ConvertServerDateToUserDate()
|
||||||
.convertServerDateToReadableFormate(
|
.convertServerDateToReadableFormate(
|
||||||
compostobj!.data[index].createdAt
|
commonobjmodel!.data[index].createdAt
|
||||||
.toString());
|
.toString());
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
@@ -864,7 +919,6 @@ class _PostsTabState extends State<PostsTab> {
|
|||||||
reactions: _reactions,
|
reactions: _reactions,
|
||||||
selectedReactions: _selectedReactions,
|
selectedReactions: _selectedReactions,
|
||||||
currentIndex: index,
|
currentIndex: index,
|
||||||
coachbool: true,
|
|
||||||
),
|
),
|
||||||
sizedBoxHeight(20.h)
|
sizedBoxHeight(20.h)
|
||||||
],
|
],
|
||||||
@@ -886,367 +940,3 @@ Widget eventstab() {
|
|||||||
children: [],
|
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/communityaddgroupsModel.dart';
|
||||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityeditpageModel.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/communitygroupsModel.dart';
|
||||||
|
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart';
|
||||||
|
|
||||||
CommunityAddgroupsModel? communityaddgroupobj;
|
CommunityAddgroupsModel? communityaddgroupobj;
|
||||||
CommunitygroupsModel? communitygroupspobj;
|
CommunitygroupsModel? communitygroupspobj;
|
||||||
CommunityMembersModel? communitymembersobj;
|
CommunityMembersModel? communitymembersobj;
|
||||||
CommunityinfopageEditModel? communityeditobj;
|
CommunityinfopageEditModel? communityeditobj;
|
||||||
|
CommunityManageGroupsModel? communitymanagegroupsobj;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Getcommunity {
|
class Getcommunity {
|
||||||
|
|
||||||
Future<ResponseData<dynamic>> getCommunityAddGroupsearch(updata,
|
Future<ResponseData<dynamic>> getCommunityAddGroupsearch(updata,community,
|
||||||
{required StreamController<CommunityAddgroupsModel> streamController}) async {
|
{required StreamController<CommunityAddgroupsModel> streamController}) async {
|
||||||
final response =
|
final response =
|
||||||
await NetworkApiServices().getApi(
|
await NetworkApiServices().getApi(
|
||||||
"${ApiUrls.getcommunityaddgroups}?search=$updata",
|
"${ApiUrls.getcommunityaddgroups}?manage_community_xid=$community&search=$updata",
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -73,4 +75,19 @@ class Getcommunity {
|
|||||||
return response;
|
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}");
|
print("response message is ${response.message}");
|
||||||
return response;
|
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