mute api and manage interest done
This commit is contained in:
BIN
assets/images/png/downarrow.png
Normal file
BIN
assets/images/png/downarrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 450 B |
BIN
assets/images/png/uparrow.png
Normal file
BIN
assets/images/png/uparrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 413 B |
@@ -92,6 +92,9 @@ class ApiUrls {
|
||||
|
||||
static const postleavecommunity = "${baseUrl}leave-community";
|
||||
|
||||
static const postmutenotification = "${baseUrl}mute-unmute-community";
|
||||
|
||||
|
||||
|
||||
|
||||
static const getrequestedcommunity =
|
||||
@@ -101,6 +104,12 @@ class ApiUrls {
|
||||
|
||||
static const postnewinterest = "${baseUrl}store-tags";
|
||||
|
||||
static const postacceptreject = "${baseUrl}accept-reject-tag";
|
||||
|
||||
|
||||
static const getinterests = "${baseUrl}list-of-tags-and-requested-tags";
|
||||
|
||||
|
||||
static const postcancelrequest = "${baseUrl}cancel-request-of-community";
|
||||
|
||||
static const postacceptinvite = "${baseUrl}accept-invite-to-join-community";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:async/src/future_group.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -29,9 +29,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
|
||||
@@ -346,9 +346,6 @@ Widget text18w400white(String text, {TextAlign? textAlign}) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Widget text14w400white(String text, {TextAlign? textAlign}) {
|
||||
return Text(
|
||||
text,
|
||||
@@ -410,6 +407,20 @@ Widget text16w400_FCFCFC(String text, {TextAlign? textAlign}) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16w700_FCFCFCItalic(String text, {TextAlign? textAlign}) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16w400_FF0000(String text) {
|
||||
return Text(
|
||||
text,
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
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:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.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/ShimmerCommon.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ViewModel/maanageInterestApi.dart';
|
||||
|
||||
var communityid;
|
||||
|
||||
class ManageTags extends StatefulWidget {
|
||||
const ManageTags({super.key});
|
||||
@@ -19,15 +27,14 @@ class ManageTags extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ManageTagsState extends State<ManageTags> {
|
||||
int communityid = Get.arguments['communityid'];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
communityid = Get.arguments['communityid'];
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Manage interest",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
@@ -45,7 +52,7 @@ class _ManageTagsState extends State<ManageTags> {
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
CommonTabBar(tabs: const [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Interest',
|
||||
),
|
||||
@@ -55,10 +62,10 @@ class _ManageTagsState extends State<ManageTags> {
|
||||
]),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
child: const TabBarView(
|
||||
children: [
|
||||
tagsTab(),
|
||||
tagrequestsrTab(),
|
||||
InterestTab(),
|
||||
TagRequestTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -69,7 +76,7 @@ class _ManageTagsState extends State<ManageTags> {
|
||||
floatingActionButton: Container(
|
||||
height: 55.h,
|
||||
width: 55.w,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -85,9 +92,9 @@ class _ManageTagsState extends State<ManageTags> {
|
||||
'communityid': communityid,
|
||||
});
|
||||
},
|
||||
backgroundColor: Color(0xFFD90B2E),
|
||||
backgroundColor: const Color(0xFFD90B2E),
|
||||
autofocus: true,
|
||||
shape: CircleBorder(),
|
||||
shape: const CircleBorder(),
|
||||
child: Image.asset(
|
||||
"assets/images/png/iconamoon_edit-thin.png",
|
||||
height: 30.h,
|
||||
@@ -98,31 +105,149 @@ class _ManageTagsState extends State<ManageTags> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget tagsTab() {
|
||||
class InterestTab extends StatefulWidget {
|
||||
const InterestTab({super.key});
|
||||
|
||||
@override
|
||||
State<InterestTab> createState() => _InterestTabState();
|
||||
}
|
||||
|
||||
class _InterestTabState extends State<InterestTab> {
|
||||
List tags = ['Cycle', 'Sports', 'Fitness', 'Kayaking', 'Sports club'];
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text16400white("Special Announcement Interest"),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: tags.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagsTile(text: tags[index]),
|
||||
if (index != tags.length - 1) commonDivider()
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
late Future interestfuture;
|
||||
@override
|
||||
void initState() {
|
||||
communityid = Get.arguments['communityid'];
|
||||
interestfuture = ManageInterestApi().getInterests(communityid);
|
||||
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
future: interestfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text16400white("Special Announcement Interest"),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Expanded(
|
||||
child: fetchinterestobj!.data!.acceptedTags.isEmpty ||
|
||||
fetchinterestobj!.data!.acceptedTags
|
||||
.every((tag) => tag.isSpecial != 0)
|
||||
? Center(
|
||||
child: Text(
|
||||
"No announcement interest found", // Updated message
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
fetchinterestobj!.data!.acceptedTags.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (fetchinterestobj!
|
||||
.data!.acceptedTags[index].isSpecial ==
|
||||
0) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagsTile(
|
||||
text: fetchinterestobj!
|
||||
.data!.acceptedTags[index].name ??
|
||||
''),
|
||||
if (index !=
|
||||
fetchinterestobj!.data!.acceptedTags
|
||||
.where(
|
||||
(tag) => tag.isSpecial == 0)
|
||||
.toList()
|
||||
.length -
|
||||
1)
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
}
|
||||
return const SizedBox
|
||||
.shrink(); // Skip rendering if isSpecial is not 0
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text16400white("Standard interest"),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Expanded(
|
||||
child: fetchinterestobj!.data!.acceptedTags.isEmpty ||
|
||||
fetchinterestobj!.data!.acceptedTags
|
||||
.every((tag) => tag.isSpecial != 1 && tag != 1)
|
||||
? Center(
|
||||
child: Text(
|
||||
"No standard interest found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
fetchinterestobj!.data!.acceptedTags.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (fetchinterestobj!
|
||||
.data!.acceptedTags[index].isSpecial ==
|
||||
1) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagsTile(
|
||||
text: fetchinterestobj!
|
||||
.data!.acceptedTags[index].name ??
|
||||
''),
|
||||
if (index !=
|
||||
fetchinterestobj!
|
||||
.data!.acceptedTags.length -
|
||||
1)
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
}
|
||||
return const SizedBox
|
||||
.shrink(); // Return an empty widget if the condition is not met
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget rowTagsTile({
|
||||
@@ -131,8 +256,8 @@ Widget rowTagsTile({
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 18.h),
|
||||
child: Row(children: [
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
text16w700_FCFCFCItalic(text),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
width: 5.w,
|
||||
@@ -142,29 +267,205 @@ Widget rowTagsTile({
|
||||
);
|
||||
}
|
||||
|
||||
Widget tagrequestsrTab() {
|
||||
class TagRequestTab extends StatefulWidget {
|
||||
const TagRequestTab({super.key});
|
||||
|
||||
@override
|
||||
State<TagRequestTab> createState() => _TagRequestTabState();
|
||||
}
|
||||
|
||||
class _TagRequestTabState extends State<TagRequestTab> {
|
||||
late Future taginterestfuture;
|
||||
|
||||
List tagrequest = [
|
||||
'Running',
|
||||
'Fit fam friday',
|
||||
];
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: tagrequest.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagRequestTile(title: tagrequest[index]),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
communityid = Get.arguments['communityid'];
|
||||
taginterestfuture = ManageInterestApi().getInterests(communityid);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
future: taginterestfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
return fetchinterestobj!.data!.requestedTags.isEmpty
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"No Posts Available",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
: Column(
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
fetchinterestobj!.data!.requestedTags.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 60.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.w),
|
||||
child: Row(children: [
|
||||
text16w700_FCFCFC(fetchinterestobj!
|
||||
.data!
|
||||
.requestedTags[index]
|
||||
.name ??
|
||||
""),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Map<String, dynamic> updata = {
|
||||
"tag_xid": fetchinterestobj!
|
||||
.data!
|
||||
.requestedTags[index]
|
||||
.id,
|
||||
"is_accepted": "0",
|
||||
};
|
||||
final data =
|
||||
await ManageInterestApi()
|
||||
.postAcceptReject(updata);
|
||||
if (data.status ==
|
||||
ResponseStatus.SUCCESS) {
|
||||
print("success");
|
||||
setState(() {
|
||||
fetchinterestobj!
|
||||
.data!.requestedTags
|
||||
.removeAt(index);
|
||||
});
|
||||
return utils
|
||||
.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("Failed");
|
||||
return utils
|
||||
.showToast(data.message);
|
||||
}
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderRadius:
|
||||
BorderRadius.circular(100),
|
||||
customWidget: const Center(
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
weight: 1,
|
||||
)),
|
||||
borderwidth: 0.5),
|
||||
),
|
||||
sizedBoxWidth(16.w),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Map<String, dynamic> updata = {
|
||||
"tag_xid": fetchinterestobj!
|
||||
.data!
|
||||
.requestedTags[index]
|
||||
.id,
|
||||
"is_accepted": "1",
|
||||
};
|
||||
final data =
|
||||
await ManageInterestApi()
|
||||
.postAcceptReject(updata);
|
||||
if (data.status ==
|
||||
ResponseStatus.SUCCESS) {
|
||||
print("success");
|
||||
setState(() {
|
||||
fetchinterestobj!
|
||||
.data!.requestedTags
|
||||
.removeAt(index);
|
||||
});
|
||||
return utils
|
||||
.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("Failed");
|
||||
return utils
|
||||
.showToast(data.message);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
weight: 1,
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget rowTagRequestTile({
|
||||
@@ -181,14 +482,14 @@ Widget rowTagRequestTile({
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(children: [
|
||||
text16w700_FCFCFC(title),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
customWidget: const Center(
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
@@ -200,11 +501,11 @@ Widget rowTagRequestTile({
|
||||
Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
class FetchInterestModel {
|
||||
FetchInterestModel({
|
||||
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 FetchInterestModel.fromJson(Map<String, dynamic> json){
|
||||
return FetchInterestModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
message: json["message"],
|
||||
data: json["data"] == null ? null : Data.fromJson(json["data"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Data {
|
||||
Data({
|
||||
required this.acceptedTags,
|
||||
required this.requestedTags,
|
||||
});
|
||||
|
||||
final List<TedTag> acceptedTags;
|
||||
final List<TedTag> requestedTags;
|
||||
|
||||
factory Data.fromJson(Map<String, dynamic> json){
|
||||
return Data(
|
||||
acceptedTags: json["accepted_tags"] == null ? [] : List<TedTag>.from(json["accepted_tags"]!.map((x) => TedTag.fromJson(x))),
|
||||
requestedTags: json["requested_tags"] == null ? [] : List<TedTag>.from(json["requested_tags"]!.map((x) => TedTag.fromJson(x))),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TedTag {
|
||||
TedTag({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.isSpecial,
|
||||
required this.isRequested,
|
||||
required this.isAccepted,
|
||||
required this.isActive,
|
||||
required this.isPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? name;
|
||||
final int? isSpecial;
|
||||
final int? isRequested;
|
||||
final int? isAccepted;
|
||||
final int? isActive;
|
||||
final bool? isPinned;
|
||||
|
||||
factory TedTag.fromJson(Map<String, dynamic> json){
|
||||
return TedTag(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
isSpecial: json["is_special"],
|
||||
isRequested: json["is_requested"],
|
||||
isAccepted: json["is_accepted"],
|
||||
isActive: json["is_active"],
|
||||
isPinned: json["is_pinned"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
// InviteComModel ? inviteComobj;
|
||||
|
||||
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/Utils/dialogs.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/Model/FetchInterestModel.dart';
|
||||
|
||||
FetchInterestModel? fetchinterestobj;
|
||||
|
||||
class ManageInterestApi {
|
||||
Future<ResponseData<dynamic>> postNewInterest(updata) async {
|
||||
@@ -33,4 +38,41 @@ class ManageInterestApi {
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> getInterests(updata) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getinterests}?manage_community_xid=$updata"
|
||||
|
||||
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
fetchinterestobj = FetchInterestModel.fromJson(response.data);
|
||||
log(fetchinterestobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> postAcceptReject(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postacceptreject,
|
||||
);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,27 @@ class CommunityInfo extends StatefulWidget {
|
||||
State<CommunityInfo> createState() => _CommunityInfoState();
|
||||
}
|
||||
|
||||
String? bannerImg;
|
||||
String? comPhoto;
|
||||
String? comName;
|
||||
String? comDes;
|
||||
String? comLocation;
|
||||
String? comType;
|
||||
|
||||
class _CommunityInfoState extends State<CommunityInfo> {
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
bannerImg = Get.arguments["bannerimage"];
|
||||
comPhoto = Get.arguments["communityphoto"];
|
||||
comName = Get.arguments["communityname"];
|
||||
comDes = Get.arguments["communitydescription"];
|
||||
comLocation = Get.arguments["communitylocation"];
|
||||
comType = Get.arguments["communitytype"];
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -41,14 +61,23 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communityInfo);
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 130.h,
|
||||
width: double.infinity,
|
||||
child: Image.asset(
|
||||
"assets/images/png/img1.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: bannerImg != null
|
||||
? SizedBox(
|
||||
height: 130.h,
|
||||
width: double.infinity,
|
||||
child: Image.network(
|
||||
bannerImg ?? '', // Replace with your API image URL
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: SizedBox(
|
||||
height: 130.h,
|
||||
width: double.infinity,
|
||||
child: Image.asset(
|
||||
"assets/images/png/img1.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: -35.h,
|
||||
@@ -70,10 +99,19 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: CircleAvatar(
|
||||
radius: 42.5.r,
|
||||
foregroundImage: AssetImage("assets/images/png/img2.png"),
|
||||
),
|
||||
child: comPhoto != null
|
||||
? CircleAvatar(
|
||||
radius: 42.5.r,
|
||||
foregroundImage: NetworkImage(
|
||||
comPhoto!), // Replace with your API image URL
|
||||
backgroundColor: Colors
|
||||
.transparent, // Optional: If the image fails to load, a transparent background is shown
|
||||
)
|
||||
: CircleAvatar(
|
||||
radius: 42.5.r,
|
||||
foregroundImage:
|
||||
const AssetImage("assets/images/png/img2.png"),
|
||||
),
|
||||
))
|
||||
]),
|
||||
sizedBoxHeight(50.h),
|
||||
@@ -82,21 +120,20 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text20w700_FCFCFC("Active alliance network"),
|
||||
text20w700_FCFCFC(comName ?? ""),
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("About community"),
|
||||
sizedBoxHeight(20.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."),
|
||||
text14w400_FCFCFCblur(comDes ?? ""),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius: BorderRadius.circular( 100.r),
|
||||
borderRadius: BorderRadius.circular(100.r),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
@@ -106,7 +143,7 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_white("Elm street london, United Kingdom")
|
||||
text16w400_white(comLocation ?? "")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
@@ -115,7 +152,7 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius: BorderRadius.circular( 100.r),
|
||||
borderRadius: BorderRadius.circular(100.r),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/puzzle-pieces 1 (traced).png",
|
||||
@@ -125,7 +162,7 @@ class _CommunityInfoState extends State<CommunityInfo> {
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_white("Sports")
|
||||
text16w400_white(comType ?? "")
|
||||
],
|
||||
)
|
||||
]),
|
||||
|
||||
@@ -25,6 +25,7 @@ class ComDetailModel {
|
||||
class Data {
|
||||
Data({
|
||||
required this.id,
|
||||
required this.isCommunityPinned,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
required this.communityProfilePhoto,
|
||||
@@ -33,10 +34,14 @@ class Data {
|
||||
required this.communityLocation,
|
||||
required this.communityDescription,
|
||||
required this.communityTypeXid,
|
||||
required this.activityXid,
|
||||
required this.userLinkInCommunity,
|
||||
required this.accessType,
|
||||
required this.activityData,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final bool? isCommunityPinned;
|
||||
final int? totalGroup;
|
||||
final int? totalAnnouncements;
|
||||
final String? communityProfilePhoto;
|
||||
@@ -45,11 +50,15 @@ class Data {
|
||||
final String? communityLocation;
|
||||
final String? communityDescription;
|
||||
final int? communityTypeXid;
|
||||
final int? activityXid;
|
||||
final UserLinkInCommunity? userLinkInCommunity;
|
||||
final AccessType? accessType;
|
||||
final ActivityData? activityData;
|
||||
|
||||
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"],
|
||||
@@ -58,7 +67,10 @@ class Data {
|
||||
communityLocation: json["community_location"],
|
||||
communityDescription: json["community_description"],
|
||||
communityTypeXid: json["community_type_xid"],
|
||||
activityXid: json["activity_xid"],
|
||||
userLinkInCommunity: json["user_link_in_community"] == null ? null : UserLinkInCommunity.fromJson(json["user_link_in_community"]),
|
||||
accessType: json["access_type"] == null ? null : AccessType.fromJson(json["access_type"]),
|
||||
activityData: json["activity_data"] == null ? null : ActivityData.fromJson(json["activity_data"]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,3 +93,60 @@ class AccessType {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ActivityData {
|
||||
ActivityData({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.image,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? title;
|
||||
final String? description;
|
||||
final String? image;
|
||||
|
||||
factory ActivityData.fromJson(Map<String, dynamic> json){
|
||||
return ActivityData(
|
||||
id: json["id"],
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
image: json["image"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class UserLinkInCommunity {
|
||||
UserLinkInCommunity({
|
||||
required this.id,
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.joinedAt,
|
||||
required this.userTypeXid,
|
||||
required this.isRequested,
|
||||
required this.isMute,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final DateTime? joinedAt;
|
||||
final AccessType? userTypeXid;
|
||||
final int? isRequested;
|
||||
final int? isMute;
|
||||
|
||||
factory UserLinkInCommunity.fromJson(Map<String, dynamic> json){
|
||||
return UserLinkInCommunity(
|
||||
id: json["id"],
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
joinedAt: DateTime.tryParse(json["joined_at"] ?? ""),
|
||||
userTypeXid: json["user_type_xid"] == null ? null : AccessType.fromJson(json["user_type_xid"]),
|
||||
isRequested: json["is_requested"],
|
||||
isMute: json["is_mute"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart' as primaryactlist;
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart'
|
||||
as primaryactlist;
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
@@ -64,7 +65,8 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
ResponseData<dynamic> response = await abilityLsitAPI.getActivitylistApi();
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
abilityModel = primaryactlist.ActivitiesListsModel.fromJson(response.data!);
|
||||
abilityModel =
|
||||
primaryactlist.ActivitiesListsModel.fromJson(response.data!);
|
||||
setState(() {
|
||||
activity = abilityModel?.data ?? []; // Store the fetched cities
|
||||
_activitydrop =
|
||||
@@ -425,32 +427,38 @@ class _NewCommunityState extends State<NewCommunity> {
|
||||
text: "Create community",
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.addgroup);
|
||||
if (bannerPath.isEmpty ||
|
||||
communitycontroller.text.isEmpty ||
|
||||
communitydescrcontroller.text.isEmpty ||
|
||||
_selectedtypecommunity.isEmpty ||
|
||||
locationcontroller.text.isEmpty ||
|
||||
selectedactivityid.isBlank!) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else if (filePath.isEmpty) {
|
||||
if (filePath.isEmpty) {
|
||||
utils.showToast(
|
||||
'Please add community profile picture');
|
||||
} else if (bannerPath.isEmpty) {
|
||||
utils.showToast('Please add banner image');
|
||||
} else if (communitycontroller.text.isEmpty) {
|
||||
utils.showToast('Please enter community name');
|
||||
} else if (communitydescrcontroller.text.isEmpty) {
|
||||
utils.showToast('Please enter community description');
|
||||
} else if (_selectedtypecommunity.isEmpty) {
|
||||
utils.showToast('Please select type of community');
|
||||
} else if (locationcontroller.text.isEmpty) {
|
||||
utils.showToast('Please enter location');
|
||||
} else if (selectedactivityid == null) {
|
||||
utils.showToast('Please select primary activity');
|
||||
} else {
|
||||
print('done');
|
||||
// indiUploadata();
|
||||
// Uploadata();
|
||||
int communityTypeValue = _TypecommunityMap[_selectedtypecommunity] ?? 0;
|
||||
|
||||
Get.toNamed(RouteName.addgroup,arguments: {
|
||||
'communityname' : communitycontroller.text,
|
||||
'communitylocation' : locationcontroller.text,
|
||||
'communitydescription' : communitydescrcontroller.text,
|
||||
'communitytype' : communityTypeValue,
|
||||
'activityid' : selectedactivityid,
|
||||
'communityprofilephoto' : filePath,
|
||||
'communitybannerimage' : bannerPath,
|
||||
});
|
||||
int communityTypeValue =
|
||||
_TypecommunityMap[_selectedtypecommunity] ?? 0;
|
||||
|
||||
Get.toNamed(RouteName.addgroup, arguments: {
|
||||
'communityname': communitycontroller.text,
|
||||
'communitylocation': locationcontroller.text,
|
||||
'communitydescription':
|
||||
communitydescrcontroller.text,
|
||||
'communitytype': communityTypeValue,
|
||||
'activityid': selectedactivityid,
|
||||
'communityprofilephoto': filePath,
|
||||
'communitybannerimage': bannerPath,
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart';
|
||||
import 'package:regroup/sidemenu/view_model/getMyCommunity.dart';
|
||||
|
||||
class MyCommunity extends StatefulWidget {
|
||||
@@ -20,6 +23,7 @@ class MyCommunity extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MyCommunityState extends State<MyCommunity> {
|
||||
int? ismute;
|
||||
List JoinedcommunityData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
@@ -66,6 +70,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
myfuture = MyCommunityAPI().getMyCommunity();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -144,6 +149,10 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < myCommunityobj!.data.length; i++) {
|
||||
ismute = myCommunityobj!.data[i].isMute;
|
||||
}
|
||||
|
||||
return myCommunityobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
@@ -191,7 +200,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.requestscreen);
|
||||
},
|
||||
child: text16w700_FCFCFC_line("Requests"))
|
||||
child: text16w700_FCFCFC_line("Request and Invites"))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
@@ -234,24 +243,27 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
joinnedComData.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto ==
|
||||
null ||
|
||||
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity !=
|
||||
null &&
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto !=
|
||||
null &&
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto!
|
||||
.isEmpty
|
||||
? const CircleAvatar(
|
||||
backgroundImage:
|
||||
AssetImage(
|
||||
'assets/images/png/img45.png',
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
.isNotEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
joinnedComData
|
||||
.joinedAndRequestedCommunity!
|
||||
.communityProfilePhoto!),
|
||||
)
|
||||
: const CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
'assets/images/png/img45.png'),
|
||||
)),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
@@ -263,21 +275,23 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
// // color: Colors.red,
|
||||
// width: double.infinity,
|
||||
// child:
|
||||
joinnedComData.joinedAndRequestedCommunity!
|
||||
.communityName ==
|
||||
null ||
|
||||
joinnedComData
|
||||
|
||||
SizedBox(
|
||||
width: 200.w,
|
||||
child: text18w700_FCFCFC(
|
||||
joinnedComData.joinedAndRequestedCommunity !=
|
||||
null &&
|
||||
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 ==
|
||||
@@ -332,7 +346,8 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
]),
|
||||
sizedBoxWidth(15.w),
|
||||
text14w400_FCFCFCblur(
|
||||
"${joinnedComData.joinedAndRequestedCommunity!.totalGroup ?? ''} groups"),
|
||||
"${joinnedComData.joinedAndRequestedCommunity != null && joinnedComData.joinedAndRequestedCommunity!.totalGroup != null ? joinnedComData.joinedAndRequestedCommunity!.totalGroup : ''} groups",
|
||||
),
|
||||
sizedBoxWidth(50.w),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
@@ -387,21 +402,61 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
onTap: () async {
|
||||
Map<String, dynamic>
|
||||
updata = {
|
||||
"manage_community_xid":
|
||||
joinnedComData
|
||||
.manageCommunityXid,
|
||||
};
|
||||
final data =
|
||||
await CommunityDetail()
|
||||
.postMuteNotification(
|
||||
updata);
|
||||
if (data.status ==
|
||||
ResponseStatus
|
||||
.SUCCESS) {
|
||||
print("success");
|
||||
setState(() {});
|
||||
await MyCommunityAPI()
|
||||
.getMyCommunity();
|
||||
bool isMuted =
|
||||
ismute == 1;
|
||||
isMuted = !isMuted;
|
||||
ismute = isMuted ? 1 : 0;
|
||||
|
||||
return utils.showToast(
|
||||
data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("Failed");
|
||||
return utils.showToast(
|
||||
data.message);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(
|
||||
"Mute group"),
|
||||
ismute == 1
|
||||
? text14w400white(
|
||||
"Unmute community")
|
||||
: text14w400white(
|
||||
"Mute community"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
ismute == 1
|
||||
? Image.asset(
|
||||
"assets/images/png/Black1233.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/Black1233.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -429,28 +484,32 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
),
|
||||
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: () {},
|
||||
onTap: () async {
|
||||
utils.loader();
|
||||
Map<String, dynamic>
|
||||
updata = {};
|
||||
final data =
|
||||
await CommunityDetail()
|
||||
.postLeaveCommunity(
|
||||
updata,
|
||||
joinnedComData
|
||||
.manageCommunityXid,
|
||||
);
|
||||
if (data.status ==
|
||||
ResponseStatus
|
||||
.SUCCESS) {
|
||||
setState(() {
|
||||
myCommunityobj!.data
|
||||
.removeAt(index);
|
||||
});
|
||||
return utils.showToast(
|
||||
data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
return utils.showToast(
|
||||
data.message);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
@@ -459,7 +518,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
children: [
|
||||
// text14w400_FCFCFC("Leave group"),
|
||||
text14w400_D90B2E(
|
||||
"Leave group"),
|
||||
"Leave Community"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/LightGray22.png",
|
||||
@@ -501,6 +560,12 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
: text16w400_FCFCFC_blur(
|
||||
'${joinnedComData.totalCommunityMember} members',
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/arrow.png",
|
||||
height: 21.h,
|
||||
width: 18.w,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
@@ -38,7 +38,7 @@ class _RequestsScreenState extends State<RequestsScreen> {
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "My Communities",
|
||||
titleTxt: "Request and Invites",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
sizedBoxWidth(12.w),
|
||||
@@ -233,104 +233,75 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
: 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(
|
||||
"${requestedComData.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")),
|
||||
),
|
||||
stackContainersGroups(
|
||||
number:
|
||||
" +${requestedComData.totalCommunityMember! - 3}",
|
||||
containerImages: requestedComData
|
||||
.fourMemberImages!
|
||||
.map((photo) => photo
|
||||
.iamPrincipal!
|
||||
.profilePhoto!)
|
||||
.toList(),
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
requestedComData.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
.totalCommunityMember!
|
||||
.isBlank!
|
||||
? const SizedBox()
|
||||
: text16w400_FCFCFC_blur(
|
||||
'${requestedComData.totalCommunityMember} members',
|
||||
),
|
||||
// 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(
|
||||
// "${requestedComData.joinedAndRequestedCommunity!.totalGroup ?? ''} groups"),
|
||||
// sizedBoxWidth(50.w),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -450,31 +421,9 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
sizedBoxHeight(10.h),
|
||||
Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
stackContainersGroups(
|
||||
number:
|
||||
" +${requestedComData.totalCommunityMember! - 3}",
|
||||
containerImages:
|
||||
requestedComData
|
||||
.fourMemberImages!
|
||||
.map((photo) => photo
|
||||
.iamPrincipal!
|
||||
.profilePhoto!)
|
||||
.toList(),
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
requestedComData.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
.totalCommunityMember!
|
||||
.isBlank!
|
||||
? const SizedBox()
|
||||
: text16w400_FCFCFC_blur(
|
||||
'${requestedComData.totalCommunityMember} members',
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Map<String, dynamic>
|
||||
@@ -506,7 +455,7 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 120.w,
|
||||
width: 180.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
@@ -517,7 +466,7 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
child: text12w400_FCFCFC(
|
||||
"Cancel request")),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -699,76 +648,28 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
// : sizedBoxHeight(10.h),
|
||||
Row(
|
||||
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,
|
||||
),
|
||||
)),
|
||||
sizedBoxWidth(15.w),
|
||||
// text14w400_FCFCFCblur(
|
||||
// "${invitedComData.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")),
|
||||
),
|
||||
stackContainersGroups(
|
||||
number: invitedComData
|
||||
.community !=
|
||||
null
|
||||
? " +${invitedComData.community!.totalCommunityMember! - 3}"
|
||||
: "",
|
||||
containerImages: invitedComData
|
||||
.community
|
||||
?.fourMemberImages
|
||||
.map((photo) => photo
|
||||
.iamPrincipal!
|
||||
.profilePhoto!)
|
||||
.toList() ??
|
||||
[],
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
if (invitedComData
|
||||
.community !=
|
||||
null)
|
||||
text16w400_FCFCFC_blur(
|
||||
'${invitedComData.community!.totalCommunityMember} members',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -890,6 +791,8 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
// stackContainersGroups(
|
||||
// number:
|
||||
@@ -910,7 +813,7 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
// : text16w400_FCFCFC_blur(
|
||||
// '${joinnedComData.totalCommunityMember} members',
|
||||
// ),
|
||||
Spacer(),
|
||||
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Map<String, dynamic>
|
||||
@@ -942,7 +845,7 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 70.w,
|
||||
width: 160.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
@@ -1008,7 +911,7 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 70.w,
|
||||
width: 160.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
|
||||
@@ -52,4 +52,15 @@ class CommunityDetail {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postMuteNotification(updata) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postmutenotification,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +1,152 @@
|
||||
class InviteComModel {
|
||||
InviteComModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
required this.message,
|
||||
required this.data,
|
||||
});
|
||||
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))),
|
||||
);
|
||||
}
|
||||
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,
|
||||
});
|
||||
Datum({
|
||||
required this.id,
|
||||
required this.senderIamXid,
|
||||
required this.communityXid,
|
||||
required this.isAccepted,
|
||||
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;
|
||||
final int? id;
|
||||
final int? senderIamXid;
|
||||
final int? communityXid;
|
||||
final int? isAccepted;
|
||||
final Community? 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"]),
|
||||
);
|
||||
}
|
||||
factory Datum.fromJson(Map<String, dynamic> json) {
|
||||
return Datum(
|
||||
id: json["id"],
|
||||
senderIamXid: json["sender_iam_xid"],
|
||||
communityXid: json["community_xid"],
|
||||
isAccepted: json["is_accepted"],
|
||||
community: json["community"] == null
|
||||
? null
|
||||
: Community.fromJson(json["community"]),
|
||||
senderDetail: json["sender_detail"] == null
|
||||
? null
|
||||
: SenderDetail.fromJson(json["sender_detail"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Community {
|
||||
Community({
|
||||
required this.id,
|
||||
required this.fourMemberImages,
|
||||
required this.totalGroup,
|
||||
required this.totalCommunityMember,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.totalAnnouncements,
|
||||
required this.isCommunityPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final List<FourMemberImage> fourMemberImages;
|
||||
final int? totalGroup;
|
||||
final int? totalCommunityMember;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityBannerImage;
|
||||
final String? communityName;
|
||||
final int? totalAnnouncements;
|
||||
final bool? isCommunityPinned;
|
||||
|
||||
factory Community.fromJson(Map<String, dynamic> json) {
|
||||
return Community(
|
||||
id: json["id"],
|
||||
fourMemberImages: json["four_member_images"] == null
|
||||
? []
|
||||
: List<FourMemberImage>.from(json["four_member_images"]!
|
||||
.map((x) => FourMemberImage.fromJson(x))),
|
||||
totalGroup: json["total_group"],
|
||||
totalCommunityMember: json["total_community_member"],
|
||||
communityProfilePhoto: json["community_profile_photo"],
|
||||
communityBannerImage: json["community_banner_image"],
|
||||
communityName: json["community_name"],
|
||||
totalAnnouncements: json["total_announcements"],
|
||||
isCommunityPinned: json["is_community_pinned"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FourMemberImage {
|
||||
FourMemberImage({
|
||||
required this.id,
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.iamPrincipal,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final SenderDetail? iamPrincipal;
|
||||
|
||||
factory FourMemberImage.fromJson(Map<String, dynamic> json) {
|
||||
return FourMemberImage(
|
||||
id: json["id"],
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
manageCommunityXid: json["manage_community_xid"],
|
||||
iamPrincipal: json["iam_principal"] == null
|
||||
? null
|
||||
: SenderDetail.fromJson(json["iam_principal"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SenderDetail {
|
||||
SenderDetail({
|
||||
required this.id,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
SenderDetail({
|
||||
required this.id,
|
||||
required this.principalTypeXid,
|
||||
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"],
|
||||
);
|
||||
}
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? fullName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory SenderDetail.fromJson(Map<String, dynamic> json) {
|
||||
return SenderDetail(
|
||||
id: json["id"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
fullName: json["full_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,152 +1,168 @@
|
||||
class MyCommunityModel {
|
||||
MyCommunityModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
required this.message,
|
||||
required this.data,
|
||||
});
|
||||
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))),
|
||||
);
|
||||
}
|
||||
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,
|
||||
});
|
||||
Datum({
|
||||
required this.totalCommunityMember,
|
||||
required this.fourMemberImages,
|
||||
required this.iamPrincipalXid,
|
||||
required this.manageCommunityXid,
|
||||
required this.joinedAt,
|
||||
required this.userTypeXid,
|
||||
required this.isMute,
|
||||
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"]),
|
||||
);
|
||||
}
|
||||
final int? totalCommunityMember;
|
||||
final List<FourMemberImage> fourMemberImages;
|
||||
final int? iamPrincipalXid;
|
||||
final int? manageCommunityXid;
|
||||
final DateTime? joinedAt;
|
||||
final UserTypeXid? userTypeXid;
|
||||
final int? isMute;
|
||||
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"]),
|
||||
isMute: json["is_mute"],
|
||||
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,
|
||||
});
|
||||
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"]),
|
||||
);
|
||||
}
|
||||
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,
|
||||
});
|
||||
IamPrincipal({
|
||||
required this.id,
|
||||
required this.principalTypeXid,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? 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"],
|
||||
);
|
||||
}
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? fullName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory IamPrincipal.fromJson(Map<String, dynamic> json) {
|
||||
return IamPrincipal(
|
||||
id: json["id"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
fullName: json["full_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class JoinedAndRequestedCommunity {
|
||||
JoinedAndRequestedCommunity({
|
||||
required this.id,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
});
|
||||
JoinedAndRequestedCommunity({
|
||||
required this.id,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityBannerImage,
|
||||
required this.communityName,
|
||||
required this.totalGroup,
|
||||
required this.totalAnnouncements,
|
||||
required this.isCommunityPinned,
|
||||
});
|
||||
|
||||
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"],
|
||||
);
|
||||
}
|
||||
final int? id;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityBannerImage;
|
||||
final String? communityName;
|
||||
final int? totalGroup;
|
||||
final int? totalAnnouncements;
|
||||
final bool? isCommunityPinned;
|
||||
|
||||
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"],
|
||||
isCommunityPinned: json["is_community_pinned"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class UserTypeXid {
|
||||
UserTypeXid({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
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"],
|
||||
);
|
||||
}
|
||||
final int? id;
|
||||
final String? name;
|
||||
|
||||
factory UserTypeXid.fromJson(Map<String, dynamic> json) {
|
||||
return UserTypeXid(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user