Merge pull request #92 from WDI-Ideas/dipti
deleted duplicate community
This commit is contained in:
@@ -91,7 +91,7 @@ class ApiUrls {
|
||||
|
||||
static const getblockuser = "${baseUrl}fetch-blocked-profile";
|
||||
static const postblockuser = "${baseUrl}block-profile";
|
||||
static const latestpost = "${baseUrl}fetch-latest-post";
|
||||
static const getlatestpost = "${baseUrl}fetch-latest-post";
|
||||
static const tagcommunityuser = "${baseUrl}fetch-communities-tags-to-pin";
|
||||
|
||||
// Individual
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,183 +0,0 @@
|
||||
class Latestpost {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
Latestpost({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
Latestpost.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
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();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
int? likecount;
|
||||
List<int>? tagsXid;
|
||||
bool? isILiked;
|
||||
int? totalComment;
|
||||
int? totalSave;
|
||||
int? iamPrincipalXid;
|
||||
int? postIn;
|
||||
String? caption;
|
||||
String? image;
|
||||
String? manageTagsXids;
|
||||
String? postAs;
|
||||
String? ctaTitle;
|
||||
String? ctaLink;
|
||||
String? createdAt;
|
||||
List<String>? tagNames;
|
||||
String? likeIcon;
|
||||
IamPrincipal? iamPrincipal;
|
||||
Community? community;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.likecount,
|
||||
this.tagsXid,
|
||||
this.isILiked,
|
||||
this.totalComment,
|
||||
this.totalSave,
|
||||
this.iamPrincipalXid,
|
||||
this.postIn,
|
||||
this.caption,
|
||||
this.image,
|
||||
this.manageTagsXids,
|
||||
this.postAs,
|
||||
this.ctaTitle,
|
||||
this.ctaLink,
|
||||
this.createdAt,
|
||||
this.tagNames,
|
||||
this.likeIcon,
|
||||
this.iamPrincipal,
|
||||
this.community});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
likecount = json['likecount'];
|
||||
tagsXid = json['tags_xid'].cast<int>();
|
||||
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 = json['created_at'];
|
||||
tagNames = json['tag_names'].cast<String>();
|
||||
likeIcon = json['likeIcon'];
|
||||
iamPrincipal = json['iam_principal'] != null
|
||||
? IamPrincipal.fromJson(json['iam_principal'])
|
||||
: null;
|
||||
community = json['community'] != null
|
||||
? Community.fromJson(json['community'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['likecount'] = likecount;
|
||||
data['tags_xid'] = tagsXid;
|
||||
data['is_i_liked'] = isILiked;
|
||||
data['total_comment'] = totalComment;
|
||||
data['total_save'] = totalSave;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['post_in'] = postIn;
|
||||
data['caption'] = caption;
|
||||
data['image'] = image;
|
||||
data['manage_tags_xids'] = manageTagsXids;
|
||||
data['post_as'] = postAs;
|
||||
data['cta_title'] = ctaTitle;
|
||||
data['cta_link'] = ctaLink;
|
||||
data['created_at'] = createdAt;
|
||||
data['tag_names'] = tagNames;
|
||||
data['likeIcon'] = likeIcon;
|
||||
if (iamPrincipal != null) {
|
||||
data['iam_principal'] = iamPrincipal!.toJson();
|
||||
}
|
||||
if (community != null) {
|
||||
data['community'] = community!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class IamPrincipal {
|
||||
int? id;
|
||||
int? principalTypeXid;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
|
||||
IamPrincipal(
|
||||
{this.id,
|
||||
this.principalTypeXid,
|
||||
this.userName,
|
||||
this.fullName,
|
||||
this.profilePhoto});
|
||||
|
||||
IamPrincipal.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
principalTypeXid = json['principal_type_xid'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['principal_type_xid'] = principalTypeXid;
|
||||
data['user_name'] = userName;
|
||||
data['full_name'] = fullName;
|
||||
data['profile_photo'] = profilePhoto;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Community {
|
||||
int? id;
|
||||
String? communityProfilePhoto;
|
||||
String? communityName;
|
||||
|
||||
Community({this.id, this.communityProfilePhoto, this.communityName});
|
||||
|
||||
Community.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
communityProfilePhoto = json['community_profile_photo'];
|
||||
communityName = json['community_name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['community_profile_photo'] = communityProfilePhoto;
|
||||
data['community_name'] = communityName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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/Feed%20Module/Main_Screens/Community/Modal/LatestPost.dart';
|
||||
|
||||
Latestpost? latestpostobj;
|
||||
|
||||
class LatespostApi {
|
||||
LatespostApi();
|
||||
|
||||
Future<ResponseData<dynamic>> getLatestPostApi() async {
|
||||
final response = await NetworkApiServices().getApi(ApiUrls.latestpost);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
latestpostobj = Latestpost.fromJson(response.data);
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/ViewModal/LatesPost.dart';
|
||||
import 'package:regroup/Main_Screens/Community/ViewModel/LatestPost.dart';
|
||||
// import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class Latestpost {
|
||||
class LatestpostModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
Latestpost({this.status, this.statusCode, this.message, this.data});
|
||||
LatestpostModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
Latestpost.fromJson(Map<String, dynamic> json) {
|
||||
LatestpostModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
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/Feed%20Module/Main_Screens/Community/Modal/LatestPost.dart';
|
||||
import 'package:regroup/Main_Screens/Community/Model/LatestPostModel.dart';
|
||||
|
||||
Latestpost? latestpostobj;
|
||||
LatestpostModel? latestpostobj;
|
||||
|
||||
class LatespostApi {
|
||||
LatespostApi();
|
||||
|
||||
Future<ResponseData<dynamic>> getLatestPostApi() async {
|
||||
final response = await NetworkApiServices().getApi(ApiUrls.latestpost);
|
||||
final response = await NetworkApiServices().getApi(ApiUrls.getlatestpost);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
latestpostobj = Latestpost.fromJson(response.data);
|
||||
latestpostobj = LatestpostModel.fromJson(response.data);
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
|
||||
Reference in New Issue
Block a user