Merge pull request #122 from WDI-Ideas/PriyankaH
requested and invited api done.
This commit is contained in:
BIN
assets/images/png/Vector 8.png
Normal file
BIN
assets/images/png/Vector 8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 360 B |
@@ -185,7 +185,8 @@ Future<TimeOfDay?> showCustomTimePicker(BuildContext context,
|
||||
onSurface: Colors.white,
|
||||
),
|
||||
textTheme: Theme.of(context).textTheme.copyWith(
|
||||
titleLarge: const TextStyle(color: Colors.blue), // Change the title color
|
||||
titleLarge:
|
||||
const TextStyle(color: Colors.blue), // Change the title color
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
@@ -247,7 +248,8 @@ Widget stackContainers({
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: const Color(0xFF2C3742), width: 1),
|
||||
border: Border.all(
|
||||
color: const Color(0xFF2C3742), width: 1),
|
||||
),
|
||||
child: CircleAvatar(
|
||||
foregroundImage: AssetImage(containerImages[index]),
|
||||
@@ -280,27 +282,34 @@ Widget stackContainersGroups({
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: const Color(0xFFD90B2E),
|
||||
border: Border.all(color: const Color(0xFF2C3742), width: 1),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
remainingCount > 0 ? '+$remainingCount' : '',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 8,
|
||||
containerImages.length > maxImagesToShow
|
||||
? Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: const Color(0xFFD90B2E),
|
||||
border:
|
||||
Border.all(color: const Color(0xFF2C3742), width: 1),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
// remainingCount > 0 ? '+$remainingCount' : '',
|
||||
number,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 8,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 22.w,
|
||||
left: containerImages.length > maxImagesToShow ? 22.w : 0.w,
|
||||
child: SizedBox(
|
||||
height: 30,
|
||||
width: 30 * maxImagesToShow.toDouble(),
|
||||
@@ -314,7 +323,8 @@ Widget stackContainersGroups({
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: const Color(0xFF2C3742), width: 1),
|
||||
border: Border.all(
|
||||
color: const Color(0xFF2C3742), width: 1),
|
||||
),
|
||||
child: CircleAvatar(
|
||||
backgroundImage: NetworkImage(imagesToShow[index]),
|
||||
@@ -395,7 +405,8 @@ Widget stackReaction({
|
||||
1,
|
||||
],
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF1E3A46), width: 1.71)),
|
||||
border: Border.all(
|
||||
color: const Color(0xFF1E3A46), width: 1.71)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
containerImages[index],
|
||||
|
||||
@@ -84,6 +84,20 @@ class ApiUrls {
|
||||
|
||||
static const getmyjoinedgroups = "${baseUrl}my-joined-groups";
|
||||
|
||||
static const getmycommunity = "${baseUrl}fetch-my-communities";
|
||||
|
||||
static const getrequestedcommunity =
|
||||
"${baseUrl}fetch-joining-request-for-community";
|
||||
|
||||
static const getInvitecommunity = "${baseUrl}fetch-all-invite";
|
||||
|
||||
static const postcancelrequest = "${baseUrl}cancel-request-of-community";
|
||||
|
||||
static const postacceptinvite = "${baseUrl}accept-invite-to-join-community";
|
||||
|
||||
static const postrejectinvite = "${baseUrl}reject-invite-to-join-community";
|
||||
|
||||
|
||||
static const getusercertificates = "${baseUrl}my-certificates";
|
||||
|
||||
static const postnotification = "${baseUrl}update-notification-settings";
|
||||
@@ -128,7 +142,6 @@ class ApiUrls {
|
||||
|
||||
static const postusertag = "${baseUrl}pin-unpin";
|
||||
|
||||
|
||||
//comments
|
||||
static const getComments = "${baseUrl}fetch-comment-with-replied-comment";
|
||||
static const storeComments = "${baseUrl}store-comment";
|
||||
@@ -136,7 +149,7 @@ class ApiUrls {
|
||||
static const deleteComments = "${baseUrl}delete-comment";
|
||||
static const deleteRepliesComments = "${baseUrl}delete-reply-on-comment";
|
||||
|
||||
static const getLikeicons= "${baseUrl}fetch-like-icons";
|
||||
static const getLikeicons = "${baseUrl}fetch-like-icons";
|
||||
|
||||
static const postLike = "${baseUrl}like-post";
|
||||
|
||||
@@ -145,8 +158,6 @@ class ApiUrls {
|
||||
static const postusersave = "${baseUrl}save-post";
|
||||
static const getpostdetail = "${baseUrl}fetch-single-post";
|
||||
|
||||
|
||||
|
||||
static const getpopularTagsdetails = "${baseUrl}fetch-popular-post";
|
||||
|
||||
static const postcreatecommunity = "${baseUrl}create-community";
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:get/get.dart';
|
||||
import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart';
|
||||
import 'package:regroup/Main_Screens/Community/Model/FeedPostModel.dart';
|
||||
import 'package:regroup/Main_Screens/Community/ViewModel/LatestPost.dart';
|
||||
import 'package:regroup/Main_Screens/Community/ViewModel/PopularPost.dart';
|
||||
|
||||
List<PinnedPost> combinedListGlobal = [];
|
||||
CommonDatumObjModel? commonobjmodel;
|
||||
|
||||
@@ -428,6 +428,7 @@ Widget text10400white(String text) {
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text9400white(String text) {
|
||||
return Text(
|
||||
text,
|
||||
@@ -473,6 +474,20 @@ Widget text16w700_FCFCFC(String text, {TextAlign? textAlign}) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16w700_FCFCFC_line(String text, {TextAlign? textAlign}) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w700),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16w700_D90B2E(String text, {TextDecoration? decoration}) {
|
||||
return Text(
|
||||
text,
|
||||
@@ -485,6 +500,7 @@ Widget text16w700_D90B2E(String text, {TextDecoration? decoration}) {
|
||||
fontWeight: FontWeight.w700),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text14w400_D90B2E(String text, {TextDecoration? decoration}) {
|
||||
return Text(
|
||||
text,
|
||||
@@ -567,6 +583,7 @@ Widget text12w400_FCFCFC(String text) {
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text12w400_8E8E8E(String text) {
|
||||
return Text(
|
||||
text,
|
||||
@@ -724,6 +741,18 @@ Widget text14w400_FCFCFC(String text, {TextAlign? textAlign}) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text13w400_FCFCFC(String text, {TextAlign? textAlign}) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text14w400_FCFCFCblur(String text) {
|
||||
return Text(
|
||||
text,
|
||||
|
||||
@@ -38,6 +38,8 @@ class RouteName {
|
||||
static const String communityInfo = '/communityInfo';
|
||||
static const String announcement = '/announcement';
|
||||
static const String watchlist = '/watchlist';
|
||||
static const String requestscreen = '/requestscreen';
|
||||
|
||||
|
||||
static const String group = '/group';
|
||||
static const String communitysetting = '/communitysetting';
|
||||
|
||||
@@ -75,6 +75,7 @@ import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart';
|
||||
import 'package:regroup/sidemenu/Community/Watchlist.dart';
|
||||
|
||||
import 'package:regroup/Login/View/loginscreen.dart';
|
||||
@@ -536,5 +537,10 @@ class AppRoutes {
|
||||
name: RouteName.viewalluserspinned,
|
||||
page: () => const Viewtusertags(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.requestscreen,
|
||||
page: () => const RequestsScreen(),
|
||||
),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -19,6 +19,15 @@ class CommunityDetails extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
bool? additionalContent = false;
|
||||
var CommunityId;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
CommunityId = Get.arguments["CommunityID"];
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -213,7 +222,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius: BorderRadius.circular( 100),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
@@ -227,75 +236,147 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
text16w400_FCFCFCblur("Public"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 51.h,
|
||||
borderRadius: BorderRadius.circular( 10.r),
|
||||
customWidget: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(90.w),
|
||||
text16w400_white('7 members'),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
sizedBoxWidth(16.w),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
borderwidth: 1.w),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addgroup);
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 51.h,
|
||||
borderRadius: BorderRadius.circular( 10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(children: [
|
||||
Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 23.h,
|
||||
width: 31.w,
|
||||
),
|
||||
sizedBoxWidth(15.w),
|
||||
text16w400white('10 groups'),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text13w400_FCFCFC("Show Details"),
|
||||
sizedBoxWidth(4.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
additionalContent = !additionalContent!;
|
||||
setState(() {});
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector 8.png",
|
||||
height: 8.h,
|
||||
width: 20.w,
|
||||
),
|
||||
borderwidth: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
if (additionalContent == true)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("About community"),
|
||||
sizedBoxHeight(16.h),
|
||||
text14w400_FCFCFCblur(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 17.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white("Elm street london, United Kingdom")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/puzzle-pieces 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 16.w,
|
||||
),
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white("Sports")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 51.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(90.w),
|
||||
text16w400_white('7 members'),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
sizedBoxWidth(16.w),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
borderwidth: 1.w),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addgroup);
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 51.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(children: [
|
||||
Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 23.h,
|
||||
width: 31.w,
|
||||
),
|
||||
sizedBoxWidth(15.w),
|
||||
text16w400white('10 groups'),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
borderwidth: 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.announcement);
|
||||
@@ -303,7 +384,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 51.h,
|
||||
borderRadius: BorderRadius.circular( 10.r),
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
@@ -604,7 +685,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
height: 30.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
borderRadius: BorderRadius.circular( 100),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
@@ -620,7 +701,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
borderwidth: 0.43,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular( 100),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
customWidget: Center(
|
||||
@@ -757,7 +838,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
borderwidth: 1,
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular( 30.r),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
borderColor: Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
@@ -8,6 +10,7 @@ import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/view_model/getMyCommunity.dart';
|
||||
|
||||
class MyCommunity extends StatefulWidget {
|
||||
const MyCommunity({super.key});
|
||||
@@ -57,96 +60,452 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
}
|
||||
}
|
||||
|
||||
late Future myfuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
myfuture = MyCommunityAPI().getMyCommunity();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "My Communities",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newcommunity);
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
shape: BoxShape.circle),
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "My Communities",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newcommunity);
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
shape: BoxShape.circle),
|
||||
child: const Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Frame 9.png",
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Frame 9.png",
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC("Joined communities"),
|
||||
sizedBoxHeight(15.h),
|
||||
Column(
|
||||
children:
|
||||
List.generate(JoinedcommunityData.length, (index) {
|
||||
return communityCard(
|
||||
ontap: () {
|
||||
Get.toNamed(RouteName.communityDetails);
|
||||
},
|
||||
imagepath: JoinedcommunityData[index]
|
||||
['imagePath'],
|
||||
title: JoinedcommunityData[index]['text'],
|
||||
members: JoinedcommunityData[index]['members'],
|
||||
index: JoinedcommunityData[index]['index']);
|
||||
}),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return myCommunityobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.requestscreen);
|
||||
},
|
||||
child: text16w700_FCFCFC_line("Requests"))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const ScrollPhysics(),
|
||||
itemCount: myCommunityobj!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
var joinnedComData = myCommunityobj!.data[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communityDetails, arguments: {"CommunityID" : joinnedComData.manageCommunityXid});
|
||||
},
|
||||
child: commonGlassUI(
|
||||
borderwidth: 0.9,
|
||||
width: double.infinity,
|
||||
height: 172.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
joinnedComData.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto!
|
||||
.isEmpty
|
||||
? const CircleAvatar(
|
||||
backgroundImage:
|
||||
AssetImage(
|
||||
'assets/images/png/img45.png',
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto!),
|
||||
)),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Container(
|
||||
// // width: 250.w,
|
||||
// // color: Colors.red,
|
||||
// width: double.infinity,
|
||||
// child:
|
||||
joinnedComData.joinedAndRequestedCommunity!
|
||||
.communityName ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityName!
|
||||
.isEmpty
|
||||
? text18w700_FCFCFC('Regroup')
|
||||
: SizedBox(
|
||||
width: 200.w,
|
||||
child: text18w700_FCFCFC(
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityName!),
|
||||
),
|
||||
// ),
|
||||
sizedBoxHeight(10.h),
|
||||
joinnedComData.totalCommunityMember ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.totalCommunityMember!
|
||||
.toString()
|
||||
.isEmpty
|
||||
? const SizedBox()
|
||||
: sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
commonGlassUI(
|
||||
borderwidth: 0.9,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
100.r),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 12.h,
|
||||
width: 16.w,
|
||||
),
|
||||
)),
|
||||
// Positioned(
|
||||
// top: 0,
|
||||
// right: -4,
|
||||
// child: Container(
|
||||
// height: 12.h,
|
||||
// width: 12.w,
|
||||
// decoration:
|
||||
// const BoxDecoration(
|
||||
// shape:
|
||||
// BoxShape.circle,
|
||||
// color: Color(
|
||||
// 0xFFD90B2E),
|
||||
// ),
|
||||
// child: Center(
|
||||
// child:
|
||||
// text6400white(
|
||||
// "2")
|
||||
|
||||
// ),))
|
||||
]),
|
||||
sizedBoxWidth(15.w),
|
||||
text14w400_FCFCFCblur(
|
||||
"${joinnedComData.joinedAndRequestedCommunity!.totalGroup ?? ''} groups"),
|
||||
sizedBoxWidth(50.w),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
toggleSelectedIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
height: 21.h,
|
||||
width: 57.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
50.r),
|
||||
gradient:
|
||||
const LinearGradient(
|
||||
begin:
|
||||
Alignment.centerLeft,
|
||||
end:
|
||||
Alignment.centerRight,
|
||||
colors: [
|
||||
Color.fromRGBO(255, 255,
|
||||
255, 0.06),
|
||||
Color.fromRGBO(255, 255,
|
||||
255, 0.08),
|
||||
],
|
||||
stops: [-0.0497, 1.0238],
|
||||
// converting degrees to radians
|
||||
),
|
||||
border: Border.all(
|
||||
color: const Color(
|
||||
0xFF434A53),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text10400white(
|
||||
"Owner")),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 200.w),
|
||||
offset: const Offset(0, 30),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(
|
||||
"Mute group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(
|
||||
"Pin group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 27.h,
|
||||
width: 27.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(
|
||||
"Make primary"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/leave group.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
// text14w400_FCFCFC("Leave group"),
|
||||
text14w400_D90B2E(
|
||||
"Leave group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/LightGray22.png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 18.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
stackContainersGroups(
|
||||
number:
|
||||
" +${joinnedComData.totalCommunityMember! - 3}",
|
||||
containerImages: joinnedComData
|
||||
.fourMemberImages!
|
||||
.map((photo) => photo
|
||||
.iamPrincipal!.profilePhoto!)
|
||||
.toList(),
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
joinnedComData.totalCommunityMember ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.totalCommunityMember.isBlank!
|
||||
? const SizedBox()
|
||||
: text16w400_FCFCFC_blur(
|
||||
'${joinnedComData.totalCommunityMember} members',
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
text18w700_FCFCFC("Requested communities"),
|
||||
sizedBoxHeight(20.h),
|
||||
Column(
|
||||
children:
|
||||
List.generate(RequestcommunityData.length, (index) {
|
||||
return communityCard(
|
||||
ontap: () {},
|
||||
imagepath: RequestcommunityData[index]
|
||||
['imagePath'],
|
||||
title: RequestcommunityData[index]['text'],
|
||||
members: RequestcommunityData[index]['members'],
|
||||
index: RequestcommunityData[index]['index']);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
))
|
||||
]));
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
]);
|
||||
}
|
||||
|
||||
Widget communityCard({
|
||||
@@ -175,7 +534,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
@@ -218,7 +577,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Container(
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
@@ -231,12 +590,12 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
surfaceTintColor: const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 200.w),
|
||||
offset: Offset(0, 30),
|
||||
color: Color(0xFF222935),
|
||||
offset: const Offset(0, 30),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
@@ -248,7 +607,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Mute community"),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
@@ -258,7 +617,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
@@ -267,7 +626,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Hide post"),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/mingcute_eye-close-line.png",
|
||||
height: 20.h,
|
||||
@@ -277,7 +636,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
@@ -286,7 +645,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Pin"),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 25.h,
|
||||
@@ -296,7 +655,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
@@ -305,7 +664,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Leave community"),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/logout 1 (traced).png",
|
||||
height: 18.h,
|
||||
@@ -340,7 +699,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Obx(() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
@@ -355,12 +714,13 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
color:
|
||||
selectedContainerIndices.contains(index)
|
||||
? null
|
||||
: Color(0xFFD90B2E),
|
||||
: const Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(30.r),
|
||||
),
|
||||
border: Border.all(
|
||||
color: Color(0xFFD90B2E), width: 1.w)),
|
||||
color: const Color(0xFFD90B2E),
|
||||
width: 1.w)),
|
||||
child: Center(
|
||||
child:
|
||||
selectedContainerIndices.contains(index)
|
||||
|
||||
1060
lib/sidemenu/Community/MyCommunity/View/RequestsScreen.dart
Normal file
1060
lib/sidemenu/Community/MyCommunity/View/RequestsScreen.dart
Normal file
File diff suppressed because it is too large
Load Diff
92
lib/sidemenu/Model/InviteComModel.dart
Normal file
92
lib/sidemenu/Model/InviteComModel.dart
Normal file
@@ -0,0 +1,92 @@
|
||||
class InviteComModel {
|
||||
InviteComModel({
|
||||
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 InviteComModel.fromJson(Map<String, dynamic> json){
|
||||
return InviteComModel(
|
||||
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.senderIamXid,
|
||||
required this.communityXid,
|
||||
required this.receiverIamXid,
|
||||
required this.isAccepted,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
required this.deletedAt,
|
||||
required this.community,
|
||||
required this.senderDetail,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? senderIamXid;
|
||||
final int? communityXid;
|
||||
final int? receiverIamXid;
|
||||
final int? isAccepted;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
final dynamic deletedAt;
|
||||
final dynamic community;
|
||||
final SenderDetail? senderDetail;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json){
|
||||
return Datum(
|
||||
id: json["id"],
|
||||
senderIamXid: json["sender_iam_xid"],
|
||||
communityXid: json["community_xid"],
|
||||
receiverIamXid: json["receiver_iam_xid"],
|
||||
isAccepted: json["is_accepted"],
|
||||
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
|
||||
updatedAt: DateTime.tryParse(json["updated_at"] ?? ""),
|
||||
deletedAt: json["deleted_at"],
|
||||
community: json["community"],
|
||||
senderDetail: json["sender_detail"] == null ? null : SenderDetail.fromJson(json["sender_detail"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SenderDetail {
|
||||
SenderDetail({
|
||||
required this.id,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? userName;
|
||||
final String? fullName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory SenderDetail.fromJson(Map<String, dynamic> json){
|
||||
return SenderDetail(
|
||||
id: json["id"],
|
||||
userName: json["user_name"],
|
||||
fullName: json["full_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
152
lib/sidemenu/Model/MyCommunityModel.dart
Normal file
152
lib/sidemenu/Model/MyCommunityModel.dart
Normal file
@@ -0,0 +1,152 @@
|
||||
class MyCommunityModel {
|
||||
MyCommunityModel({
|
||||
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 MyCommunityModel.fromJson(Map<String, dynamic> json){
|
||||
return MyCommunityModel(
|
||||
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.totalCommunityMember,
|
||||
required this.fourMemberImages,
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.joinedAt,
|
||||
required this.userTypeXid,
|
||||
required this.joinedAndRequestedCommunity,
|
||||
});
|
||||
|
||||
final int? totalCommunityMember;
|
||||
final List<FourMemberImage> fourMemberImages;
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final DateTime? joinedAt;
|
||||
final UserTypeXid? userTypeXid;
|
||||
final JoinedAndRequestedCommunity? joinedAndRequestedCommunity;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json){
|
||||
return Datum(
|
||||
totalCommunityMember: json["total_community_member"],
|
||||
fourMemberImages: json["four_member_images"] == null ? [] : List<FourMemberImage>.from(json["four_member_images"]!.map((x) => FourMemberImage.fromJson(x))),
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
joinedAt: DateTime.tryParse(json["joined_at"] ?? ""),
|
||||
userTypeXid: json["user_type_xid"] == null ? null : UserTypeXid.fromJson(json["user_type_xid"]),
|
||||
joinedAndRequestedCommunity: json["joined_and_requested_community"] == null ? null : JoinedAndRequestedCommunity.fromJson(json["joined_and_requested_community"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FourMemberImage {
|
||||
FourMemberImage({
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.iamPrincipal,
|
||||
});
|
||||
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final IamPrincipal? iamPrincipal;
|
||||
|
||||
factory FourMemberImage.fromJson(Map<String, dynamic> json){
|
||||
return FourMemberImage(
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class IamPrincipal {
|
||||
IamPrincipal({
|
||||
required this.id,
|
||||
required this.principalTypeXid,
|
||||
required this.userName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory IamPrincipal.fromJson(Map<String, dynamic> json){
|
||||
return IamPrincipal(
|
||||
id: json["id"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JoinedAndRequestedCommunity {
|
||||
JoinedAndRequestedCommunity({
|
||||
required this.id,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityBannerImage;
|
||||
final String? communityName;
|
||||
final int? totalGroup;
|
||||
final int? totalAnnouncements;
|
||||
|
||||
factory JoinedAndRequestedCommunity.fromJson(Map<String, dynamic> json){
|
||||
return JoinedAndRequestedCommunity(
|
||||
id: json["id"],
|
||||
communityProfilePhoto: json["community_profile_photo"],
|
||||
communityBannerImage: json["community_banner_image"],
|
||||
communityName: json["community_name"],
|
||||
totalGroup: json["total_group"],
|
||||
totalAnnouncements: json["total_announcements"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class UserTypeXid {
|
||||
UserTypeXid({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? name;
|
||||
|
||||
factory UserTypeXid.fromJson(Map<String, dynamic> json){
|
||||
return UserTypeXid(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
137
lib/sidemenu/Model/RequestedComModel.dart
Normal file
137
lib/sidemenu/Model/RequestedComModel.dart
Normal file
@@ -0,0 +1,137 @@
|
||||
class RequestedComModel {
|
||||
RequestedComModel({
|
||||
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 RequestedComModel.fromJson(Map<String, dynamic> json){
|
||||
return RequestedComModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
message: json["message"],
|
||||
data: json["data"] == null ? [] : List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Datum {
|
||||
Datum({
|
||||
required this.id,
|
||||
required this.iamPrincipalXid,
|
||||
required this.fourMemberImages,
|
||||
required this.totalCommunityMember,
|
||||
required this.manageCommunityXid,
|
||||
required this.joinedAt,
|
||||
required this.isRequested,
|
||||
required this.joinedAndRequestedCommunity,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? iamPrincipalXid;
|
||||
final List<FourMemberImage> fourMemberImages;
|
||||
final int? totalCommunityMember;
|
||||
final int? manageCommunityXid;
|
||||
final DateTime? joinedAt;
|
||||
final int? isRequested;
|
||||
final JoinedAndRequestedCommunity? joinedAndRequestedCommunity;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json){
|
||||
return Datum(
|
||||
id: json["id"],
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
fourMemberImages: json["four_member_images"] == null ? [] : List<FourMemberImage>.from(json["four_member_images"]!.map((x) => FourMemberImage.fromJson(x))),
|
||||
totalCommunityMember: json["total_community_member"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
joinedAt: DateTime.tryParse(json["joined_at"] ?? ""),
|
||||
isRequested: json["is_requested"],
|
||||
joinedAndRequestedCommunity: json["joined_and_requested_community"] == null ? null : JoinedAndRequestedCommunity.fromJson(json["joined_and_requested_community"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FourMemberImage {
|
||||
FourMemberImage({
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.iamPrincipal,
|
||||
});
|
||||
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final IamPrincipal? iamPrincipal;
|
||||
|
||||
factory FourMemberImage.fromJson(Map<String, dynamic> json){
|
||||
return FourMemberImage(
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class IamPrincipal {
|
||||
IamPrincipal({
|
||||
required this.id,
|
||||
required this.principalTypeXid,
|
||||
required this.userName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory IamPrincipal.fromJson(Map<String, dynamic> json){
|
||||
return IamPrincipal(
|
||||
id: json["id"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JoinedAndRequestedCommunity {
|
||||
JoinedAndRequestedCommunity({
|
||||
required this.id,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityBannerImage;
|
||||
final String? communityName;
|
||||
final int? totalGroup;
|
||||
final int? totalAnnouncements;
|
||||
|
||||
factory JoinedAndRequestedCommunity.fromJson(Map<String, dynamic> json){
|
||||
return JoinedAndRequestedCommunity(
|
||||
id: json["id"],
|
||||
communityProfilePhoto: json["community_profile_photo"],
|
||||
communityBannerImage: json["community_banner_image"],
|
||||
communityName: json["community_name"],
|
||||
totalGroup: json["total_group"],
|
||||
totalAnnouncements: json["total_announcements"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
108
lib/sidemenu/view_model/getMyCommunity.dart
Normal file
108
lib/sidemenu/view_model/getMyCommunity.dart
Normal file
@@ -0,0 +1,108 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:regroup/Common/api_urls.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
import 'package:regroup/sidemenu/Model/InviteComModel.dart';
|
||||
import 'package:regroup/sidemenu/Model/MyCommunityModel.dart';
|
||||
import 'package:regroup/sidemenu/Model/RequestedComModel.dart';
|
||||
|
||||
MyCommunityModel? myCommunityobj;
|
||||
RequestedComModel ? requestedComobj;
|
||||
InviteComModel ? inviteComobj;
|
||||
|
||||
|
||||
class MyCommunityAPI {
|
||||
|
||||
Future<ResponseData<dynamic>> getMyCommunity() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getmycommunity,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
myCommunityobj = MyCommunityModel.fromJson(response.data);
|
||||
log(myCommunityobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getRequestedCommunity() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getrequestedcommunity,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
requestedComobj = RequestedComModel.fromJson(response.data);
|
||||
log(requestedComobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getInviteCommunity() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getInvitecommunity,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
inviteComobj = InviteComModel.fromJson(response.data);
|
||||
log(inviteComobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> postcancelRequest(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postcancelrequest,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
// likepostobj = LikepostModel.fromJson(response.data);
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postAcceptInvite(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postacceptinvite,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
// likepostobj = LikepostModel.fromJson(response.data);
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postRejectInvite(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postrejectinvite,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
// likepostobj = LikepostModel.fromJson(response.data);
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user