337 lines
12 KiB
Dart
337 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/CommonBottomNavigationBar.dart';
|
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
|
import 'package:regroup/Common/CommonWidget.dart';
|
|
import 'package:regroup/Common/controller/MainScreen.dart';
|
|
import 'package:regroup/Utils/Common/CustomTextformfield.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 GroupTab extends StatefulWidget {
|
|
const GroupTab({super.key});
|
|
|
|
@override
|
|
State<GroupTab> createState() => _GroupTabState();
|
|
}
|
|
|
|
class _GroupTabState extends State<GroupTab> {
|
|
List groupData = [
|
|
{
|
|
"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"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/img2.png",
|
|
"text": "Active alliance network",
|
|
"members": "7 members"
|
|
},
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
// key: _scaffoldKey1,
|
|
backgroundColor: const Color(0xFF222935),
|
|
extendBody: true,
|
|
appBar: AppBar(
|
|
scrolledUnderElevation: 0.0,
|
|
backgroundColor: const Color(0xff222935),
|
|
elevation: 0,
|
|
automaticallyImplyLeading: false,
|
|
title: text20700white("Groups"),
|
|
actions: [
|
|
InkWell(
|
|
onTap: () {
|
|
// Get.toNamed(RouteName.addEvent);
|
|
},
|
|
child: Container(
|
|
height: 35.h,
|
|
width: 35.w,
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFFD90B2E),
|
|
shape: BoxShape.circle,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Color(0x40000000),
|
|
offset: Offset(0, 6),
|
|
blurRadius: 8,
|
|
spreadRadius: 0,
|
|
),
|
|
],
|
|
),
|
|
child: const Icon(Icons.add, color: Colors.white, weight: 2),
|
|
),
|
|
),
|
|
sizedBoxWidth(14.w),
|
|
InkWell(
|
|
onTap: () {
|
|
// Get.toNamed(RouteName.setavailabillity);
|
|
},
|
|
child: Image.asset(
|
|
'assets/images/png/ion_search-outline.png',
|
|
height: 22.h,
|
|
width: 22.w,
|
|
),
|
|
),
|
|
sizedBoxWidth(14.w),
|
|
InkWell(
|
|
onTap: () {
|
|
// Get.toNamed(RouteName.managememberscal);
|
|
},
|
|
child: Image.asset(
|
|
'assets/images/png/Frame 9.png',
|
|
height: 22.h,
|
|
width: 22.w,
|
|
),
|
|
),
|
|
sizedBoxWidth(16.w),
|
|
],
|
|
),
|
|
body: Stack(children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
|
fit: BoxFit.fill)),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
child: Column(children: [
|
|
sizedBoxHeight(25.h),
|
|
Row(
|
|
children: [
|
|
const Spacer(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.requestedgroups);
|
|
},
|
|
child: text16w700_FCFCFCUnderline("Requested groups")),
|
|
],
|
|
),
|
|
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",
|
|
),
|
|
sizedBoxHeight(20.h),
|
|
Expanded(
|
|
child: ListView.builder(
|
|
shrinkWrap: true,
|
|
physics: const BouncingScrollPhysics(),
|
|
itemCount: groupData.length,
|
|
itemBuilder: (context, index) {
|
|
return groupCard(
|
|
ontap: () {
|
|
Get.toNamed(RouteName.groupdetail);
|
|
},
|
|
imagepath: groupData[index]['imagePath'],
|
|
title: groupData[index]['text'],
|
|
members: groupData[index]['members']);
|
|
},
|
|
),
|
|
)
|
|
]),
|
|
),
|
|
]),
|
|
bottomNavigationBar: bottomnavigationbar(mainController),
|
|
);
|
|
}
|
|
|
|
Widget groupCard({
|
|
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: commonGlassUI(
|
|
width: double.infinity,
|
|
height: 162.h,
|
|
borderwidth: 0.9,
|
|
borderRadius: BorderRadius.circular(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: const 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: [
|
|
Image.asset(
|
|
"assets/images/png/community 1 (traced).png",
|
|
height: 20.h,
|
|
width: 20.w,
|
|
),
|
|
sizedBoxWidth(3.w),
|
|
text14w400_FCFCFCblur("10 groups")
|
|
],
|
|
),
|
|
],
|
|
),
|
|
const Spacer(),
|
|
PopupMenuButton(
|
|
surfaceTintColor: const Color(0xFF222935),
|
|
constraints: BoxConstraints.tightFor(width: 200.w),
|
|
offset: const Offset(0, 30),
|
|
color: const Color(0xFF222935),
|
|
tooltip: "",
|
|
itemBuilder: (BuildContext context) =>
|
|
<PopupMenuEntry>[
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Mute group"),
|
|
const Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/Black (1).png",
|
|
height: 18.h,
|
|
width: 18.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Pin group"),
|
|
const Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/f7_pin-fill (2).png",
|
|
height: 27.h,
|
|
width: 27.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
text14w400_FCFCFC("Make primary"),
|
|
const Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/leave group.png",
|
|
height: 20.h,
|
|
width: 20.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const PopupMenuDivider(),
|
|
PopupMenuItem(
|
|
onTap: () {},
|
|
child: Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 8.w),
|
|
child: Row(
|
|
children: [
|
|
// text14w400_FCFCFC("Leave group"),
|
|
text14w400_D90B2E("Leave group"),
|
|
const Spacer(),
|
|
Image.asset(
|
|
"assets/images/png/LightGray22.png",
|
|
height: 18.h,
|
|
width: 18.w,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
child: Image.asset(
|
|
"assets/images/png/Group 1000004071.png",
|
|
height: 18.h,
|
|
width: 20.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),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
}
|