Files
Regroup/lib/Main_Screens/GroupTab/View/GroupDetail.dart
2024-07-31 16:08:23 +05:30

1126 lines
42 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/CommonButton.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/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 GroupDetail extends StatefulWidget {
const GroupDetail({super.key});
@override
State<GroupDetail> createState() => _GroupDetailState();
}
class _GroupDetailState extends State<GroupDetail> {
List cardtile = [
{
"imagePath": "assets/images/png/Rectangle 29ss.png",
"title": "Cardio crusaders circle"
},
{
"imagePath": "assets/images/png/Rectangle 31ee.png",
"title": "Strength squad syndicate"
},
{
"imagePath": "assets/images/png/Rectangle 30aa.png",
"title": "Flexibility faction force"
},
{
"imagePath": "assets/images/png/Rectangle 29ss.png",
"title": "Cardio crusaders circle"
},
];
CalendarController? _calendarController;
List<Appointment>? _appointments;
@override
void initState() {
super.initState();
_calendarController = CalendarController();
_appointments = <Appointment>[
Appointment(
startTime: DateTime(2024, 6, 25, 20, 0),
endTime: DateTime(2024, 6, 25, 23, 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',
// color: Colors.red,
),
Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(const Duration(hours: 3)),
subject: 'Muharram/Ashura',
// color: Colors.red,
),
];
}
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: const Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "",
customActionWidget: Row(children: [
PopupMenuButton(
surfaceTintColor: const Color(0xFF222935),
constraints: BoxConstraints.tightFor(
width: 150.w,
),
offset: const Offset(0, 40),
color: const Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.newpost);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: text14w400white("Create post"),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.sessions);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: text14w400white("Create event"),
),
),
],
child: commonGlassContainer(
opacity1: 0.24,
opacity2: 0.24,
width: 40.w,
height: 40.h,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector536.png",
height: 17.h,
width: 17.w,
),
),
border: 0.5),
),
sizedBoxWidth(16.w),
PopupMenuButton(
surfaceTintColor: const Color(0xFF222935),
constraints: BoxConstraints.tightFor(
width: 210.w,
),
offset: const Offset(0, 40),
color: const Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Add members"),
const Spacer(),
Image.asset(
"assets/images/png/uiw_user-add.png",
height: 15.h,
width: 15.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Share"),
const Spacer(),
Image.asset(
"assets/images/png/share.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.groupinfo);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Group info"),
const Spacer(),
Image.asset(
"assets/images/png/Vector1a.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Search"),
const Spacer(),
Image.asset(
"assets/images/png/Frame 58575.png",
height: 18.h,
width: 18.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Mute Notification"),
const Spacer(),
Image.asset(
"assets/images/png/Black1233.png",
height: 16.h,
width: 16.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.groupsettings);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Row(
children: [
text14w400white("Edit group settings"),
const Spacer(),
Image.asset(
"assets/images/png/setting2.png",
height: 18.h,
width: 18.w,
)
],
),
),
),
],
child: Image.asset(
'assets/images/png/Group 1000004071.png',
height: 20.h,
width: 20.w,
)),
]),
),
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(20.h),
Stack(clipBehavior: Clip.none, children: [
GestureDetector(
onTap: () {},
child: SizedBox(
height: 130.h,
width: double.infinity,
child: Image.asset(
"assets/images/png/group11.png",
fit: BoxFit.cover,
),
),
),
Positioned(
bottom: -35.h,
left: 20.w,
child: Container(
width: 85.r,
height: 85.r,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: Colors.white,
width: 2,
),
boxShadow: const [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.25),
blurRadius: 12,
offset: Offset(0, 6),
),
],
),
child: CircleAvatar(
radius: 42.5.r,
foregroundImage:
const AssetImage("assets/images/png/group111.png"),
),
))
]),
sizedBoxHeight(80.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text20w700_FCFCFC("Iron titans fitness crew"),
sizedBoxHeight(16.h),
Row(
children: [
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset(
"assets/images/png/community 1 (traced).png",
height: 20.h,
width: 20.w),
),
),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("The athlectic town"),
sizedBoxWidth(20.w),
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset("assets/images/png/img12.png",
height: 20.h, width: 20.w),
),
),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("Public"),
],
),
sizedBoxHeight(25.h),
Row(
children: [
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (4).png",
height: 20.h,
width: 20.w),
),
),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("Rowing, Football, Swimming"),
],
),
sizedBoxHeight(25.h),
commonGlassContainer(
width: double.infinity,
height: 135.h,
borderradius: 10,
customWidget: Padding(
padding: EdgeInsets.symmetric(
vertical: 12.h, horizontal: 16.w),
child: Column(
children: [
Row(
children: [
text16w700white("Badges"),
const Spacer(),
GestureDetector(
onTap: () {
// Get.toNamed(RouteName.badges);
},
child: text12400white("View more"))
],
),
sizedBoxHeight(8.h),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
],
),
],
),
),
border: 1),
sizedBoxHeight(20.h),
commonGlassContainer(
width: double.infinity,
height: 51.h,
borderradius: 10.r,
customWidget: Padding(
padding: EdgeInsets.only(right: 16.w),
child: Center(
child: Row(children: [
sizedBoxWidth(16.w),
stackContainers(containerImages: [
"assets/images/png/cimg3.png",
"assets/images/png/cimg2.png",
"assets/images/png/cimg3.png",
"assets/images/png/cimg2.png",
], number: "+2"),
sizedBoxWidth(100.w),
text16400white("7 members"),
const Spacer(),
const Icon(
Icons.arrow_forward,
color: Colors.white,
)
]),
),
),
border: 1),
sizedBoxHeight(20.h),
Row(
children: [
text18w400white("Subgroups"),
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.subgroups);
},
child: text14400white("View more")),
],
),
sizedBoxHeight(20.h),
SizedBox(
height: 190.h,
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
// padding: EdgeInsets.only(left: 16.w),
itemCount: cardtile.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(right: 20.w),
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.subgroupinfo);
},
child: profilecardtile(
imagePath: cardtile[index]["imagePath"],
title: cardtile[index]["title"]),
),
);
},
),
),
sizedBoxHeight(25.h),
commonGlassContainer(
width: double.infinity,
height: 51.h,
borderradius: 10.r,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(children: [
Image.asset(
"assets/images/png/marketing 1 (traced).png",
height: 28.h,
width: 28.w,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
text16w700white("Announcements"),
text11w400_F91D42(
"11 New Announcements Request"),
],
),
const Spacer(),
GestureDetector(
onTap: () {
// Get.toNamed(RouteName.addEvent);
},
child: Container(
height: 21.h,
width: 43.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.r),
color: const Color(0xFFD90B2E),
),
child: Center(child: text12400white("11")),
),
)
]),
),
border: 1),
sizedBoxHeight(25.h),
],
),
),
DefaultTabController(
length: 2,
// initialIndex: selectedIndex.value,
child: Column(
children: [
const CommonTabBar(tabs: [
Tab(
text: 'Announcement',
),
Tab(
text: 'sessions',
),
]),
SizedBox(
height: 700.h,
child: TabBarView(
// clipBehavior: Clip.none,
children: [
announcementTab(),
sessionsTab(),
],
),
),
sizedBoxHeight(90.h),
],
),
),
]),
)
]));
}
Widget announcementTab() {
return Column(
children: [
sizedBoxHeight(30.h),
normalcardtile(
profileImg: 'assets/images/png/cimg4.png',
title: 'Edward Hackket',
mainImg: 'assets/images/png/img322.png',
containerTitle: [
'Kayaking',
'Marathon',
'Events',
'Marathon',
'Events'
]),
],
);
}
Widget normalcardtile({
required String profileImg,
required String title,
required String mainImg,
required List<String> containerTitle,
}) {
var mainImage = 'assets/images/png/uiw_like-o.png'.obs;
void updateImage(String reaction) {
if (reaction == 'like') {
mainImage.value = 'assets/images/png/f7_hand-thumbsup.png';
} else if (reaction == 'heart') {
mainImage.value = 'assets/images/png/heart 2.png';
} else if (reaction == 'party') {
mainImage.value = 'assets/images/png/party-popper 2.png';
}
}
// MediaQuery.of(context).size.height
return commonGlassUIBlue(
width: double.infinity,
height: 610.h,
borderRadius: BorderRadius.circular(1),
customWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(25.h),
Padding(
padding: EdgeInsets.only(left: 16.w),
child: text16w700_FCFCFC("#Announcement"),
),
sizedBoxHeight(25.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
foregroundImage: AssetImage(profileImg),
radius: 25.r,
),
sizedBoxWidth(12.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(5.h),
Row(
children: [
Image.asset(
'assets/images/png/community 1 (traced).png',
height: 14.w,
width: 14.w,
),
sizedBoxWidth(7.w),
text12w400_FCFCFC('Active alliance network'),
sizedBoxWidth(7.w),
Icon(
Icons.circle,
color: const Color(0xFFFCFCFC),
size: 4.sp,
),
sizedBoxWidth(6.w),
text12w400_FCFCFC('1 Hour ago'),
],
)
],
),
const Spacer(),
PopupMenuButton(
surfaceTintColor: const Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: const Offset(0, 50),
color: const Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Report Post',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Nunito Sans",
),
),
const Spacer(),
Image.asset(
"assets/images/png/Vector (5).png",
height: 15.h,
width: 15.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Share post',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Nunito Sans",
),
),
const Spacer(),
Image.asset(
"assets/images/png/share.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Pin',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Nunito Sans",
),
),
const Spacer(),
Image.asset(
"assets/images/png/f7_pin-fill (2).png",
height: 25.h,
width: 25.w,
)
],
),
),
),
],
child: Image.asset(
'assets/images/png/Group 1000004071.png',
width: 16.w,
height: 18.h,
),
),
sizedBoxWidth(5.w)
],
),
),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
// Get.toNamed(RouteName.postdetailsScreen);
},
child: SizedBox(
height: 163.h,
width: double.infinity,
child: Image.asset(
mainImg,
fit: BoxFit.cover,
),
)),
sizedBoxHeight(20.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(children: [
SizedBox(
height: 30.h,
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemCount: containerTitle.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
// Get.toNamed(RouteName.cyclescreen);
},
child: containertile(text: containerTitle[index])),
);
},
),
),
sizedBoxHeight(20.h),
text16w400_FCFCFC(
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
Row(children: [
InkWell(
onTap: () {
// Get.toNamed(RouteName.reactionview);
},
child: stackReaction(number: '20', containerImages: [
'assets/images/png/f7_hand-thumbsup.png',
'assets/images/png/heart 2.png',
'assets/images/png/party-popper 2.png'
]),
),
const Spacer(),
commonContainer(
width: 30.w,
height: 30.h,
opacity1: 0.24,
opacity2: 0.24,
boxShape: BoxShape.circle,
borderwidth: 0.43,
customWidget: Center(
child: Image.asset(
'assets/images/png/Frame 1000004088.png',
height: 13.h,
width: 13.w,
),
),
),
sizedBoxWidth(12.w),
text14w400_FCFCFC('20'),
sizedBoxWidth(20.w),
commonContainer(
width: 30.w,
height: 30.h,
opacity1: 0.24,
opacity2: 0.24,
boxShape: BoxShape.circle,
borderwidth: 0.43,
customWidget: Center(
child: Image.asset(
'assets/images/png/Vector (1).png',
height: 12.h,
width: 12.w,
),
),
),
sizedBoxWidth(12.w),
text14w400_FCFCFC('10'),
]),
sizedBoxHeight(12.h),
commonDivider(),
sizedBoxHeight(12.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Obx(() {
return ReactionButton<String>(
onReactionChanged: (reaction) {
updateImage(reaction?.value ?? 'like');
debugPrint('Selected value: ${reaction?.value}');
},
reactions: <Reaction<String>?>[
Reaction<String>(
value: 'like',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/f7_hand-thumbsup.png'),
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
Reaction<String>(
value: 'heart',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/heart 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/heart 2.png'),
),
Reaction<String>(
value: 'party',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/party-popper 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/party-popper 2.png'),
),
],
selectedReaction: Reaction<String>(
value: 'like',
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
boxColor: Colors.white,
boxElevation: 9,
boxRadius: 30,
itemsSpacing: 8,
itemScale: 0.4,
itemSize: const Size(45, 45),
boxPadding: const EdgeInsets.all(8),
boxAnimationDuration: const Duration(milliseconds: 200),
itemAnimationDuration: const Duration(milliseconds: 500),
hoverDuration: const Duration(milliseconds: 700),
// toggle: false,
child: _buildReactionsIcon(mainImage.value),
);
})
],
),
GestureDetector(
onTap: () {
// Get.toNamed(RouteName.postdetailsScreen);
},
child: Column(
children: [
Image.asset(
'assets/images/png/Frame 1000004088.png',
height: 19.h,
width: 19.w,
),
sizedBoxHeight(8.h),
text11w400_FCFCFC('Comment')
],
),
),
Column(
children: [
Image.asset(
'assets/images/png/Frame 1000004089.png',
height: 19.h,
width: 19.w,
),
sizedBoxHeight(8.h),
text11w400_FCFCFC('Save')
],
)
],
),
sizedBoxHeight(12.h),
commonDivider(),
sizedBoxHeight(12.h),
]),
),
],
));
}
Widget _buildReactionsPreviewIcon(String assetPath) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
assetPath,
height: 40.h,
width: 40.w,
),
);
}
Widget _buildReactionsIcon(String assetPath) {
return Column(
children: [
Image.asset(
assetPath,
height: 19.h,
width: 19.w,
),
sizedBoxHeight(8.h),
text11w400_FCFCFC('Like')
],
);
}
Widget containertile({required String text}) {
return commonContainer(
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderwidth: 1,
borderColor: const Color(0xFFD90B2E),
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Center(child: text14w400_FCFCFC(text)),
));
}
Widget sessionsTab() {
return Column(
children: [
sizedBoxHeight(40.h),
commonGlassUI(
width: double.infinity,
height: 500.h,
borderRadius: BorderRadius.circular(1),
customWidget: SfCalendar(
view: CalendarView.day,
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: 1,
cellBorderColor: Colors.white,
todayHighlightColor: const Color(0xFFD90B2E),
todayTextStyle: const TextStyle(color: Colors.white),
controller: _calendarController,
showNavigationArrow: true,
allowViewNavigation: true,
showDatePickerButton: true,
monthViewSettings: const MonthViewSettings(
// agendaStyle: AgendaStyle(
// dateTextStyle: TextStyle(color: Colors.amber),
// ),
),
allowedViews: const [
CalendarView.month,
CalendarView.day,
CalendarView.schedule,
],
viewNavigationMode: ViewNavigationMode.snap,
showCurrentTimeIndicator: true,
dataSource: MeetingDataSource(_appointments!),
onTap: calendarTapped,
timeSlotViewSettings: const TimeSlotViewSettings(
timeTextStyle: TextStyle(
color: Colors.white,
),
),
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
),
),
);
},
),
),
sizedBoxHeight(30.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: CommonBtn(text: "Join the group"),
)
],
);
}
Widget profilecardtile({required String imagePath, required String title}) {
return Column(
children: [
Container(
height: 109.h,
width: 100.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
),
child: Image.asset(imagePath),
),
sizedBoxHeight(10.h),
SizedBox(width: 100.w, child: text12w700_FCFCFC(title)),
],
);
}
void _showEventDetails(Appointment appointment) {
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();
},
),
],
);
},
);
}
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;
}
}