Files
Regroup/lib/Feed Module/Main_Screens/GroupTab/View/GroupManage.dart
2024-06-25 20:14:03 +05:30

618 lines
20 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonTabBar.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Utils/Common/CommonAppbar.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';
class GroupManage extends StatefulWidget {
const GroupManage({super.key});
@override
State<GroupManage> createState() => _GroupManageState();
}
class _GroupManageState extends State<GroupManage> {
List members = [
{"imagePath": "assets/images/png/cimg1.png", "title": "Ryan Dorwart"},
{"imagePath": "assets/images/png/cimg2.png", "title": "Ahmad Rhiel Madsen"},
{"imagePath": "assets/images/png/cimg3.png", "title": "Kaylynn Vaccaro"},
{"imagePath": "assets/images/png/cimg4.png", "title": "Kianna Donin"},
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
];
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Manage members",
customActionWidget: Container(
height: 35.h,
width: 35.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Color(0x40000000),
offset: Offset(0, 6),
blurRadius: 8,
spreadRadius: 0,
),
],
),
child: Icon(Icons.add, color: Colors.white, weight: 2),
),
),
body: Stack(children: [
const CommonBlurLeftRed(),
const CommonBlurRightRed(),
const CommonBlurLeft(),
const CommonBlurRight(),
Positioned.fill(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
DefaultTabController(
length: 4,
child: Column(
children: [
CommonTabBar(tabs: const [
Tab(
text: 'Members',
),
Tab(
text: 'Admins',
),
Tab(
text: 'Requests',
),
Tab(
text: 'Invites',
),
]),
SizedBox(
height: 655.h,
child: TabBarView(
children: [
membersTab(),
AdminsTab(),
RequestsTab(),
InvitesTab(),
],
),
),
],
))
]))
]));
}
Widget membersTab() {
return SingleChildScrollView(
child: Column(children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
children: [
sizedBoxHeight(25.h),
CustomTextFormField(
leadingIcon: Container(
height: 20.h,
width: 20.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 58575.png",
height: 20.h,
width: 20.w,
),
),
),
hintText: "Search members",
),
sizedBoxHeight(20.h),
Row(
children: [
SizedBox(
width: 300.w,
child: CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 17.w,
child: Center(
child: Image.asset(
"assets/images/png/calender.png",
height: 17.h,
width: 17.w,
),
),
),
hintText: "Start date - End date",
)),
Spacer(),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(
child: Image.asset(
"assets/images/png/bi_filter.png",
height: 23.h,
width: 23.w,
),
),
border: 0.5)
],
),
],
),
),
sizedBoxHeight(30.h),
Column(
children: List.generate(members.length, (index) {
return Column(
children: [
rowTile(
imagePath: members[index]["imagePath"],
title: members[index]["title"]),
if (index != members.length - 1) commonDivider(),
],
);
}),
)
]),
);
}
Widget rowTile({
required String imagePath,
required String title,
}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Row(
children: [
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 17.5.r,
),
sizedBoxWidth(10.w),
text16w400_FCFCFC(title),
sizedBoxWidth(8.w),
InkWell(
onTap: () {
dialogwidget();
},
child: Image.asset(
"assets/images/png/calender.png",
height: 15.h,
width: 15.w,
),
),
Spacer(),
Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 5.w,
)
],
),
);
}
dialogwidget() {
Get.dialog(Dialog(
// backgroundColor: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
color: Color(0xFF222935)),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text18w700_FCFCFC("Availability"),
sizedBoxHeight(16.h),
Row(
children: [
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("M")),
border: 0.5),
sizedBoxWidth(15.w),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("Tu")),
border: 0.5),
sizedBoxWidth(15.w),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("W")),
border: 0.5),
Spacer(),
Row(
children: [
Image.asset(
"assets/images/png/clock.png",
height: 20.h,
width: 20.w,
),
sizedBoxWidth(8.w),
text16w400_FCFCFC("4pm - 8pm"),
],
)
],
),
sizedBoxHeight(20.h),
commonDivider(),
sizedBoxHeight(20.h),
Row(
children: [
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("Th")),
border: 0.5),
sizedBoxWidth(15.w),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("F")),
border: 0.5),
sizedBoxWidth(15.w),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(child: text16w400_FCFCFC("Sa")),
border: 0.5),
Spacer(),
Row(
children: [
Image.asset(
"assets/images/png/clock.png",
height: 20.h,
width: 20.w,
),
sizedBoxWidth(8.w),
text16w400_FCFCFC("5pm - 9pm"),
],
)
],
),
sizedBoxHeight(20.h),
commonDivider(),
sizedBoxHeight(20.h),
Row(
children: [
GlassmorphicContainer(
width: 40.w,
height: 40.h,
borderRadius: 100,
border: 0.5,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFD90B2E).withOpacity(0.18),
const Color(0xFFD90B2E).withOpacity(0.4),
],
stops: const [
0.1,
1,
],
),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xffD90B2E),
Color(0xFFD90B2E),
],
),
blur: 10,
child: Center(child: text16w400_FCFCFC("Su")),
),
sizedBoxWidth(8.w),
text16w400_FCFCFC("Not available")
],
),
],
),
),
),
],
),
));
}
Widget AdminsTab() {
return Column(
children: [],
);
}
Widget RequestsTab() {
return SingleChildScrollView(
child: Column(children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
children: [
sizedBoxHeight(25.h),
CustomTextFormField(
leadingIcon: Container(
height: 20.h,
width: 20.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 58575.png",
height: 20.h,
width: 20.w,
),
),
),
hintText: "Search members",
),
sizedBoxHeight(20.h),
Row(
children: [
SizedBox(
width: 300.w,
child: CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 17.w,
child: Center(
child: Image.asset(
"assets/images/png/calender.png",
height: 17.h,
width: 17.w,
),
),
),
hintText: "Start date - End date",
)),
Spacer(),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(
child: Image.asset(
"assets/images/png/bi_filter.png",
height: 23.h,
width: 23.w,
),
),
border: 0.5)
],
),
],
),
),
sizedBoxHeight(30.h),
Column(
children: List.generate(members.length, (index) {
return Column(
children: [
requestsTile(
imagePath: members[index]["imagePath"],
title: members[index]["title"]),
if (index != members.length - 1) commonDivider(),
],
);
}),
)
]),
);
}
Widget requestsTile({
required String imagePath,
required String title,
}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Row(
children: [
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 17.5.r,
),
sizedBoxWidth(10.w),
text16w400_FCFCFC(title),
sizedBoxWidth(8.w),
InkWell(
onTap: () {
dialogwidget();
},
child: Image.asset(
"assets/images/png/calender.png",
height: 15.h,
width: 15.w,
),
),
Spacer(),
Container(
width: 74.w,
height: 25.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(23.r),
color: Color(0xFFD90B2E),
),
child: Center(child: text11w400white("Confirm")),
),
sizedBoxWidth(6.w),
Icon(
Icons.clear,
size: 20,
color: Colors.white,
)
],
),
);
}
Widget InvitesTab() {
return SingleChildScrollView(
child: Column(children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
children: [
sizedBoxHeight(25.h),
CustomTextFormField(
leadingIcon: Container(
height: 20.h,
width: 20.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 58575.png",
height: 20.h,
width: 20.w,
),
),
),
hintText: "Search members",
),
sizedBoxHeight(20.h),
Row(
children: [
SizedBox(
width: 300.w,
child: CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 17.w,
child: Center(
child: Image.asset(
"assets/images/png/calender.png",
height: 17.h,
width: 17.w,
),
),
),
hintText: "Start date - End date",
)),
Spacer(),
commonGlassContainer(
width: 40.w,
height: 40.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(
child: Image.asset(
"assets/images/png/bi_filter.png",
height: 23.h,
width: 23.w,
),
),
border: 0.5)
],
),
],
),
),
sizedBoxHeight(30.h),
Column(
children: List.generate(members.length, (index) {
return Column(
children: [
invitesTile(
imagePath: members[index]["imagePath"],
title: members[index]["title"]),
if (index != members.length - 1) commonDivider(),
],
);
}),
)
]),
);
}
Widget invitesTile({
required String imagePath,
required String title,
}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Row(
children: [
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 17.5.r,
),
sizedBoxWidth(10.w),
text16w400_FCFCFC(title),
sizedBoxWidth(8.w),
InkWell(
onTap: () {
dialogwidget();
},
child: Image.asset(
"assets/images/png/calender.png",
height: 15.h,
width: 15.w,
),
),
Spacer(),
Container(
width: 74.w,
height: 25.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(23.r),
color: Color(0xFFD90B2E),
),
child: Center(child: text11w400white("Invite")),
),
],
),
);
}
}