edit community details completed and some fixes in main page and also fixes in communities page

This commit is contained in:
Sahil Shetty
2024-08-17 00:44:52 +05:30
parent ace7d84b29
commit 9d98c57bbd
7 changed files with 714 additions and 588 deletions

View File

@@ -176,6 +176,7 @@ class ApiUrls {
static const geteditcommunity = "${baseUrl}edit-community";
static const posteditcommunity = "${baseUrl}update-community";

View File

@@ -125,7 +125,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
debugShowCheckedModeBanner: false,
// initialRoute: RouteName.individualactivitystep2,
initialRoute: RouteName.individualactivitystep2,
initialRoute: RouteName.splashScreen,
getPages: AppRoutes.appRoutes(),
),

View File

@@ -152,151 +152,154 @@ class _AddGroupState extends State<AddGroup> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Add groups",
),
resizeToAvoidBottomInset: false,
bottomNavigationBar: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
child: CustomButton(
text: "Add",
onPressed: () {
// Get.toNamed(RouteName.mycommunity);
print('selected groups are ${_selectedIndices.toString()}');
Uploadata();
},
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Add groups",
),
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
resizeToAvoidBottomInset: false,
bottomNavigationBar: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
child: CustomButton(
text: "Add",
onPressed: () {
// Get.toNamed(RouteName.mycommunity);
print('selected groups are ${_selectedIndices.toString()}');
Uploadata();
},
),
),
SingleChildScrollView(
child: Column(children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
CustomTextFormField(
leadingIcon: SizedBox(
height: 23,
width: 23,
child: Center(
child: Image.asset(
"assets/images/png/ion_search-outline.png",
height: 23,
width: 23,
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Column(children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
CustomTextFormField(
leadingIcon: SizedBox(
height: 23,
width: 23,
child: Center(
child: Image.asset(
"assets/images/png/ion_search-outline.png",
height: 23,
width: 23,
),
),
),
hintText: "Search groups",
onInput: (value) {
Getcommunity().getCommunityAddGroupsearch(value,
streamController: searchcontroller);
},
),
hintText: "Search groups",
onInput: (value) {
Getcommunity().getCommunityAddGroupsearch(value,
streamController: searchcontroller);
},
),
sizedBoxHeight(25.h),
// Row(
// children: [
// commonGlassUI(
// opacity1: 0.24,
// opacity2: 0.24,
// width: 50.w,
// height: 50.h,
// borderRadius: BorderRadius.circular( 100),
// customWidget: Center(
// child: Image.asset(
// "assets/images/png/Black.png",
// height: 30.h,
// width: 30.w,
// )),
// borderwidth: 0.5),
// sizedBoxWidth(8.w),
// text18w400_FCFCFC("Create group"),
// Spacer(),
// Icon(
// Icons.arrow_forward_ios_outlined,
// color: Colors.white,
// size: 14.sp,
// ),
// ],
// ),
// sizedBoxHeight(25.h),
sizedBoxHeight(30.h),
text18w700white("Existing Groups"),
sizedBoxHeight(20.h),
]),
),
StreamBuilder<CommunityAddgroupsModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(),
],
),
);
} else if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.sp),
),
);
} else {
return communityaddgroupobj!.data.isEmpty
? _buildNoDataBody(context)
: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: communityaddgroupobj!.data.length,
itemBuilder: (context, index) {
final isChecked = _selectedIndices.contains(
communityaddgroupobj!.data[index].id!);
return Column(
children: [
groupWidget(
index:
communityaddgroupobj!.data[index].id!,
imagePath: communityaddgroupobj!
.data[index].groupImage ??
'',
title: communityaddgroupobj!
.data[index].title!,
subtitle: communityaddgroupobj!
.data[index].description!,
isChecked: isChecked,
// isCheckedList[index],
onCheckedChanged: (bool? value) {
// isCheckedList[index] = value ?? false;
_onContainerTap(communityaddgroupobj!
.data[index].id!);
},
),
commonDivider(),
],
);
},
);
}
}),
sizedBoxHeight(50.h),
]),
)
]));
sizedBoxHeight(25.h),
// Row(
// children: [
// commonGlassUI(
// opacity1: 0.24,
// opacity2: 0.24,
// width: 50.w,
// height: 50.h,
// borderRadius: BorderRadius.circular( 100),
// customWidget: Center(
// child: Image.asset(
// "assets/images/png/Black.png",
// height: 30.h,
// width: 30.w,
// )),
// borderwidth: 0.5),
// sizedBoxWidth(8.w),
// text18w400_FCFCFC("Create group"),
// Spacer(),
// Icon(
// Icons.arrow_forward_ios_outlined,
// color: Colors.white,
// size: 14.sp,
// ),
// ],
// ),
// sizedBoxHeight(25.h),
sizedBoxHeight(30.h),
text18w700white("Existing Groups"),
sizedBoxHeight(20.h),
]),
),
StreamBuilder<CommunityAddgroupsModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(),
],
),
);
} else if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.sp),
),
);
} else {
return communityaddgroupobj!.data.isEmpty
? _buildNoDataBody(context)
: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: communityaddgroupobj!.data.length,
itemBuilder: (context, index) {
final isChecked = _selectedIndices.contains(
communityaddgroupobj!.data[index].id!);
return Column(
children: [
groupWidget(
index:
communityaddgroupobj!.data[index].id!,
imagePath: communityaddgroupobj!
.data[index].groupImage ??
'',
title: communityaddgroupobj!
.data[index].title!,
subtitle: communityaddgroupobj!
.data[index].description!,
isChecked: isChecked,
// isCheckedList[index],
onCheckedChanged: (bool? value) {
// isCheckedList[index] = value ?? false;
_onContainerTap(communityaddgroupobj!
.data[index].id!);
},
),
commonDivider(),
],
);
},
);
}
}),
sizedBoxHeight(50.h),
]),
)
])),
);
}
Widget _buildNoDataBody(context) {

View File

@@ -160,7 +160,7 @@ class _NewCommunityState extends State<NewCommunity> {
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
resizeToAvoidBottomInset: true,
appBar: CommonAppbar(
titleTxt: "New community",
),

View File

@@ -425,7 +425,11 @@ class _CommunityDetailsState extends State<CommunityDetails> {
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.addgroup);
// Get.toNamed(RouteName.addgroup);
Get.toNamed(RouteName.group, arguments: {
'id': CommunityId,
'iscommunity': true,
});
},
child: commonGlassUI(
width: double.infinity,

View File

@@ -15,4 +15,15 @@ class PostMethodCommunity {
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> postEditcommunity(updata) async {
print("updata is $updata");
final response = await NetworkApiServices().postApi(
updata,
ApiUrls.posteditcommunity,
);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
}