Merge pull request #88 from WDI-Ideas/dipti

changes
This commit is contained in:
diptimhabadi351
2024-08-01 13:49:18 +05:30
committed by GitHub
11 changed files with 2041 additions and 144 deletions

View File

@@ -91,14 +91,14 @@ class ApiUrls {
static const getblockuser = "${baseUrl}fetch-blocked-profile";
static const postblockuser = "${baseUrl}block-profile";
static const latestpost = "${baseUrl}fetch-latest-post";
static const tagcommunityuser = "${baseUrl}fetch-communities-tags-to-pin";
// Individual
static const posteditprofile = "${baseUrl}update-profile";
static const geteditprofile = "${baseUrl}fetch-profile";
static const getinterestlist = "${baseUrl}fetch-interests";
// Business
static const posteditprofilebusiness = "${baseUrl}update-business-profile";
static const geteditprofilebusiness = "${baseUrl}fetch-business-profile";

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,183 @@
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;
}
}

View File

@@ -0,0 +1,26 @@
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);
}
}
}

View File

@@ -0,0 +1,22 @@
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/TagCommunityUserModel.dart';
TagCommunityUserModel? tagcommunityuserobj;
class Sidegetmethod {
Future<ResponseData<dynamic>> getJoinedusergroups(updata) async {
final response = await NetworkApiServices().getApi(
"${ApiUrls.tagcommunityuser}?=$updata",
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
tagcommunityuserobj = TagCommunityUserModel.fromJson(response.data);
log(tagcommunityuserobj!.data.toString());
}
return response;
}
}

View File

@@ -7,10 +7,11 @@ 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/sidemenu/sidemenu.dart';
// import 'package:regroup/Feed%20Module/sidemenu/sidemenu.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/sidemenu.dart';
class CommunityScreen extends StatefulWidget {
const CommunityScreen({super.key});

View File

@@ -33,12 +33,13 @@ class _CycleScreenState extends State<CycleScreen> {
width: 26.w,
)),
body: Stack(children: [
Container(
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
), Column(children: [
),
Column(children: [
sizedBoxHeight(10.h),
DefaultTabController(
length: 2,
@@ -282,7 +283,7 @@ Widget normalcardtile({
Get.toNamed(RouteName.postdetailsScreen);
},
child: SizedBox(
height: 163.h,
height: 360.h,
width: double.infinity,
child: Image.asset(
mainImg,
@@ -412,8 +413,10 @@ Widget normalcardtile({
itemScale: 0.4,
itemSize: const Size(45, 45),
boxPadding: const EdgeInsets.all(8),
boxAnimationDuration: const Duration(milliseconds: 200),
itemAnimationDuration: const Duration(milliseconds: 500),
boxAnimationDuration:
const Duration(milliseconds: 200),
itemAnimationDuration:
const Duration(milliseconds: 500),
hoverDuration: const Duration(milliseconds: 700),
// toggle: false,

View File

@@ -0,0 +1,98 @@
class TagCommunityUserModel {
String? status;
int? statusCode;
String? message;
Data? data;
TagCommunityUserModel(
{this.status, this.statusCode, this.message, this.data});
TagCommunityUserModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
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!.toJson();
}
return data;
}
}
class Data {
List<Community>? community;
List<Tags>? tags;
Data({this.community, this.tags});
Data.fromJson(Map<String, dynamic> json) {
if (json['community'] != null) {
community = <Community>[];
json['community'].forEach((v) {
community!.add(Community.fromJson(v));
});
}
if (json['tags'] != null) {
tags = <Tags>[];
json['tags'].forEach((v) {
tags!.add(Tags.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (community != null) {
data['community'] = community!.map((v) => v.toJson()).toList();
}
if (tags != null) {
data['tags'] = tags!.map((v) => v.toJson()).toList();
}
return data;
}
}
class Community {
int? id;
String? communityName;
Community({this.id, this.communityName});
Community.fromJson(Map<String, dynamic> json) {
id = json['id'];
communityName = json['community_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['community_name'] = communityName;
return data;
}
}
class Tags {
int? id;
String? name;
Tags({this.id, this.name});
Tags.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['name'] = name;
return data;
}
}

View File

@@ -1,9 +1,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/CommonWidget.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
@@ -69,84 +67,17 @@ class _SideMenuState extends State<SideMenu> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF222935),
backgroundColor: const Color(0xFF222935),
body: Column(
children: [
sizedBoxHeight(50.h),
Expanded(
child: ListView(children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: commonGlassUI(
width: double.infinity,
height: 330.h,
borderRadius: BorderRadius.circular(10.r),
customWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 12.h),
child: Row(
children: [
text16w400_FCFCFC("Pinned"),
Spacer(),
Icon(
Icons.arrow_drop_up,
color: Colors.white,
size: 25,
)
],
),
),
commonDivider(),
sizedBoxHeight(10.h),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 1),
firstRowTile(
text: "Advice",
leadingimage:
"assets/images/png/sidemenu/solar_cloud-outline.png",
index: 2),
firstRowTile(
text: "Crush",
leadingimage:
"assets/images/png/sidemenu/Vector (4).png",
index: 3),
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 52.png"),
),
title: text14w400_FCFCFC("Ryan Dorwart"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
),
onTap: () {},
),
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 53.png"),
),
title: text14w400_FCFCFC("Ahmad Rhiel Madsen"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
),
onTap: () {},
),
]),
),
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: text16w400_FCFCFC("My pinned content"),
),
const Spacer(),
sizedBoxHeight(18.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
@@ -156,7 +87,7 @@ class _SideMenuState extends State<SideMenu> {
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(255, 255, 255, 0.3),
color: const Color.fromRGBO(255, 255, 255, 0.3),
width: 1.w,
),
),
@@ -168,8 +99,8 @@ class _SideMenuState extends State<SideMenu> {
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
text16w400_FCFCFC("Communities"),
Spacer(),
text16w400_FCFCFC("Tags"),
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.mycommunity);
@@ -207,7 +138,7 @@ class _SideMenuState extends State<SideMenu> {
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(255, 255, 255, 0.3),
color: const Color.fromRGBO(255, 255, 255, 0.3),
width: 1.w,
),
),
@@ -219,59 +150,8 @@ class _SideMenuState extends State<SideMenu> {
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
text16w400_FCFCFC("Watchlist"),
Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.watchlist);
},
child: text14w400_FCFCFC("View all")),
],
),
),
sizedBoxHeight(20.h),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 8),
firstRowTile(
text: "Advice",
leadingimage:
"assets/images/png/sidemenu/solar_cloud-outline.png",
index: 9),
firstRowTile(
text: "Crush",
leadingimage: "assets/images/png/sidemenu/Vector (4).png",
index: 10),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 11),
sizedBoxHeight(18.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(255, 255, 255, 0.3),
width: 1.w,
),
),
),
),
),
sizedBoxHeight(18.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
text16w400_FCFCFC("Recent"),
Spacer(),
text16w400_FCFCFC("Communities"),
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.mycommunity);
@@ -285,21 +165,21 @@ class _SideMenuState extends State<SideMenu> {
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 8),
index: 4),
firstRowTile(
text: "Advice",
leadingimage:
"assets/images/png/sidemenu/solar_cloud-outline.png",
index: 9),
index: 5),
firstRowTile(
text: "Crush",
leadingimage: "assets/images/png/sidemenu/Vector (4).png",
index: 10),
index: 6),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 11),
index: 7),
sizedBoxHeight(18.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
@@ -309,7 +189,7 @@ class _SideMenuState extends State<SideMenu> {
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(255, 255, 255, 0.3),
color: const Color.fromRGBO(255, 255, 255, 0.3),
width: 1.w,
),
),
@@ -322,7 +202,7 @@ class _SideMenuState extends State<SideMenu> {
child: Row(
children: [
text16w400_FCFCFC("Users"),
Spacer(),
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.mycommunity);

View File

@@ -0,0 +1,23 @@
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/TagCommunityUserModel.dart';
// import 'package:regroup/Feed%20Module/sidemenu/Model/TagCommunityUserModel.dart';
TagCommunityUserModel? tagcommunityuserobj;
class Sidegetmethod {
Future<ResponseData<dynamic>> getJoinedusergroups(updata) async {
final response = await NetworkApiServices().getApi(
"${ApiUrls.tagcommunityuser}?=$updata",
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
tagcommunityuserobj = TagCommunityUserModel.fromJson(response.data);
log(tagcommunityuserobj!.data.toString());
}
return response;
}
}