creategroups #23
BIN
assets/images/png/availabilitycalendar.png
Normal file
BIN
assets/images/png/availabilitycalendar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/png/basil_sort-outline.png
Normal file
BIN
assets/images/png/basil_sort-outline.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 254 B |
BIN
assets/images/png/ph_camera-light.png
Normal file
BIN
assets/images/png/ph_camera-light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 603 B |
@@ -198,4 +198,8 @@ class ApiUrls {
|
||||
|
||||
static const postmanageaddgroupscommunity = "${baseUrl}add-groups-in-community";
|
||||
|
||||
static const getgroupsaddfollowers = "${baseUrl}fetch-follower-to-add";
|
||||
|
||||
static const postcreategroups = "${baseUrl}create-group";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/CalenderTab.dart';
|
||||
import 'package:regroup/Main_Screens/Calendar/Calendar.dart';
|
||||
import 'package:regroup/Main_Screens/Chats/View/chatsmainscreen.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GroupTab.dart';
|
||||
import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart';
|
||||
|
||||
|
||||
class MainController extends GetxController {
|
||||
var selectedIndex = 0.obs;
|
||||
|
||||
var currentTab = [
|
||||
const CommunityScreen(),
|
||||
const GroupTab(),
|
||||
const CalenderTab(),
|
||||
const Calendar(),
|
||||
const ChatsMainScreen(),
|
||||
const ProfileTab(),
|
||||
].obs;
|
||||
|
||||
433
lib/Main_Screens/Calendar/AddUsers.dart
Normal file
433
lib/Main_Screens/Calendar/AddUsers.dart
Normal file
@@ -0,0 +1,433 @@
|
||||
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/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,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Add users",
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
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: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Group members ',
|
||||
),
|
||||
Tab(
|
||||
text: 'Subgroups ',
|
||||
),
|
||||
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"),
|
||||
const Spacer(),
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)22.png",
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(14.w),
|
||||
commonGlassUI(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
borderwidth: 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),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 14.h,
|
||||
width: 14.w,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(4.h),
|
||||
text12w400_FCFCFC_blur(subtitle),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
commonGlassUI(
|
||||
borderwidth: 1,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: const BorderSide(color: Color(0xFF434A53)),
|
||||
value: isChecked,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: onCheckedChanged,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
dialogwidget() {
|
||||
Get.dialog(Dialog(
|
||||
// backgroundColor: Colors.transparent,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
color: const 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: [
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("M")),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Tu")),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("W")),
|
||||
borderwidth: 0.5),
|
||||
const 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: [
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Th")),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("F")),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassUI(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Sa")),
|
||||
borderwidth: 0.5),
|
||||
const 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: [
|
||||
const Color(0xFFD90B2E).withOpacity(0.18),
|
||||
const Color(0xFFD90B2E).withOpacity(0.4),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
],
|
||||
),
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xffD90B2E),
|
||||
Color(0xFFD90B2E),
|
||||
],
|
||||
),
|
||||
blur: 6,
|
||||
child: Center(child: text16w400_FCFCFC("Su")),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_FCFCFC("Not available")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget subgroupTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget followersTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
297
lib/Main_Screens/Calendar/AvailabilityRequest.dart
Normal file
297
lib/Main_Screens/Calendar/AvailabilityRequest.dart
Normal file
@@ -0,0 +1,297 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.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/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class AvailabilityRequest extends StatefulWidget {
|
||||
const AvailabilityRequest({super.key});
|
||||
|
||||
@override
|
||||
State<AvailabilityRequest> createState() => _AvailabilityRequestState();
|
||||
}
|
||||
|
||||
class _AvailabilityRequestState extends State<AvailabilityRequest> {
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
|
||||
TimeOfDay? slotduration = const TimeOfDay(hour: 15, minute: 0);
|
||||
bool swichvalue = false;
|
||||
bool deadline = false;
|
||||
|
||||
String formatTimeOfDay(TimeOfDay time) {
|
||||
final now = DateTime.now();
|
||||
final dt = DateTime(now.year, now.month, now.day, time.hour, time.minute);
|
||||
final format =
|
||||
MediaQuery.of(context).alwaysUse24HourFormat ? 'HH:mm' : 'h:mm a';
|
||||
return DateFormat(format).format(dt);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Availability Request",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Event title (optional)"),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)12.png",
|
||||
fit: BoxFit.cover,
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "",
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Post in"),
|
||||
sizedBoxHeight(10.h),
|
||||
CommonDropdownBtn(
|
||||
hint: '',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 28.w,
|
||||
child: Center(
|
||||
child: Image.asset("assets/images/png/Black.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Slot Duration"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: slotduration);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
slotduration = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
customWidget: Center(
|
||||
child: Row(children: [
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_white(formatTimeOfDay(slotduration!)),
|
||||
]),
|
||||
),
|
||||
borderwidth: 1),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Transform.scale(
|
||||
scaleY: 1,
|
||||
child: CupertinoSwitch(
|
||||
value: swichvalue,
|
||||
trackColor: Colors.white.withOpacity(0.4),
|
||||
activeColor: const Color(0xFF34C759),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
swichvalue = value ?? false;
|
||||
});
|
||||
}))
|
||||
],
|
||||
),
|
||||
text16400white("Weekly recurrence"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(context, dateController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
textEditingController: dateController,
|
||||
hintText: "",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Transform.scale(
|
||||
scaleY: 1,
|
||||
child: CupertinoSwitch(
|
||||
value: deadline,
|
||||
trackColor: Colors.white.withOpacity(0.4),
|
||||
activeColor: const Color(0xFF34C759),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
deadline = value ?? false;
|
||||
});
|
||||
}))
|
||||
],
|
||||
),
|
||||
text16400white("Deadline"),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Date"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: slotduration);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
slotduration = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
customWidget: Center(
|
||||
child: Row(children: [
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_white(
|
||||
formatTimeOfDay(slotduration!)),
|
||||
]),
|
||||
),
|
||||
borderwidth: 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.h),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Time"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, dateController2),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
textEditingController: dateController2,
|
||||
hintText: "",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
CommonBtn(text: "Save"),
|
||||
sizedBoxHeight(50.h),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget containerWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Center(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16400white(title),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/cancelicon.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
borderwidth: 1);
|
||||
}
|
||||
}
|
||||
792
lib/Main_Screens/Calendar/Calendar.dart
Normal file
792
lib/Main_Screens/Calendar/Calendar.dart
Normal file
@@ -0,0 +1,792 @@
|
||||
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/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/controller/CommonTextFormField.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
class Calendar extends StatefulWidget {
|
||||
const Calendar({super.key});
|
||||
|
||||
@override
|
||||
State<Calendar> createState() => _CalendarState();
|
||||
}
|
||||
|
||||
class _CalendarState extends State<Calendar> {
|
||||
List sessionData = [
|
||||
{
|
||||
"title": "Attending events",
|
||||
"imagePath": "assets/images/png/Rectangle299.png",
|
||||
"names": "Sports challenge"
|
||||
},
|
||||
{
|
||||
"title": "Shown Interest",
|
||||
"imagePath": "assets/images/png/Rectangle 25.png",
|
||||
"names": "Ultimate athlete challenge"
|
||||
},
|
||||
{
|
||||
"title": "Not going",
|
||||
"imagePath": "assets/images/png/Rectangle 24.png",
|
||||
"names": "Cyclotron challenge"
|
||||
},
|
||||
];
|
||||
|
||||
List communityData = [
|
||||
{
|
||||
"title": "Featured community",
|
||||
"imagePath": "assets/images/png/Rectangle 24.png",
|
||||
"names": "Sports challenge"
|
||||
},
|
||||
{
|
||||
"title": "Featured community",
|
||||
"imagePath": "assets/images/png/Rectangle 24.png",
|
||||
"names": "Tri-sport challenge"
|
||||
},
|
||||
];
|
||||
|
||||
CalendarController? _sessionCalController;
|
||||
CalendarController? _comCalController;
|
||||
List<Appointment>? _appointments;
|
||||
// final List<String> _nameCollection = <String>[];
|
||||
// final List<String> _userImages = <String>[];
|
||||
// DateTime? _startDate;
|
||||
// DateTime? _endDate;
|
||||
// bool _isRangeSelection = false;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_sessionCalController = CalendarController();
|
||||
_comCalController = CalendarController();
|
||||
|
||||
_appointments = <Appointment>[
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 26, 9, 0),
|
||||
endTime: DateTime(2024, 6, 26, 10, 30),
|
||||
subject: 'Development Meeting',
|
||||
color: const Color(0XFFFC571D)),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 26, 18, 0),
|
||||
endTime: DateTime(2024, 6, 26, 18, 30),
|
||||
subject: 'GeneralMeeting',
|
||||
color: const Color(0xFF8B1FA9)),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 28, 9, 0),
|
||||
endTime: DateTime(2024, 6, 28, 10, 30),
|
||||
subject: 'Lunch',
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 25, 10, 0),
|
||||
endTime: DateTime(2024, 6, 25, 10, 30),
|
||||
subject: 'Meeting',
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime.now(),
|
||||
endTime: DateTime.now().add(const Duration(hours: 3)),
|
||||
subject: 'Match day',
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime.now(),
|
||||
endTime: DateTime.now().add(const Duration(hours: 3)),
|
||||
subject: 'Muharram/Ashura',
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
DateTime selectedDate = DateTime.now();
|
||||
@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("Sessions"),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addUser);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.8),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.8),
|
||||
],
|
||||
stops: const [0.1, 1],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(
|
||||
color: const Color(0xff434A53),
|
||||
),
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/availabilitycalendar.png',
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
text12400white('Availability')
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(14.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addEvent);
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 30.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.managememberscal);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 9.png',
|
||||
height: 25.h,
|
||||
width: 25.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: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(children: [
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'My calendar',
|
||||
),
|
||||
Tab(
|
||||
text: 'Community calendar',
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
myCalendarTab(),
|
||||
comCalendarTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(90.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]))
|
||||
]),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
);
|
||||
}
|
||||
|
||||
Widget myCalendarTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.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 events",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 400.h,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
// borderw: 0,
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: SfCalendar(
|
||||
view: CalendarView.month,
|
||||
appointmentTextStyle: const TextStyle(color: Colors.white),
|
||||
headerStyle: const CalendarHeaderStyle(
|
||||
textStyle: TextStyle(
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
),
|
||||
weekNumberStyle: const WeekNumberStyle(
|
||||
textStyle: TextStyle(color: Colors.red),
|
||||
),
|
||||
viewHeaderStyle: const ViewHeaderStyle(
|
||||
dateTextStyle: TextStyle(color: Colors.white),
|
||||
dayTextStyle: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
cellBorderColor: Colors.white,
|
||||
todayHighlightColor: Colors.transparent,
|
||||
todayTextStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
controller: _sessionCalController,
|
||||
showNavigationArrow: false,
|
||||
allowViewNavigation: false,
|
||||
allowDragAndDrop: true,
|
||||
showDatePickerButton: true,
|
||||
viewNavigationMode: ViewNavigationMode.snap,
|
||||
showCurrentTimeIndicator: true,
|
||||
dataSource: MeetingDataSource(_appointments!),
|
||||
timeSlotViewSettings: TimeSlotViewSettings(
|
||||
timeTextStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
timelineAppointmentHeight: 60.h,
|
||||
timeIntervalWidth: 70,
|
||||
),
|
||||
monthCellBuilder: (context, details) {
|
||||
bool isToday = details.date.day == DateTime.now().day &&
|
||||
details.date.month == DateTime.now().month &&
|
||||
details.date.year == DateTime.now().year;
|
||||
return Center(
|
||||
child: Container(
|
||||
width: 40
|
||||
.w, // Adjust the width to make the circle smaller
|
||||
height: 40
|
||||
.h, // Adjust the height to make the circle smaller
|
||||
decoration: BoxDecoration(
|
||||
color: isToday ? Colors.red : Colors.transparent,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
details.date.day.toString(),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
// Ensure text color is white
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
resourceViewSettings: const ResourceViewSettings(
|
||||
displayNameTextStyle:
|
||||
TextStyle(color: Colors.white, fontSize: 10),
|
||||
showAvatar: true,
|
||||
),
|
||||
appointmentBuilder: (context, details) {
|
||||
final Appointment appointment =
|
||||
details.appointments.first;
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: details.appointments.first.color ?? Colors.red,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
appointment.subject,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 8.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget sessionCard({
|
||||
required String title,
|
||||
required String imagePath,
|
||||
required String names,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(25.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.eventDetails);
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 300.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
borderwidth: 1.w,
|
||||
customWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 151.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.r),
|
||||
topLeft: Radius.circular(10.r))),
|
||||
child: Image.asset(
|
||||
imagePath,
|
||||
fit: BoxFit.cover,
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text10w400_FCFCFC_blur("29th april 2024"),
|
||||
sizedBoxWidth(10.w),
|
||||
Container(
|
||||
height: 15,
|
||||
width: 1,
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text10w400_FCFCFC_blur("3:00 pm"),
|
||||
sizedBoxWidth(10.w),
|
||||
Container(
|
||||
height: 15,
|
||||
width: 1,
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text10w400_FCFCFC_blur("Iron titans fitness crew"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16.w),
|
||||
child: text18w700_FCFCFC(names),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
CircleAvatar(
|
||||
radius: 12.r,
|
||||
backgroundImage: const AssetImage(
|
||||
"assets/images/png/Ellipse 52.png"),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text14w400_FCFCFC("Ryan dorwat"),
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget comCalendarTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
|
||||
Stack(children: [
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 530.h,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
// border: 0,
|
||||
customWidget: SfCalendar(
|
||||
view: CalendarView.month,
|
||||
appointmentTextStyle: const TextStyle(color: Colors.white),
|
||||
headerStyle: const CalendarHeaderStyle(
|
||||
textStyle: TextStyle(
|
||||
color: Color(0xFFD90B2E),
|
||||
)),
|
||||
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
|
||||
|
||||
weekNumberStyle: const WeekNumberStyle(
|
||||
textStyle: TextStyle(color: Colors.white)),
|
||||
viewHeaderStyle: const ViewHeaderStyle(
|
||||
// backgroundColor: Colors.amber,
|
||||
dateTextStyle: TextStyle(color: Colors.white),
|
||||
dayTextStyle: TextStyle(
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
),
|
||||
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
|
||||
// selectionDecoration: BoxDecoration(color: Colors.amber),
|
||||
backgroundColor: Colors.transparent,
|
||||
// firstDayOfWeek: 3,
|
||||
cellBorderColor: Colors.white,
|
||||
todayHighlightColor: const Color(0xFFD90B2E),
|
||||
todayTextStyle: const TextStyle(color: Colors.white),
|
||||
controller: _comCalController,
|
||||
showNavigationArrow: true,
|
||||
allowViewNavigation: true,
|
||||
allowDragAndDrop: true,
|
||||
showDatePickerButton: true,
|
||||
monthViewSettings: const MonthViewSettings(
|
||||
navigationDirection: MonthNavigationDirection.horizontal,
|
||||
),
|
||||
allowedViews: const [
|
||||
CalendarView.month,
|
||||
// CalendarView.day,
|
||||
CalendarView.schedule,
|
||||
],
|
||||
viewNavigationMode: ViewNavigationMode.snap,
|
||||
showCurrentTimeIndicator: true,
|
||||
dataSource: MeetingDataSource(_appointments!),
|
||||
onTap: calendarTapped,
|
||||
timeSlotViewSettings: TimeSlotViewSettings(
|
||||
// minimumAppointmentDuration: Duration(hours: 5),
|
||||
timeTextStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
timelineAppointmentHeight: 60.h,
|
||||
// timeIntervalWidth: 100,
|
||||
|
||||
// timeIntervalHeight: 50,
|
||||
timeIntervalWidth: 70,
|
||||
),
|
||||
monthCellBuilder: (context, details) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
details.date.day.toString(),
|
||||
style: const TextStyle(
|
||||
color: Colors.white), // Set text color to white
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
resourceViewSettings: const ResourceViewSettings(
|
||||
displayNameTextStyle:
|
||||
TextStyle(color: Colors.white, fontSize: 10),
|
||||
showAvatar: true,
|
||||
),
|
||||
scheduleViewSettings: const ScheduleViewSettings(
|
||||
placeholderTextStyle: TextStyle(color: Colors.white),
|
||||
dayHeaderSettings: DayHeaderSettings(
|
||||
dateTextStyle: TextStyle(color: Colors.white),
|
||||
dayTextStyle: TextStyle(color: Colors.white),
|
||||
)),
|
||||
appointmentBuilder: (context, details) {
|
||||
final Appointment appointment = details.appointments.first;
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: details.appointments.first.color ?? Colors.blue,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
appointment.subject,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 8.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
]),
|
||||
|
||||
// SfCalendar(
|
||||
// view: CalendarView.month,
|
||||
// controller: _calendarController,
|
||||
// onSelectionChanged: (CalendarSelectionDetails details) {
|
||||
// setState(() {
|
||||
// _startDate = details.date!;
|
||||
// _endDate = details.date!
|
||||
// .add(Duration(days: 6)); // assuming a week range
|
||||
// });
|
||||
// },
|
||||
// monthViewSettings: MonthViewSettings(
|
||||
// showAgenda: true,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// commonGlassContainer(
|
||||
// width: double.infinity,
|
||||
// height: 314.h,
|
||||
// borderradius: 1,
|
||||
// customWidget: CalendarDatePicker2(
|
||||
// config: CalendarDatePicker2Config(
|
||||
// calendarType: CalendarDatePicker2Type.range,
|
||||
// weekdayLabels: [
|
||||
// 'Sun',
|
||||
// 'Mon',
|
||||
// 'Tue',
|
||||
// 'Wed',
|
||||
// 'Thu',
|
||||
// 'Fri',
|
||||
// 'Sat'
|
||||
// ],
|
||||
// selectedYearTextStyle: TextStyle(color: Colors.white),
|
||||
// yearTextStyle: TextStyle(color: Colors.white),
|
||||
// selectedDayHighlightColor: Color(0xFFD90B2E),
|
||||
// controlsTextStyle: TextStyle(color: Colors.white),
|
||||
// dayTextStyle: TextStyle(color: Colors.white),
|
||||
// monthTextStyle: TextStyle(color: Colors.white),
|
||||
// weekdayLabelTextStyle: TextStyle(color: Colors.white),
|
||||
// nextMonthIcon: Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// lastMonthIcon: Icon(
|
||||
// Icons.arrow_back_ios_new,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// value: [selectedDate],
|
||||
// ),
|
||||
// border: 0.9),
|
||||
sizedBoxHeight(25.h),
|
||||
// Column(
|
||||
// children: List.generate(communityData.length, (index) {
|
||||
// return communitysessionCard(
|
||||
// imagePath: communityData[index]["imagePath"],
|
||||
// names: communityData[index]["names"],
|
||||
// title: communityData[index]["title"]);
|
||||
// }),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget communitysessionCard({
|
||||
required String title,
|
||||
required String imagePath,
|
||||
required String names,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(25.h),
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 290.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
borderwidth: 1,
|
||||
customWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 151.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.r),
|
||||
topLeft: Radius.circular(10.r))),
|
||||
child: Image.asset(
|
||||
imagePath,
|
||||
fit: BoxFit.cover,
|
||||
)),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text10w400_FCFCFC_blur("29th april 2024"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16.w),
|
||||
child: text18w700_FCFCFC(names),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
CircleAvatar(
|
||||
radius: 12.r,
|
||||
backgroundImage: const AssetImage(
|
||||
"assets/images/png/Ellipse 52.png"),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text14w400_FCFCFC("Ryan dorwat"),
|
||||
],
|
||||
),
|
||||
]),
|
||||
const Spacer(),
|
||||
Container(
|
||||
height: 138.h,
|
||||
width: 143.w,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(10.r),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text25700FCFCFC("14"),
|
||||
text16w700_FCFCFCblur("April 2024"),
|
||||
sizedBoxHeight(12.h),
|
||||
text16w700_FCFCFC("3:00 pm")
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void calendarTapped(CalendarTapDetails details) {
|
||||
if (details.targetElement == CalendarElement.appointment) {
|
||||
Appointment appointment = details.appointments![0];
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Event Details'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text('Event: ${appointment.subject}'),
|
||||
Text('From: ${appointment.startTime}'),
|
||||
Text('To: ${appointment.endTime}'),
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('Close'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MeetingDataSource extends CalendarDataSource {
|
||||
MeetingDataSource(
|
||||
List<Appointment> source,
|
||||
) {
|
||||
appointments = source;
|
||||
}
|
||||
}
|
||||
121
lib/Main_Screens/Calendar/SelectTimeSlot.dart
Normal file
121
lib/Main_Screens/Calendar/SelectTimeSlot.dart
Normal file
@@ -0,0 +1,121 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
|
||||
class SelectTimeSlot extends StatefulWidget {
|
||||
const SelectTimeSlot({super.key});
|
||||
|
||||
@override
|
||||
State<SelectTimeSlot> createState() => _SelectTimeSlotState();
|
||||
}
|
||||
|
||||
class _SelectTimeSlotState extends State<SelectTimeSlot> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Select time slot",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
CalendarTabBar(tabs: const [
|
||||
Tab(
|
||||
text: 'Week',
|
||||
),
|
||||
Tab(
|
||||
text: 'Day',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
groupTab(),
|
||||
subgroupTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget groupTab() {
|
||||
return Column(
|
||||
children: const [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget subgroupTab() {
|
||||
return Column(
|
||||
children: const [],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CalendarTabBar extends StatelessWidget {
|
||||
// Set the desired height
|
||||
|
||||
final List<Tab> tabs;
|
||||
CalendarTabBar({
|
||||
super.key,
|
||||
required this.tabs,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 239.w,
|
||||
height: 42.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(41.r), // Rounded corners
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xFFFFFFFF)
|
||||
.withOpacity(0.036), // Start color with opacity
|
||||
const Color(0xFFFFFFFF)
|
||||
.withOpacity(0.048), // End color with opacity
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
border: Border.all(
|
||||
color: const Color(0xFF434A53), // Border color
|
||||
width: 1.39, // Border width
|
||||
),
|
||||
),
|
||||
child: TabBar(
|
||||
dividerColor: const Color(0xFFFFFFFF).withOpacity(0.07),
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicatorColor: const Color(0xFFD90B2E),
|
||||
indicatorWeight: 2.h,
|
||||
unselectedLabelColor: const Color(0xFFFCFCFC),
|
||||
overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)),
|
||||
tabs: tabs, // Your tabs list
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
77
lib/Main_Screens/GroupTab/Model/groupsAddFollowersModel.dart
Normal file
77
lib/Main_Screens/GroupTab/Model/groupsAddFollowersModel.dart
Normal file
@@ -0,0 +1,77 @@
|
||||
class GroupsAddfollowersModel {
|
||||
GroupsAddfollowersModel({
|
||||
required this.status,
|
||||
required this.statusCode,
|
||||
required this.message,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
final String? status;
|
||||
final int? statusCode;
|
||||
final String? message;
|
||||
final List<Datum> data;
|
||||
|
||||
factory GroupsAddfollowersModel.fromJson(Map<String, dynamic> json){
|
||||
return GroupsAddfollowersModel(
|
||||
status: json["status"],
|
||||
statusCode: json["status_code"],
|
||||
message: json["message"],
|
||||
data: json["data"] == null ? [] : List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Datum {
|
||||
Datum({
|
||||
required this.id,
|
||||
required this.iamPrincipalXid,
|
||||
required this.followingIamPrincipalXid,
|
||||
required this.following,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? iamPrincipalXid;
|
||||
final int? followingIamPrincipalXid;
|
||||
final Following? following;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json){
|
||||
return Datum(
|
||||
id: json["id"],
|
||||
iamPrincipalXid: json["iam_principal_xid"],
|
||||
followingIamPrincipalXid: json["following_iam_principal_xid"],
|
||||
following: json["following"] == null ? null : Following.fromJson(json["following"]),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Following {
|
||||
Following({
|
||||
required this.id,
|
||||
required this.principalTypeXid,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.profilePhoto,
|
||||
required this.isUserPinned,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final int? principalTypeXid;
|
||||
final String? userName;
|
||||
final String? fullName;
|
||||
final String? profilePhoto;
|
||||
final bool? isUserPinned;
|
||||
|
||||
factory Following.fromJson(Map<String, dynamic> json){
|
||||
return Following(
|
||||
id: json["id"],
|
||||
principalTypeXid: json["principal_type_xid"],
|
||||
userName: json["user_name"],
|
||||
fullName: json["full_name"],
|
||||
profilePhoto: json["profile_photo"],
|
||||
isUserPinned: json["is_user_pinned"],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
347
lib/Main_Screens/GroupTab/View/CreateGroups.dart
Normal file
347
lib/Main_Screens/GroupTab/View/CreateGroups.dart
Normal file
@@ -0,0 +1,347 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class Creategroup extends StatefulWidget {
|
||||
const Creategroup({super.key});
|
||||
|
||||
@override
|
||||
State<Creategroup> createState() => _CreategroupState();
|
||||
}
|
||||
|
||||
class _CreategroupState extends State<Creategroup> {
|
||||
List<File?> filePath = [];
|
||||
List<File?> bannerPath = [];
|
||||
|
||||
bool isImageAdded = false;
|
||||
bool isbannerAdded = false;
|
||||
|
||||
TextEditingController grouptitlecontroller = TextEditingController();
|
||||
TextEditingController groupdescriptioncontroller = TextEditingController();
|
||||
|
||||
final Map<String, int> _TypecommunityMap = {
|
||||
'Public': 1,
|
||||
'Private': 2,
|
||||
'Secret': 3,
|
||||
};
|
||||
|
||||
String _selectedtypecommunity = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedtypecommunity = value;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
Get.back(result: true);
|
||||
return true;
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "New group",
|
||||
customBack: true,
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
if (result != null && result.isNotEmpty) {
|
||||
var file = File(result);
|
||||
filePath.cast();
|
||||
filePath.add(file);
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
if (Platform.isAndroid) {
|
||||
Get.back();
|
||||
}
|
||||
} else {
|
||||
// Handle case where no image is selected
|
||||
filePath.clear();
|
||||
isImageAdded = false;
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: 95.w,
|
||||
height: 95.h,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget:
|
||||
filePath.isNotEmpty && isImageAdded
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(47.5.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/cameraicon2.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
),
|
||||
borderwidth: 0.5),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: text16w400_white(
|
||||
"Add group profile picture")),
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("Group banner image"),
|
||||
sizedBoxHeight(15.h),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
// var file = File(result);
|
||||
|
||||
// bannerPath.add(file);
|
||||
// isbannerAdded = true;
|
||||
// setState(() {});
|
||||
if (result != null && result.isNotEmpty) {
|
||||
var file = File(result);
|
||||
|
||||
// Check if the file size exceeds 10 MB
|
||||
// int fileSizeInBytes = file.lengthSync();
|
||||
// double fileSizeInMB =
|
||||
// fileSizeInBytes / (1024 * 1024);
|
||||
|
||||
// if (fileSizeInMB > 10) {
|
||||
// // Show toast message if the file size exceeds 10 MB
|
||||
|
||||
// utils.showToast(
|
||||
// "The selected file is too large. Max file size is 10 MB.");
|
||||
// } else {
|
||||
|
||||
// Clear the existing image and add the new one
|
||||
bannerPath.clear();
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
// }
|
||||
} else {
|
||||
// Handle case where no image is selected
|
||||
bannerPath.clear();
|
||||
isbannerAdded = false;
|
||||
setState(() {});
|
||||
}
|
||||
if (Platform.isAndroid) {
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: Color(0xFF434A53),
|
||||
child: commonGlassUI(
|
||||
borderwidth: 0,
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: bannerPath.isNotEmpty &&
|
||||
isbannerAdded
|
||||
? Stack(children: [
|
||||
Image.file(
|
||||
bannerPath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
bannerPath.clear();
|
||||
isbannerAdded = false;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
width: 27,
|
||||
height: 27,
|
||||
decoration: ShapeDecoration(
|
||||
color: Color(0xFF7E7E7E),
|
||||
shape:
|
||||
RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
5)),
|
||||
),
|
||||
child: Icon(
|
||||
Icons
|
||||
.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 25.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/ph_camera-light.png",
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400white(
|
||||
'Upload banner image'),
|
||||
sizedBoxHeight(8.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Group title"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: grouptitlecontroller,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: 'Enter group title',
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter group title';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Group description"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
textEditingController: groupdescriptioncontroller,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
// FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: 'Enter group description',
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter group description';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Type of group"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const ['Public', 'Private', 'Secret'],
|
||||
onItemSelected: _onItemSelected,
|
||||
// (p0) {},
|
||||
leadingImage: SizedBox()),
|
||||
sizedBoxHeight(25.h),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomButton(
|
||||
text: "Create group",
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.addgroup);
|
||||
if (filePath.isEmpty) {
|
||||
utils.showToast(
|
||||
'Please add group profile picture');
|
||||
} else if (bannerPath.isEmpty) {
|
||||
utils.showToast('Please add banner image');
|
||||
} else if (grouptitlecontroller.text.isEmpty) {
|
||||
utils.showToast('Please enter group title');
|
||||
} else if (groupdescriptioncontroller
|
||||
.text.isEmpty) {
|
||||
utils.showToast(
|
||||
'Please enter group description');
|
||||
} else if (_selectedtypecommunity.isEmpty) {
|
||||
utils.showToast('Please select type of group');
|
||||
} else {
|
||||
print('done');
|
||||
// indiUploadata();
|
||||
// Uploadata();
|
||||
int groupTypeValue =
|
||||
_TypecommunityMap[_selectedtypecommunity] ??
|
||||
0;
|
||||
|
||||
Get.toNamed(RouteName.groupaddfollowers, arguments: {
|
||||
'groupname': grouptitlecontroller.text,
|
||||
'groupdescription':
|
||||
groupdescriptioncontroller.text,
|
||||
'grouptype': groupTypeValue,
|
||||
'groupprofilephoto': filePath,
|
||||
'groupbannerimage': bannerPath,
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
],
|
||||
)))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
422
lib/Main_Screens/GroupTab/View/GroupAddfollowers.dart
Normal file
422
lib/Main_Screens/GroupTab/View/GroupAddfollowers.dart
Normal file
@@ -0,0 +1,422 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/Model/groupsAddFollowersModel.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/view_model/getmethod.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/view_model/postmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class GroupAddFollowers extends StatefulWidget {
|
||||
const GroupAddFollowers({super.key});
|
||||
|
||||
@override
|
||||
State<GroupAddFollowers> createState() => _GroupAddFollowersState();
|
||||
}
|
||||
|
||||
class _GroupAddFollowersState extends State<GroupAddFollowers> {
|
||||
int grouptype = Get.arguments["grouptype"];
|
||||
String groupname = Get.arguments["groupname"];
|
||||
String groupdescription = Get.arguments["groupdescription"];
|
||||
List<File?> filepath = Get.arguments['groupprofilephoto'];
|
||||
List<File?> bannerPath = Get.arguments['groupbannerimage'];
|
||||
|
||||
StreamController<GroupsAddfollowersModel> searchcontroller =
|
||||
StreamController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var updata = "";
|
||||
Getgroups()
|
||||
.getGroupsAddfollowersearch(updata, streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
final List<int> _selectedIndices = [];
|
||||
|
||||
void _onContainerTap(int id) {
|
||||
setState(() {
|
||||
if (_selectedIndices.contains(id)) {
|
||||
_selectedIndices.remove(id);
|
||||
} else {
|
||||
_selectedIndices.add(id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
List<MultipartFile> bannermedialist = [];
|
||||
List<MultipartFile> profielpicturelist = [];
|
||||
|
||||
for (var file in bannerPath.where((file) => file != null)) {
|
||||
bannermedialist.add(
|
||||
await MultipartFile.fromFile(
|
||||
file!.path,
|
||||
filename: path.basename(file.path),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
for (var file in filepath.where((file) => file != null)) {
|
||||
profielpicturelist.add(
|
||||
await MultipartFile.fromFile(
|
||||
file!.path,
|
||||
filename: path.basename(file.path),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
|
||||
print('Selected Indices: $selectedIndicesString');
|
||||
|
||||
FormData formdata = FormData.fromMap({
|
||||
"manage_group_type_xid": grouptype,
|
||||
"background_image": bannermedialist[0],
|
||||
"group_image": profielpicturelist[0],
|
||||
"title": groupname,
|
||||
"description": groupdescription,
|
||||
'members': selectedIndicesString.isEmpty ? null : selectedIndicesString,
|
||||
});
|
||||
print('updata is ${formdata.toString()}');
|
||||
log('log is ${formdata.toString()}');
|
||||
final data = await PostMethodGroups().postCreategroups(formdata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("groups created");
|
||||
// Get.toNamed(RouteName.mycommunity);
|
||||
Get.back();
|
||||
Get.back(result: true);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("groups not created");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
Get.back();
|
||||
return true;
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Add followers",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
bottomNavigationBar: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
|
||||
child: CustomButton(
|
||||
text: "Add",
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.mycommunity);
|
||||
print('selected groups are ${_selectedIndices.toString()}');
|
||||
|
||||
Uploadata();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
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 users",
|
||||
onInput: (value) {
|
||||
Getgroups().getGroupsAddfollowersearch(
|
||||
value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
text18w700_FCFCFC("Select followers"),
|
||||
Spacer(),
|
||||
commonGlassUI(
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius:
|
||||
BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/basil_sort-outline.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
borderwidth: 0.5),
|
||||
sizedBoxWidth(18.w),
|
||||
commonGlassUI(
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderRadius:
|
||||
BorderRadius.circular(100),
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
borderwidth: 0.5),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
// sizedBoxHeight(30.h),
|
||||
text20w700red("Available"),
|
||||
sizedBoxHeight(20.h),
|
||||
]),
|
||||
),
|
||||
StreamBuilder<GroupsAddfollowersModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const Center(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.sp),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return groupsaddfollowersobj!.data.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
itemCount:
|
||||
groupsaddfollowersobj!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
final isChecked = _selectedIndices
|
||||
.contains(groupsaddfollowersobj!
|
||||
.data[index].following!.id);
|
||||
return Column(
|
||||
children: [
|
||||
groupWidget(
|
||||
index: groupsaddfollowersobj!
|
||||
.data[index].id!,
|
||||
imagePath:
|
||||
groupsaddfollowersobj!
|
||||
.data[index]
|
||||
.following!
|
||||
.profilePhoto ??
|
||||
'',
|
||||
title: groupsaddfollowersobj!
|
||||
.data[index]
|
||||
.following!
|
||||
.fullName!,
|
||||
subtitle: groupsaddfollowersobj!
|
||||
.data[index]
|
||||
.following!
|
||||
.userName!,
|
||||
isChecked: isChecked,
|
||||
// isCheckedList[index],
|
||||
onCheckedChanged:
|
||||
(bool? value) {
|
||||
// isCheckedList[index] = value ?? false;
|
||||
_onContainerTap(
|
||||
groupsaddfollowersobj!
|
||||
.data[index]
|
||||
.following!
|
||||
.id!);
|
||||
},
|
||||
),
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}),
|
||||
sizedBoxHeight(50.h),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No followers found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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: [
|
||||
imagePath == null || imagePath.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: AssetImage('assets/images/png/img2.png'),
|
||||
radius: 20.r,
|
||||
)
|
||||
:
|
||||
// CircleAvatar(
|
||||
// backgroundImage: NetworkImage(imagePath),
|
||||
// radius: 20.r,
|
||||
// ),
|
||||
CircleAvatar(
|
||||
backgroundImage: CachedNetworkImageProvider(imagePath),
|
||||
radius: 20.r,
|
||||
child: CachedNetworkImage(
|
||||
cacheKey: index.toString(),
|
||||
maxHeightDiskCache: 100,
|
||||
maxWidthDiskCache: 100,
|
||||
imageUrl: imagePath,
|
||||
placeholder: (context, url) => Container(),
|
||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||
imageBuilder: (context, imageProvider) => CircleAvatar(
|
||||
backgroundImage: imageProvider,
|
||||
radius: 25.r,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
title == null || title.isEmpty
|
||||
? text16w400_FCFCFC('ReGroup')
|
||||
: Text(
|
||||
title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
sizedBoxHeight(4.h),
|
||||
subtitle == null || subtitle.isEmpty
|
||||
? text12w400_FCFCFC_blur('ReGroup')
|
||||
: Text(
|
||||
subtitle,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: const Color(0xFFFCFCFC).withOpacity(0.8),
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
commonGlassUI(
|
||||
borderwidth: isChecked ? 1.2 : 0.9,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderColor:
|
||||
// isChecked ? Color(0xFFD90B2E) :
|
||||
Color(0xFF434A53),
|
||||
customWidget: Transform.scale(
|
||||
scale: 1,
|
||||
child: Checkbox(
|
||||
side: BorderSide(color: Colors.transparent),
|
||||
value: isChecked,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor:
|
||||
// Color(0xFFD90B2E),
|
||||
Color(0XFFFFFFFF),
|
||||
onChanged: onCheckedChanged,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@ class _GroupTabState extends State<GroupTab> {
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.addEvent);
|
||||
Get.toNamed(RouteName.creategroup);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
|
||||
28
lib/Main_Screens/GroupTab/view_model/getmethod.dart
Normal file
28
lib/Main_Screens/GroupTab/view_model/getmethod.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:regroup/Common/api_urls.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/Model/groupsAddFollowersModel.dart';
|
||||
|
||||
|
||||
GroupsAddfollowersModel? groupsaddfollowersobj;
|
||||
|
||||
class Getgroups {
|
||||
|
||||
Future<ResponseData<dynamic>> getGroupsAddfollowersearch(updata,
|
||||
{required StreamController<GroupsAddfollowersModel> streamController}) async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getgroupsaddfollowers}?search=$updata",
|
||||
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
groupsaddfollowersobj = GroupsAddfollowersModel.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(groupsaddfollowersobj!);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
19
lib/Main_Screens/GroupTab/view_model/postmethod.dart
Normal file
19
lib/Main_Screens/GroupTab/view_model/postmethod.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:regroup/Common/api_urls.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
|
||||
class PostMethodGroups {
|
||||
PostMethodGroups();
|
||||
|
||||
Future<ResponseData<dynamic>> postCreategroups(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postcreategroups,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -824,3 +824,16 @@ Widget text8w700_white(String text) {
|
||||
fontWeight: FontWeight.w700),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text20w700red(String text, {TextAlign? textAlign}) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0XFFD90B2E),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
debugShowCheckedModeBanner: false,
|
||||
// initialRoute: RouteName.individualactivitystep2,
|
||||
|
||||
initialRoute: RouteName.splashScreen,
|
||||
initialRoute: RouteName.selecttimeslot,
|
||||
|
||||
getPages: AppRoutes.appRoutes(),
|
||||
),
|
||||
|
||||
@@ -3,28 +3,22 @@ class RouteName {
|
||||
static const String onboarding1 = '/onboarding1';
|
||||
static const String loginScreen = '/loginScreen';
|
||||
static const String nointernet = '/nointernet';
|
||||
|
||||
static const String signupscreen = '/signupscreen';
|
||||
static const String verifyusercreen = '/verifyuser';
|
||||
static const String tellusindividualscreen = '/tellusindividualscreen';
|
||||
static const String tellusbusinessscreen = '/tellusbusinessscreen';
|
||||
static const String forgotpass = '/forgotpass';
|
||||
|
||||
static const String individualprofilestep1 = '/individualprofilestep1';
|
||||
static const String individualactivitystep2 = '/individualactivitystep2';
|
||||
static const String individualgroupstep3 = '/individualgroupstep3';
|
||||
static const String individualcommunitystep4 = '/individualcommunitystep4';
|
||||
static const String findcommunitypage = '/findcommunitypage';
|
||||
|
||||
static const String communitycommitscreen = '/communitycommitscreen';
|
||||
static const String signupendpage = '/signupendpage';
|
||||
|
||||
|
||||
static const String bussignupScreen = '/bussignupScreen';
|
||||
static const String businessletusunderstandstep1 = '/businessletusunderstand';
|
||||
static const String businessSelectgroupstep2 = '/businessselectgroup';
|
||||
static const String businessSelectcommunitystep3 = '/businessselectcommunity';
|
||||
|
||||
static const String communityScreen = '/communityScreen';
|
||||
static const String mainscreen = '/mainscreen';
|
||||
static const String sidemenu = '/sidemenu';
|
||||
@@ -39,8 +33,6 @@ class RouteName {
|
||||
static const String announcement = '/announcement';
|
||||
static const String watchlist = '/watchlist';
|
||||
static const String requestscreen = '/requestscreen';
|
||||
|
||||
|
||||
static const String group = '/group';
|
||||
static const String communitysetting = '/communitysetting';
|
||||
static const String editcommunity = '/editcommunity';
|
||||
@@ -57,17 +49,11 @@ class RouteName {
|
||||
static const String addEvent = '/addEvent';
|
||||
static const String setavailabillity = '/setavailabillity';
|
||||
static const String addUsers = '/addUsers';
|
||||
|
||||
static const String newchatpage = '/newchatpage';
|
||||
static const String newgrouppage = '/newgrouppage';
|
||||
|
||||
static const String userchatpage = '/userchatpage';
|
||||
|
||||
static const String profiletab = '/profiletab';
|
||||
static const String mynetwork = '/mynetwork';
|
||||
|
||||
|
||||
|
||||
static const String groupchatpage = '/groupchatpage';
|
||||
static const String managememberscal = '/managememberscal';
|
||||
static const String shareProfile = '/shareProfile';
|
||||
@@ -93,13 +79,9 @@ class RouteName {
|
||||
static const String addtimeline = '/addtimeline';
|
||||
static const String verifycode = '/verifycode';
|
||||
static const String newpassword = '/newpassword';
|
||||
static const String forgotOtp= '/forgotOtp';
|
||||
|
||||
|
||||
static const String forgotOtp = '/forgotOtp';
|
||||
static const String availability = '/availability';
|
||||
|
||||
//Group Tab
|
||||
|
||||
static const String grouptab = '/grouptab';
|
||||
static const String requestedgroups = '/requestedgroups';
|
||||
static const String groupdetail = '/groupdetail';
|
||||
@@ -111,45 +93,42 @@ class RouteName {
|
||||
static const String connectcommunity = '/connectcommunity';
|
||||
static const String certificate = '/certificate';
|
||||
static const String sessions = '/sessions';
|
||||
|
||||
//subgroup
|
||||
static const String subgroups = '/subgroups';
|
||||
static const String subgroupinfo = '/subgroupinfo';
|
||||
static const String editsubgroupinfo = '/editsubgroupinfo';
|
||||
static const String subgroupsetting = '/subgroupsetting';
|
||||
|
||||
//ExploreDesign
|
||||
|
||||
static const String explorescreen = '/explorescreen';
|
||||
static const String searchgroup = '/searchgroup';
|
||||
static const String detailexplore = '/detailexplore';
|
||||
|
||||
static const String notificaationpage = '/notificationpage';
|
||||
|
||||
static const String verifygoogleapplepage = '/verifygoogleapplepage';
|
||||
|
||||
|
||||
//profiletabIndGestUser
|
||||
|
||||
static const String profiletabindguest = '/profiletabindguest';
|
||||
|
||||
//profiletabBusGestUser
|
||||
|
||||
//profiletabBusGestUser
|
||||
static const String profiletabbusguest = '/profiletabbusguest';
|
||||
|
||||
static const String addcertificate = '/addusercertificate';
|
||||
|
||||
static const String viewalltags = '/viewalltags';
|
||||
|
||||
static const String viewallcommunitiespinned = '/viewallcommunitiespinned';
|
||||
|
||||
static const String viewalluserspinned = '/viewallusersspinned';
|
||||
|
||||
static const String communitymembers = '/communitymembers';
|
||||
|
||||
|
||||
static const String creategroup = '/creategroup';
|
||||
|
||||
static const String groupaddfollowers = '/groupaddfollowers';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// calendar
|
||||
static const String calendar = '/calendar';
|
||||
static const String availabilityrequest = '/availabilityrequest';
|
||||
static const String selecttimeslot = '/selecttimeslot';
|
||||
static const String addUser = '/addUser';
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Login/View/loginscreen.dart';
|
||||
import 'package:regroup/Login/View/verifygoogleapple.dart';
|
||||
import 'package:regroup/Main_Screens/Calendar/AvailabilityRequest.dart';
|
||||
import 'package:regroup/Main_Screens/Calendar/Calendar.dart';
|
||||
|
||||
import 'package:regroup/Main_Screens/Calendar/SelectTimeSlot.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/AddEvent/AddEvent.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/AddUsers/AddUsers.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/Availabillity.dart';
|
||||
// import 'package:regroup/Main_Screens/CalenderTab/AddUsers/AddUsers.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/EventDetails.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart';
|
||||
import 'package:regroup/Main_Screens/CalenderTab/Resource%20Pool/ResourcePool.dart';
|
||||
@@ -12,15 +18,17 @@ import 'package:regroup/Main_Screens/Chats/View/newchatpage.dart';
|
||||
import 'package:regroup/Main_Screens/Chats/View/newgroup.dart';
|
||||
import 'package:regroup/Main_Screens/Chats/View/userchat.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/Community.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/TagsdDetailScreen.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/PostScreen.dart';
|
||||
import 'package:regroup/Main_Screens/Community_HomePage/TagsdDetailScreen.dart';
|
||||
import 'package:regroup/Main_Screens/ExploreDesign/DetailExplore.dart';
|
||||
import 'package:regroup/Main_Screens/ExploreDesign/ExploreScreen.dart';
|
||||
import 'package:regroup/Main_Screens/ExploreDesign/SearchGroup.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/CreateGroups.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/ConnectCommunity.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GoupSettings.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GroupAddfollowers.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GroupDetail.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GroupEvent.dart';
|
||||
import 'package:regroup/Main_Screens/GroupTab/View/GroupInfo.dart';
|
||||
@@ -61,45 +69,13 @@ import 'package:regroup/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart'
|
||||
import 'package:regroup/Main_Screens/ProfileTab/Settings/View/Notification.dart';
|
||||
import 'package:regroup/Main_Screens/ProfileTab/Share%20profile/ShareProfile.dart';
|
||||
import 'package:regroup/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart';
|
||||
|
||||
import 'package:regroup/Notifications/notification.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Business/View/busSignupScreen.dart';
|
||||
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageGroup.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ManageInterest.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/View/NewTag/NewTag.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/AnnouncementRequest.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart';
|
||||
import 'package:regroup/sidemenu/Community/Members/CommunityMembers.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart';
|
||||
import 'package:regroup/sidemenu/Community/Watchlist.dart';
|
||||
|
||||
import 'package:regroup/Login/View/loginscreen.dart';
|
||||
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
|
||||
import 'package:regroup/sidemenu/Community/Announcements/View/Announcements.dart';
|
||||
import 'package:regroup/sidemenu/Community/Group/view/Group.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/CommunityDetails.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/MyCommunity.dart';
|
||||
import 'package:regroup/sidemenu/SavedPosts/SavedPosts.dart';
|
||||
import 'package:regroup/sidemenu/communities.dart';
|
||||
import 'package:regroup/sidemenu/sidemenu.dart';
|
||||
import 'package:regroup/Login/View/verifygoogleapple.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/NoInternet.dart';
|
||||
import 'package:regroup/onboarding/NewPass/View/NewPass.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Business/View/busSignupScreen.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart';
|
||||
|
||||
import 'package:regroup/onboarding/Signup/View/Business/View/tellusbusiness.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Individual/FindCommunityPage.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Individual/step1Selectprofile.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Individual/step2Selectactivity.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Individual/step3Selectyourgroup.dart';
|
||||
import 'package:regroup/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart';
|
||||
@@ -113,6 +89,27 @@ import 'package:regroup/onboarding/forgotPass/View/ForgotPass.dart';
|
||||
import 'package:regroup/onboarding/onboarding1.dart';
|
||||
import 'package:regroup/onboarding/splashscreen.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageGroup.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ManageInterest.dart';
|
||||
import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/View/NewTag/NewTag.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/AnnouncementRequest.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart';
|
||||
import 'package:regroup/sidemenu/Community/Announcements/View/Announcements.dart';
|
||||
import 'package:regroup/sidemenu/Community/Group/view/Group.dart';
|
||||
import 'package:regroup/sidemenu/Community/Members/CommunityMembers.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/CommunityDetails.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/MyCommunity.dart';
|
||||
import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart';
|
||||
import 'package:regroup/sidemenu/Community/Watchlist.dart';
|
||||
import 'package:regroup/sidemenu/SavedPosts/SavedPosts.dart';
|
||||
import 'package:regroup/sidemenu/communities.dart';
|
||||
import 'package:regroup/sidemenu/sidemenu.dart';
|
||||
import 'package:regroup/sidemenu/tags.dart';
|
||||
import 'package:regroup/sidemenu/users.dart';
|
||||
|
||||
@@ -306,10 +303,10 @@ class AppRoutes {
|
||||
name: RouteName.setavailabillity,
|
||||
page: () => const SetAvailabillity(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.addUsers,
|
||||
page: () => const AddUsers(),
|
||||
),
|
||||
// GetPage(
|
||||
// name: RouteName.addUsers,
|
||||
// page: () => const AddUsers(),
|
||||
// ),
|
||||
GetPage(
|
||||
name: RouteName.managememberscal,
|
||||
page: () => const ManageMembersCal(),
|
||||
@@ -478,10 +475,10 @@ class AppRoutes {
|
||||
name: RouteName.certificate,
|
||||
page: () => const Certificate(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.availability,
|
||||
page: () => const Availability(),
|
||||
),
|
||||
// GetPage(
|
||||
// name: RouteName.availability,
|
||||
// page: () => const Availability(),
|
||||
// ),
|
||||
GetPage(
|
||||
name: RouteName.sessions,
|
||||
page: () => const Sessions(),
|
||||
@@ -526,11 +523,11 @@ class AppRoutes {
|
||||
name: RouteName.addcertificate,
|
||||
page: () => const AddCertificate(),
|
||||
),
|
||||
GetPage(
|
||||
GetPage(
|
||||
name: RouteName.viewalltags,
|
||||
page: () => const Viewtags(),
|
||||
),
|
||||
GetPage(
|
||||
GetPage(
|
||||
name: RouteName.viewallcommunitiespinned,
|
||||
page: () => const Communitiespinned(),
|
||||
),
|
||||
@@ -538,18 +535,48 @@ class AppRoutes {
|
||||
name: RouteName.viewalluserspinned,
|
||||
page: () => const Viewtusertags(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.communitymembers,
|
||||
page: () => const CommunityMembers(),
|
||||
),
|
||||
|
||||
|
||||
GetPage(
|
||||
GetPage(
|
||||
name: RouteName.requestscreen,
|
||||
page: () => const RequestsScreen(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.calendar,
|
||||
page: () => const Calendar(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.availabilityrequest,
|
||||
page: () => const AvailabilityRequest(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.selecttimeslot,
|
||||
page: () => const SelectTimeSlot(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.addUser,
|
||||
page: () => const AddUsers(),
|
||||
),
|
||||
|
||||
|
||||
GetPage(
|
||||
name: RouteName.creategroup,
|
||||
page: () => const Creategroup(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.groupaddfollowers,
|
||||
page: () => const GroupAddFollowers(),
|
||||
),
|
||||
|
||||
|
||||
|
||||
// GetPage(
|
||||
// name: RouteName.addUser,
|
||||
// page: () => const SelectTimeSlot(),
|
||||
// ),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ Widget announcementWidget({
|
||||
return commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 120.h,
|
||||
borderRadius: BorderRadius.circular( 10.r),
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||
child: Column(
|
||||
|
||||
@@ -228,24 +228,8 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
child: Row(
|
||||
children: [
|
||||
iscommunitypin == true
|
||||
? Text(
|
||||
'Unpin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Pin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
? text14w400white('Unpin')
|
||||
: text14w400white('Pin'),
|
||||
const Spacer(),
|
||||
iscommunitypin == true
|
||||
? Image.asset(
|
||||
@@ -595,7 +579,25 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
.toList() ??
|
||||
[],
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
sizedBoxWidth(comdetailobj!
|
||||
.data!
|
||||
.userLinkInCommunity!
|
||||
.totalCommunityMember! ==
|
||||
1
|
||||
? 5.w
|
||||
: comdetailobj!
|
||||
.data!
|
||||
.userLinkInCommunity!
|
||||
.totalCommunityMember! ==
|
||||
2
|
||||
? 30.w
|
||||
: comdetailobj!
|
||||
.data!
|
||||
.userLinkInCommunity!
|
||||
.totalCommunityMember! ==
|
||||
3
|
||||
? 40.w
|
||||
: 75.w),
|
||||
comdetailobj!
|
||||
.data!
|
||||
.userLinkInCommunity!
|
||||
@@ -688,7 +690,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.addgroup);
|
||||
Get.toNamed(RouteName.group, arguments: {
|
||||
Get.toNamed(RouteName.announcement, arguments: {
|
||||
'id': CommunityId,
|
||||
'iscommunity': true,
|
||||
});
|
||||
|
||||
@@ -50,149 +50,149 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
|
||||
void refreshData() {
|
||||
setState(() {
|
||||
myfuture = MyCommunityAPI().getMyCommunity();
|
||||
// await MyCommunityAPI().getMyCommunity();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> setValues() async {
|
||||
if (mounted) {
|
||||
isMuteList.clear();
|
||||
isPinList.clear();
|
||||
|
||||
for (int i = 0; i < myCommunityobj!.data.length; i++) {
|
||||
isMuteList.add(myCommunityobj!.data[i].isMute!);
|
||||
if (myCommunityobj!.data[i].joinedAndRequestedCommunity != null) {
|
||||
isPinList.add(myCommunityobj!
|
||||
.data[i].joinedAndRequestedCommunity!.isCommunityPinned!);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 0);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
customBack: true,
|
||||
titleTxt: "My Communities",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Get.toNamed(RouteName.newcommunity);
|
||||
if (result != null && result) {
|
||||
refreshData();
|
||||
// CommunityDetail().getCommunityDetail(CommunityId);
|
||||
print("Updating community details...");
|
||||
// setState(() {});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
shape: BoxShape.circle),
|
||||
child: const Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Frame 9.png",
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
onWillPop: () async {
|
||||
Get.back();
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
customBack: true,
|
||||
titleTxt: "My Communities",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Get.toNamed(RouteName.newcommunity);
|
||||
if (result != null && result) {
|
||||
refreshData();
|
||||
// CommunityDetail().getCommunityDetail(CommunityId);
|
||||
print("Updating community details...");
|
||||
// setState(() {});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
shape: BoxShape.circle),
|
||||
child: const Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Frame 9.png",
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// for (int i = 0; i < myCommunityobj!.data.length; i++) {
|
||||
// ismute = myCommunityobj!.data[i].isMute;
|
||||
// iscommunitypin = myCommunityobj!
|
||||
// .data[i].joinedAndRequestedCommunity!.isCommunityPinned;
|
||||
// }
|
||||
for (int i = 0; i < myCommunityobj!.data.length; i++) {
|
||||
// Check if the current data item and its joinedAndRequestedCommunity property are not null
|
||||
|
||||
isMuteList.add(myCommunityobj!.data[i].isMute!);
|
||||
|
||||
if (myCommunityobj!.data[i].joinedAndRequestedCommunity != null) {
|
||||
isPinList.add(myCommunityobj!
|
||||
.data[i]
|
||||
.joinedAndRequestedCommunity!
|
||||
.isCommunityPinned!); // Handle null with a default value if needed
|
||||
}
|
||||
}
|
||||
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: MyCommunityAPI().getMyCommunity(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result =
|
||||
await Get.toNamed(RouteName.requestscreen);
|
||||
if (result != null && result) {
|
||||
refreshData();
|
||||
// CommunityDetail().getCommunityDetail(CommunityId);
|
||||
print("Updating community details...");
|
||||
// setState(() {});
|
||||
}
|
||||
},
|
||||
child:
|
||||
text16w700_FCFCFC_line("Request and Invites"))
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
myCommunityobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context),
|
||||
]))
|
||||
]);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (snapshot.hasData) {
|
||||
setValues();
|
||||
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Get.toNamed(
|
||||
RouteName.requestscreen);
|
||||
if (result != null && result) {
|
||||
refreshData();
|
||||
print("Updating community details...");
|
||||
// setState(() {});
|
||||
}
|
||||
},
|
||||
child: text16w700_FCFCFC_line(
|
||||
"Request and Invites"))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
myCommunityobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context),
|
||||
]))
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
})));
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
@@ -235,7 +235,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
|
||||
if (result != null && result) {
|
||||
refreshData();
|
||||
print("Updating community details...");
|
||||
print("Updating community details...$result");
|
||||
}
|
||||
},
|
||||
child: commonGlassUI(
|
||||
@@ -484,6 +484,7 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
// .joinedAndRequestedCommunity!
|
||||
// .id
|
||||
// .toString());
|
||||
|
||||
Map<String, dynamic> updata = {
|
||||
"manage_communities_xid":
|
||||
myCommunityobj!
|
||||
@@ -523,28 +524,8 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
child: Row(
|
||||
children: [
|
||||
isPinList[index] == true
|
||||
? Text(
|
||||
'Unpin ',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.w800,
|
||||
fontFamily:
|
||||
"Nunito Sans",
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Pin ',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.w800,
|
||||
fontFamily:
|
||||
"Nunito Sans",
|
||||
),
|
||||
),
|
||||
? text14w400white('Unpin')
|
||||
: text14w400white('Pin'),
|
||||
const Spacer(),
|
||||
isPinList[index] == true
|
||||
? Image.asset(
|
||||
@@ -638,7 +619,24 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
.toList() ??
|
||||
[],
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
sizedBoxWidth(joinnedComData
|
||||
.totalCommunityMember ==
|
||||
null ||
|
||||
joinnedComData.totalCommunityMember == 1
|
||||
? 5.w
|
||||
: joinnedComData.totalCommunityMember ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.totalCommunityMember ==
|
||||
2
|
||||
? 30.w
|
||||
: joinnedComData.totalCommunityMember ==
|
||||
null ||
|
||||
joinnedComData
|
||||
.totalCommunityMember ==
|
||||
3
|
||||
? 40.w
|
||||
: 75.w),
|
||||
joinnedComData.totalCommunityMember == null ||
|
||||
joinnedComData
|
||||
.totalCommunityMember.isBlank!
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
@@ -268,7 +266,28 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
.toList() ??
|
||||
[],
|
||||
),
|
||||
sizedBoxWidth(75.w),
|
||||
sizedBoxWidth(requestedComData
|
||||
.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
.totalCommunityMember ==
|
||||
1
|
||||
? 5.w
|
||||
: requestedComData
|
||||
.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
.totalCommunityMember ==
|
||||
2
|
||||
? 30.w
|
||||
: requestedComData
|
||||
.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
.totalCommunityMember ==
|
||||
3
|
||||
? 40.w
|
||||
: 75.w),
|
||||
requestedComData.totalCommunityMember ==
|
||||
null ||
|
||||
requestedComData
|
||||
@@ -485,8 +504,8 @@ class _RequestedTabState extends State<RequestedTab> {
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(30.r),
|
||||
color:
|
||||
Color(0xFFD90B2E)),
|
||||
color: const Color(
|
||||
0xFFD90B2E)),
|
||||
child: Center(
|
||||
child: text12w400_FCFCFC(
|
||||
"Cancel request")),
|
||||
@@ -954,8 +973,8 @@ class _InvitedTabState extends State<InvitedTab> {
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(30.r),
|
||||
color:
|
||||
Color(0xFFD90B2E)),
|
||||
color: const Color(
|
||||
0xFFD90B2E)),
|
||||
child: Center(
|
||||
child:
|
||||
text12w400_FCFCFC(
|
||||
|
||||
Reference in New Issue
Block a user