Merge branch 'main' into createcommunity
This commit is contained in:
BIN
assets/images/png/PinnedIcon.png
Normal file
BIN
assets/images/png/PinnedIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
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";
|
||||
|
||||
251
lib/Main_Screens/Community/Model/CommonDatumObjModel.dart
Normal file
251
lib/Main_Screens/Community/Model/CommonDatumObjModel.dart
Normal file
@@ -0,0 +1,251 @@
|
||||
class CommonDatumObjModel {
|
||||
CommonDatumObjModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
required this.message,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
final String? status;
|
||||
final int? statusCode;
|
||||
final String? message;
|
||||
final List<CommonDatumObjModelData> data;
|
||||
|
||||
factory CommonDatumObjModel.fromJson(Map<String, dynamic> json) {
|
||||
return CommonDatumObjModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
message: json["message"],
|
||||
data: json["data"] == null
|
||||
? []
|
||||
: List<CommonDatumObjModelData>.from(
|
||||
json["data"]!.map((x) => CommonDatumObjModelData.fromJson(x))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CommonDatumObjModelData {
|
||||
CommonDatumObjModelData({
|
||||
required this.id,
|
||||
required this.likecount,
|
||||
required this.isISaved,
|
||||
required this.tagsXid,
|
||||
required this.isILiked,
|
||||
required this.totalComment,
|
||||
required this.totalSave,
|
||||
required this.iamPrincipalXid,
|
||||
required this.postIn,
|
||||
required this.caption,
|
||||
required this.image,
|
||||
required this.manageTagsXids,
|
||||
required this.postAs,
|
||||
required this.ctaTitle,
|
||||
required this.ctaLink,
|
||||
required this.createdAt,
|
||||
required this.likeIcon,
|
||||
required this.totalViewCount,
|
||||
required this.totalReactionCount,
|
||||
required this.totalCommentCount,
|
||||
required this.totalImpressionCount,
|
||||
required this.totalPopularScore,
|
||||
required this.totalHoursAgo,
|
||||
required this.iamPrincipal,
|
||||
required this.community,
|
||||
required this.attachTags,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? likecount;
|
||||
final bool? isISaved;
|
||||
final List<int> tagsXid;
|
||||
final bool? isILiked;
|
||||
final int? totalComment;
|
||||
final int? totalSave;
|
||||
final int? iamPrincipalXid;
|
||||
final int? postIn;
|
||||
final String? caption;
|
||||
final String? image;
|
||||
final String? manageTagsXids;
|
||||
final String? postAs;
|
||||
final String? ctaTitle;
|
||||
final String? ctaLink;
|
||||
final DateTime? createdAt;
|
||||
final LikeIcon1? likeIcon;
|
||||
final int? totalViewCount;
|
||||
final int? totalReactionCount;
|
||||
final int? totalCommentCount;
|
||||
final int? totalImpressionCount;
|
||||
final int? totalPopularScore;
|
||||
final int? totalHoursAgo;
|
||||
final IamPrincipal? iamPrincipal;
|
||||
final Community? community;
|
||||
final List<AttachTag1> attachTags;
|
||||
|
||||
factory CommonDatumObjModelData.fromJson(Map<String, dynamic> json) {
|
||||
return CommonDatumObjModelData(
|
||||
id: json["id"],
|
||||
likecount: json["likecount"],
|
||||
isISaved: json["is_i_saved"],
|
||||
tagsXid: json["tags_xid"] == null
|
||||
? []
|
||||
: List<int>.from(json["tags_xid"]!.map((x) => x)),
|
||||
isILiked: json["is_i_liked"],
|
||||
totalComment: json["total_comment"],
|
||||
totalSave: json["total_save"],
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
postIn: json["post_in"],
|
||||
caption: json["caption"],
|
||||
image: json["image"],
|
||||
manageTagsXids: json["manage_tags_xids"],
|
||||
postAs: json["post_as"],
|
||||
ctaTitle: json["cta_title"],
|
||||
ctaLink: json["cta_link"],
|
||||
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
|
||||
likeIcon:
|
||||
json["likeIcon"] == null ? null : LikeIcon1.fromJson(json["likeIcon"]),
|
||||
totalViewCount: json["totalViewCount"],
|
||||
totalReactionCount: json["totalReactionCount"],
|
||||
totalCommentCount: json["totalCommentCount"],
|
||||
totalImpressionCount: json["totalImpressionCount"],
|
||||
totalPopularScore: json["totalPopularScore"],
|
||||
totalHoursAgo: json["totalHoursAgo"],
|
||||
iamPrincipal: json["iam_principal"] == null
|
||||
? null
|
||||
: IamPrincipal.fromJson(json["iam_principal"]),
|
||||
community: json["community"] == null
|
||||
? null
|
||||
: Community.fromJson(json["community"]),
|
||||
attachTags: json["attach_tags"] == null
|
||||
? []
|
||||
: List<AttachTag1>.from(
|
||||
json["attach_tags"]!.map((x) => AttachTag1.fromJson(x))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AttachTag1 {
|
||||
AttachTag1({
|
||||
required this.managePostXid,
|
||||
required this.manageTagXid,
|
||||
required this.manageTag,
|
||||
});
|
||||
|
||||
final int? managePostXid;
|
||||
final int? manageTagXid;
|
||||
final ManageTagPopular? manageTag;
|
||||
|
||||
factory AttachTag1.fromJson(Map<String, dynamic> json) {
|
||||
return AttachTag1(
|
||||
managePostXid: json["manage_post_xid"],
|
||||
manageTagXid: json["manage_tag_xid"],
|
||||
manageTag: json["manage_tag"] == null
|
||||
? null
|
||||
: ManageTagPopular.fromJson(json["manage_tag"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ManageTagPopular {
|
||||
ManageTagPopular({
|
||||
required this.id,
|
||||
required this.isPinned,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final bool? isPinned;
|
||||
final String? name;
|
||||
|
||||
factory ManageTagPopular.fromJson(Map<String, dynamic> json) {
|
||||
return ManageTagPopular(
|
||||
id: json["id"],
|
||||
isPinned: json["is_pinned"],
|
||||
name: json["name"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Community {
|
||||
Community({
|
||||
required this.id,
|
||||
required this.communityProfilePhoto,
|
||||
required this.communityName,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? communityProfilePhoto;
|
||||
final String? communityName;
|
||||
|
||||
factory Community.fromJson(Map<String, dynamic> json) {
|
||||
return Community(
|
||||
id: json["id"],
|
||||
communityProfilePhoto: json["community_profile_photo"],
|
||||
communityName: json["community_name"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IamPrincipal {
|
||||
IamPrincipal({
|
||||
required this.id,
|
||||
required this.isUserPinned,
|
||||
required this.principalTypeXid,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.profilePhoto,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final bool? isUserPinned;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? fullName;
|
||||
final String? profilePhoto;
|
||||
|
||||
factory IamPrincipal.fromJson(Map<String, dynamic> json) {
|
||||
return IamPrincipal(
|
||||
id: json["id"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
fullName: json["full_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LikeIcon1 {
|
||||
LikeIcon1({
|
||||
required this.likeIconsXid,
|
||||
required this.likeIcon,
|
||||
});
|
||||
|
||||
final int? likeIconsXid;
|
||||
final LikeIconClass1? likeIcon;
|
||||
|
||||
factory LikeIcon1.fromJson(Map<String, dynamic> json) {
|
||||
return LikeIcon1(
|
||||
likeIconsXid: json["like_icons_xid"],
|
||||
likeIcon: json["like_icon"] == null
|
||||
? null
|
||||
: LikeIconClass1.fromJson(json["like_icon"]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LikeIconClass1 {
|
||||
LikeIconClass1({
|
||||
required this.id,
|
||||
required this.image,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? image;
|
||||
|
||||
factory LikeIconClass1.fromJson(Map<String, dynamic> json) {
|
||||
return LikeIconClass1(
|
||||
id: json["id"],
|
||||
image: json["image"],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
class FeedPostModel {
|
||||
class FeedPostModel {
|
||||
FeedPostModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
|
||||
@@ -11,7 +11,7 @@ class LatestpostModel {
|
||||
final String? message;
|
||||
final List<Datum> data;
|
||||
|
||||
factory LatestpostModel.fromJson(Map<String, dynamic> json){
|
||||
factory LatestpostModel.fromJson(Map<String, dynamic> json){
|
||||
return LatestpostModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
|
||||
@@ -2,7 +2,7 @@ class FetchlikeIconsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
List<ReactionData>? data;
|
||||
|
||||
FetchlikeIconsModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
@@ -11,18 +11,18 @@ class FetchlikeIconsModel {
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
data = <ReactionData>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
data!.add(ReactionData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
@@ -30,35 +30,35 @@ class FetchlikeIconsModel {
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
class ReactionData {
|
||||
int? id;
|
||||
String? image;
|
||||
String image = "";
|
||||
|
||||
Data({this.id, this.image});
|
||||
ReactionData({this.id, required this.image});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
ReactionData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
image = json['image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['image'] = this.image;
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['image'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ReactionData {
|
||||
final int id;
|
||||
final String image;
|
||||
// class ReactionData {
|
||||
// final int id;
|
||||
// final String image;
|
||||
|
||||
ReactionData({required this.id, required this.image});
|
||||
// ReactionData({required this.id, required this.image});
|
||||
|
||||
factory ReactionData.fromJson(Map<String, dynamic> json) {
|
||||
return ReactionData(
|
||||
id: json['id'],
|
||||
image: json['image'],
|
||||
);
|
||||
}
|
||||
}
|
||||
// factory ReactionData.fromJson(Map<String, dynamic> json) {
|
||||
// return ReactionData(
|
||||
// id: json['id'],
|
||||
// image: json['image'],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:regroup/Main_Screens/Community/Model/PopularPostModel.dart';
|
||||
|
||||
PopularpostModel? popularpostobj;
|
||||
|
||||
class PopularpostApi {
|
||||
class PopularpostApi{
|
||||
PopularpostApi();
|
||||
|
||||
Future<ResponseData<dynamic>> getPopularPostApi() async {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -149,7 +149,7 @@ class _AllTabsState extends State<AllTabs> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
postId = Get.arguments['postId'];
|
||||
postId = Get.arguments['postId'].toString();
|
||||
|
||||
alltabfuture = LikePostApi().postLike({'manage_posts_xid': postId});
|
||||
super.initState();
|
||||
@@ -226,9 +226,10 @@ class _LikeTabsState extends State<LikeTabs> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
postId = Get.arguments['postId'];
|
||||
postId = Get.arguments['postId'].toString();
|
||||
|
||||
liketabfuture = LikePostApi() .postLike({'manage_posts_xid': postId, 'like_icons_xid': 1});
|
||||
liketabfuture = LikePostApi()
|
||||
.postLike({'manage_posts_xid': postId, 'like_icons_xid': 1});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -303,9 +304,10 @@ class _FavouriteTabsState extends State<FavouriteTabs> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
postId = Get.arguments['postId'];
|
||||
postId = Get.arguments['postId'].toString();
|
||||
|
||||
favouritetabfuture = LikePostApi() .postLike({'manage_posts_xid': postId, 'like_icons_xid': 2});
|
||||
favouritetabfuture = LikePostApi()
|
||||
.postLike({'manage_posts_xid': postId, 'like_icons_xid': 2});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -380,8 +382,9 @@ class _PartyTabsState extends State<PartyTabs> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
postId = Get.arguments['postId'];
|
||||
partytabfuture = LikePostApi().postLike({'manage_posts_xid': postId, 'like_icons_xid': 3});
|
||||
postId = Get.arguments['postId'].toString();
|
||||
partytabfuture = LikePostApi()
|
||||
.postLike({'manage_posts_xid': postId, 'like_icons_xid': 3});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
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';
|
||||
|
||||
List<PinnedPost> combinedListGlobal = [];
|
||||
CommonDatumObjModel? commonobjmodel;
|
||||
class CountersHelper extends GetxController {
|
||||
RxList<int> likesCounterPopular = <int>[].obs;
|
||||
RxList<int> commentsCounterPopular = <int>[].obs;
|
||||
RxList<int> savePostCounterPopular = <int>[].obs;
|
||||
RxList<bool> saveButtonPopular = <bool>[].obs;
|
||||
RxList<bool> pinButtonPopular = <bool>[].obs;
|
||||
|
||||
setListsPopular() {
|
||||
likesCounterPopular.clear();
|
||||
commentsCounterPopular.clear();
|
||||
savePostCounterPopular.clear();
|
||||
saveButtonPopular.clear();
|
||||
|
||||
for (var i = 0; i < commonobjmodel!.data.length; i++) {
|
||||
likesCounterPopular.add(commonobjmodel?.data[i].likecount ?? 0);
|
||||
commentsCounterPopular
|
||||
.add(commonobjmodel?.data[i].totalCommentCount ?? 0);
|
||||
savePostCounterPopular.add(commonobjmodel?.data[i].totalSave ?? 0);
|
||||
saveButtonPopular.add(commonobjmodel?.data[i].isISaved ?? false);
|
||||
pinButtonPopular
|
||||
.add(commonobjmodel?.data[i].iamPrincipal?.isUserPinned ?? false);
|
||||
}
|
||||
}
|
||||
|
||||
RxList<int> likesCounterFeed = <int>[].obs;
|
||||
RxList<int> commentsCounterFeed = <int>[].obs;
|
||||
RxList<int> savePostCounterFeed = <int>[].obs;
|
||||
|
||||
setListsFeed() {
|
||||
for (var i = 0; i < combinedListGlobal.length; i++) {
|
||||
likesCounterLatest.add(combinedListGlobal[i].likecount ?? 0);
|
||||
commentsCounterLatest.add(combinedListGlobal[i].totalCommentCount ?? 0);
|
||||
savePostCounterLatest.add(combinedListGlobal[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
RxList<int> likesCounterLatest = <int>[].obs;
|
||||
RxList<int> commentsCounterLatest = <int>[].obs;
|
||||
RxList<int> savePostCounterLatest = <int>[].obs;
|
||||
|
||||
setListsLatest() {
|
||||
for (var i = 0; i < latestpostobj!.data.length; i++) {
|
||||
likesCounterFeed.add(latestpostobj!.data[i].likecount ?? 0);
|
||||
commentsCounterFeed.add(latestpostobj!.data[i].totalCommentCount ?? 0);
|
||||
savePostCounterFeed.add(latestpostobj!.data[i].totalSave ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -29,33 +29,36 @@ 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
|
||||
Size get preferredSize => Size.fromHeight(height);
|
||||
|
||||
const CommonAppbar({
|
||||
Key? key,
|
||||
required this.titleTxt,
|
||||
this.showLeading = true,
|
||||
this.customActionWidget,
|
||||
this.onCustomActionPressed,
|
||||
this.showEdit = false,
|
||||
this.customBack,
|
||||
this.editPageName,
|
||||
this.height = 80,
|
||||
}) : super(key: key);
|
||||
const CommonAppbar(
|
||||
{Key? key,
|
||||
required this.titleTxt,
|
||||
this.showLeading = true,
|
||||
this.customActionWidget,
|
||||
this.onCustomActionPressed,
|
||||
this.showEdit = false,
|
||||
this.customBack = false,
|
||||
this.editPageName,
|
||||
this.height = 80,
|
||||
this.customRouteName})
|
||||
: super(key: key);
|
||||
|
||||
final String titleTxt;
|
||||
final bool? showLeading;
|
||||
final Widget? customActionWidget;
|
||||
final VoidCallback? onCustomActionPressed;
|
||||
final bool? showEdit;
|
||||
final bool? customBack;
|
||||
final bool customBack;
|
||||
final String? editPageName;
|
||||
final double height;
|
||||
|
||||
final String? customRouteName;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PreferredSize(
|
||||
@@ -125,7 +128,11 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
padding: EdgeInsets.only(top: 10.h),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
if (customBack) {
|
||||
Get.back(result: true);
|
||||
} else {
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -76,6 +76,7 @@ import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnno
|
||||
import 'package:regroup/sidemenu/Community/Members/CommunityMembers.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';
|
||||
@@ -537,11 +538,18 @@ class AppRoutes {
|
||||
name: RouteName.viewalluserspinned,
|
||||
page: () => const Viewtusertags(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.communitymembers,
|
||||
page: () => const CommunityMembers(),
|
||||
),
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1214,7 +1214,9 @@ packages:
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
sqflite:
|
||||
dependency: "direct main"
|
||||
|
||||
dependency: transitive
|
||||
|
||||
description:
|
||||
name: sqflite
|
||||
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
|
||||
|
||||
@@ -77,9 +77,12 @@ dependencies:
|
||||
flutter_html: ^3.0.0-beta.2
|
||||
comment_tree: ^0.3.0
|
||||
flutter_keyboard_visibility: ^6.0.0
|
||||
cached_network_image: ^3.4.0
|
||||
|
||||
sqflite: ^2.3.3+1
|
||||
|
||||
cached_network_image: any
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
Reference in New Issue
Block a user