313 lines
12 KiB
Dart
313 lines
12 KiB
Dart
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/CommonAppbar.dart';
|
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
|
import 'package:regroup/Utils/texts.dart';
|
|
import 'package:regroup/resources/routes/route_name.dart';
|
|
|
|
class MyCommunity extends StatefulWidget {
|
|
const MyCommunity({super.key});
|
|
|
|
@override
|
|
State<MyCommunity> createState() => _MyCommunityState();
|
|
}
|
|
|
|
class _MyCommunityState extends State<MyCommunity> {
|
|
List JoinedcommunityData = [
|
|
{
|
|
"imagePath": "assets/images/png/img2.png",
|
|
"text": "Active alliance network",
|
|
"members": "7 members"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/img34.png",
|
|
"text": "FitFam federation",
|
|
"members": "7 members"
|
|
},
|
|
];
|
|
|
|
List RequestcommunityData = [
|
|
{
|
|
"imagePath": "assets/images/png/img45.png",
|
|
"text": "The athletic town",
|
|
"members": "7 members"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/img2.png",
|
|
"text": "Football fever",
|
|
"members": "7 members"
|
|
},
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// key: _scaffoldKey1,
|
|
backgroundColor: Color(0xFF222935),
|
|
extendBody: true,
|
|
appBar: CommonAppbar(
|
|
titleTxt: "My Community",
|
|
customActionWidget: Row(
|
|
children: [
|
|
Container(
|
|
height: 30.h,
|
|
width: 30.w,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFD90B2E),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Color(0xFF000000).withOpacity(0.25),
|
|
offset: Offset(0, 6),
|
|
blurRadius: 8,
|
|
),
|
|
],
|
|
shape: BoxShape.circle),
|
|
child: Icon(
|
|
Icons.add,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
sizedBoxWidth(12.w),
|
|
Image.asset(
|
|
"assets/images/png/Frame 9.png",
|
|
height: 22.h,
|
|
width: 22.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
body: Stack(children: [
|
|
const CommonBlurLeftRed(),
|
|
const CommonBlurRightRed(),
|
|
const CommonBlurLeft(),
|
|
const CommonBlurRight(),
|
|
Positioned.fill(
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
text18w700_FCFCFC("Joined communities"),
|
|
sizedBoxHeight(15.h),
|
|
Column(
|
|
children: List.generate(JoinedcommunityData.length,
|
|
(index) {
|
|
return communityCard(
|
|
ontap: () {
|
|
Get.toNamed(RouteName.communityDetails);
|
|
},
|
|
imagepath: JoinedcommunityData[index]
|
|
['imagePath'],
|
|
title: JoinedcommunityData[index]['text'],
|
|
members: JoinedcommunityData[index]
|
|
['members']);
|
|
}),
|
|
),
|
|
text18w700_FCFCFC("Requested communities"),
|
|
sizedBoxHeight(20.h),
|
|
Column(
|
|
children: List.generate(RequestcommunityData.length,
|
|
(index) {
|
|
return communityCard(
|
|
ontap: () {},
|
|
imagepath: RequestcommunityData[index]
|
|
['imagePath'],
|
|
title: RequestcommunityData[index]['text'],
|
|
members: RequestcommunityData[index]
|
|
['members']);
|
|
}),
|
|
)
|
|
]),
|
|
)))
|
|
]));
|
|
}
|
|
|
|
Widget communityCard({
|
|
required String imagepath,
|
|
required String title,
|
|
required void Function()? ontap,
|
|
required String members,
|
|
}) {
|
|
return Padding(
|
|
padding: EdgeInsets.only(bottom: 25.h),
|
|
child: GestureDetector(
|
|
onTap: ontap,
|
|
child: commonGlassContainer(
|
|
border: 0.9,
|
|
width: double.infinity,
|
|
height: 162.h,
|
|
borderradius: 10.r,
|
|
customWidget: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
height: 65.h,
|
|
width: 65.h,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
// color: Colors.amber,
|
|
),
|
|
child:
|
|
// Center(
|
|
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
|
|
|
CircleAvatar(
|
|
backgroundImage: AssetImage(
|
|
imagepath,
|
|
),
|
|
),
|
|
),
|
|
sizedBoxWidth(13.w),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
text18w700_FCFCFC(title),
|
|
sizedBoxHeight(10.h),
|
|
Row(
|
|
children: [
|
|
commonGlassContainer(
|
|
border: 0.9,
|
|
width: 30.w,
|
|
height: 30.h,
|
|
borderradius: 100.r,
|
|
customWidget: Center(
|
|
child: Image.asset(
|
|
"assets/images/png/Black.png",
|
|
height: 12.h,
|
|
width: 16.w,
|
|
),
|
|
)),
|
|
sizedBoxWidth(15.w),
|
|
text14w400_FCFCFCblur("10 groups")
|
|
],
|
|
),
|
|
],
|
|
),
|
|
Spacer(),
|
|
PopupMenuButton(
|
|
surfaceTintColor: Color(0xFF222935),
|
|
constraints: BoxConstraints.tightFor(width: 200.w),
|
|
offset: Offset(0, 30),
|
|
color: Color(0xFF222935),
|
|
tooltip: "",
|
|
itemBuilder: (BuildContext context) =>
|
|
<PopupMenuEntry>[
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Mute community"),
|
|
Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/Black (1).png",
|
|
height: 18.h,
|
|
width: 18.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Hide post"),
|
|
Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/mingcute_eye-close-line.png",
|
|
height: 20.h,
|
|
width: 20.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Pin"),
|
|
Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/f7_pin-fill (2).png",
|
|
height: 25.h,
|
|
width: 25.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Leave community"),
|
|
Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/logout 1 (traced).png",
|
|
height: 18.h,
|
|
width: 18.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
child: Image.asset(
|
|
"assets/images/png/Group 1000004071.png",
|
|
height: 13.h,
|
|
width: 3.w,
|
|
)),
|
|
],
|
|
),
|
|
sizedBoxHeight(16.h),
|
|
commonDivider(),
|
|
sizedBoxHeight(10.h),
|
|
Row(
|
|
children: [
|
|
stackContainers(
|
|
number: "+2",
|
|
containerImages: [
|
|
"assets/images/png/cimg3.png",
|
|
"assets/images/png/cimg2.png",
|
|
"assets/images/png/cimg3.png",
|
|
"assets/images/png/cimg2.png",
|
|
],
|
|
),
|
|
sizedBoxWidth(95.w),
|
|
text12w400_FCFCFC_blur(members),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|