Files
Regroup/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart
2024-06-10 12:43:54 +05:30

268 lines
8.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_connect/http/src/utils/utils.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonTabBar.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/controller/CommonTextFormField.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';
class AddUsers extends StatefulWidget {
const AddUsers({super.key});
@override
State<AddUsers> createState() => _AddUsersState();
}
class _AddUsersState extends State<AddUsers> {
List groupData = [
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Ryan Dorwart",
"subtitle": "Row row row your boat",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Football fever",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Kaylynn Vaccaro",
"subtitle": "The athletic town",
},
{
"imagePath": "assets/images/png/cimg4.png",
"title": "Kianna Donin",
"subtitle": "Active alliance network",
},
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Football fever",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Kaylynn Vaccaro",
"subtitle": "The athletic town",
},
{
"imagePath": "assets/images/png/cimg4.png",
"title": "Kianna Donin",
"subtitle": "Active alliance network",
},
];
List<bool> isCheckedList = [false, false, false, false, false, false, false];
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Add users",
),
body: Stack(children: [
const CommonBlurLeftRed(),
const CommonBlurRightRed(),
const CommonBlurLeft(),
const CommonBlurRight(),
Positioned.fill(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(10.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: 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 users",
),
),
sizedBoxHeight(16.h),
DefaultTabController(
length: 3,
// initialIndex: selectedIndex.value,
child: Column(children: [
CommonTabBar(tabs: const [
Tab(
text: 'Group',
),
Tab(
text: 'Sub-group',
),
Tab(
text: 'Followers',
),
]),
SizedBox(
height: 600.h,
child: TabBarView(
children: [
GroupTab(),
SubgroupTab(),
FollowersTab(),
],
),
),
]))
])))
]));
}
Widget GroupTab() {
return Column(
children: [
sizedBoxHeight(30.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
children: [
text18w700_FCFCFC("Group members"),
Spacer(),
commonGlassContainer(
width: 35.w,
height: 35.h,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (5)22.png",
height: 12.h,
width: 12.w,
),
),
border: 0.5),
sizedBoxWidth(14.w),
commonGlassContainer(
width: 35.w,
height: 35.h,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/bi_filter.png",
height: 22.h,
width: 18.w,
),
),
border: 0.5)
],
),
),
sizedBoxHeight(15.h),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: groupData.length,
itemBuilder: (context, index) {
return Column(
children: [
groupWidget(
index: index,
imagePath: groupData[index]["imagePath"],
title: groupData[index]["title"],
subtitle: groupData[index]["subtitle"],
isChecked: isCheckedList[index],
onCheckedChanged: (bool? value) {
setState(() {
isCheckedList[index] = value ?? false;
});
},
),
if (index != groupData.length - 1) commonDivider(),
],
);
},
),
),
],
);
}
Widget groupWidget({
required int index,
required String imagePath,
required String title,
required String subtitle,
required bool isChecked,
required ValueChanged<bool?> onCheckedChanged,
}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
text16w400_FCFCFC(title),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/calender.png",
height: 14.h,
width: 14.w,
)
],
),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(subtitle),
],
),
Spacer(),
commonGlassContainer(
border: 1,
borderradius: 2,
height: 23.h,
width: 23.w,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Transform.scale(
scale: 1.4,
child: Checkbox(
side: BorderSide(color: Color(0xFF434A53)),
value: isChecked,
activeColor: Colors.transparent,
checkColor: Colors.white,
onChanged: onCheckedChanged,
),
),
),
],
),
);
}
Widget SubgroupTab() {
return Column(
children: [],
);
}
Widget FollowersTab() {
return Column(
children: [],
);
}
}