Merge pull request #139 from WDI-Ideas/coflicts22aug

conflict solved for page refresh in communkty details page if iser go…
This commit is contained in:
Shubham Shetty
2024-08-22 13:32:50 +05:30
committed by GitHub
2 changed files with 76 additions and 54 deletions

View File

@@ -19,57 +19,64 @@ class _CommunitySettingState extends State<CommunitySetting> {
int communityid = Get.arguments['communityid'];
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Community settings",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
return WillPopScope(
onWillPop: () async{
Get.back(result: true);
return true;
},
child: Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Community settings",
customBack: true,
),
Column(children: [
sizedBoxHeight(30.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.editcommunity, arguments: {
'communityid': communityid,
});
},
child: rowTile(text: 'Edit community info')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managemembers);
},
child: rowTile(text: 'Manage members')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managegroups,
arguments: {
'communityid' : communityid,
}
);
},
child: rowTile(text: 'Manage groups')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managetags, arguments: {
'communityid': communityid,
});
},
child: rowTile(text: 'Manage interest')),
sizedBoxHeight(20.h),
])
]));
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
Column(children: [
sizedBoxHeight(30.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.editcommunity, arguments: {
'communityid': communityid,
});
},
child: rowTile(text: 'Edit community info')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managemembers);
},
child: rowTile(text: 'Manage members')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managegroups,
arguments: {
'communityid' : communityid,
}
);
},
child: rowTile(text: 'Manage groups')),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.managetags, arguments: {
'communityid': communityid,
});
},
child: rowTile(text: 'Manage interest')),
sizedBoxHeight(20.h),
])
])),
);
}
Widget rowTile({

View File

@@ -47,6 +47,12 @@ class _CommunityDetailsState extends State<CommunityDetails> {
super.initState();
}
void refreshData() {
setState(() {
myfuture = CommunityDetail().getCommunityDetail(CommunityId);
});}
pinunpinCommunity(String communitypinid) async {
// utils.loader();
Map<String, dynamic> updata = {
@@ -217,10 +223,19 @@ class _CommunityDetailsState extends State<CommunityDetails> {
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.communitysetting, arguments: {
'communityid': CommunityId,
});
onTap: () async {
var result = await Get.toNamed(
RouteName.communitysetting,
arguments: {
'communityid': CommunityId,
});
if (result != null && result) {
refreshData();
// CommunityDetail().getCommunityDetail(CommunityId);
print("Updating community details...");
// setState(() {});
}
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),