Merge pull request #94 from WDI-Ideas/Communitypost
community post completed for individual and business
This commit is contained in:
BIN
assets/images/png/add 1.png
Normal file
BIN
assets/images/png/add 1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 594 B |
9
assets/images/svg/add 1.svg
Normal file
9
assets/images/svg/add 1.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 23 KiB |
@@ -112,4 +112,15 @@ class ApiUrls {
|
||||
|
||||
static const getGuestfollowers = "${baseUrl}get-guest-user-followers";
|
||||
static const getGuestfollowing = "${baseUrl}get-guest-user-following";
|
||||
|
||||
//community
|
||||
static const getpostcommunitylist = "${baseUrl}fetch-communities-with-tags";
|
||||
static const getpopulartagscommunity = "${baseUrl}fetch-popular-tags";
|
||||
|
||||
static const postnewtags = "${baseUrl}store-tags";
|
||||
static const postupload = "${baseUrl}store-post";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
class CommunityListModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
CommunityListModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
CommunityListModel.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(new Data.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;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? manageCommunityXid;
|
||||
Community? community;
|
||||
|
||||
Data(
|
||||
{this.id, this.iamPrincipalXid, this.manageCommunityXid, this.community});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
manageCommunityXid = json['manage_community_xid'];
|
||||
community = json['community'] != null
|
||||
? new Community.fromJson(json['community'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
data['manage_community_xid'] = this.manageCommunityXid;
|
||||
if (this.community != null) {
|
||||
data['community'] = this.community!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Community {
|
||||
int? id;
|
||||
String? communityName;
|
||||
String? communityProfilePhoto;
|
||||
|
||||
Community({this.id, this.communityName, this.communityProfilePhoto});
|
||||
|
||||
Community.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
communityName = json['community_name'];
|
||||
communityProfilePhoto = json['community_profile_photo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['community_name'] = this.communityName;
|
||||
data['community_profile_photo'] = this.communityProfilePhoto;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
class PopulartagsListModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
PopulartagsListModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
PopulartagsListModel.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(new Data.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;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? name;
|
||||
int? tagPopularity;
|
||||
|
||||
Data({this.id, this.name, this.tagPopularity});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
tagPopularity = json['tag_popularity'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['tag_popularity'] = this.tagPopularity;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
class TagsMainModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
TagsMainModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
TagsMainModel.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(new Data.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;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? name;
|
||||
int? tagPopularity;
|
||||
|
||||
Data({this.id, this.name, this.tagPopularity});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
tagPopularity = json['tag_popularity'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['tag_popularity'] = this.tagPopularity;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
|
||||
// FollowersModel? communitytagssobj;
|
||||
|
||||
|
||||
class Communitygetmethod {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:regroup/Common/api_urls.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
|
||||
class Communitypostmethod {
|
||||
Communitypostmethod();
|
||||
|
||||
Future<ResponseData<dynamic>> postCreatedTag(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postnewtags,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postUpload(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postupload,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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/Model/communitylistModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/Model/populartagsListModel.dart';
|
||||
|
||||
class CommunityLsitApi {
|
||||
CommunityLsitApi();
|
||||
var data = "";
|
||||
Future<ResponseData<dynamic>> getPostinList() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getpostcommunitylist,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
print("success");
|
||||
CommunityListModel communitylistobj =
|
||||
CommunityListModel.fromJson(responseData);
|
||||
} else {
|
||||
// return ResponseData<dynamic>(
|
||||
// responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getPopulartagsList(updata) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$updata&name=');
|
||||
// '${ApiUrls.getpopulartagscommunity}?manage_community_xid=$updata&name=',
|
||||
|
||||
// );
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
print("success");
|
||||
PopulartagsListModel populartagslistobj =
|
||||
PopulartagsListModel.fromJson(responseData);
|
||||
} else {
|
||||
// return ResponseData<dynamic>(
|
||||
// responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonBottomNavigationBar.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
@@ -136,10 +137,11 @@ class _CommunityScreenState extends State<CommunityScreen> {
|
||||
]))
|
||||
]),
|
||||
floatingActionButton: Container(
|
||||
height: 55.h,
|
||||
width: 55.w,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
height: 40.h,
|
||||
width: 164.w,
|
||||
decoration: BoxDecoration(
|
||||
// shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000), // Hex color with 40% opacity
|
||||
@@ -149,18 +151,30 @@ class _CommunityScreenState extends State<CommunityScreen> {
|
||||
],
|
||||
),
|
||||
child: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.postscreen);
|
||||
},
|
||||
backgroundColor: const Color(0xFFD90B2E),
|
||||
autofocus: true,
|
||||
shape: const CircleBorder(),
|
||||
child: Image.asset(
|
||||
"assets/images/png/iconamoon_edit-thin.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.postscreen);
|
||||
},
|
||||
backgroundColor: const Color(0xFFD90B2E),
|
||||
autofocus: true,
|
||||
// shape: const OvalBorder(),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// SvgPicture.asset('assets/images/svg/add 1.svg'),
|
||||
Image.asset('assets/images/png/add 1.png'),
|
||||
sizedBoxWidth(4.w),
|
||||
text16400white('Create posts')
|
||||
],
|
||||
)
|
||||
// Image.asset(
|
||||
// "assets/images/png/iconamoon_edit-thin.png",
|
||||
// height: 30.h,
|
||||
// width: 30.w,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -174,7 +174,7 @@ class _ContactUsState extends State<ContactUs> {
|
||||
hintText: "Enter query",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
return 'Enter your query';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -539,10 +539,12 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
value: item,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
selectedValue.value = item;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(item);
|
||||
onDropTap.value = !onDropTap.value;
|
||||
setState(() {
|
||||
selectedValue.value = item;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(item);
|
||||
onDropTap.value = false; // Close the dropdown
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -555,9 +557,12 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
activeColor: Colors.white,
|
||||
groupValue: selectedValue.value,
|
||||
onChanged: (value) {
|
||||
selectedValue.value = value!;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(value);
|
||||
setState(() {
|
||||
selectedValue.value = value!;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(value);
|
||||
onDropTap.value = false; // Close the dropdown
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
@@ -597,9 +602,12 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
activeColor: Colors.white,
|
||||
groupValue: selectedValue.value,
|
||||
onChanged: (value) {
|
||||
selectedValue.value = value!;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(value);
|
||||
setState(() {
|
||||
selectedValue.value = value!;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(value);
|
||||
onDropTap.value = false; // Close the dropdown
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
@@ -633,8 +641,11 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (_textController.text.trim().isNotEmpty) {
|
||||
selectedValue.value = _textController.text;
|
||||
widget.onItemSelected(_textController.text);
|
||||
setState(() {
|
||||
selectedValue.value = _textController.text;
|
||||
widget.onItemSelected(_textController.text);
|
||||
onDropTap.value = false; // Close the dropdown
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
@@ -667,7 +678,9 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onDropTap.value = !onDropTap.value;
|
||||
setState(() {
|
||||
onDropTap.value = !onDropTap.value;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
@@ -1031,7 +1044,7 @@ class CustomDropDownCheckBox extends StatefulWidget {
|
||||
final String header;
|
||||
final String title;
|
||||
final List<String> listData;
|
||||
final Function(String) onItemSelected;
|
||||
final Function(List<String>) onItemSelected;
|
||||
final List<String> images;
|
||||
final Widget? leadingImage;
|
||||
|
||||
@@ -1135,7 +1148,7 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
|
||||
} else {
|
||||
selectedValues.add(item);
|
||||
}
|
||||
widget.onItemSelected(selectedValues.join(', '));
|
||||
widget.onItemSelected(selectedValues);
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -1182,7 +1195,7 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
|
||||
selectedValues.remove(item);
|
||||
}
|
||||
widget.onItemSelected(
|
||||
selectedValues.join(', '));
|
||||
selectedValues);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -238,7 +238,7 @@ class _CustomTextFormField2State extends State<CustomTextFormField2> {
|
||||
void validateField(String value) {
|
||||
setState(() {
|
||||
widget.validationMessage = widget.validator?.call(value) ??
|
||||
(value.isEmpty ? "Empty value" : null);
|
||||
(value.isEmpty ? "" : null);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -333,15 +333,18 @@ class _CustomTextFormField2State extends State<CustomTextFormField2> {
|
||||
inputFormatters: widget.inputFormatters,
|
||||
onChanged: (value) {
|
||||
widget.onInput?.call(value);
|
||||
validateField(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(5.h),
|
||||
Text(
|
||||
widget.validationMessage ?? '',
|
||||
style: TextStyle(color: Colors.red, fontSize: 12.sp),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
widget.validationMessage == null
|
||||
? const SizedBox()
|
||||
: Text(
|
||||
widget.validationMessage ?? '',
|
||||
style: TextStyle(color: Colors.red, fontSize: 12.sp),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user