Conflict resolve
This commit is contained in:
@@ -1,545 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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/ImageUpload.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:intl/intl.dart';
|
||||
|
||||
class AddEvent extends StatefulWidget {
|
||||
const AddEvent({super.key});
|
||||
|
||||
@override
|
||||
State<AddEvent> createState() => _AddEventState();
|
||||
}
|
||||
|
||||
class _AddEventState extends State<AddEvent> {
|
||||
RxBool isChecked = false.obs;
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
|
||||
TimeOfDay? starttime = const TimeOfDay(hour: 15, minute: 0);
|
||||
TimeOfDay? endtime = const TimeOfDay(hour: 15, minute: 0);
|
||||
|
||||
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: "",
|
||||
),
|
||||
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"),
|
||||
sizedBoxHeight(14.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: "Tri-sport challenge",
|
||||
),
|
||||
text16400white("Event image"),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassContainer(
|
||||
border: 0,
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderradius: 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: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/bi_download.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400white("Upload event image"),
|
||||
sizedBoxHeight(8.h),
|
||||
text8w400_8A8A8A(
|
||||
"Allowed file extensions: jpg, png, gif Max file size: 10 MB"),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 60.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(children: [
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.r)),
|
||||
child: Image.asset(
|
||||
"assets/images/png/img2.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text14400white("Event1.png"),
|
||||
sizedBoxHeight(2.h),
|
||||
text12w400_FCFCFC_blur("10 kb")
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
'assets/images/png/cancelicon.png',
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Type of event"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: 'Race',
|
||||
items: const ['', ''],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)12.png",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Sport"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: 'Cycling',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start date "),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, dateController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
textEditingController: dateController,
|
||||
hintText: "1-4-2024",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.h),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End date"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, dateController2),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
textEditingController: dateController2,
|
||||
hintText: "4-4-2024",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]))
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start time"),
|
||||
sizedBoxHeight(14.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: starttime);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
starttime = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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(starttime!)),
|
||||
]),
|
||||
),
|
||||
border: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End time"),
|
||||
sizedBoxHeight(14.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: endtime);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
endtime = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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(endtime!)),
|
||||
]),
|
||||
),
|
||||
border: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: const BorderSide(color: Color(0xFF434A53)),
|
||||
value: isChecked.value,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: ((value) {
|
||||
isChecked.value = value!;
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
sizedBoxWidth(8.w),
|
||||
text14w400_FCFCFC("Repeat event")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Post in"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: '',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 28.w,
|
||||
child: Center(
|
||||
child: Image.asset("assets/images/png/Black.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Add Users"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addUsers);
|
||||
},
|
||||
leadingIcon: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group122.png",
|
||||
fit: BoxFit.cover,
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "",
|
||||
suffixIcon:
|
||||
const Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
containerWidget(
|
||||
imagePath: "assets/images/png/Ellipse 52.png",
|
||||
title: "Ryan Dorwart"),
|
||||
sizedBoxHeight(10.h),
|
||||
containerWidget(
|
||||
imagePath: "assets/images/png/Ellipse 52.png",
|
||||
title: "Ryan Dorwart"),
|
||||
sizedBoxHeight(10.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text14400white("View more")),
|
||||
sizedBoxHeight(30.h),
|
||||
text16400white("Location"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 19.h,
|
||||
width: 15.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 19.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Elm street, London, United kingdom",
|
||||
),
|
||||
text16400white("Reminder"),
|
||||
sizedBoxHeight(14.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 127.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: text16400white("2"),
|
||||
)),
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 215.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text16400white("Minutes"),
|
||||
sizedBoxWidth(5.w),
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(35.h),
|
||||
CommonBtn(text: "Save"),
|
||||
sizedBoxHeight(70.h),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget containerWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderradius: 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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
border: 1);
|
||||
}
|
||||
}
|
||||
@@ -1,425 +0,0 @@
|
||||
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',
|
||||
),
|
||||
Tab(
|
||||
text: 'Sub-group',
|
||||
),
|
||||
Tab(
|
||||
text: 'Followers',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
groupTab(),
|
||||
subgroupTab(),
|
||||
followersTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
]))
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget groupTab() {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
text18w700_FCFCFC("Group members"),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)22.png",
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(14.w),
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: groupData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
groupWidget(
|
||||
index: index,
|
||||
imagePath: groupData[index]["imagePath"],
|
||||
title: groupData[index]["title"],
|
||||
subtitle: groupData[index]["subtitle"],
|
||||
isChecked: isCheckedList[index],
|
||||
onCheckedChanged: (bool? value) {
|
||||
setState(() {
|
||||
isCheckedList[index] = value ?? false;
|
||||
});
|
||||
},
|
||||
),
|
||||
if (index != groupData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget groupWidget({
|
||||
required int index,
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
required bool isChecked,
|
||||
required ValueChanged<bool?> onCheckedChanged,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(6.w),
|
||||
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(),
|
||||
commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: 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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("M")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Tu")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("W")),
|
||||
border: 0.5),
|
||||
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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Th")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("F")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Sa")),
|
||||
border: 0.5),
|
||||
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: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
class Availability extends StatefulWidget {
|
||||
const Availability({super.key});
|
||||
|
||||
@override
|
||||
State<Availability> createState() => _AvailabilityState();
|
||||
}
|
||||
|
||||
CalendarController? _calendarController;
|
||||
List<Appointment>? _appointments;
|
||||
List<CalendarResource> _employeeCollection = <CalendarResource>[];
|
||||
// final List<String> _nameCollection = <String>[];
|
||||
// final List<String> _userImages = <String>[];
|
||||
|
||||
class _AvailabilityState extends State<Availability> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_calendarController = CalendarController();
|
||||
_appointments = <Appointment>[
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 26, 9, 0),
|
||||
endTime: DateTime(2024, 6, 26, 10, 30),
|
||||
subject: 'Development Meeting',
|
||||
resourceIds: [4],
|
||||
color: const Color(0XFFFC571D)),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 26, 18, 0),
|
||||
endTime: DateTime(2024, 6, 26, 18, 30),
|
||||
subject: 'GeneralMeeting',
|
||||
resourceIds: [2],
|
||||
color: const Color(0xFF8B1FA9)),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 28, 9, 0),
|
||||
endTime: DateTime(2024, 6, 28, 10, 30),
|
||||
subject: 'Lunch',
|
||||
resourceIds: [1],
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime(2024, 6, 25, 10, 0),
|
||||
endTime: DateTime(2024, 6, 25, 10, 30),
|
||||
subject: 'Meeting',
|
||||
resourceIds: [2],
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime.now(),
|
||||
endTime: DateTime.now().add(const Duration(hours: 3)),
|
||||
subject: 'Match day',
|
||||
resourceIds: [3],
|
||||
),
|
||||
Appointment(
|
||||
startTime: DateTime.now(),
|
||||
endTime: DateTime.now().add(const Duration(hours: 3)),
|
||||
subject: 'Muharram/Ashura',
|
||||
resourceIds: [3],
|
||||
),
|
||||
];
|
||||
_employeeCollection = <CalendarResource>[
|
||||
CalendarResource(
|
||||
id: 1,
|
||||
image: const AssetImage("assets/images/png/cimg1.png"),
|
||||
displayName: 'Kaylly Vaccaro',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
CalendarResource(
|
||||
id: 2,
|
||||
image: const AssetImage("assets/images/png/cimg2.png"),
|
||||
displayName: 'Ryan Dorwart',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
CalendarResource(
|
||||
id: 3,
|
||||
image: const AssetImage("assets/images/png/cimg3.png"),
|
||||
displayName: 'Ahmad Rhiel',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
CalendarResource(
|
||||
id: 4,
|
||||
image: const AssetImage("assets/images/png/cimg3.png"),
|
||||
displayName: 'Ahmad Rhiel',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
CalendarResource(
|
||||
id: 5,
|
||||
image: const AssetImage("assets/images/png/Ellipse 52.png"),
|
||||
displayName: 'Ahmad Rhiel',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
CalendarResource(
|
||||
id: 6,
|
||||
image: const AssetImage("assets/images/png/Ellipse 48.png"),
|
||||
displayName: 'Ahmad Rhiel',
|
||||
color: Colors.transparent,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Availability",
|
||||
),
|
||||
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: [
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 670.h,
|
||||
borderradius: 1,
|
||||
border: 0,
|
||||
customWidget: SfCalendar(
|
||||
view: CalendarView.timelineMonth,
|
||||
appointmentTextStyle: const TextStyle(color: Colors.white),
|
||||
headerStyle: const CalendarHeaderStyle(
|
||||
textStyle: TextStyle(
|
||||
color: Colors.blue,
|
||||
)),
|
||||
// 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: _calendarController,
|
||||
showNavigationArrow: true,
|
||||
allowViewNavigation: true,
|
||||
showDatePickerButton: true,
|
||||
monthViewSettings: const MonthViewSettings(
|
||||
navigationDirection:
|
||||
MonthNavigationDirection.horizontal,
|
||||
),
|
||||
allowDragAndDrop: true,
|
||||
allowedViews: const [
|
||||
// CalendarView.month,
|
||||
// CalendarView.day,
|
||||
// CalendarView.schedule,
|
||||
CalendarView.timelineMonth,
|
||||
CalendarView.timelineDay
|
||||
],
|
||||
viewNavigationMode: ViewNavigationMode.snap,
|
||||
showCurrentTimeIndicator: true,
|
||||
dataSource: MeetingDataSource(
|
||||
_appointments!, _employeeCollection),
|
||||
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,
|
||||
),
|
||||
|
||||
// selectionDecoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(20.r)),
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
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, List<CalendarResource> resourceColl) {
|
||||
appointments = source;
|
||||
resources = resourceColl;
|
||||
}
|
||||
}
|
||||
@@ -1,856 +0,0 @@
|
||||
import 'dart:math';
|
||||
|
||||
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/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 CalenderTab extends StatefulWidget {
|
||||
const CalenderTab({super.key});
|
||||
|
||||
@override
|
||||
State<CalenderTab> createState() => _CalenderTabState();
|
||||
}
|
||||
|
||||
class _CalenderTabState extends State<CalenderTab> {
|
||||
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.addEvent);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(14.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.setavailabillity);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/calender.png',
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(14.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.managememberscal);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 9.png',
|
||||
height: 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 sessions',
|
||||
),
|
||||
Tab(
|
||||
text: 'Community session',
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
|
||||
children: [
|
||||
mySessionsTab(),
|
||||
comSessionTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(90.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]))
|
||||
]),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
);
|
||||
}
|
||||
|
||||
Widget mySessionsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 136.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 171.w,
|
||||
child: text14w400_FCFCFC(
|
||||
"Are you looking for resources ? We might have a solution"),
|
||||
),
|
||||
sizedBoxHeight(12.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.resourcepool);
|
||||
},
|
||||
child: text16w700_FCFCFCline("View resources"))
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Image.asset("assets/images/png/Rectangle 45.png")
|
||||
],
|
||||
),
|
||||
border: 1),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(children: [
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 500.h,
|
||||
borderradius: 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: _sessionCalController,
|
||||
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: ScheduleViewSettings(
|
||||
// appointmentTextStyle: TextStyle(color: Colors.red)),
|
||||
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
Positioned(
|
||||
top: 6.h,
|
||||
left: 100.w,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.availability);
|
||||
},
|
||||
child: Container(
|
||||
height: 25.h,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: const Color(0xFFD90B2E),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(15.r)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.w,
|
||||
),
|
||||
child:
|
||||
Center(child: text10400white("view availability")),
|
||||
),
|
||||
)
|
||||
|
||||
// Image.asset(
|
||||
// "assets/images/png/calender.png",
|
||||
// color: Colors.blue,
|
||||
// height: 18.h,
|
||||
// width: 18.w,
|
||||
// ),
|
||||
))
|
||||
]),
|
||||
|
||||
// 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(3, (index) {
|
||||
// return sessionCard(
|
||||
// imagePath: sessionData[index]["imagePath"],
|
||||
// names: sessionData[index]["names"],
|
||||
// title: sessionData[index]["title"]);
|
||||
// }),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 300.h,
|
||||
borderradius: 10.r,
|
||||
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"),
|
||||
],
|
||||
)
|
||||
]),
|
||||
border: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget comSessionTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
|
||||
Stack(children: [
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 530.h,
|
||||
borderradius: 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,
|
||||
),
|
||||
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),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 290.h,
|
||||
borderradius: 10.r,
|
||||
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")
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
border: 1)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,382 +0,0 @@
|
||||
import 'package:flutter/material.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/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';
|
||||
|
||||
class EventDetails extends StatefulWidget {
|
||||
const EventDetails({super.key});
|
||||
|
||||
@override
|
||||
State<EventDetails> createState() => _EventDetailsState();
|
||||
}
|
||||
|
||||
class _EventDetailsState extends State<EventDetails> {
|
||||
bool memberView = false;
|
||||
bool adminView = true;
|
||||
bool guestView = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "",
|
||||
customActionWidget: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addEvent);
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset("assets/images/png/Vector536.png",
|
||||
height: 17.h, width: 17.w),
|
||||
),
|
||||
border: 0.5),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset("assets/images/png/Vector522.png",
|
||||
height: 17.h, width: 17.w),
|
||||
),
|
||||
border: 0.5),
|
||||
],
|
||||
),
|
||||
),
|
||||
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: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
SizedBox(
|
||||
height: 260.h,
|
||||
width: double.infinity,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
child: Image.asset(
|
||||
"assets/images/png/Rectangle299.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text18w700_FCFCFC("Sports challenge"),
|
||||
sizedBoxHeight(16.h),
|
||||
text14400whiteblur(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer . . . "),
|
||||
sizedBoxHeight(22.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white("20th April 2024 - 21st April 2024"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white("3 hours"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white("Elm street london, United Kingdom"),
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Visibility(
|
||||
visible: adminView,
|
||||
child: Column(
|
||||
children: [
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
text18w700white("Are you attending this event ?"),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 87.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
customWidget:
|
||||
Center(child: text16w400_white("Yes")),
|
||||
border: 1),
|
||||
commonGlassContainer(
|
||||
width: 87.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
customWidget: Center(child: text16w400_white("No")),
|
||||
border: 1),
|
||||
commonGlassContainer(
|
||||
width: 154.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
customWidget: Center(
|
||||
child: text16w400_white("Not yet decided")),
|
||||
border: 1),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: guestView,
|
||||
child: Column(
|
||||
children: [
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
text18w700white("Are you attending this event ?"),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassContainer(
|
||||
width: 221.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
customWidget:
|
||||
Center(child: text16w400_white("Request to join")),
|
||||
border: 1),
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text18w700white("Reminder"),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/alarm 1 (traced).png",
|
||||
height: 24.h,
|
||||
width: 24.w,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_white("10 minutes before")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Visibility(
|
||||
visible: adminView,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 251.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
reminderWidget(
|
||||
text: "Total invites", count: '150'),
|
||||
sizedBoxHeight(16.h),
|
||||
reminderWidget(text: "Attending", count: '78'),
|
||||
sizedBoxHeight(16.h),
|
||||
reminderWidget(
|
||||
text: "Not attending", count: '35'),
|
||||
sizedBoxHeight(16.h),
|
||||
reminderWidget(
|
||||
text: "Not deciding", count: '20'),
|
||||
sizedBoxHeight(16.h),
|
||||
reminderWidget(
|
||||
text: "Waiting reply", count: '17'),
|
||||
],
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Visibility(
|
||||
visible: memberView,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 65.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
stackContainers2(containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
]),
|
||||
sizedBoxHeight(10.h),
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(70.w),
|
||||
text18w400white("90 Attending")
|
||||
],
|
||||
),
|
||||
border: 1)),
|
||||
text18w700white("Messages"),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/Vector (5)3343.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_white("Send message to invites"),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 98.w,
|
||||
height: 30.h,
|
||||
borderradius: 30.r,
|
||||
customWidget:
|
||||
Center(child: text14400white("Select")),
|
||||
border: 1)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 240.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 80.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
radius: 33.5,
|
||||
backgroundImage:
|
||||
AssetImage("assets/images/png/cimg1.png"),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
text12400whiteblur("Organized By"),
|
||||
text16w700white("Ryan dorwat"),
|
||||
sizedBoxHeight(15.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(15.h),
|
||||
text12400whiteblur('Group'),
|
||||
sizedBoxHeight(15.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 12.5.r,
|
||||
backgroundImage: const AssetImage(
|
||||
"assets/images/png/img322.png"),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w700white("Row row your boat"),
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(text: "Join the event"),
|
||||
sizedBoxHeight(40.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget reminderWidget({required String text, required String count}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset("assets/images/png/Red.png", height: 22.h, width: 16.w),
|
||||
sizedBoxWidth(10.w),
|
||||
SizedBox(width: 250.w, child: text16w400_white(text)),
|
||||
const Spacer(),
|
||||
text16400white(count),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,377 +0,0 @@
|
||||
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/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';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class ManageMembersCal extends StatefulWidget {
|
||||
const ManageMembersCal({super.key});
|
||||
|
||||
@override
|
||||
State<ManageMembersCal> createState() => _ManageMembersCalState();
|
||||
}
|
||||
|
||||
class _ManageMembersCalState extends State<ManageMembersCal> {
|
||||
List memberData = [
|
||||
{
|
||||
"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 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": "Maria Herwitz",
|
||||
"subtitle": "Football fever",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Ahmad Madsen",
|
||||
"subtitle": "The athletic town",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Active alliance network",
|
||||
},
|
||||
];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Manage members",
|
||||
customActionWidget: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.addEvent);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
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 members",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: memberData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
memberWidget(
|
||||
index: index,
|
||||
imagePath: memberData[index]["imagePath"],
|
||||
title: memberData[index]["title"],
|
||||
subtitle: memberData[index]["subtitle"],
|
||||
),
|
||||
if (index != memberData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget memberWidget({
|
||||
required int index,
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
sizedBoxWidth(16.w),
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 135.w, child: text16w400_FCFCFC(title)),
|
||||
// sizedBoxWidth(4.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(),
|
||||
Container(
|
||||
height: 25.h,
|
||||
width: 72.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
border: Border.all(color: const Color(0xFFFF002B), width: 1.w)),
|
||||
child: Center(child: text10400white("Attending")),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
commonGlassContainer(
|
||||
width: 25.w,
|
||||
height: 25.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100.r,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/alarm 1 (traced).png",
|
||||
height: 13.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(8.w),
|
||||
commonGlassContainer(
|
||||
width: 25.w,
|
||||
height: 25.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100.r,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/fluent_delete-28-regular.png",
|
||||
height: 13.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(12.w)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("M")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Tu")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("W")),
|
||||
border: 0.5),
|
||||
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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Th")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("F")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Sa")),
|
||||
border: 0.5),
|
||||
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")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,285 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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 ResourcePool extends StatefulWidget {
|
||||
const ResourcePool({super.key});
|
||||
|
||||
@override
|
||||
State<ResourcePool> createState() => _ResourcePoolState();
|
||||
}
|
||||
|
||||
class _ResourcePoolState extends State<ResourcePool> {
|
||||
List<bool> isCheckedList = [false, false, false, false];
|
||||
|
||||
List eventData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img45.png",
|
||||
"title": "Super sports fest",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 25.png",
|
||||
"title": "Tri-sport challenge",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Ultimate athlete challenge",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Cyclotron challenge",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Resource pool",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(10.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 community sessions",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 2,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: resourceCard(),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget resourceCard() {
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 216.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage("assets/images/png/Ellipse 52.png"),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC("Ryan Dorwart"),
|
||||
sizedBoxHeight(6.h),
|
||||
text12w400_FCFCFC_blur("Row row row your boat")
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
inviteBottomSheet();
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 95.w,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r)),
|
||||
child: Center(child: text14400white("Invite")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(14.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(14.h),
|
||||
text16w400_FCFCFC("Available for :"),
|
||||
sizedBoxHeight(12.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
SizedBox(width: 140.w, child: text14w400_FCFCFC("Race")),
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
SizedBox(width: 120.w, child: text14w400_FCFCFC("Race")),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(12.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
SizedBox(
|
||||
width: 140.w,
|
||||
child: text14w400_FCFCFC("Only group events")),
|
||||
sizedBoxWidth(16.w),
|
||||
Image.asset(
|
||||
"assets/images/png/Group122.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
SizedBox(width: 120.w, child: text14w400_FCFCFC("Lorem ipsum")),
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
border: 1);
|
||||
}
|
||||
|
||||
void inviteBottomSheet() {
|
||||
Get.bottomSheet(
|
||||
StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30.r),
|
||||
topRight: Radius.circular(30.r),
|
||||
),
|
||||
color: const Color(0xFF222935),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text18w400white("Events"),
|
||||
Column(
|
||||
children: List.generate(eventData.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
eventWidget(
|
||||
index: index,
|
||||
imagePath: eventData[index]["imagePath"],
|
||||
title: eventData[index]["title"],
|
||||
isChecked: isCheckedList[index],
|
||||
onCheckedChanged: (bool? value) {
|
||||
setState(() {
|
||||
isCheckedList[index] = value ?? false;
|
||||
});
|
||||
},
|
||||
),
|
||||
if (index != eventData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget eventWidget({
|
||||
required int index,
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required bool isChecked,
|
||||
required ValueChanged<bool?> onCheckedChanged,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
child: Image.asset(
|
||||
imagePath,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: const BorderSide(color: Color(0xFF434A53)),
|
||||
value: isChecked,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: onCheckedChanged,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class SetAvailabillity extends StatefulWidget {
|
||||
const SetAvailabillity({super.key});
|
||||
|
||||
@override
|
||||
State<SetAvailabillity> createState() => _SetAvailabillityState();
|
||||
}
|
||||
|
||||
class _SetAvailabillityState extends State<SetAvailabillity> {
|
||||
bool swichvalue = false;
|
||||
|
||||
var selectedContainerIndices = <int>{}.obs;
|
||||
|
||||
void toggleSelectedIndex(int index) {
|
||||
if (selectedContainerIndices.contains(index)) {
|
||||
selectedContainerIndices.remove(index);
|
||||
} else {
|
||||
selectedContainerIndices.add(index);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Set availability",
|
||||
),
|
||||
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: [
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Select event type"),
|
||||
sizedBoxHeight(15.h),
|
||||
CommonDropdownBtn(hint: "", items: const ['']),
|
||||
sizedBoxHeight(18.h),
|
||||
text16400white("Select sport"),
|
||||
sizedBoxHeight(15.h),
|
||||
CommonDropdownBtn(hint: "", items: const ['']),
|
||||
sizedBoxHeight(18.h),
|
||||
text16400white("Select role "),
|
||||
sizedBoxHeight(15.h),
|
||||
CommonDropdownBtn(hint: "", items: const ['']),
|
||||
sizedBoxHeight(18.h),
|
||||
text16400white("Space selection"),
|
||||
sizedBoxHeight(15.h),
|
||||
CommonDropdownBtn(hint: "", items: const ['']),
|
||||
sizedBoxHeight(18.h),
|
||||
Row(
|
||||
children: [
|
||||
text16w400_white("Availability"),
|
||||
const Spacer(),
|
||||
Transform.scale(
|
||||
scaleY: 1,
|
||||
child: CupertinoSwitch(
|
||||
value: swichvalue,
|
||||
trackColor: Colors.white.withOpacity(0.4),
|
||||
activeColor: const Color(0xFF3192D8),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
swichvalue = value ?? false;
|
||||
});
|
||||
}))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text16400white("Select days"),
|
||||
sizedBoxHeight(15.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commondayContainer(text: "M", index: 1),
|
||||
commondayContainer(text: "Tu", index: 2),
|
||||
commondayContainer(text: "W", index: 3),
|
||||
commondayContainer(text: "Th", index: 4),
|
||||
commondayContainer(text: "F", index: 5),
|
||||
commondayContainer(text: "Sa", index: 6),
|
||||
commondayContainer(text: "Su", index: 7),
|
||||
// GlassmorphicContainer(
|
||||
// width: 40.w,
|
||||
// height: 40.h,
|
||||
// borderRadius: 100,
|
||||
// blur: 10,
|
||||
// alignment: Alignment.topCenter,
|
||||
// border: 0.5,
|
||||
// linearGradient: LinearGradient(
|
||||
// begin: Alignment.topLeft,
|
||||
// end: Alignment.bottomRight,
|
||||
// colors: [
|
||||
// Color(0xFFD90B2E).withOpacity(0.18),
|
||||
// const Color(0xFFD90B2E).withOpacity(0.4),
|
||||
// ],
|
||||
// stops: const [
|
||||
// 0.1,
|
||||
// 1,
|
||||
// ],
|
||||
// ),
|
||||
// borderGradient: LinearGradient(
|
||||
// begin: Alignment.topLeft,
|
||||
// end: Alignment.bottomRight,
|
||||
// colors: [
|
||||
// Color(0xffD90B2E),
|
||||
// Color(0xFFD90B2E),
|
||||
// ],
|
||||
// ),
|
||||
// child: Center(child: text16w400_FCFCFC("Su")),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start time"),
|
||||
sizedBoxHeight(14.h),
|
||||
commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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("3:00 pm")
|
||||
]),
|
||||
),
|
||||
border: 1)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End time"),
|
||||
sizedBoxHeight(14.h),
|
||||
commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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("5:00 pm")
|
||||
]),
|
||||
),
|
||||
border: 1)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
CommonBtn(text: "Send"),
|
||||
sizedBoxHeight(30.h),
|
||||
])))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget commondayContainer({
|
||||
required String text,
|
||||
required int index,
|
||||
}) {
|
||||
return Obx(() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
toggleSelectedIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: selectedContainerIndices.contains(index)
|
||||
? const Color(0xFFD90B2E).withOpacity(0.4)
|
||||
: const Color(0xFFFFFFFF).withOpacity(0.2),
|
||||
border: selectedContainerIndices.contains(index)
|
||||
? Border.all(color: const Color(0xFFD90B2E), width: 1)
|
||||
: null),
|
||||
child: Center(child: text16w400_FCFCFC(text)),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,870 +0,0 @@
|
||||
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/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.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:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class ChatsMainScreen extends StatefulWidget {
|
||||
const ChatsMainScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ChatsMainScreen> createState() => _ChatsMainScreenState();
|
||||
}
|
||||
|
||||
class _ChatsMainScreenState extends State<ChatsMainScreen> {
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>();
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Alfonso Rosser",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Tatiana Kenter",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Liverpool FC",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Abram Westervelt",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
}
|
||||
];
|
||||
|
||||
List clubcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Wellness warriors collective",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Body blitz brigade",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Wellness warriors collective",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
];
|
||||
|
||||
List teamcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Cardio crusaders circle",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Strength squad syndicate",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Flexibility faction force",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
appBar: AppBar(
|
||||
scrolledUnderElevation: 0.0,
|
||||
backgroundColor: const Color(0xff222935),
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: Padding(
|
||||
padding: EdgeInsets.only(left: 16.w),
|
||||
child: Text(
|
||||
'Chats',
|
||||
style: TextStyle(
|
||||
fontSize: 23.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 16.w),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newchatpage);
|
||||
},
|
||||
child: Image.asset('assets/images/png/editicon.png')),
|
||||
)
|
||||
],
|
||||
// bottom: PreferredSize(
|
||||
// preferredSize: Size.fromHeight(90),
|
||||
// child:
|
||||
// ),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search chats",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: const Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h)
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 3,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
const MyTabBar(),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [feedTab(), clubsTab(), teamsTab()],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget feedTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.userchatpage);
|
||||
},
|
||||
child: ChatList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
isMessageRead: chatcontents[index]['messageread'],
|
||||
activestatus: chatcontents[index]['actstatus'],
|
||||
ispinned: chatcontents[index]['pinned'],
|
||||
count:
|
||||
(index == 0 || index == 1 || index == 2 || index == 3)
|
||||
? true
|
||||
: false),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget clubsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: clubcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupchatpage);
|
||||
},
|
||||
child: SecondChatList(
|
||||
name: clubcontents[index]['tittle'],
|
||||
imageurl: clubcontents[index]['image'],
|
||||
message: clubcontents[index]['subtittle'],
|
||||
isMessageRead: clubcontents[index]['messageread'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget teamsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: teamcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupchatpage);
|
||||
},
|
||||
child: SecondChatList(
|
||||
name: teamcontents[index]['tittle'],
|
||||
imageurl: teamcontents[index]['image'],
|
||||
message: teamcontents[index]['subtittle'],
|
||||
isMessageRead: teamcontents[index]['messageread'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyTabBar extends StatelessWidget {
|
||||
const MyTabBar({super.key});
|
||||
|
||||
// Set the desired height
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return 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),
|
||||
// labelColor: Colors.white,
|
||||
indicatorWeight: 2.h,
|
||||
dividerHeight: 2.h,
|
||||
unselectedLabelColor: const Color(0xFFFCFCFC),
|
||||
overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)),
|
||||
tabs: const [
|
||||
Tab(
|
||||
text: 'Friends',
|
||||
),
|
||||
Tab(
|
||||
text: 'Clubs',
|
||||
),
|
||||
Tab(
|
||||
text: 'Teams',
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ChatList extends StatefulWidget {
|
||||
String name;
|
||||
String imageurl;
|
||||
String message;
|
||||
bool isMessageRead;
|
||||
bool activestatus;
|
||||
bool ispinned;
|
||||
bool count;
|
||||
|
||||
ChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
required this.isMessageRead,
|
||||
required this.activestatus,
|
||||
required this.ispinned,
|
||||
required this.count,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ChatList> createState() => _ChatListState();
|
||||
}
|
||||
|
||||
class _ChatListState extends State<ChatList> {
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: const Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onLongPressStart: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(children: [
|
||||
Container(
|
||||
width: 55.w,
|
||||
height: 55.h,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 40.h,
|
||||
left: 45.w,
|
||||
child: widget.activestatus == true
|
||||
? Container(
|
||||
width: 10.w,
|
||||
height: 10.h,
|
||||
decoration: const ShapeDecoration(
|
||||
color: Color(0xFF32D74B),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: 10.w,
|
||||
height: 10.h,
|
||||
decoration: const ShapeDecoration(
|
||||
color: Color(0xFFFF453A),
|
||||
shape: OvalBorder(),
|
||||
)),
|
||||
)
|
||||
]),
|
||||
sizedBoxWidth(8.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white(widget.name),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
widget.isMessageRead == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset('assets/images/png/messagedelivered.png'),
|
||||
sizedBoxWidth(5.w),
|
||||
SizedBox(
|
||||
width: 170.w,
|
||||
child: Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
text12400white('Yesterday'),
|
||||
sizedBoxHeight(5.h),
|
||||
Row(
|
||||
children: [
|
||||
widget.ispinned == true
|
||||
? Image.asset('assets/images/png/pin.png')
|
||||
: const SizedBox(
|
||||
width: 25,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
widget.count == true
|
||||
? Container(
|
||||
width: 18,
|
||||
height: 18,
|
||||
decoration: const ShapeDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
child: Text(
|
||||
'1',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox()
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondChatList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
final bool isMessageRead;
|
||||
|
||||
const SecondChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
required this.isMessageRead,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SecondChatList> createState() => _SecondChatListState();
|
||||
}
|
||||
|
||||
class _SecondChatListState extends State<SecondChatList> {
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: const Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onLongPressStart: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 55.w,
|
||||
height: 55.h,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
widget.isMessageRead
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
SizedBox(width: 5.w),
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end, // Align to the end of the column
|
||||
children: [
|
||||
Text(
|
||||
'Yesterday',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class SecondChatList extends StatefulWidget {
|
||||
// String name;
|
||||
// String imageurl;
|
||||
// String message;
|
||||
// bool isMessageRead;
|
||||
|
||||
// SecondChatList({
|
||||
// Key? key,
|
||||
// required this.name,
|
||||
// required this.imageurl,
|
||||
// required this.message,
|
||||
// required this.isMessageRead,
|
||||
// }) : super(key: key);
|
||||
|
||||
// @override
|
||||
// State<SecondChatList> createState() => _SecondChatListState();
|
||||
// }
|
||||
|
||||
// class _SecondChatListState extends State<SecondChatList> {
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Padding(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
// child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Container(
|
||||
// width: 55,
|
||||
// height: 55,
|
||||
// decoration: BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage(widget.imageurl),
|
||||
// fit: BoxFit.fill,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.only(top: 5),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// text16400white(widget.name),
|
||||
// sizedBoxHeight(3.h),
|
||||
// Row(
|
||||
// children: [
|
||||
// widget.isMessageRead == true
|
||||
// ? Image.asset(
|
||||
// 'assets/images/png/messagereadcheckmark.png')
|
||||
// : Image.asset('assets/images/png/messagedelivered.png'),
|
||||
// sizedBoxWidth(5.w),
|
||||
// Text(
|
||||
// widget.message,
|
||||
// style: TextStyle(
|
||||
// color: Color(0xCCFCFCFC),
|
||||
// fontSize: 12.sp,
|
||||
// fontFamily: 'Helvetica',
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 5),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// text12400white('Yesterday'),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@@ -1,722 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class GroupChatPage extends StatefulWidget {
|
||||
const GroupChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<GroupChatPage> createState() => _GroupChatPageState();
|
||||
}
|
||||
|
||||
class _GroupChatPageState extends State<GroupChatPage> {
|
||||
ScrollController myController = ScrollController();
|
||||
|
||||
List<ChatMessage> messages = [
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/Photo.png'),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat2.png'),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat3.png'),
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat4.png'),
|
||||
];
|
||||
|
||||
String? attachimage;
|
||||
|
||||
final messageController = TextEditingController();
|
||||
|
||||
bool isImageAdded = false;
|
||||
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: const Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Search", style: TextStyle(color: Colors.white)),
|
||||
Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Profile", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/profile.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Block chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/blockchat.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Search chat selected');
|
||||
break;
|
||||
case 3:
|
||||
// Pin chat
|
||||
print('Profile chat selected');
|
||||
break;
|
||||
case 4:
|
||||
// Pin chat
|
||||
print('block chat selected');
|
||||
break;
|
||||
case 5:
|
||||
// Pin chat
|
||||
print('delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
if (messageController.text.isNotEmpty) {
|
||||
setState(() {
|
||||
messages.add(ChatMessage(
|
||||
messageContent: messageController.text,
|
||||
messageType: "sender",
|
||||
isread: false,
|
||||
image: 'assets/images/png/groupchat2.png'));
|
||||
messageController.clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Timer(const Duration(milliseconds: 50),
|
||||
() => myController.jumpTo(myController.position.maxScrollExtent));
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.focusScope?.unfocus();
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: const Color(0xFF222935).withOpacity(0.50),
|
||||
flexibleSpace: SafeArea(
|
||||
child: Container(
|
||||
// height: 90.h,
|
||||
padding: EdgeInsets.only(right: 10.w, left: 4.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
sizedBoxWidth(10.w),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/appbararrowbutton.png')
|
||||
// Icon(
|
||||
// Icons.arrow_back,
|
||||
// color: Colors.white,
|
||||
// size: 20.sp,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
width: 18.w,
|
||||
),
|
||||
Container(
|
||||
width: 40.h,
|
||||
height: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.h),
|
||||
image: const DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/groupchat.png"),
|
||||
fit: BoxFit.cover)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Liverpool FC',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white),
|
||||
),
|
||||
sizedBoxWidth(4.w),
|
||||
Image.asset(
|
||||
'assets/images/png/noto_soccer-ball.png')
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Text(
|
||||
"Ryan, Jaxson, Dulce, Nolan ",
|
||||
style: TextStyle(
|
||||
color: const Color(0xffFCFCFC).withOpacity(0.80),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTapDown: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 20,
|
||||
child: Image.asset(
|
||||
'assets/images/png/vertical3dots.png')))
|
||||
|
||||
// ignore: prefer_const_constructors
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 6,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
controller: myController,
|
||||
itemCount: messages.length,
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 70.0),
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return messages[index].messageType == "receiver"
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
right: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
messages[index].image,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
shape: const OvalBorder(),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(2.w),
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(1.00, -0.03),
|
||||
end: const Alignment(-1, 0.03),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.05999999865889549),
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomRight:
|
||||
Radius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
left: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: const ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, 0.05),
|
||||
end: Alignment(-1, -0.05),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x38D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft:
|
||||
Radius.circular(20),
|
||||
)),
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
messages[index]
|
||||
.messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(2.w),
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
messages[index].image,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
shape: const OvalBorder(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
sizedBoxWidth(16.w),
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderRadius: 30.r,
|
||||
blur: 6,
|
||||
alignment: Alignment.bottomCenter,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.24),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.24),
|
||||
],
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
stops: [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff434A53),
|
||||
Color(0xFF434A53),
|
||||
],
|
||||
),
|
||||
child: Center(
|
||||
child: TextFormField(
|
||||
controller: messageController,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
obscureText: false,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
decoration: InputDecoration(
|
||||
contentPadding:
|
||||
const EdgeInsets.all(10.0),
|
||||
// filled: true,
|
||||
// fillColor: Color(0XFF434A53),
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: const Color(0XFFFCFCFC)
|
||||
.withOpacity(0.80),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
hintText: "Type your message",
|
||||
suffixIcon: messageController
|
||||
.text.isNotEmpty ||
|
||||
isImageAdded == true
|
||||
? GestureDetector(
|
||||
// onTap: () => _chatItemsAdd(),
|
||||
onTap: _sendMessage,
|
||||
// () {
|
||||
// setState(() {
|
||||
// // UploadData();
|
||||
// messageController.clear();
|
||||
// });
|
||||
// },
|
||||
// => UploadData(),
|
||||
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 8.w,
|
||||
top: 2.h,
|
||||
bottom: 2.h),
|
||||
child: Container(
|
||||
width: 45.w,
|
||||
height: 30.h,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
const Color(0xFFD90B2E),
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
30.r)),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.send_outlined,
|
||||
color: Colors.white,
|
||||
)
|
||||
// Text(
|
||||
// 'Send',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 16.sp),
|
||||
// )
|
||||
)),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
ImageUploadBottomSheet()
|
||||
.showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
attachimage = result;
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
messageController.text =
|
||||
filenameresult;
|
||||
setState(() {
|
||||
isImageAdded = true;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.attach_file,
|
||||
color: Colors.white,
|
||||
size: 23.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
onChanged: (text) {
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ChatMessage {
|
||||
String messageContent;
|
||||
String messageType;
|
||||
bool isread;
|
||||
String image;
|
||||
ChatMessage({
|
||||
required this.messageContent,
|
||||
required this.messageType,
|
||||
required this.isread,
|
||||
required this.image,
|
||||
});
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class NewChatPage extends StatefulWidget {
|
||||
const NewChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<NewChatPage> createState() => _NewChatPageState();
|
||||
}
|
||||
|
||||
class _NewChatPageState extends State<NewChatPage> {
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "The athletic town",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Active alliance network",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Maria_01",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// backgroundColor: Color(0xFF222935),
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
|
||||
appBar: const CommonAppbar(titleTxt: 'New chat'),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search people",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: const Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newgrouppage);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/chatgroup.png'),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white
|
||||
.withOpacity(0.30000001192092896),
|
||||
Colors.white
|
||||
.withOpacity(0.30000001192092896)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50, color: Color(0xFF434A53)),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text18w400white('New group')
|
||||
],
|
||||
),
|
||||
Image.asset('assets/images/png/arrow-left (2).png')
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text18w700_FCFCFC('Contacts'),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {},
|
||||
child: SecondChatList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
],
|
||||
),
|
||||
]),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondChatList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
|
||||
const SecondChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SecondChatList> createState() => _SecondChatListState();
|
||||
}
|
||||
|
||||
class _SecondChatListState extends State<SecondChatList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,341 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:regroup/Common/controller/MainScreen.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/ImageUpload.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class NewGroupPage extends StatefulWidget {
|
||||
const NewGroupPage({super.key});
|
||||
|
||||
@override
|
||||
State<NewGroupPage> createState() => _NewGroupPageState();
|
||||
}
|
||||
|
||||
class _NewGroupPageState extends State<NewGroupPage> {
|
||||
TextEditingController groupnamecontroller = TextEditingController();
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
|
||||
List<File?> filePath = [];
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "The athletic town",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Active alliance network",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Maria_01",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: const CommonAppbar(titleTxt: 'New group'),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
filePath.add(file);
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage('assets/images/png/camera1.png'),
|
||||
// ),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.30000001192092896),
|
||||
Colors.white.withOpacity(0.30000001192092896)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50, color: Color(0xFF434A53)),
|
||||
),
|
||||
),
|
||||
child:
|
||||
// Obx(
|
||||
// () =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// addgroupImage.profilePicPath.value != ''
|
||||
filePath.isNotEmpty
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(24.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
'assets/images/png/camera1.png')
|
||||
],
|
||||
),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Expanded(
|
||||
child: CustomTextFormField(
|
||||
textEditingController: groupnamecontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Group name",
|
||||
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text18w700_FCFCFC('Select contacts to add to group'),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search people",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: const Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {},
|
||||
child: GroupsList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomButton(
|
||||
text: 'Create group',
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
Get.offUntil(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const MainScreen()),
|
||||
(Route<dynamic> route) => false);
|
||||
}),
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GroupsList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
|
||||
const GroupsList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<GroupsList> createState() => _GroupsListState();
|
||||
}
|
||||
|
||||
class _GroupsListState extends State<GroupsList> {
|
||||
bool isAdded = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide(
|
||||
color: const Color(0xFF434A53).withOpacity(0.72), width: 1.5.w),
|
||||
activeColor: const Color(0xFF434A53).withOpacity(0.72),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(0.0)),
|
||||
),
|
||||
value: isAdded,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isAdded = value ?? false;
|
||||
});
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,622 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class UserChatPage extends StatefulWidget {
|
||||
const UserChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<UserChatPage> createState() => _UserChatPageState();
|
||||
}
|
||||
|
||||
class _UserChatPageState extends State<UserChatPage> {
|
||||
ScrollController myController = ScrollController();
|
||||
|
||||
List<ChatMessage> messages = [
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: false),
|
||||
];
|
||||
|
||||
String? attachimage;
|
||||
|
||||
final messageController = TextEditingController();
|
||||
|
||||
bool isImageAdded = false;
|
||||
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: const Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Search", style: TextStyle(color: Colors.white)),
|
||||
Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Profile", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/profile.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Block chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/blockchat.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Search chat selected');
|
||||
break;
|
||||
case 3:
|
||||
// Pin chat
|
||||
print('Profile chat selected');
|
||||
break;
|
||||
case 4:
|
||||
// Pin chat
|
||||
print('block chat selected');
|
||||
break;
|
||||
case 5:
|
||||
// Pin chat
|
||||
print('delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
if (messageController.text.isNotEmpty) {
|
||||
setState(() {
|
||||
messages.add(ChatMessage(
|
||||
messageContent: messageController.text,
|
||||
messageType: "sender",
|
||||
isread: false,
|
||||
));
|
||||
messageController.clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Timer(const Duration(milliseconds: 50),
|
||||
() => myController.jumpTo(myController.position.maxScrollExtent));
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.focusScope?.unfocus();
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: const Color(0xFF222935).withOpacity(0.50),
|
||||
flexibleSpace: SafeArea(
|
||||
child: Container(
|
||||
// height: 90.h,
|
||||
padding: EdgeInsets.only(right: 10.w, left: 4.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
sizedBoxWidth(10.w),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/appbararrowbutton.png')
|
||||
// Icon(
|
||||
// Icons.arrow_back,
|
||||
// color: Colors.white,
|
||||
// size: 20.sp,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
width: 18.w,
|
||||
),
|
||||
Container(
|
||||
width: 40.h,
|
||||
height: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.h),
|
||||
image: const DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/Ellipse 52.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Ryan Dorwart',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white),
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Text(
|
||||
"Ryan_01",
|
||||
style: TextStyle(
|
||||
color: const Color(0xffFCFCFC).withOpacity(0.80),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTapDown: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 30,
|
||||
height: 20,
|
||||
child: Image.asset(
|
||||
'assets/images/png/vertical3dots.png')))
|
||||
|
||||
// ignore: prefer_const_constructors
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView.builder(
|
||||
controller: myController,
|
||||
itemCount: messages.length,
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 70.0),
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return messages[index].messageType == "receiver"
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0, top: 5.0, bottom: 5.0, right: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(1.00, -0.03),
|
||||
end: const Alignment(-1, 0.03),
|
||||
colors: [
|
||||
Colors.white
|
||||
.withOpacity(0.05999999865889549),
|
||||
Colors.white
|
||||
.withOpacity(0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 16.0, top: 5.0, bottom: 5.0, left: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: const ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, 0.05),
|
||||
end: Alignment(-1, -0.05),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x38D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft: Radius.circular(20),
|
||||
)),
|
||||
),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
sizedBoxWidth(16.w),
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 48.h,
|
||||
borderRadius: 30.r,
|
||||
blur: 6,
|
||||
alignment: Alignment.bottomCenter,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.24),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.24),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff434A53),
|
||||
Color(0xFF434A53),
|
||||
],
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: messageController,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(10.0),
|
||||
// filled: true,
|
||||
// fillColor: Color(0XFF434A53),
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: const Color(0XFFFCFCFC).withOpacity(0.80),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
hintText: "Type your message",
|
||||
suffixIcon: messageController.text.isNotEmpty ||
|
||||
isImageAdded == true
|
||||
? GestureDetector(
|
||||
// onTap: () => _chatItemsAdd(),
|
||||
onTap: _sendMessage,
|
||||
// () {
|
||||
// setState(() {
|
||||
// // UploadData();
|
||||
// messageController.clear();
|
||||
// });
|
||||
// },
|
||||
// => UploadData(),
|
||||
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 8.w, top: 2.h, bottom: 2.h),
|
||||
child: Container(
|
||||
width: 45.w,
|
||||
height: 30.h,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD90B2E),
|
||||
borderRadius:
|
||||
BorderRadius.circular(30.r)),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.send_outlined,
|
||||
color: Colors.white,
|
||||
)
|
||||
// Text(
|
||||
// 'Send',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 16.sp),
|
||||
// )
|
||||
)),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
attachimage = result;
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
messageController.text =
|
||||
filenameresult;
|
||||
setState(() {
|
||||
isImageAdded = true;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.attach_file,
|
||||
color: Colors.white,
|
||||
size: 23.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
onChanged: (text) {
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ChatMessage {
|
||||
String messageContent;
|
||||
String messageType;
|
||||
bool isread;
|
||||
ChatMessage({
|
||||
required this.messageContent,
|
||||
required this.messageType,
|
||||
required this.isread,
|
||||
});
|
||||
}
|
||||
@@ -10,10 +10,11 @@ import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/ViewModal/LatesPost.dart';
|
||||
import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart';
|
||||
// import 'package:regroup/Feed%20Module/sidemenu/sidemenu.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:regroup/sidemenu/sidemenu.dart';
|
||||
|
||||
class CommunityScreen extends StatefulWidget {
|
||||
const CommunityScreen({super.key});
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
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/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.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';
|
||||
|
||||
class CycleScreen extends StatefulWidget {
|
||||
const CycleScreen({super.key});
|
||||
|
||||
@override
|
||||
State<CycleScreen> createState() => _CycleScreenState();
|
||||
}
|
||||
|
||||
class _CycleScreenState extends State<CycleScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Cycle",
|
||||
customActionWidget: Image.asset(
|
||||
"assets/images/png/sidemenu/f7_pin-fill.png",
|
||||
height: 26.h,
|
||||
width: 26.w,
|
||||
)),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Popular',
|
||||
),
|
||||
Tab(
|
||||
text: 'Latest',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 670.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
cyclepopularTab(),
|
||||
cyclelatestTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
])
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
Widget cyclepopularTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
normalcardtile(
|
||||
profileImg: 'assets/images/png/Ellipse 52.png',
|
||||
title: 'Ryan Dorwat',
|
||||
mainImg: 'assets/images/png/img322.png',
|
||||
containerTitle: [
|
||||
'Football',
|
||||
'Teams player',
|
||||
'Events',
|
||||
'Marathon',
|
||||
'Events'
|
||||
]),
|
||||
sizedBoxHeight(30.h),
|
||||
normalcardtile(
|
||||
profileImg: 'assets/images/png/Ellipse 43.png',
|
||||
title: 'Edward Hackket',
|
||||
mainImg: 'assets/images/png/Rectangle 24.png',
|
||||
containerTitle: [
|
||||
'Cycle',
|
||||
'Marathon',
|
||||
'Events',
|
||||
'Marathon',
|
||||
'Events'
|
||||
]),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget cyclelatestTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
normalcardtile(
|
||||
profileImg: 'assets/images/png/Ellipse 43.png',
|
||||
title: 'Edward Hackket',
|
||||
mainImg: 'assets/images/png/Rectangle 24.png',
|
||||
containerTitle: [
|
||||
'Cycle',
|
||||
'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';
|
||||
}
|
||||
}
|
||||
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 570.h,
|
||||
border: 0,
|
||||
borderradius: 1,
|
||||
customWidget: Column(
|
||||
children: [
|
||||
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: 360.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(),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
borderradius: 100,
|
||||
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),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
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')
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -1,491 +0,0 @@
|
||||
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/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';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class PostDetailsScreen extends StatefulWidget {
|
||||
const PostDetailsScreen({super.key});
|
||||
|
||||
@override
|
||||
State<PostDetailsScreen> createState() => _PostDetailsScreenState();
|
||||
}
|
||||
|
||||
class _PostDetailsScreenState extends State<PostDetailsScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Post",
|
||||
),
|
||||
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: [
|
||||
postCards(
|
||||
profileImg: 'assets/images/png/Ellipse 52.png',
|
||||
title: 'Ryan Dorwat',
|
||||
mainImg: 'assets/images/png/Rectangle 25.png',
|
||||
containerTitle: [
|
||||
'Football',
|
||||
'Marathon',
|
||||
'Events',
|
||||
'Marathon',
|
||||
'Events'
|
||||
]),
|
||||
sizedBoxHeight(35.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 20.r,
|
||||
foregroundImage: const AssetImage(
|
||||
"assets/images/png/Ellipse 48.png",
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(15.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text12w400_FCFCFC_blur("Roger Saris"),
|
||||
text14w400_FCFCFC(
|
||||
"Lorem Ipsum has been the industry's standard dummy text 😍"),
|
||||
text10w400_FCFCFC_blur("Reply. . . ")
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: CustomTextFormField(
|
||||
hintText: "Add comment",
|
||||
suffixIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 25.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/iconoir_send.png",
|
||||
height: 20.h,
|
||||
width: 25.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
sizedBoxHeight(85.h)
|
||||
]))
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget postCards({
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 570.h,
|
||||
border: 0,
|
||||
borderradius: 0,
|
||||
customWidget: Column(
|
||||
children: [
|
||||
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),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 72.w,
|
||||
height: 26.h,
|
||||
borderradius: 5.r,
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget:
|
||||
Center(child: text14400white("Follow")),
|
||||
border: 1),
|
||||
sizedBoxWidth(6.w),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
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'),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
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: [
|
||||
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(),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
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),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
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: [
|
||||
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),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
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 containertile({required String text}) {
|
||||
return commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderradius: 30.r,
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
|
||||
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')
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,315 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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';
|
||||
|
||||
class ReactionView extends StatefulWidget {
|
||||
const ReactionView({super.key});
|
||||
|
||||
@override
|
||||
State<ReactionView> createState() => _ReactionViewState();
|
||||
}
|
||||
|
||||
class _ReactionViewState extends State<ReactionView> {
|
||||
List allTabData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg1.png",
|
||||
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
||||
"title": "Edward Hackket"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg2.png",
|
||||
"reactionimg": "assets/images/png/heart 2.png",
|
||||
"title": "Dulce Vaccaro"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg3.png",
|
||||
"reactionimg": "assets/images/png/party-popper 2.png",
|
||||
"title": "Edward Hackket"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
||||
"title": "Dulce Vaccaro"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 65.png",
|
||||
"reactionimg": "assets/images/png/heart 2.png",
|
||||
"title": "Edward Hackket"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"reactionimg": "assets/images/png/party-popper 2.png",
|
||||
"title": "Dulce Vaccaro"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
||||
"title": "Dulce Vaccaro"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg3.png",
|
||||
"reactionimg": "assets/images/png/party-popper 2.png",
|
||||
"title": "Edward Hackket"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
||||
"title": "Dulce Vaccaro"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Post",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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: [
|
||||
sizedBoxHeight(10.h),
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 4,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
CommonTabBar(tabs: [
|
||||
const Tab(
|
||||
text: 'All',
|
||||
),
|
||||
Tab(
|
||||
child: Row(children: [
|
||||
commonGlassContainer(
|
||||
borderColor: const Color(0xFF1E3A46),
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/f7_hand-thumbsup.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 1.71),
|
||||
const Spacer(),
|
||||
text14400white("110K"),
|
||||
]),
|
||||
),
|
||||
Tab(
|
||||
child: Row(children: [
|
||||
commonGlassContainer(
|
||||
borderColor: const Color(0xFF1E3A46),
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/heart 2.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 1.71),
|
||||
const Spacer(),
|
||||
text14400white("9.7K"),
|
||||
]),
|
||||
),
|
||||
Tab(
|
||||
child: Row(children: [
|
||||
commonGlassContainer(
|
||||
borderColor: const Color(0xFF1E3A46),
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/party-popper 2.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
border: 1.71),
|
||||
const Spacer(),
|
||||
text14400white("7.4K"),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
allTab(),
|
||||
likeTab(),
|
||||
favouriteTab(),
|
||||
partyTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
])),
|
||||
)
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget allTab() {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: allTabData.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
commonReaction(
|
||||
imagePath: allTabData[index]["imagePath"],
|
||||
reactionimg: allTabData[index]["reactionimg"],
|
||||
title: allTabData[index]["title"]),
|
||||
if (allTabData.length - 1 != index) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget likeTab() {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: allTabData.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
commonReaction(
|
||||
imagePath: allTabData[index]["imagePath"],
|
||||
reactionimg: allTabData[index]["reactionimg"],
|
||||
title: allTabData[index]["title"]),
|
||||
if (allTabData.length - 1 != index) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget favouriteTab() {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: allTabData.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
commonReaction(
|
||||
imagePath: allTabData[index]["imagePath"],
|
||||
reactionimg: allTabData[index]["reactionimg"],
|
||||
title: allTabData[index]["title"]),
|
||||
if (allTabData.length - 1 != index) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget partyTab() {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: allTabData.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
commonReaction(
|
||||
imagePath: allTabData[index]["imagePath"],
|
||||
reactionimg: allTabData[index]["reactionimg"],
|
||||
title: allTabData[index]["title"]),
|
||||
if (allTabData.length - 1 != index) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget commonReaction(
|
||||
{required String imagePath,
|
||||
required String reactionimg,
|
||||
required String title}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 18.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Stack(children: [
|
||||
CircleAvatar(
|
||||
radius: 25.r,
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: const Color(0xFF1E3A46),
|
||||
border: Border.all(
|
||||
color: const Color(0xFFFCFCFC).withOpacity(0.18),
|
||||
width: 0.6)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
reactionimg,
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
]),
|
||||
sizedBoxWidth(10.w),
|
||||
text17400white(title),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
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';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
|
||||
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/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.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:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class PostScreen extends StatefulWidget {
|
||||
const PostScreen({super.key});
|
||||
|
||||
@override
|
||||
State<PostScreen> createState() => _PostScreenState();
|
||||
}
|
||||
|
||||
class _PostScreenState extends State<PostScreen> {
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
var selectedContainerIndices = <int>{}.obs;
|
||||
|
||||
void toggleSelectedIndex(int index) {
|
||||
if (selectedContainerIndices.contains(index)) {
|
||||
selectedContainerIndices.remove(index);
|
||||
} else {
|
||||
selectedContainerIndices.add(index);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Create a post",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
|
||||
text16w400_FCFCFC("Caption"),
|
||||
|
||||
sizedBoxHeight(18.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Media"),
|
||||
sizedBoxHeight(18.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
borderColor: Colors.transparent,
|
||||
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: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/bi_download.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400_FCFCFC("Upload image"),
|
||||
sizedBoxHeight(8.h),
|
||||
text8w400_8A8A8A(
|
||||
"Allowed file extensions: jpg, png, gif Max file size: 10 MB"),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Tags"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownTag1(
|
||||
header: "Enter tags",
|
||||
title: "Enter tags",
|
||||
listData: const [
|
||||
"#Race",
|
||||
"#Swimming",
|
||||
"#Cycle",
|
||||
"#Swimming",
|
||||
"#Race"
|
||||
],
|
||||
rowData: const [
|
||||
"23,233 Recently use tags",
|
||||
"15,123 Recently use tags",
|
||||
"15,123 Recently use tags",
|
||||
"15,123 Available tags",
|
||||
"15,123 Available tags"
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: const SizedBox()),
|
||||
// CustomTextFormField(
|
||||
// suffixIcon: Container(
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// child: Center(
|
||||
// child: Image.asset(
|
||||
// "assets/images/png/Frame 58575.png",
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
containerTile(text: "# Race", index: 0),
|
||||
containerTile(text: "# Swimming", index: 1),
|
||||
containerTile(text: "# Cycle", index: 2),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
containerTile(text: "# Race", index: 3),
|
||||
containerTile(text: "# Swimming", index: 4),
|
||||
containerTile(text: "# Cycle", index: 5),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("CTA Title"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomTextFormField(
|
||||
// validationMessage: "Enter a CTA Title",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter a CTA Title';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Post as"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const ['Individual', 'Anonymous'],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: const SizedBox()),
|
||||
// CommonDropdownradioBtn(
|
||||
// hint: '', items: ['Individual', 'Anonymous']),
|
||||
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Post in"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownCheckBox(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const [
|
||||
'Active alliance network',
|
||||
'Fitfam federation',
|
||||
'The athletic town',
|
||||
'Football fever'
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
images: const [
|
||||
'assets/images/png/Rectangle 65.png',
|
||||
'assets/images/png/Rectangle 66.png',
|
||||
'assets/images/png/Rectangle 60.png',
|
||||
'assets/images/png/Rectangle 68.png'
|
||||
],
|
||||
leadingImage: const SizedBox()),
|
||||
// CommonDropdownCheckbox(
|
||||
// hint: '',
|
||||
// items: [
|
||||
// 'Active alliance network',
|
||||
// 'Fitfam federation',
|
||||
// 'The athletic town',
|
||||
// 'Football fever'
|
||||
// ],
|
||||
// images: [
|
||||
// 'assets/images/png/Rectangle 65.png',
|
||||
// 'assets/images/png/Rectangle 66.png',
|
||||
// 'assets/images/png/Rectangle 60.png',
|
||||
// 'assets/images/png/Rectangle 68.png'
|
||||
// ],
|
||||
// ),
|
||||
sizedBoxHeight(40.h),
|
||||
CommonBtn(
|
||||
text: 'Submit post',
|
||||
onTap: () {
|
||||
successBottomsheet();
|
||||
},
|
||||
),
|
||||
|
||||
sizedBoxHeight(150.h),
|
||||
]),
|
||||
),
|
||||
),
|
||||
]));
|
||||
}
|
||||
|
||||
void successBottomsheet() {
|
||||
Get.bottomSheet(Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14.r),
|
||||
color: const Color(0xFF222935)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.w),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Image.asset(
|
||||
'assets/images/png/Frame 1000004082.png',
|
||||
width: 199.w,
|
||||
height: 158.h,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text18w500Center_FCFCFC(
|
||||
'Your post has been succesfully uploaded'),
|
||||
sizedBoxHeight(20.h),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 216.w,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: const Color(0xFF434A53), width: 1),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color.fromRGBO(255, 255, 255, 0.054),
|
||||
Color.fromRGBO(255, 255, 255, 0.072),
|
||||
],
|
||||
stops: [0.0233, 1.0],
|
||||
transform: GradientRotation(271.14 *
|
||||
(3.141592653589793 /
|
||||
180)), // Converting degrees to radians
|
||||
),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text14w400_FCFCFC('Check out')),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h)
|
||||
]))));
|
||||
}
|
||||
|
||||
Widget containerTile({
|
||||
required String text,
|
||||
required int index,
|
||||
}) {
|
||||
return Obx(() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
toggleSelectedIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
color: selectedContainerIndices.contains(index)
|
||||
? const Color(0xFFD90B2E).withOpacity(0.4)
|
||||
: const Color(0xFFFFFFFF).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(color: const Color(0xFFD90B2E), width: 1)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/CommonTextFormField.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class DetailExplore extends StatefulWidget {
|
||||
const DetailExplore({super.key});
|
||||
|
||||
@override
|
||||
State<DetailExplore> createState() => _DetailExploreState();
|
||||
}
|
||||
|
||||
class _DetailExploreState extends State<DetailExplore> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
customWidget: const Center(
|
||||
child: Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.white,
|
||||
)),
|
||||
border: 1,
|
||||
borderColor: const Color(0xFF55434F)),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Expanded(
|
||||
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: "",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 4,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'All',
|
||||
),
|
||||
Tab(
|
||||
text: 'Events',
|
||||
),
|
||||
Tab(
|
||||
text: 'Groups',
|
||||
),
|
||||
Tab(
|
||||
text: 'Communities',
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
allTab(),
|
||||
eventsTab(),
|
||||
groupsTab(),
|
||||
communitiesTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
])),
|
||||
)
|
||||
])
|
||||
])));
|
||||
}
|
||||
|
||||
Widget allTab() {
|
||||
List alldata = [
|
||||
{
|
||||
"imagePath": "assets/images/png/notification1.png",
|
||||
"title": "Kartikey gautam"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/notification2.png",
|
||||
"title": "Kartikey gautam"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/notification1.png",
|
||||
"title": "Kartikey gautam"
|
||||
},
|
||||
];
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text16w700_FCFCFC("People"),
|
||||
sizedBoxHeight(16.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: alldata.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTile(
|
||||
imagePath: alldata[index]["imagePath"],
|
||||
title: alldata[index]["title"]),
|
||||
if (index != alldata.length - 1) commonDivider()
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTile({required String imagePath, required String title}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: const Color(0xFF434A53), width: 0.5.w),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(child: Image.asset(imagePath, fit: BoxFit.fill)),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white(title),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget eventsTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget groupsTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget communitiesTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,340 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/Common/global.dart' as global;
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class ExploreScreen extends StatefulWidget {
|
||||
const ExploreScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ExploreScreen> createState() => _ExploreScreenState();
|
||||
}
|
||||
|
||||
class _ExploreScreenState extends State<ExploreScreen> {
|
||||
GoogleMapController? _mapController;
|
||||
final double _zoomLevel = 18.0;
|
||||
|
||||
// BitmapDescriptor? _customIcon1;
|
||||
// BitmapDescriptor? _customIcon2;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// _loadCustomMarkers();
|
||||
global.getLocation();
|
||||
_showInitialBottomSheet();
|
||||
}
|
||||
|
||||
// void _loadCustomMarkers() async {
|
||||
// _customIcon1 = await BitmapDescriptor.fromAssetImage(
|
||||
// ImageConfiguration(size: Size(48, 48)),
|
||||
// 'assets/images/png/Group 58613.png',
|
||||
// );
|
||||
// _customIcon2 = await BitmapDescriptor.fromAssetImage(
|
||||
// ImageConfiguration(size: Size(48, 48)),
|
||||
// 'assets/images/custom_marker2.png',
|
||||
// );
|
||||
// setState(() {});
|
||||
// }
|
||||
|
||||
Future<void> _showInitialBottomSheet() async {
|
||||
await Future.delayed(const Duration(milliseconds: 400));
|
||||
exploreBottomSheet();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
// appBar: CommonAppbar(
|
||||
// titleTxt: "",
|
||||
// ),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), Stack(children: [
|
||||
GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
mapToolbarEnabled: true,
|
||||
onMapCreated: (controller) {
|
||||
_mapController = controller;
|
||||
_mapController!.animateCamera(
|
||||
CameraUpdate.newCameraPosition(
|
||||
CameraPosition(
|
||||
target: global.latlong!,
|
||||
zoom: _zoomLevel,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
zoomControlsEnabled: false,
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: global.latlong!,
|
||||
zoom: _zoomLevel,
|
||||
),
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: const MarkerId('currentP'),
|
||||
icon: BitmapDescriptor.defaultMarker,
|
||||
position: global.latlong!,
|
||||
onTap: () {
|
||||
exploreBottomSheet2();
|
||||
},
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('currentP'),
|
||||
icon: BitmapDescriptor.defaultMarker,
|
||||
position: const LatLng(19.155001, 72.84998),
|
||||
onTap: () {
|
||||
exploreBottomSheet2();
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
Positioned(
|
||||
top: 50.h,
|
||||
right: 0,
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.searchgroup);
|
||||
},
|
||||
child: AbsorbPointer(
|
||||
child: 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 groups",
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
void exploreBottomSheet2() {
|
||||
Get.bottomSheet(
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.r),
|
||||
topRight: Radius.circular(10.r),
|
||||
),
|
||||
color: const Color(0xFF222935),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Stack(clipBehavior: Clip.none, children: [
|
||||
Container(
|
||||
height: 130.h,
|
||||
width: double.infinity,
|
||||
decoration:
|
||||
BoxDecoration(borderRadius: BorderRadius.circular(5.r)),
|
||||
child: Image.asset(
|
||||
"assets/images/png/Rectangle 32.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: -40.h,
|
||||
right: 0,
|
||||
left: 0,
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
height: 85.h,
|
||||
width: 85.w,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Image.asset("assets/images/png/Ellipse 37.png",
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
))
|
||||
]),
|
||||
sizedBoxHeight(50.h),
|
||||
text20w700_FCFCFC("Iron titans fitness crew"),
|
||||
sizedBoxHeight(25.h),
|
||||
text14400whiteblur(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
|
||||
textAlign: TextAlign.center),
|
||||
sizedBoxHeight(25.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white("10 subgroups "),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/ph_users-light.png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white("7 members"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 170.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
borderradius: 30.r,
|
||||
customWidget: Center(child: text14w400_FCFCFC("Message")),
|
||||
border: 1),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 170.w,
|
||||
height: 35.h,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r)),
|
||||
child: Center(child: text14400white("Visit group")),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void exploreBottomSheet() {
|
||||
List exploreData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 29.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Elm street london, United Kingdom"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 31ee.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Elm street london, United Kingdom"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 45.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Elm street london, United Kingdom"
|
||||
},
|
||||
];
|
||||
Get.bottomSheet(
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.r),
|
||||
topRight: Radius.circular(10.r),
|
||||
),
|
||||
color: const Color(0xFF222935),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text18w700_FCFCFC('Explore groups and business'),
|
||||
sizedBoxHeight(25.h),
|
||||
Column(
|
||||
children: List.generate(exploreData.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowtile(
|
||||
imagePath: exploreData[index]["imagePath"],
|
||||
title: exploreData[index]["title"],
|
||||
subtitle: exploreData[index]["subtitle"]),
|
||||
if (exploreData.length - 1 != index) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowtile(
|
||||
{required String imagePath,
|
||||
required String title,
|
||||
required String subtitle}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 15.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 50.h,
|
||||
width: 50.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
),
|
||||
child: Image.asset(imagePath),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(6.h),
|
||||
text12400whiteblur(subtitle),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/CommonTextFormField.dart';
|
||||
|
||||
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class SearchGroup extends StatefulWidget {
|
||||
const SearchGroup({super.key});
|
||||
|
||||
@override
|
||||
State<SearchGroup> createState() => _SearchGroupState();
|
||||
}
|
||||
|
||||
class _SearchGroupState extends State<SearchGroup> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
body: SafeArea(
|
||||
child: 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),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
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 groups",
|
||||
),
|
||||
),
|
||||
text14400white("Cancel"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
text18w700white("Recent"),
|
||||
const Spacer(),
|
||||
text16w400_FCFCFCblur("See all"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.detailexplore);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/ion_search-outline.png",
|
||||
title: "Athletes"),
|
||||
),
|
||||
sizedBoxHeight(12.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 15.r,
|
||||
backgroundImage:
|
||||
const AssetImage("assets/images/png/cimg3.png"),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white("Kartikey gautam"),
|
||||
const Spacer(),
|
||||
const Icon(
|
||||
Icons.clear,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(12.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
rowTile(
|
||||
imagePath: "assets/images/png/Black.png",
|
||||
title: "Athletes"),
|
||||
sizedBoxHeight(12.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
rowTile(
|
||||
imagePath: "assets/images/png/Vector (5)aa.png",
|
||||
title: "Athletes"),
|
||||
sizedBoxHeight(12.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
rowTile(
|
||||
imagePath: "assets/images/png/calender.png",
|
||||
title: "Athletes"),
|
||||
sizedBoxHeight(12.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(16.h),
|
||||
]))
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
Widget rowTile({required String imagePath, required String title}) {
|
||||
return Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
imagePath,
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white(title),
|
||||
const Spacer(),
|
||||
const Icon(
|
||||
Icons.clear,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class ConnectCommunity extends StatefulWidget {
|
||||
const ConnectCommunity({super.key});
|
||||
|
||||
@override
|
||||
State<ConnectCommunity> createState() => _ConnectCommunityState();
|
||||
}
|
||||
|
||||
class _ConnectCommunityState extends State<ConnectCommunity> {
|
||||
List communityData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img34.png",
|
||||
"text": "FitFam federation",
|
||||
"members": "7 members"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Connect with communities",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: communityData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return communityCard(
|
||||
ontap: () {},
|
||||
imagepath: communityData[index]['imagePath'],
|
||||
title: communityData[index]['text'],
|
||||
members: communityData[index]['members']);
|
||||
},
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget communityCard({
|
||||
required String imagepath,
|
||||
required String title,
|
||||
required void Function()? ontap,
|
||||
required String members,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
imagepath,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
text14w400_FCFCFCblur("10 groups")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
const Spacer(),
|
||||
Container(
|
||||
height: 30.h,
|
||||
width: 123.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
color: const Color(0xFFD90B2E)),
|
||||
child: Center(
|
||||
child: text14w400_FCFCFC("Request to join")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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';
|
||||
|
||||
class GroupSettings extends StatefulWidget {
|
||||
const GroupSettings({super.key});
|
||||
|
||||
@override
|
||||
State<GroupSettings> createState() => _GroupSettingsState();
|
||||
}
|
||||
|
||||
class _GroupSettingsState extends State<GroupSettings> {
|
||||
var selectedIndex = (-1).obs;
|
||||
|
||||
List eventData = [
|
||||
{
|
||||
"title": "Public",
|
||||
},
|
||||
{
|
||||
"title": "Private - Request to join",
|
||||
},
|
||||
{
|
||||
"title": "Private - Invite only",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Group settings",
|
||||
),
|
||||
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: [
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
inviteBottomSheet();
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text18w400_FCFCFC("Group type"),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 18.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(25.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupmanage);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text18w400_FCFCFC("Manage members"),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 18.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
void inviteBottomSheet() {
|
||||
Get.bottomSheet(
|
||||
StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30.r),
|
||||
topRight: Radius.circular(30.r),
|
||||
),
|
||||
color: const Color(0xFF222935),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text18w400white("Choose"),
|
||||
Obx(
|
||||
() => Column(
|
||||
children: List.generate(eventData.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
eventWidget(
|
||||
index: index,
|
||||
title: eventData[index]["title"],
|
||||
isSelected: selectedIndex.value == index,
|
||||
onSelectedChanged: (int? value) {
|
||||
selectedIndex.value = value ?? -1;
|
||||
},
|
||||
),
|
||||
if (index != eventData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget eventWidget({
|
||||
required int index,
|
||||
required String title,
|
||||
required bool isSelected,
|
||||
required ValueChanged<int?> onSelectedChanged,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.h,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Radio<int>(
|
||||
value: index,
|
||||
groupValue: isSelected ? index : null,
|
||||
onChanged: onSelectedChanged,
|
||||
activeColor: Colors.white,
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
return Colors.white;
|
||||
}),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,558 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class GroupEvent extends StatefulWidget {
|
||||
const GroupEvent({super.key});
|
||||
|
||||
@override
|
||||
State<GroupEvent> createState() => _GroupEventState();
|
||||
}
|
||||
|
||||
class _GroupEventState extends State<GroupEvent> {
|
||||
RxBool isChecked = false.obs;
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
|
||||
TimeOfDay? starttime = const TimeOfDay(hour: 15, minute: 0);
|
||||
TimeOfDay? endtime = const TimeOfDay(hour: 15, minute: 0);
|
||||
|
||||
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,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
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"),
|
||||
sizedBoxHeight(14.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: "",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter Event Title';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Event image"),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassContainer(
|
||||
border: 0,
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderradius: 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: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/bi_download.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400white("Upload event image"),
|
||||
sizedBoxHeight(8.h),
|
||||
text8w400_8A8A8A(
|
||||
"Allowed file extensions: jpg, png, gif Max file size: 10 MB"),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 60.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(children: [
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.r)),
|
||||
child: Image.asset(
|
||||
"assets/images/png/img2.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text14400white("Event1.png"),
|
||||
sizedBoxHeight(2.h),
|
||||
text12w400_FCFCFC_blur("10 kb")
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
'assets/images/png/cancelicon.png',
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Type of event"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: '',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)12.png",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Sport"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: '',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start date "),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.h),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End date"),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]))
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start time"),
|
||||
sizedBoxHeight(14.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: starttime);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
starttime = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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(starttime!)),
|
||||
]),
|
||||
),
|
||||
border: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End time"),
|
||||
sizedBoxHeight(14.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final TimeOfDay? pickedTime =
|
||||
await showCustomTimePicker(context,
|
||||
initialTime: endtime);
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
endtime = pickedTime;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 174.w,
|
||||
height: 50.h,
|
||||
borderradius: 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(endtime!)),
|
||||
]),
|
||||
),
|
||||
border: 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: const BorderSide(color: Color(0xFF434A53)),
|
||||
value: isChecked.value,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: ((value) {
|
||||
isChecked.value = value!;
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
sizedBoxWidth(8.w),
|
||||
text14w400_FCFCFC("Repeat event")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Post in"),
|
||||
sizedBoxHeight(14.h),
|
||||
CommonDropdownBtn(
|
||||
hint: '',
|
||||
items: const [],
|
||||
leadingImage: SizedBox(
|
||||
height: 22.h,
|
||||
width: 28.w,
|
||||
child: Center(
|
||||
child: Image.asset("assets/images/png/Black.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Add Users"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.addUsers);
|
||||
},
|
||||
leadingIcon: SizedBox(
|
||||
height: 22.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group122.png",
|
||||
fit: BoxFit.cover,
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "",
|
||||
suffixIcon:
|
||||
const Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)),
|
||||
),
|
||||
// sizedBoxHeight(20.h),
|
||||
// containerWidget(
|
||||
// imagePath: "assets/images/png/Ellipse 52.png",
|
||||
// title: "Ryan Dorwart"),
|
||||
// sizedBoxHeight(10.h),
|
||||
// containerWidget(
|
||||
// imagePath: "assets/images/png/Ellipse 52.png",
|
||||
// title: "Ryan Dorwart"),
|
||||
// sizedBoxHeight(10.h),
|
||||
// Align(
|
||||
// alignment: Alignment.center,
|
||||
// child: text14400white("View more")),
|
||||
// sizedBoxHeight(30.h),
|
||||
text16400white("Location"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 19.h,
|
||||
width: 15.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 19.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter the location';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
text16400white("Reminder"),
|
||||
sizedBoxHeight(14.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 127.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: text16400white("2"),
|
||||
)),
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 215.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text16400white("Minutes"),
|
||||
sizedBoxWidth(5.w),
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(35.h),
|
||||
CommonBtn(text: "Create event"),
|
||||
sizedBoxHeight(70.h),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget containerWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderradius: 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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
border: 1);
|
||||
}
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
import 'package:flutter/material.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/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';
|
||||
|
||||
class GroupInfo extends StatefulWidget {
|
||||
const GroupInfo({super.key});
|
||||
|
||||
@override
|
||||
State<GroupInfo> createState() => _GroupInfoState();
|
||||
}
|
||||
|
||||
class _GroupInfoState extends State<GroupInfo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Groups info",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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: [
|
||||
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,
|
||||
),
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
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(60.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text20w700_FCFCFC("Iron titans fitness crew"),
|
||||
sizedBoxHeight(10.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("About group"),
|
||||
sizedBoxHeight(20.h),
|
||||
text14w400_FCFCFCblur(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 17.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white("Elm street london, United Kingdom")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector2a.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(12.w),
|
||||
text16400white("www.exampledummywebsite.com")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(text: "Connect with the community", onTap: () {
|
||||
Get.toNamed(RouteName.connectcommunity);
|
||||
},),
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,616 +0,0 @@
|
||||
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 GroupManage extends StatefulWidget {
|
||||
const GroupManage({super.key});
|
||||
|
||||
@override
|
||||
State<GroupManage> createState() => _GroupManageState();
|
||||
}
|
||||
|
||||
class _GroupManageState extends State<GroupManage> {
|
||||
List members = [
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Ryan Dorwart"},
|
||||
{"imagePath": "assets/images/png/cimg2.png", "title": "Ahmad Rhiel Madsen"},
|
||||
{"imagePath": "assets/images/png/cimg3.png", "title": "Kaylynn Vaccaro"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Kianna Donin"},
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Manage members",
|
||||
customActionWidget: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
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: [
|
||||
sizedBoxHeight(20.h),
|
||||
DefaultTabController(
|
||||
length: 4,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Members',
|
||||
),
|
||||
Tab(
|
||||
text: 'Admins',
|
||||
),
|
||||
Tab(
|
||||
text: 'Requests',
|
||||
),
|
||||
Tab(
|
||||
text: 'Invites',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 655.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
membersTab(),
|
||||
adminsTab(),
|
||||
requestsTab(),
|
||||
invitesTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget membersTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 5.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
dialogwidget() {
|
||||
Get.dialog(Dialog(
|
||||
// backgroundColor: Colors.transparent,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
color: 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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("M")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Tu")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("W")),
|
||||
border: 0.5),
|
||||
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: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Th")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("F")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Sa")),
|
||||
border: 0.5),
|
||||
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 adminsTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget requestsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
requestsTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget requestsTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 74.w,
|
||||
height: 25.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(23.r),
|
||||
color: const Color(0xFFD90B2E),
|
||||
),
|
||||
child: Center(child: text11w400white("Confirm")),
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
const Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget invitesTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
const Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
invitesTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget invitesTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 74.w,
|
||||
height: 25.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(23.r),
|
||||
color: const Color(0xFFD90B2E),
|
||||
),
|
||||
child: Center(child: text11w400white("Invite")),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,336 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonBottomNavigationBar.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class GroupTab extends StatefulWidget {
|
||||
const GroupTab({super.key});
|
||||
|
||||
@override
|
||||
State<GroupTab> createState() => _GroupTabState();
|
||||
}
|
||||
|
||||
class _GroupTabState extends State<GroupTab> {
|
||||
List groupData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img34.png",
|
||||
"text": "FitFam federation",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: AppBar(
|
||||
scrolledUnderElevation: 0.0,
|
||||
backgroundColor: const Color(0xff222935),
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
title: text20700white("Groups"),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.addEvent);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(14.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.setavailabillity);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/ion_search-outline.png',
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(14.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.managememberscal);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 9.png',
|
||||
height: 22.h,
|
||||
width: 22.w,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(16.w),
|
||||
],
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.requestedgroups);
|
||||
},
|
||||
child: text16w700_FCFCFCUnderline("Requested groups")),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 23,
|
||||
width: 23,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/ion_search-outline.png",
|
||||
height: 23,
|
||||
width: 23,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search groups",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: groupData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return groupCard(
|
||||
ontap: () {
|
||||
Get.toNamed(RouteName.groupdetail);
|
||||
},
|
||||
imagepath: groupData[index]['imagePath'],
|
||||
title: groupData[index]['text'],
|
||||
members: groupData[index]['members']);
|
||||
},
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
]),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
);
|
||||
}
|
||||
|
||||
Widget groupCard({
|
||||
required String imagepath,
|
||||
required String title,
|
||||
required void Function()? ontap,
|
||||
required String members,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderwidth: 0.9,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
imagepath,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
text14w400_FCFCFCblur("10 groups")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 200.w),
|
||||
offset: const Offset(0, 30),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Mute group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Pin group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 27.h,
|
||||
width: 27.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Make primary"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/leave group.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
// text14w400_FCFCFC("Leave group"),
|
||||
text14w400_D90B2E("Leave group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/LightGray22.png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 18.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.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/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.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/texts.dart';
|
||||
|
||||
class NewPost extends StatefulWidget {
|
||||
const NewPost({super.key});
|
||||
|
||||
@override
|
||||
State<NewPost> createState() => _NewPostState();
|
||||
}
|
||||
|
||||
class _NewPostState extends State<NewPost> {
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
var selectedContainerIndices = <int>{}.obs;
|
||||
|
||||
void toggleSelectedIndex(int index) {
|
||||
if (selectedContainerIndices.contains(index)) {
|
||||
selectedContainerIndices.remove(index);
|
||||
} else {
|
||||
selectedContainerIndices.add(index);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "New post",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("Caption"),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
),
|
||||
text16400white("Media"),
|
||||
sizedBoxHeight(15.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassContainer(
|
||||
border: 0,
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderradius: 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: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/file 1.png",
|
||||
height: 44.h,
|
||||
width: 44.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
text8w400_white(
|
||||
"Drag and Drop file here or "),
|
||||
text8w700_white("Choose file")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
]),
|
||||
)),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Tags"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownTag1(
|
||||
header: "Enter tags",
|
||||
title: "Enter tags",
|
||||
listData: const [
|
||||
"#Race",
|
||||
"#Swimming",
|
||||
"#Cycle",
|
||||
"#Swimming",
|
||||
"#Race"
|
||||
],
|
||||
rowData: const [
|
||||
"23,233 Recently use tags",
|
||||
"15,123 Recently use tags",
|
||||
"15,123 Recently use tags",
|
||||
"15,123 Available tags",
|
||||
"15,123 Available tags"
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: const SizedBox()),
|
||||
// CustomTextFormField(
|
||||
// suffixIcon: Container(
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// child: Center(
|
||||
// child: Image.asset(
|
||||
// "assets/images/png/Frame 58575.png",
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
containerTile(text: "# Race", index: 0),
|
||||
containerTile(text: "# Swimming", index: 1),
|
||||
containerTile(text: "# Cycle", index: 2),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
containerTile(text: "# Race", index: 3),
|
||||
containerTile(text: "# Swimming", index: 4),
|
||||
containerTile(text: "# Cycle", index: 5),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
// text16w400_FCFCFC("CTA Title"),
|
||||
// sizedBoxHeight(18.h),
|
||||
// CustomTextFormField(),
|
||||
// sizedBoxHeight(25.h),
|
||||
// text16w400_FCFCFC("Post as"),
|
||||
// sizedBoxHeight(18.h),
|
||||
// CustomDropDownRadio(
|
||||
// header: "",
|
||||
// title: "",
|
||||
// listData: ['Individual', 'Anonymous'],
|
||||
// onItemSelected: (p0) {},
|
||||
// leadingImage: SizedBox()),
|
||||
// CommonDropdownradioBtn(
|
||||
// hint: '', items: ['Individual', 'Anonymous']),
|
||||
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Post in"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownCheckBox(
|
||||
header: "",
|
||||
title: "",
|
||||
|
||||
listData: const [
|
||||
'Active alliance network',
|
||||
'Fitfam federation',
|
||||
'The athletic town',
|
||||
'Football fever'
|
||||
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
images: const [
|
||||
'assets/images/png/Rectangle 65.png',
|
||||
'assets/images/png/Rectangle 66.png',
|
||||
'assets/images/png/Rectangle 60.png',
|
||||
'assets/images/png/Rectangle 68.png'
|
||||
],
|
||||
leadingImage: const SizedBox()),
|
||||
|
||||
sizedBoxHeight(40.h),
|
||||
CommonBtn(
|
||||
text: 'Submit post',
|
||||
onTap: () {
|
||||
// successBottomsheet();
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget containerTile({
|
||||
required String text,
|
||||
required int index,
|
||||
}) {
|
||||
return Obx(() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
toggleSelectedIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
color: selectedContainerIndices.contains(index)
|
||||
? const Color(0xFFD90B2E).withOpacity(0.4)
|
||||
: const Color(0xFFFFFFFF).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(color: const Color(0xFFD90B2E), width: 1)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,258 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class RequestedGroups extends StatefulWidget {
|
||||
const RequestedGroups({super.key});
|
||||
|
||||
@override
|
||||
State<RequestedGroups> createState() => _RequestedGroupsState();
|
||||
}
|
||||
|
||||
class _RequestedGroupsState extends State<RequestedGroups> {
|
||||
List groupData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img34.png",
|
||||
"text": "FitFam federation",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Requested groups",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
sizedBoxHeight(20.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: groupData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return groupCard(
|
||||
ontap: () {},
|
||||
imagepath: groupData[index]['imagePath'],
|
||||
title: groupData[index]['text'],
|
||||
members: groupData[index]['members']);
|
||||
},
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget groupCard({
|
||||
required String imagepath,
|
||||
required String title,
|
||||
required void Function()? ontap,
|
||||
required String members,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderwidth: 0.9,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
imagepath,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
text14w400_FCFCFCblur("10 groups")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 200.w),
|
||||
offset: const Offset(0, 30),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Mute group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Pin group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 27.h,
|
||||
width: 27.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Make primary"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/leave group.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
// text14w400_FCFCFC("Leave group"),
|
||||
text14w400_D90B2E("Leave group"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/LightGray22.png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 18.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 127.w,
|
||||
height: 30.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
color: const Color(0xFFD90B2E)),
|
||||
child:
|
||||
Center(child: text14w400_FCFCFC("Cancel request")),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,464 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.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/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.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/texts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class Sessions extends StatefulWidget {
|
||||
const Sessions({super.key});
|
||||
|
||||
@override
|
||||
State<Sessions> createState() => _SessionsState();
|
||||
}
|
||||
|
||||
RxBool isChecked = false.obs;
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
|
||||
class _SessionsState extends State<Sessions> {
|
||||
DateTime? _selectedDate;
|
||||
TimeOfDay? _selectedTime;
|
||||
String _formattedDateTime = 'Thu, Jan 20 08:00 pm';
|
||||
|
||||
Future<TimeOfDay?> showCustomTimePicker(BuildContext context,
|
||||
{TimeOfDay? initialTime}) {
|
||||
final ThemeData customTheme2 = Theme.of(context).copyWith(
|
||||
colorScheme: const ColorScheme.light(
|
||||
primary: Color(0xFFD90B2E),
|
||||
surfaceTint: Color(0xFF222935),
|
||||
surface: Color(0xFF222935),
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Colors.white,
|
||||
),
|
||||
textTheme: Theme.of(context).textTheme.copyWith(
|
||||
titleLarge: const TextStyle(color: Colors.blue),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFD90B2E),
|
||||
),
|
||||
));
|
||||
return showTimePicker(
|
||||
context: context,
|
||||
initialTime: initialTime ?? TimeOfDay.now(),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return Theme(
|
||||
data: customTheme2,
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _selectDateTime(BuildContext context) async {
|
||||
final ThemeData customTheme2 = Theme.of(context).copyWith(
|
||||
colorScheme: const ColorScheme.light(
|
||||
primary: Color(0xFFD90B2E),
|
||||
surfaceTint: Color(0xFF222935),
|
||||
surface: Color(0xFF222935),
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Colors.white,
|
||||
// onSecondary: Colors.red,
|
||||
),
|
||||
textTheme: Theme.of(context).textTheme.copyWith(
|
||||
titleLarge: const TextStyle(color: Colors.blue),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFD90B2E),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final DateTime? pickedDate = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime(2101),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return Theme(
|
||||
data: customTheme2,
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
final TimeOfDay? pickedTime = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.now(),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return Theme(
|
||||
data: customTheme2,
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (pickedTime != null) {
|
||||
setState(() {
|
||||
_selectedDate = pickedDate;
|
||||
_selectedTime = pickedTime;
|
||||
|
||||
final DateTime selectedDateTime = DateTime(
|
||||
_selectedDate!.year,
|
||||
_selectedDate!.month,
|
||||
_selectedDate!.day,
|
||||
_selectedTime!.hour,
|
||||
_selectedTime!.minute,
|
||||
);
|
||||
|
||||
_formattedDateTime =
|
||||
DateFormat('EEE, MMM d h:mm a').format(selectedDateTime);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Sessions",
|
||||
),
|
||||
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: [
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("Session Title"),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
hintText: "",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (5)12.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Text.rich(
|
||||
TextSpan(children: [
|
||||
TextSpan(
|
||||
text: 'Description ',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '(optional)',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFFCFCFC),
|
||||
fontSize: 14.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField2(),
|
||||
text16w400_FCFCFC('Type of session'),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const ["hhh"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Vector (5)12.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC('Sport'),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const ["hhh"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
)),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC('Starts'),
|
||||
sizedBoxHeight(25.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_selectDateTime(context);
|
||||
},
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
)),
|
||||
hintText: _formattedDateTime,
|
||||
// hintText: "Thu, Jan 20 08:00 pm",
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: const BorderSide(
|
||||
color: Color(0xFF434A53)),
|
||||
value: isChecked.value,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: ((value) {
|
||||
isChecked.value = value!;
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
sizedBoxWidth(8.w),
|
||||
text14w400_FCFCFC("Repeat event")
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Location"),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomTextFormField(
|
||||
hintText: "",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Post in"),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const ["hryy"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Add Users"),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
hintText: "",
|
||||
leadingIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group122.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
)),
|
||||
suffixIcon: SizedBox(
|
||||
height: 20.h,
|
||||
width: 20.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/arrow.png",
|
||||
height: 20.h,
|
||||
width: 20.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Reminder"),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 127.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: text16400white("2"),
|
||||
)),
|
||||
commonGlassContainer(
|
||||
height: 50.h,
|
||||
width: 215.w,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
text16400white("Minutes"),
|
||||
sizedBoxWidth(5.w),
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
]),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("session image"),
|
||||
sizedBoxHeight(25.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: const [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: const Color(0xFF434A53),
|
||||
child: commonGlassContainer(
|
||||
border: 0,
|
||||
width: double.infinity,
|
||||
height: 130.h,
|
||||
borderradius: 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:
|
||||
const Color(0xFF7E7E7E),
|
||||
shape:
|
||||
RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons
|
||||
.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/bi_download.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400_FCFCFC(
|
||||
"Upload session image"),
|
||||
sizedBoxHeight(8.h),
|
||||
text8w400_8A8A8A(
|
||||
"Allowed file extensions: jpg, png, gif Max file size: 10 MB"),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
CustomDropDownRadio(
|
||||
header: "More options",
|
||||
title: "",
|
||||
listData: const [""],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: const SizedBox()),
|
||||
sizedBoxHeight(30.h),
|
||||
CommonBtn(text: "Create event"),
|
||||
sizedBoxHeight(50.h),
|
||||
])))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,211 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
class EditSubgroupInfo extends StatefulWidget {
|
||||
const EditSubgroupInfo({super.key});
|
||||
|
||||
@override
|
||||
State<EditSubgroupInfo> createState() => _EditSubgroupInfoState();
|
||||
}
|
||||
|
||||
class _EditSubgroupInfoState extends State<EditSubgroupInfo> {
|
||||
List<File?> filePath = [];
|
||||
bool? isImageAdded = false;
|
||||
List<File?> bannerPath = [];
|
||||
bool isbannerAdded = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Edit subgroup info",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
), Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Stack(
|
||||
children: [
|
||||
filePath.isNotEmpty
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: const AssetImage(
|
||||
"assets/images/png/cimg3.png",
|
||||
),
|
||||
radius: 50.r,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
filePath.add(file);
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/cameraicon2.png",
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Edit profile picture"),
|
||||
sizedBoxHeight(20.h),
|
||||
]),
|
||||
),
|
||||
text16w400_FCFCFC("Event banner image"),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: double.infinity,
|
||||
height: 150.h,
|
||||
borderradius: 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: const Color(0xFF7E7E7E),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
])
|
||||
: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/onlycamera.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400white("Upload event image"),
|
||||
sizedBoxHeight(12.h),
|
||||
SizedBox(
|
||||
width: 192.w,
|
||||
child: text8w400_8A8A8A(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Group title"),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomTextFormField(
|
||||
hintText: "Iron titans fitness crew"),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Group description"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText:
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer .",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Location"),
|
||||
CustomTextFormField(
|
||||
hintText: "Elm street london, United Kingdom"),
|
||||
sizedBoxHeight(40.h),
|
||||
CommonBtn(text: "Save changes"),
|
||||
sizedBoxHeight(40.h),
|
||||
],
|
||||
),
|
||||
))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,771 +0,0 @@
|
||||
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/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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class SubGroupInfo extends StatefulWidget {
|
||||
const SubGroupInfo({super.key});
|
||||
|
||||
@override
|
||||
State<SubGroupInfo> createState() => _SubGroupInfoState();
|
||||
}
|
||||
|
||||
class _SubGroupInfoState extends State<SubGroupInfo> {
|
||||
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"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
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.groupevent);
|
||||
},
|
||||
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),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.editsubgroupinfo);
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/codicon_account.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
border: 0.5),
|
||||
),
|
||||
sizedBoxWidth(16.w),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 230.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("Sub -Group info"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/codicon_account.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.subgroupsetting);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400white("Edit sub-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(60.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text20w700_FCFCFC("Cardio crusaders circle"),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset("assets/images/png/Black.png",
|
||||
height: 20.h, width: 20.w),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(7.w),
|
||||
text16w400_FCFCFCblur("The athlectic town"),
|
||||
sizedBoxWidth(20.w),
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset("assets/images/png/img12.png",
|
||||
height: 20.h, width: 20.w),
|
||||
),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(7.w),
|
||||
text16w400_FCFCFCblur("Public"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(35.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Posts',
|
||||
),
|
||||
Tab(
|
||||
text: 'Events',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
// clipBehavior: Clip.none,
|
||||
children: [
|
||||
postsTab(),
|
||||
eventsTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(90.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget postsTab() {
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 570.h,
|
||||
border: 0,
|
||||
borderradius: 1,
|
||||
customWidget: Column(
|
||||
children: [
|
||||
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: Container(
|
||||
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(),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
borderradius: 100,
|
||||
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),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
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 commonGlassContainer(
|
||||
border: 1,
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderradius: 30.r,
|
||||
borderColor: const Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
|
||||
Widget eventsTab() {
|
||||
return const Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class SubGroupSetting extends StatefulWidget {
|
||||
const SubGroupSetting({super.key});
|
||||
|
||||
@override
|
||||
State<SubGroupSetting> createState() => _SubGroupSettingState();
|
||||
}
|
||||
|
||||
class _SubGroupSettingState extends State<SubGroupSetting> {
|
||||
var selectedIndex = (-1).obs;
|
||||
|
||||
List eventData = [
|
||||
{
|
||||
"title": "Open",
|
||||
},
|
||||
{
|
||||
"title": "Invite only",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Subgroup settings",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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: [
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
inviteBottomSheet();
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text18w400_FCFCFC("Group type"),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 18.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(25.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupmanage);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text18w400_FCFCFC("Manage members"),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 18.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
void inviteBottomSheet() {
|
||||
Get.bottomSheet(
|
||||
StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30.r),
|
||||
topRight: Radius.circular(30.r),
|
||||
),
|
||||
color: Color(0xFF222935),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text18w400white("Choose"),
|
||||
Obx(
|
||||
() => Column(
|
||||
children: List.generate(eventData.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
eventWidget(
|
||||
index: index,
|
||||
title: eventData[index]["title"],
|
||||
isSelected: selectedIndex.value == index,
|
||||
onSelectedChanged: (int? value) {
|
||||
selectedIndex.value = value ?? -1;
|
||||
},
|
||||
),
|
||||
if (index != eventData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget eventWidget({
|
||||
required int index,
|
||||
required String title,
|
||||
required bool isSelected,
|
||||
required ValueChanged<int?> onSelectedChanged,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.h,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Radio<int>(
|
||||
value: index,
|
||||
groupValue: isSelected ? index : null,
|
||||
onChanged: onSelectedChanged,
|
||||
activeColor: Colors.white,
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
return Colors.white;
|
||||
}),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class SubGroups extends StatefulWidget {
|
||||
const SubGroups({super.key});
|
||||
|
||||
@override
|
||||
State<SubGroups> createState() => _SubGroupsState();
|
||||
}
|
||||
|
||||
class _SubGroupsState extends State<SubGroups> {
|
||||
List subgroupData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img34.png",
|
||||
"text": "FitFam federation",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Active alliance network",
|
||||
"members": "7 members"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Subgroups",
|
||||
customActionWidget: InkWell(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.addEvent);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: subgroupData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return subgroupCard(
|
||||
ontap: () {
|
||||
Get.toNamed(RouteName.groupdetail);
|
||||
},
|
||||
imagepath: subgroupData[index]['imagePath'],
|
||||
title: subgroupData[index]['text'],
|
||||
members: subgroupData[index]['members']);
|
||||
},
|
||||
),
|
||||
)
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget subgroupCard({
|
||||
required String imagepath,
|
||||
required String title,
|
||||
required void Function()? ontap,
|
||||
required String members,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 65.h,
|
||||
width: 65.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
imagepath,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
text14w400_FCFCFCblur("10 groups")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 200.w),
|
||||
offset: Offset(0, 30),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Mute community"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Hide post"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/mingcute_eye-close-line.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Pin"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC("Leave community"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/logout 1 (traced).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 18.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class Badges extends StatefulWidget {
|
||||
const Badges({super.key});
|
||||
|
||||
@override
|
||||
State<Badges> createState() => _BadgesState();
|
||||
}
|
||||
|
||||
class _BadgesState extends State<Badges> {
|
||||
List BadgesData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Frame 1000004056.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Badges",
|
||||
),
|
||||
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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Container(
|
||||
height: 600.h,
|
||||
child: GridView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 35,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: 0.65,
|
||||
),
|
||||
itemCount: BadgesData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
BadgesData[index]["imagePath"],
|
||||
height: 100.h,
|
||||
width: 105.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: text14w400_FCFCFC(
|
||||
BadgesData[index]["text"],
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]))),
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,400 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/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';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class AddCertificate extends StatefulWidget {
|
||||
const AddCertificate({super.key});
|
||||
|
||||
@override
|
||||
State<AddCertificate> createState() => _AddCertificateState();
|
||||
}
|
||||
|
||||
class _AddCertificateState extends State<AddCertificate> {
|
||||
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
|
||||
TextEditingController certicationname = TextEditingController();
|
||||
TextEditingController certificationreason = TextEditingController();
|
||||
TextEditingController datecontroller = TextEditingController();
|
||||
|
||||
TextEditingController querycontroller = TextEditingController();
|
||||
|
||||
DateTime? _selectedDate;
|
||||
|
||||
Future<void> _selectDate(BuildContext context) async {
|
||||
DateTime yesterday = DateTime.now().subtract(const Duration(days: 1));
|
||||
DateTime eighteenYearsAgo =
|
||||
DateTime.now().subtract(const Duration(days: 365 * 18));
|
||||
|
||||
final ThemeData customTheme = Theme.of(context).copyWith(
|
||||
colorScheme: const ColorScheme.light(
|
||||
primary: Color(0xFFD90B2E),
|
||||
surfaceTint: Color(0xFF222935),
|
||||
surface: Color(0xFF222935),
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Colors.white,
|
||||
onSecondary: Colors.white),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFD90B2E),
|
||||
),
|
||||
));
|
||||
|
||||
final DateTime? pickedDate = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: yesterday,
|
||||
firstDate: DateTime(1950),
|
||||
lastDate: DateTime(2026),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return Theme(
|
||||
data: customTheme,
|
||||
// ThemeData.light().copyWith(
|
||||
// colorScheme: ColorScheme.dark(
|
||||
// primary: Color(0XFF222935).withOpacity(0.60),
|
||||
// onPrimary: Colors.white, // Change text color
|
||||
// ),
|
||||
// textButtonTheme: TextButtonThemeData(
|
||||
// style: TextButton.styleFrom(
|
||||
// foregroundColor: Colors.white, // Change button text color
|
||||
// ),
|
||||
// ),
|
||||
// dialogBackgroundColor: Color(0XFF222935)
|
||||
// .withOpacity(0.60), // Change dialog background color
|
||||
// ),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
// if (pickedDate.isBefore(eighteenYearsAgo)) {
|
||||
setState(() {
|
||||
_selectedDate = pickedDate;
|
||||
datecontroller.text =
|
||||
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
|
||||
});
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
List<File?> filePath = [];
|
||||
bool isImageAdded = false;
|
||||
|
||||
UploadData() async {
|
||||
utils.loader();
|
||||
List<MultipartFile> certificatelist = [];
|
||||
|
||||
for (var file in filePath.where((file) => file != null)) {
|
||||
certificatelist.add(
|
||||
await MultipartFile.fromFile(
|
||||
file!.path,
|
||||
filename: path.basename(file.path),
|
||||
),
|
||||
);
|
||||
}
|
||||
FormData formdata = FormData.fromMap({
|
||||
"certification_name": certicationname.text,
|
||||
"certification_reason": certificationreason.text,
|
||||
"certification_date": datecontroller.text,
|
||||
"certification_image": certificatelist[0],
|
||||
});
|
||||
final data = await Profilepostmethod().postCertification(formdata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
// Get.back();
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Add certifications",
|
||||
),
|
||||
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(horizontal: 16),
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formkey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Certification name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your certification name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: "Enter certification name",
|
||||
textEditingController: certicationname,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Certification reason"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your certification reason ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: "Enter certification reason",
|
||||
textEditingController: certificationreason,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Certification date"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: datecontroller,
|
||||
readonly: true,
|
||||
onTap: () {
|
||||
_selectDate(context);
|
||||
},
|
||||
// texttype: TextInputType.text,
|
||||
hintText: "Enter your certification date",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/dateimage.png',
|
||||
),
|
||||
// validatorText: "Enter date of birth",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your certification date';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Certification image"),
|
||||
sizedBoxHeight(16.h),
|
||||
filePath.isNotEmpty && isImageAdded
|
||||
? Container(
|
||||
height: 167.h,
|
||||
width: double.infinity,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white
|
||||
.withOpacity(0.30000001192092896),
|
||||
Colors.white
|
||||
.withOpacity(0.2800000011920929)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF7E7E7E)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Stack(children: [
|
||||
Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
Positioned(
|
||||
// top: 0,
|
||||
// left: 0,
|
||||
right: 12,
|
||||
bottom: 12,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// Clear the list and show the upload button
|
||||
filePath.clear();
|
||||
isImageAdded = false;
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
width: 27,
|
||||
height: 27,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.black,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5)),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete_outline_outlined,
|
||||
color: Colors.white,
|
||||
))),
|
||||
),
|
||||
// ),
|
||||
]),
|
||||
)
|
||||
: GestureDetector(
|
||||
// onTap: () {
|
||||
// ImageUploadBottomSheet().showModal(
|
||||
// context,
|
||||
// false,
|
||||
// (result) {
|
||||
// var file = File(result);
|
||||
// filePath.add(file);
|
||||
// // isImageAdded = true;
|
||||
// setState(() {
|
||||
// isImageAdded = true;
|
||||
|
||||
// });
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
filePath.add(file);
|
||||
isImageAdded = true;
|
||||
setState(() {
|
||||
// Navigator.of(context).pop();
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 167,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white
|
||||
.withOpacity(0.30000001192092896),
|
||||
Colors.white
|
||||
.withOpacity(0.2800000011920929)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF7E7E7E)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/onlycamera.png'),
|
||||
sizedBoxHeight(5.h),
|
||||
Text(
|
||||
'Upload certification \nimage',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CustomButton(
|
||||
onPressed: () {
|
||||
// final isValid =
|
||||
// _formkey.currentState?.validate();
|
||||
if (certicationname.text.isBlank! &&
|
||||
certificationreason.text.isBlank! &&
|
||||
datecontroller.text.isBlank! &&
|
||||
filePath.isEmpty) {
|
||||
utils.showToast("Please fill all fields");
|
||||
} else {
|
||||
UploadData();
|
||||
}
|
||||
},
|
||||
text: "Send")
|
||||
]),
|
||||
),
|
||||
))
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class Certificate extends StatefulWidget {
|
||||
const Certificate({super.key});
|
||||
|
||||
@override
|
||||
State<Certificate> createState() => _CertificateState();
|
||||
}
|
||||
|
||||
class _CertificateState extends State<Certificate> {
|
||||
List certificateData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/image 17.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/image 18.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/image 20.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/image 17.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/image 18.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/image 20.png",
|
||||
"text": "Lorem ipsum is a dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
late Future myfuture;
|
||||
int id = Get.arguments["id"];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
myfuture = Profilegetmethod().getUserCertificates(id);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Certifications/Qualifications",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return certificateobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return 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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: GridView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 20,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: 0.65,
|
||||
),
|
||||
itemCount: certificateobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
certificateobj!.data![index].certificationImage ==
|
||||
null ||
|
||||
certificateobj!.data![index]
|
||||
.certificationImage!.isEmpty
|
||||
? Image.asset(
|
||||
certificateData[index]["imagePath"],
|
||||
height: 100.h,
|
||||
width: 105.w,
|
||||
)
|
||||
: Image.network(
|
||||
certificateobj!
|
||||
.data![index].certificationImage!,
|
||||
height: 100.h,
|
||||
width: 105.w,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
// Error handling when image fails to load
|
||||
return Image.asset(
|
||||
certificateData[index]["imagePath"],
|
||||
fit: BoxFit.cover,
|
||||
);
|
||||
}),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: text14w400_FCFCFC(
|
||||
certificateobj!.data![index]
|
||||
.certificationName ==
|
||||
null ||
|
||||
certificateobj!.data![index]
|
||||
.certificationName!.isEmpty
|
||||
? certificateData[index]["text"]
|
||||
: certificateobj!
|
||||
.data![index].certificationName,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
])))
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class Clubs extends StatefulWidget {
|
||||
const Clubs({super.key});
|
||||
|
||||
@override
|
||||
State<Clubs> createState() => _ClubsState();
|
||||
}
|
||||
|
||||
class _ClubsState extends State<Clubs> {
|
||||
List ClubsData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 65.png",
|
||||
"text": "Cardio crusaders circle",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 26.png",
|
||||
"text": "Strength squad syndicate",
|
||||
"members": "7 members"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"text": "Flexibility faction force",
|
||||
"members": "7 members"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Clubs",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: ClubsData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return clubsCard(
|
||||
ontap: () {},
|
||||
imagepath: ClubsData[index]['imagePath'],
|
||||
title: ClubsData[index]['text'],
|
||||
members: ClubsData[index]['members']);
|
||||
},
|
||||
)
|
||||
]),
|
||||
))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget clubsCard({
|
||||
required String imagepath,
|
||||
required String title,
|
||||
required void Function()? ontap,
|
||||
required String members,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: double.infinity,
|
||||
height: 143.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 54.h,
|
||||
width: 54.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// color: Colors.amber,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.25),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 12,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child:
|
||||
// Center(
|
||||
// child: Image.asset(imagepath, fit: BoxFit.cover)),
|
||||
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
imagepath,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(13.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC(title),
|
||||
sizedBoxHeight(5.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/community 1 (traced).png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text14w400_FCFCFCblur("Iron titans fitness crew")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 200.w),
|
||||
offset: Offset(0, 30),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(""),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black (1).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14w400_FCFCFC(""),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/logout 1 (traced).png",
|
||||
height: 18.h,
|
||||
width: 18.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 16.h,
|
||||
width: 22.w,
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 13.h,
|
||||
width: 3.w,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
stackContainers(
|
||||
number: "+2",
|
||||
containerImages: [
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
"assets/images/png/cimg3.png",
|
||||
"assets/images/png/cimg2.png",
|
||||
],
|
||||
),
|
||||
sizedBoxWidth(95.w),
|
||||
text12w400_FCFCFC_blur(members),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,414 +0,0 @@
|
||||
class GetEditProfileBus {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GetEditProfileBus({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetEditProfileBus.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? businessTypeXid;
|
||||
String? foundedon;
|
||||
String? businessOwnerName;
|
||||
String? businessName;
|
||||
String? businessUsername;
|
||||
String? businessLocation;
|
||||
String? businessContactNumber;
|
||||
String? businessEmail;
|
||||
String? businessHandle;
|
||||
String? websiteLink;
|
||||
String? googleReviewLink;
|
||||
String? businessLogo;
|
||||
String? tags;
|
||||
String? bannerImage;
|
||||
String? businessProfileImage;
|
||||
String? bio;
|
||||
Follows? follows;
|
||||
int? isIamFollowingToGuestUser;
|
||||
BusinessType? businessType;
|
||||
IamPrincipalData? iamPrincipalData;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.iamPrincipalXid,
|
||||
this.businessTypeXid,
|
||||
this.businessOwnerName,
|
||||
this.businessName,
|
||||
this.businessUsername,
|
||||
this.businessLocation,
|
||||
this.businessContactNumber,
|
||||
this.businessEmail,
|
||||
this.businessHandle,
|
||||
this.websiteLink,
|
||||
this.googleReviewLink,
|
||||
this.businessLogo,
|
||||
this.tags,
|
||||
this.bannerImage,
|
||||
this.businessProfileImage,
|
||||
this.bio,
|
||||
this.follows,
|
||||
this.isIamFollowingToGuestUser,
|
||||
this.businessType,
|
||||
this.iamPrincipalData});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
businessTypeXid = json['business_type_xid'];
|
||||
foundedon = json['founded_on'];
|
||||
businessOwnerName = json['business_owner_name'];
|
||||
businessName = json['business_name'];
|
||||
businessUsername = json['business_username'];
|
||||
businessLocation = json['business_location'];
|
||||
businessContactNumber = json['business_contact_number'];
|
||||
businessEmail = json['business_email'];
|
||||
businessHandle = json['business_handle'];
|
||||
websiteLink = json['website_link'];
|
||||
googleReviewLink = json['google_review_link'];
|
||||
businessLogo = json['business_logo'];
|
||||
tags = json['tags'];
|
||||
bannerImage = json['banner_image'];
|
||||
businessProfileImage = json['business_profile_image'];
|
||||
bio = json['bio'];
|
||||
follows =
|
||||
json['follows'] != null ? new Follows.fromJson(json['follows']) : null;
|
||||
isIamFollowingToGuestUser = json['is_iam_following_to_guest_user'];
|
||||
businessType = json['business_type'] != null
|
||||
? new BusinessType.fromJson(json['business_type'])
|
||||
: null;
|
||||
iamPrincipalData = json['iam_principal_data'] != null
|
||||
? new IamPrincipalData.fromJson(json['iam_principal_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
data['business_type_xid'] = this.businessTypeXid;
|
||||
data['founded_on'] = this.foundedon;
|
||||
data['business_owner_name'] = this.businessOwnerName;
|
||||
data['business_name'] = this.businessName;
|
||||
data['business_username'] = this.businessUsername;
|
||||
data['business_location'] = this.businessLocation;
|
||||
data['business_contact_number'] = this.businessContactNumber;
|
||||
data['business_email'] = this.businessEmail;
|
||||
data['business_handle'] = this.businessHandle;
|
||||
data['website_link'] = this.websiteLink;
|
||||
data['google_review_link'] = this.googleReviewLink;
|
||||
data['business_logo'] = this.businessLogo;
|
||||
data['tags'] = this.tags;
|
||||
data['banner_image'] = this.bannerImage;
|
||||
data['business_profile_image'] = this.businessProfileImage;
|
||||
data['bio'] = this.bio;
|
||||
if (this.follows != null) {
|
||||
data['follows'] = this.follows!.toJson();
|
||||
}
|
||||
data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser;
|
||||
if (this.businessType != null) {
|
||||
data['business_type'] = this.businessType!.toJson();
|
||||
}
|
||||
if (this.iamPrincipalData != null) {
|
||||
data['iam_principal_data'] = this.iamPrincipalData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follows {
|
||||
int? following;
|
||||
int? followers;
|
||||
|
||||
Follows({this.following, this.followers});
|
||||
|
||||
Follows.fromJson(Map<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following'] = this.following;
|
||||
data['followers'] = this.followers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class BusinessType {
|
||||
int? id;
|
||||
String? name;
|
||||
String? image;
|
||||
String? description;
|
||||
int? isActive;
|
||||
String? createdBy;
|
||||
String? modifiedBy;
|
||||
String? deletedAt;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
|
||||
BusinessType(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.image,
|
||||
this.description,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.modifiedBy,
|
||||
this.deletedAt,
|
||||
this.createdAt,
|
||||
this.updatedAt});
|
||||
|
||||
BusinessType.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
image = json['image'];
|
||||
description = json['description'];
|
||||
isActive = json['is_active'];
|
||||
createdBy = json['created_by'];
|
||||
modifiedBy = json['modified_by'];
|
||||
deletedAt = json['deleted_at'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['image'] = this.image;
|
||||
data['description'] = this.description;
|
||||
data['is_active'] = this.isActive;
|
||||
data['created_by'] = this.createdBy;
|
||||
data['modified_by'] = this.modifiedBy;
|
||||
data['deleted_at'] = this.deletedAt;
|
||||
data['created_at'] = this.createdAt;
|
||||
data['updated_at'] = this.updatedAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class IamPrincipalData {
|
||||
int? id;
|
||||
int? principalTypeXid;
|
||||
int? principalSourceXid;
|
||||
String? oneSignalPlayerId;
|
||||
String? googleId;
|
||||
String? appleId;
|
||||
String? facebookId;
|
||||
String? microsoftId;
|
||||
String? userName;
|
||||
String? pin;
|
||||
String? fullName;
|
||||
String? gender;
|
||||
String? dateOfBirth;
|
||||
String? phoneNumber;
|
||||
String? otherPhoneNumber;
|
||||
String? emailAddress;
|
||||
String? addressLine1;
|
||||
String? addressLine2;
|
||||
String? cityXid;
|
||||
String? stateXid;
|
||||
String? countryXid;
|
||||
String? postCode;
|
||||
String? lastLoginDatetime;
|
||||
String? profilePhoto;
|
||||
String? referralCode;
|
||||
String? description;
|
||||
String? about;
|
||||
String? position;
|
||||
String? trainingScores;
|
||||
String? height;
|
||||
String? weight;
|
||||
String? battingAverage;
|
||||
int? isProfileUpdated;
|
||||
String? isActive;
|
||||
int? groupNotification;
|
||||
int? communityNotification;
|
||||
int? followerNotification;
|
||||
int? newFollowerNotification;
|
||||
int? directMessageNotification;
|
||||
int? isAccountVisibility;
|
||||
int? isDeleted;
|
||||
String? reason;
|
||||
String? createdBy;
|
||||
String? modifiedBy;
|
||||
String? deletedAt;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
String? profileImage;
|
||||
|
||||
IamPrincipalData(
|
||||
{this.id,
|
||||
this.principalTypeXid,
|
||||
this.principalSourceXid,
|
||||
this.oneSignalPlayerId,
|
||||
this.googleId,
|
||||
this.appleId,
|
||||
this.facebookId,
|
||||
this.microsoftId,
|
||||
this.userName,
|
||||
this.pin,
|
||||
this.fullName,
|
||||
this.gender,
|
||||
this.dateOfBirth,
|
||||
this.phoneNumber,
|
||||
this.otherPhoneNumber,
|
||||
this.emailAddress,
|
||||
this.addressLine1,
|
||||
this.addressLine2,
|
||||
this.cityXid,
|
||||
this.stateXid,
|
||||
this.countryXid,
|
||||
this.postCode,
|
||||
this.lastLoginDatetime,
|
||||
this.profilePhoto,
|
||||
this.referralCode,
|
||||
this.description,
|
||||
this.about,
|
||||
this.position,
|
||||
this.trainingScores,
|
||||
this.height,
|
||||
this.weight,
|
||||
this.battingAverage,
|
||||
this.isProfileUpdated,
|
||||
this.isActive,
|
||||
this.groupNotification,
|
||||
this.communityNotification,
|
||||
this.followerNotification,
|
||||
this.newFollowerNotification,
|
||||
this.directMessageNotification,
|
||||
this.isAccountVisibility,
|
||||
this.isDeleted,
|
||||
this.reason,
|
||||
this.createdBy,
|
||||
this.modifiedBy,
|
||||
this.deletedAt,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.profileImage});
|
||||
|
||||
IamPrincipalData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
principalTypeXid = json['principal_type_xid'];
|
||||
principalSourceXid = json['principal_source_xid'];
|
||||
oneSignalPlayerId = json['one_signal_player_id'];
|
||||
googleId = json['google_id'];
|
||||
appleId = json['apple_id'];
|
||||
facebookId = json['facebook_id'];
|
||||
microsoftId = json['microsoft_id'];
|
||||
userName = json['user_name'];
|
||||
pin = json['pin'];
|
||||
fullName = json['full_name'];
|
||||
gender = json['gender'];
|
||||
dateOfBirth = json['date_of_birth'];
|
||||
phoneNumber = json['phone_number'];
|
||||
otherPhoneNumber = json['other_phone_number'];
|
||||
emailAddress = json['email_address'];
|
||||
addressLine1 = json['address_line1'];
|
||||
addressLine2 = json['address_line2'];
|
||||
cityXid = json['city_xid'];
|
||||
stateXid = json['state_xid'];
|
||||
countryXid = json['country_xid'];
|
||||
postCode = json['post_code'];
|
||||
lastLoginDatetime = json['last_login_datetime'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
referralCode = json['referral_code'];
|
||||
description = json['description'];
|
||||
about = json['about'];
|
||||
position = json['position'];
|
||||
trainingScores = json['training_scores'];
|
||||
height = json['height'];
|
||||
weight = json['weight'];
|
||||
battingAverage = json['batting_average'];
|
||||
isProfileUpdated = json['is_profile_updated'];
|
||||
isActive = json['is_active'];
|
||||
groupNotification = json['group_notification'];
|
||||
communityNotification = json['community_notification'];
|
||||
followerNotification = json['follower_notification'];
|
||||
newFollowerNotification = json['new_follower_notification'];
|
||||
directMessageNotification = json['direct_message_notification'];
|
||||
isAccountVisibility = json['is_account_visibility'];
|
||||
isDeleted = json['is_deleted'];
|
||||
reason = json['reason'];
|
||||
createdBy = json['created_by'];
|
||||
modifiedBy = json['modified_by'];
|
||||
deletedAt = json['deleted_at'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
profileImage = json['profile_image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['principal_type_xid'] = this.principalTypeXid;
|
||||
data['principal_source_xid'] = this.principalSourceXid;
|
||||
data['one_signal_player_id'] = this.oneSignalPlayerId;
|
||||
data['google_id'] = this.googleId;
|
||||
data['apple_id'] = this.appleId;
|
||||
data['facebook_id'] = this.facebookId;
|
||||
data['microsoft_id'] = this.microsoftId;
|
||||
data['user_name'] = this.userName;
|
||||
data['pin'] = this.pin;
|
||||
data['full_name'] = this.fullName;
|
||||
data['gender'] = this.gender;
|
||||
data['date_of_birth'] = this.dateOfBirth;
|
||||
data['phone_number'] = this.phoneNumber;
|
||||
data['other_phone_number'] = this.otherPhoneNumber;
|
||||
data['email_address'] = this.emailAddress;
|
||||
data['address_line1'] = this.addressLine1;
|
||||
data['address_line2'] = this.addressLine2;
|
||||
data['city_xid'] = this.cityXid;
|
||||
data['state_xid'] = this.stateXid;
|
||||
data['country_xid'] = this.countryXid;
|
||||
data['post_code'] = this.postCode;
|
||||
data['last_login_datetime'] = this.lastLoginDatetime;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
data['referral_code'] = this.referralCode;
|
||||
data['description'] = this.description;
|
||||
data['about'] = this.about;
|
||||
data['position'] = this.position;
|
||||
data['training_scores'] = this.trainingScores;
|
||||
data['height'] = this.height;
|
||||
data['weight'] = this.weight;
|
||||
data['batting_average'] = this.battingAverage;
|
||||
data['is_profile_updated'] = this.isProfileUpdated;
|
||||
data['is_active'] = this.isActive;
|
||||
data['group_notification'] = this.groupNotification;
|
||||
data['community_notification'] = this.communityNotification;
|
||||
data['follower_notification'] = this.followerNotification;
|
||||
data['new_follower_notification'] = this.newFollowerNotification;
|
||||
data['direct_message_notification'] = this.directMessageNotification;
|
||||
data['is_account_visibility'] = this.isAccountVisibility;
|
||||
data['is_deleted'] = this.isDeleted;
|
||||
data['reason'] = this.reason;
|
||||
data['created_by'] = this.createdBy;
|
||||
data['modified_by'] = this.modifiedBy;
|
||||
data['deleted_at'] = this.deletedAt;
|
||||
data['created_at'] = this.createdAt;
|
||||
data['updated_at'] = this.updatedAt;
|
||||
data['profile_image'] = this.profileImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
class GetEditProfileIndi {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GetEditProfileIndi({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetEditProfileIndi.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? location;
|
||||
String? fullName;
|
||||
// String? profileImage;
|
||||
String? profilePhoto;
|
||||
String? gender;
|
||||
String? dateOfBirth;
|
||||
List<Interest>? interest;
|
||||
String? about;
|
||||
String? position;
|
||||
String? trainingScores;
|
||||
String? height;
|
||||
String? weight;
|
||||
String? battingAverage;
|
||||
Follows? follows;
|
||||
List<Timelines>? timelines;
|
||||
int? accountVisibility;
|
||||
List<MyJoinedGroups>? myJoinedGroups;
|
||||
List<Certifications>? certifications;
|
||||
int? daysBeforeJoined;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.userName,
|
||||
this.fullName,
|
||||
// this.profileImage,
|
||||
this.profilePhoto,
|
||||
this.gender,
|
||||
this.dateOfBirth,
|
||||
this.interest,
|
||||
this.about,
|
||||
this.position,
|
||||
this.trainingScores,
|
||||
this.height,
|
||||
this.weight,
|
||||
this.battingAverage,
|
||||
this.follows,
|
||||
this.timelines,
|
||||
this.accountVisibility,
|
||||
this.myJoinedGroups,
|
||||
this.certifications,
|
||||
this.daysBeforeJoined});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
location = json['location'];
|
||||
|
||||
fullName = json['full_name'];
|
||||
// profileImage = json['profile_image'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
gender = json['gender'];
|
||||
dateOfBirth = json['date_of_birth'];
|
||||
if (json['interest'] != null) {
|
||||
interest = <Interest>[];
|
||||
json['interest'].forEach((v) {
|
||||
interest!.add(Interest.fromJson(v));
|
||||
});
|
||||
}
|
||||
about = json['about'];
|
||||
position = json['position'];
|
||||
trainingScores = json['training_scores'];
|
||||
height = json['height'];
|
||||
weight = json['weight'];
|
||||
battingAverage = json['batting_average'];
|
||||
follows =
|
||||
json['follows'] != null ? Follows.fromJson(json['follows']) : null;
|
||||
if (json['timelines'] != null) {
|
||||
timelines = <Timelines>[];
|
||||
json['timelines'].forEach((v) {
|
||||
timelines!.add(Timelines.fromJson(v));
|
||||
});
|
||||
}
|
||||
accountVisibility = json['account_visibility'];
|
||||
if (json['my_joined_groups'] != null) {
|
||||
myJoinedGroups = <MyJoinedGroups>[];
|
||||
json['my_joined_groups'].forEach((v) {
|
||||
myJoinedGroups!.add(MyJoinedGroups.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['certifications'] != null) {
|
||||
certifications = <Certifications>[];
|
||||
json['certifications'].forEach((v) {
|
||||
certifications!.add(Certifications.fromJson(v));
|
||||
});
|
||||
}
|
||||
daysBeforeJoined = json['days_before_joined'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['user_name'] = userName;
|
||||
data['location'] = location;
|
||||
|
||||
data['full_name'] = fullName;
|
||||
// data['profile_image'] = this.profileImage;
|
||||
data['profile_photo'] = profilePhoto;
|
||||
data['gender'] = gender;
|
||||
data['date_of_birth'] = dateOfBirth;
|
||||
if (interest != null) {
|
||||
data['interest'] = interest!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['about'] = about;
|
||||
data['position'] = position;
|
||||
data['training_scores'] = trainingScores;
|
||||
data['height'] = height;
|
||||
data['weight'] = weight;
|
||||
data['batting_average'] = battingAverage;
|
||||
if (follows != null) {
|
||||
data['follows'] = follows!.toJson();
|
||||
}
|
||||
if (timelines != null) {
|
||||
data['timelines'] = timelines!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['account_visibility'] = accountVisibility;
|
||||
if (myJoinedGroups != null) {
|
||||
data['my_joined_groups'] =
|
||||
myJoinedGroups!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (certifications != null) {
|
||||
data['certifications'] =
|
||||
certifications!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['days_before_joined'] = daysBeforeJoined;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Interest {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Interest({this.id, this.name});
|
||||
|
||||
Interest.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Timelines {
|
||||
int? id;
|
||||
String? clubName;
|
||||
String? roleName;
|
||||
String? teamName;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
String? abilitiesXids;
|
||||
List<Abilities>? abilities;
|
||||
|
||||
Timelines(
|
||||
{this.id,
|
||||
this.clubName,
|
||||
this.roleName,
|
||||
this.teamName,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.abilitiesXids,
|
||||
this.abilities});
|
||||
|
||||
Timelines.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
clubName = json['club_name'];
|
||||
roleName = json['role_name'];
|
||||
teamName = json['team_name'];
|
||||
startDate = json['start_date'];
|
||||
endDate = json['end_date'];
|
||||
abilitiesXids = json['abilities_xids'];
|
||||
if (json['abilities'] != null) {
|
||||
abilities = <Abilities>[];
|
||||
json['abilities'].forEach((v) {
|
||||
abilities!.add(Abilities.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['club_name'] = clubName;
|
||||
data['role_name'] = roleName;
|
||||
data['team_name'] = teamName;
|
||||
data['start_date'] = startDate;
|
||||
data['end_date'] = endDate;
|
||||
data['abilities_xids'] = abilitiesXids;
|
||||
if (abilities != null) {
|
||||
data['abilities'] = abilities!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Abilities {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Abilities({this.id, this.name});
|
||||
|
||||
Abilities.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follows {
|
||||
int? following;
|
||||
int? followers;
|
||||
|
||||
Follows({this.following, this.followers});
|
||||
|
||||
Follows.fromJson(Map<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['following'] = following;
|
||||
data['followers'] = followers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Certifications {
|
||||
int? id;
|
||||
String? certificationName;
|
||||
String? certificationImage;
|
||||
String? certificationReason;
|
||||
String? certificationDate;
|
||||
int? iamPrincipalXid;
|
||||
|
||||
Certifications(
|
||||
{this.id,
|
||||
this.certificationName,
|
||||
this.certificationImage,
|
||||
this.certificationReason,
|
||||
this.certificationDate,
|
||||
this.iamPrincipalXid});
|
||||
|
||||
Certifications.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
certificationName = json['certification_name'];
|
||||
certificationImage = json['certification_image'];
|
||||
certificationReason = json['certification_reason'];
|
||||
certificationDate = json['certification_date'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['certification_name'] = certificationName;
|
||||
data['certification_image'] = certificationImage;
|
||||
data['certification_reason'] = certificationReason;
|
||||
data['certification_date'] = certificationDate;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MyJoinedGroups {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? manageGroupXid;
|
||||
GroupData? groupData;
|
||||
|
||||
MyJoinedGroups(
|
||||
{this.id, this.iamPrincipalXid, this.manageGroupXid, this.groupData});
|
||||
|
||||
MyJoinedGroups.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
manageGroupXid = json['manage_group_xid'];
|
||||
groupData = json['group_data'] != null
|
||||
? GroupData.fromJson(json['group_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['manage_group_xid'] = manageGroupXid;
|
||||
if (groupData != null) {
|
||||
data['group_data'] = groupData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class GroupData {
|
||||
int? id;
|
||||
String? title;
|
||||
String? groupImage;
|
||||
|
||||
GroupData({this.id, this.title, this.groupImage});
|
||||
|
||||
GroupData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
groupImage = json['group_image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
data['group_image'] = groupImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
class InterestModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
InterestModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
InterestModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? name;
|
||||
String? image;
|
||||
|
||||
Data({this.id, this.name, this.image});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
image = json['image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['image'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,507 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.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/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.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:path/path.dart' as path;
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
import '../../../../../Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
class BusEditProfile extends StatefulWidget {
|
||||
const BusEditProfile({super.key});
|
||||
|
||||
@override
|
||||
State<BusEditProfile> createState() => _BusEditProfileState();
|
||||
}
|
||||
|
||||
class _BusEditProfileState extends State<BusEditProfile> {
|
||||
TextEditingController busNameController = TextEditingController();
|
||||
TextEditingController busUserNameController = TextEditingController();
|
||||
TextEditingController ownerNameController = TextEditingController();
|
||||
|
||||
TextEditingController foundedonController = TextEditingController();
|
||||
TextEditingController websiteLinkController = TextEditingController();
|
||||
TextEditingController locationController = TextEditingController();
|
||||
TextEditingController bioController = TextEditingController();
|
||||
|
||||
String profilePicture = "";
|
||||
bool isImageAdded = false;
|
||||
|
||||
bool isOnce = true;
|
||||
late Future myfuture;
|
||||
|
||||
convertFileToMultiPart(String? file) async {
|
||||
return await MultipartFile.fromFile(
|
||||
file!,
|
||||
filename: path.basename(file),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
myfuture = EditProfileApi()
|
||||
.getEditProfileBusiness()
|
||||
.then((value) => {setValues()});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
//Founded on & bio , businessUsername data not there
|
||||
|
||||
setValues() {
|
||||
if (isOnce) {
|
||||
busNameController.text = getEditProfileBus!.data!.businessName ?? '';
|
||||
busUserNameController.text =
|
||||
getEditProfileBus!.data!.businessOwnerName ?? 'victorygames _10';
|
||||
ownerNameController.text =
|
||||
getEditProfileBus!.data!.businessOwnerName ?? 'James Bothman';
|
||||
foundedonController.text =
|
||||
getEditProfileBus!.data!.foundedon ?? '12-04-2024';
|
||||
websiteLinkController.text =
|
||||
getEditProfileBus!.data!.websiteLink ?? 'victorygames _10';
|
||||
locationController.text = getEditProfileBus!.data!.businessLocation ??
|
||||
'Elm street london, United Kingdom';
|
||||
|
||||
bioController.text = getEditProfileBus!.data!.bio ?? "";
|
||||
|
||||
// _selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
|
||||
// _selectedsportType = getEditProfileIndi!.data!.interest!.join(', ') ?? '';
|
||||
|
||||
isOnce = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
void saveEditProfileBus() async {
|
||||
var imageFile;
|
||||
|
||||
if (editProfileImage.usserprofilePicPath.value.isNotEmpty) {
|
||||
imageFile = await MultipartFile.fromFile(
|
||||
editProfileImage.usserprofilePicPath.value,
|
||||
filename: path.basename(profilePicture),
|
||||
);
|
||||
}
|
||||
|
||||
FormData? updata;
|
||||
if (busNameController.text.isBlank! ||
|
||||
busUserNameController.text.isBlank! ||
|
||||
ownerNameController.text.isBlank! ||
|
||||
foundedonController.text.isBlank! ||
|
||||
websiteLinkController.text.isBlank! ||
|
||||
locationController.text.isBlank! ||
|
||||
bioController.text.isBlank!) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Enter your credentials',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
}
|
||||
// else if (profilePicture == "") {
|
||||
// utils.showToast('Upload edit profile picture!');
|
||||
// }
|
||||
else {
|
||||
utils.loader();
|
||||
updata = FormData.fromMap({
|
||||
"business_name": busNameController.text,
|
||||
"business_username": busUserNameController.text,
|
||||
"business_owner_name": ownerNameController.text,
|
||||
"founded_on": foundedonController.text,
|
||||
"website_link": websiteLinkController.text,
|
||||
"business_location": locationController.text,
|
||||
"bio": bioController.text,
|
||||
"business_profile":
|
||||
editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null,
|
||||
// await convertFileToMultiPart(profilePicture),
|
||||
});
|
||||
|
||||
final data = await EditProfileApi().postEditProfileBusiness(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
// await global.setname();
|
||||
// Get.snackbar(
|
||||
// "Success!",
|
||||
// 'success!',
|
||||
// duration: Duration(seconds: 2),
|
||||
// colorText: Colors.white,
|
||||
// backgroundColor: Colors.green,
|
||||
// margin: EdgeInsets.all(8),
|
||||
// snackStyle: SnackStyle.FLOATING,
|
||||
// snackPosition: SnackPosition.BOTTOM,
|
||||
// );
|
||||
utils.showToast("Data Saved Successfully");
|
||||
// Get.back();
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
// Get.back(result: true);
|
||||
} else {
|
||||
Get.back();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final UserProfileImageController editProfileImage =
|
||||
Get.put(UserProfileImageController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return
|
||||
// const ShimmerCommon();
|
||||
|
||||
const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.blue,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
print("Data fetched-->");
|
||||
return 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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
Obx(
|
||||
() => editProfileImage
|
||||
.usserprofilePicPath.value !=
|
||||
''
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value !=
|
||||
''
|
||||
? Image(
|
||||
// File(profilePicture),
|
||||
image: FileImage(
|
||||
File(
|
||||
editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value,
|
||||
),
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
errorBuilder:
|
||||
(BuildContext
|
||||
context,
|
||||
Object
|
||||
exception,
|
||||
StackTrace?
|
||||
stackTrace) {
|
||||
return CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
"assets/images/png/Ellipse 37 (1).png"),
|
||||
radius: 50.r,
|
||||
);
|
||||
},
|
||||
)
|
||||
: Image.asset(
|
||||
'assets/images/png/Ellipse 37 (1).png')),
|
||||
)
|
||||
: ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(60.r),
|
||||
child: getEditProfileBus!.data!
|
||||
.businessProfileImage !=
|
||||
null
|
||||
? ClipOval(
|
||||
child:
|
||||
SizedBox.fromSize(
|
||||
size: Size.fromRadius(
|
||||
25.r),
|
||||
child: CircleAvatar(
|
||||
backgroundImage:
|
||||
NetworkImage(
|
||||
getEditProfileBus!
|
||||
.data!
|
||||
.businessProfileImage!),
|
||||
radius: 25.r,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/Ellipse 37 (1).png")),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value = result;
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
print(
|
||||
"File name is $filenameresult");
|
||||
|
||||
profilePicture = result;
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/cameraicon2.png",
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
text16400white("Edit profile picture"),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Business name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: busNameController,
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your business name",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Business username"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
busUserNameController,
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your business username",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Owner name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: ownerNameController,
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your owner name",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Founded on"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(
|
||||
context, foundedonController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.0,
|
||||
height: 17.0,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
width: 18.0,
|
||||
height: 17.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Select date",
|
||||
textEditingController:
|
||||
foundedonController,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Website link"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
websiteLinkController,
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector2a.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your website link",
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Location"),
|
||||
sizedBoxWidth(6.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: locationController,
|
||||
leadingIcon: SizedBox(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your location",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Bio"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
textEditingController: bioController,
|
||||
hintText: "Enter your business bio",
|
||||
maxlines: 3,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
CommonBtn(
|
||||
text: "Save",
|
||||
onTap: () {
|
||||
saveEditProfileBus();
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
],
|
||||
)
|
||||
])))
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,621 +0,0 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.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/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.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:path/path.dart' as path;
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class EditProfile extends StatefulWidget {
|
||||
const EditProfile({super.key});
|
||||
|
||||
@override
|
||||
State<EditProfile> createState() => _EditProfileState();
|
||||
}
|
||||
|
||||
//location in normal profile individual api
|
||||
|
||||
class _EditProfileState extends State<EditProfile> {
|
||||
TextEditingController fullNameController = TextEditingController();
|
||||
TextEditingController userNameController = TextEditingController();
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController locationController = TextEditingController();
|
||||
TextEditingController aboutController = TextEditingController();
|
||||
TextEditingController positionController = TextEditingController();
|
||||
TextEditingController trainingScoresController = TextEditingController();
|
||||
TextEditingController heightController = TextEditingController();
|
||||
TextEditingController weightController = TextEditingController();
|
||||
TextEditingController battingAvgController = TextEditingController();
|
||||
|
||||
String profilePicture = "";
|
||||
bool isImageAdded = false;
|
||||
|
||||
bool isOnce = true;
|
||||
late Future myfuture;
|
||||
|
||||
convertFileToMultiPart1(String? file) async {
|
||||
return await MultipartFile.fromFile(
|
||||
file!,
|
||||
filename: path.basename(file),
|
||||
);
|
||||
}
|
||||
|
||||
String extractFileName1(String filePath) {
|
||||
return path.basename(filePath);
|
||||
}
|
||||
|
||||
String _selectedgenderType = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedgenderType = value;
|
||||
});
|
||||
}
|
||||
|
||||
List<int> selectedinterestid = [];
|
||||
RxBool isloading = true.obs;
|
||||
|
||||
void getCatIdFromName(List<String> selectedInterests) {
|
||||
// selectedinterestid.clear();
|
||||
for (var name in selectedInterests) {
|
||||
for (var i = 0; i < interestlistobj!.data!.length; i++) {
|
||||
if (name == interestlistobj!.data![i].name) {
|
||||
selectedinterestid.add(interestlistobj!.data![i].id!);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
myfuture = EditProfileApi()
|
||||
.getEditProfileIndividual()
|
||||
.then((value) => {setValues()});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
setValues() async {
|
||||
if (isOnce) {
|
||||
fullNameController.text = getEditProfileIndi!.data!.fullName ?? '';
|
||||
userNameController.text = getEditProfileIndi!.data!.userName ?? '';
|
||||
dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? '';
|
||||
|
||||
_selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
|
||||
locationController.text = getEditProfileIndi!.data!.location ?? '';
|
||||
|
||||
locationController.text = getEditProfileIndi!.data!.about ?? '';
|
||||
aboutController.text = getEditProfileIndi!.data!.about ?? '';
|
||||
positionController.text =
|
||||
getEditProfileIndi!.data!.position ?? 'Lorem lpsum';
|
||||
|
||||
trainingScoresController.text =
|
||||
getEditProfileIndi!.data!.trainingScores ?? '50';
|
||||
|
||||
heightController.text = getEditProfileIndi!.data!.height ?? '6 feet';
|
||||
weightController.text = getEditProfileIndi!.data!.weight ?? '70kg';
|
||||
battingAvgController.text =
|
||||
getEditProfileIndi!.data!.battingAverage ?? '372';
|
||||
|
||||
isOnce = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
void saveEditProfileInd() async {
|
||||
utils.loader();
|
||||
|
||||
FormData? updata;
|
||||
|
||||
var imageFile;
|
||||
selectedinterestid.isEmpty
|
||||
? getCatIdFromName(listofUserInterests)
|
||||
: selectedinterestid;
|
||||
|
||||
String abilitiesIds = selectedinterestid.toString();
|
||||
print("Interests String: $abilitiesIds");
|
||||
|
||||
if (editProfileImage.usserprofilePicPath.value.isNotEmpty) {
|
||||
imageFile = await MultipartFile.fromFile(
|
||||
editProfileImage.usserprofilePicPath.value,
|
||||
filename: path.basename(profilePicture),
|
||||
);
|
||||
print(imageFile.toString());
|
||||
}
|
||||
|
||||
updata = FormData.fromMap({
|
||||
// "email_address": "priyanka14@yopmail.com",
|
||||
"full_name": fullNameController.text,
|
||||
"profile_image":
|
||||
editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null,
|
||||
// profilePicture.isNotEmpty
|
||||
// ? await convertFileToMultiPart1(profilePicture)
|
||||
// : null,
|
||||
// "profile_image": "ghjkk.png",
|
||||
|
||||
"user_name": userNameController.text,
|
||||
"date_of_birth": dateController.text,
|
||||
"gender": _selectedgenderType,
|
||||
// "interest": "selectedSportsIds",
|
||||
"interest":
|
||||
// '[1,2,3,4]',
|
||||
abilitiesIds,
|
||||
"about": aboutController.text,
|
||||
"position": positionController.text,
|
||||
"training_scores": trainingScoresController.text,
|
||||
"height": heightController.text,
|
||||
"weight": weightController.text,
|
||||
"batting_average": battingAvgController.text,
|
||||
"address_line1": battingAvgController.text,
|
||||
});
|
||||
log(updata.toString());
|
||||
print(imageFile.toString());
|
||||
|
||||
final data = await EditProfileApi().postEditProfileIndividual(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
} else {
|
||||
Get.back();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
final UserIndiProfileImageController editProfileImage =
|
||||
Get.put(UserIndiProfileImageController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.blue,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
print("Data fetched-->");
|
||||
return 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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
Obx(
|
||||
() => editProfileImage
|
||||
.usserprofilePicPath.value !=
|
||||
''
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value !=
|
||||
''
|
||||
? Image(
|
||||
// File(profilePicture),
|
||||
image: FileImage(
|
||||
File(
|
||||
editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value,
|
||||
),
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
errorBuilder:
|
||||
(BuildContext
|
||||
context,
|
||||
Object
|
||||
exception,
|
||||
StackTrace?
|
||||
stackTrace) {
|
||||
return CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
"assets/images/png/cimg3.png"),
|
||||
radius: 50.r,
|
||||
);
|
||||
},
|
||||
)
|
||||
: Image.asset(
|
||||
'assets/images/png/cimg3.png')),
|
||||
)
|
||||
: ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(60.r),
|
||||
child: getEditProfileIndi!.data!
|
||||
.profilePhoto !=
|
||||
null
|
||||
? ClipOval(
|
||||
child:
|
||||
SizedBox.fromSize(
|
||||
size: Size.fromRadius(
|
||||
25.r),
|
||||
child: CircleAvatar(
|
||||
backgroundImage:
|
||||
NetworkImage(
|
||||
getEditProfileIndi!
|
||||
.data!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/blank-profile-picture-973460_1280.png")),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
// var filenameresult =
|
||||
// extractFileName1(result);
|
||||
editProfileImage
|
||||
.usserprofilePicPath
|
||||
.value = result;
|
||||
|
||||
var filenameresult =
|
||||
extractFileName1(result);
|
||||
print(
|
||||
"File name is $filenameresult");
|
||||
|
||||
profilePicture = result;
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/cameraicon2.png",
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
text16400white("Edit profile picture"),
|
||||
sizedBoxHeight(20.h),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Full name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: fullNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("User name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: userNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your user name",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Date of birth"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, dateController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
width: 18.0,
|
||||
height: 17.0,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
width: 18.0,
|
||||
height: 17.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "12-04-2024",
|
||||
textEditingController: dateController,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Gender"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomDropDownRadio(
|
||||
initialSelectedValue: _selectedgenderType,
|
||||
header: _selectedgenderType ?? "Male",
|
||||
title: "",
|
||||
showOtherOption: true,
|
||||
listData: const [
|
||||
"Male",
|
||||
"Female",
|
||||
"Prefer not to say"
|
||||
],
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Vector ws.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Location"),
|
||||
sizedBoxWidth(6.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: locationController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Enter your location",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Interests"),
|
||||
sizedBoxWidth(6.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
|
||||
//Obx(() {
|
||||
//return
|
||||
CustomDropDownChexkBox(
|
||||
header: 'Select interest',
|
||||
title: "",
|
||||
listData: listofInterests,
|
||||
onItemSelected: getCatIdFromName,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
// showOtherOption: true,
|
||||
initiallySelected: listofUserInterests,
|
||||
),
|
||||
// }),
|
||||
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("About"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
textEditingController: aboutController,
|
||||
hintText:
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
|
||||
maxlines: 3,
|
||||
),
|
||||
// sizedBoxHeight(20.h),
|
||||
|
||||
text16400white("Position"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: positionController,
|
||||
hintText: "Enter your position",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Training Scores"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
trainingScoresController,
|
||||
texttype: TextInputType.number,
|
||||
hintText: "Enter your training scores",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(10),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Height"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: heightController,
|
||||
hintText: "Enter your height",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Weight"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: weightController,
|
||||
hintText: "Enter your weight",
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'[a-zA-Z0-9\s]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Batting Average"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
texttype: TextInputType.number,
|
||||
textEditingController: battingAvgController,
|
||||
hintText: "Enter your batting average",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(10),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
sizedBoxHeight(60.h),
|
||||
CommonBtn(
|
||||
text: "Save",
|
||||
onTap: () {
|
||||
if (fullNameController.text.isBlank! ||
|
||||
userNameController.text.isBlank! ||
|
||||
dateController.text.isBlank! ||
|
||||
locationController.text.isBlank! ||
|
||||
aboutController.text.isBlank! ||
|
||||
positionController.text.isBlank! ||
|
||||
trainingScoresController
|
||||
.text.isBlank! ||
|
||||
heightController.text.isBlank! ||
|
||||
weightController.text.isBlank! ||
|
||||
battingAvgController.text.isBlank!) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Please fill missing details',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
}
|
||||
// else if (profilePicture == "") {
|
||||
// utils.showToast(
|
||||
// 'Upload edit profile picture!');
|
||||
// }
|
||||
else {
|
||||
print(selectedinterestid.toString());
|
||||
saveEditProfileInd();
|
||||
}
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
],
|
||||
)
|
||||
])))
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
|
||||
class UserIndiProfileImageController extends GetxController {
|
||||
RxString usserprofilePicPath = "".obs;
|
||||
|
||||
void getImage(ImageSource imgSource) async {
|
||||
final ImagePicker picker = ImagePicker();
|
||||
print('profilePicPath $usserprofilePicPath');
|
||||
final XFile? pickedImg = await picker.pickImage(source: imgSource);
|
||||
if (pickedImg != null) {
|
||||
final CroppedFile? croppedImg = await ImageCropper().cropImage(
|
||||
sourcePath: pickedImg.path,
|
||||
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
|
||||
compressFormat: ImageCompressFormat.jpg,
|
||||
maxHeight: 512,
|
||||
maxWidth: 512,
|
||||
compressQuality: 100,
|
||||
cropStyle: CropStyle.circle,
|
||||
aspectRatioPresets: [
|
||||
CropAspectRatioPreset.square,
|
||||
],
|
||||
uiSettings: [
|
||||
AndroidUiSettings(
|
||||
toolbarTitle: "Crop Image",
|
||||
toolbarColor: Get.theme.appBarTheme.backgroundColor,
|
||||
backgroundColor: Colors.black,
|
||||
activeControlsWidgetColor: Colors.red,
|
||||
cropFrameColor: Colors.white,
|
||||
cropGridColor: Colors.white, // Ensure this matches the theme
|
||||
cropGridColumnCount: 2, // Add to make the grid lines prominent
|
||||
cropGridRowCount: 2, // Add to make the grid lines prominent
|
||||
lockAspectRatio: true, // Ensure the aspect ratio is locked
|
||||
),
|
||||
IOSUiSettings(
|
||||
title: 'Crop Image',
|
||||
),
|
||||
],
|
||||
);
|
||||
if (croppedImg != null) {
|
||||
usserprofilePicPath.value = croppedImg.path;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
|
||||
class UserProfileImageController extends GetxController {
|
||||
RxString usserprofilePicPath = "".obs;
|
||||
|
||||
void getImage(ImageSource imgSource) async {
|
||||
final ImagePicker picker = ImagePicker();
|
||||
print('profilePicPath $usserprofilePicPath');
|
||||
final XFile? pickedImg = await picker.pickImage(source: imgSource);
|
||||
if (pickedImg != null) {
|
||||
final CroppedFile? croppedImg = await ImageCropper().cropImage(
|
||||
sourcePath: pickedImg.path,
|
||||
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
|
||||
compressFormat: ImageCompressFormat.jpg,
|
||||
maxHeight: 512,
|
||||
maxWidth: 512,
|
||||
compressQuality: 100,
|
||||
cropStyle: CropStyle.circle,
|
||||
aspectRatioPresets: [
|
||||
CropAspectRatioPreset.square,
|
||||
],
|
||||
uiSettings: [
|
||||
AndroidUiSettings(
|
||||
toolbarTitle: "Crop Image",
|
||||
toolbarColor: Get.theme.appBarTheme.backgroundColor,
|
||||
backgroundColor: Colors.black,
|
||||
activeControlsWidgetColor: Colors.red,
|
||||
cropFrameColor: Colors.white,
|
||||
cropGridColor: Colors.white, // Ensure this matches the theme
|
||||
cropGridColumnCount: 2, // Add to make the grid lines prominent
|
||||
cropGridRowCount: 2, // Add to make the grid lines prominent
|
||||
lockAspectRatio: true, // Ensure the aspect ratio is locked
|
||||
),
|
||||
IOSUiSettings(
|
||||
title: 'Crop Image',
|
||||
),
|
||||
],
|
||||
);
|
||||
if (croppedImg != null) {
|
||||
usserprofilePicPath.value = croppedImg.path;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
|
||||
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
GetEditProfileIndi? getEditProfileIndi;
|
||||
GetEditProfileBus? getEditProfileBus;
|
||||
List<String> listofUserInterests = [];
|
||||
|
||||
bool accountvisibility = true;
|
||||
|
||||
class EditProfileApi {
|
||||
EditProfileApi();
|
||||
|
||||
Future<ResponseData<dynamic>> postEditProfileIndividual(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response =
|
||||
await NetworkApiServices().postApi(data, ApiUrls.posteditprofile);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['status'] == 'success') {
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getEditProfileIndividual() async {
|
||||
final response = await NetworkApiServices().getApi(ApiUrls.geteditprofile);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
getEditProfileIndi = GetEditProfileIndi.fromJson(response.data);
|
||||
accountvisibility = getEditProfileIndi!.data!.accountVisibility == 1;
|
||||
getUserIntersetFromResponse();
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
getUserIntersetFromResponse() {
|
||||
for (var interests in getEditProfileIndi!.data!.interest!) {
|
||||
String interestName = interests.name ?? "null";
|
||||
int index = listofUserInterests.indexOf(interestName);
|
||||
if (index != -1) {
|
||||
listofUserInterests[index] = interestName;
|
||||
} else {
|
||||
listofUserInterests.add(interestName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postEditProfileBusiness(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices()
|
||||
.postApi(data, ApiUrls.posteditprofilebusiness);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['status'] == 'success') {
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getEditProfileBusiness() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.geteditprofilebusiness,
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
getEditProfileBus = GetEditProfileBus.fromJson(response.data);
|
||||
|
||||
if (response.data["status"] == "success") {
|
||||
print("Success---->");
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart';
|
||||
|
||||
InterestModel? interestlistobj;
|
||||
List<String> listofInterests = [];
|
||||
|
||||
class InterestListApi {
|
||||
InterestListApi();
|
||||
var data = "";
|
||||
Future<ResponseData<dynamic>> getinterestlistApi() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getinterestlist,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
interestlistobj = InterestModel.fromJson(responseData);
|
||||
getIntersetFromResponse();
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
getIntersetFromResponse() {
|
||||
listofInterests.clear();
|
||||
for (var interests in interestlistobj!.data!) {
|
||||
listofInterests.add(interests.name ?? "null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,784 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/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 Followers extends StatefulWidget {
|
||||
const Followers({super.key});
|
||||
|
||||
@override
|
||||
State<Followers> createState() => _FollowersState();
|
||||
}
|
||||
|
||||
class _FollowersState extends State<Followers> {
|
||||
StreamController<FollowersModel> searchcontroller = StreamController();
|
||||
StreamController<GetGuestFollowers> guestsearchcontroller =
|
||||
StreamController();
|
||||
var guestUserid = Get.arguments['UpdataGuestIdfollowers'] ?? '';
|
||||
|
||||
var fromBusFollower = Get.arguments['From'] ?? '';
|
||||
var guestUserBusid = Get.arguments['UpdataGuestBusIdfollowers'] ?? '';
|
||||
var fromMainBusProfile = Get.arguments['From'] ?? '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
var updata = "";
|
||||
if (fromMainBusProfile == 'MainBusProfile') {
|
||||
Profilegetmethod()
|
||||
.getFollowers(updata, streamController: searchcontroller);
|
||||
}
|
||||
|
||||
var guestupdata = "";
|
||||
|
||||
if (fromBusFollower == 'GuestBusFollowers') {
|
||||
GuestProfileApi().getGuestfollowers(guestUserBusid, guestupdata,
|
||||
streamController: guestsearchcontroller);
|
||||
} else {
|
||||
GuestProfileApi().getGuestfollowers(guestUserid, guestupdata,
|
||||
streamController: guestsearchcontroller);
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int? blockid;
|
||||
int? removeid;
|
||||
|
||||
RemoveUploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"iam_principal_xid": removeid,
|
||||
};
|
||||
final data = await Profilepostmethod().postRemoveuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("block done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("block not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
BlockUploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"blocked_iam_principal_xid": blockid,
|
||||
};
|
||||
final data = await Profilepostmethod().postBlockuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("block done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("block not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Followers",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: fromMainBusProfile == 'MainBusProfile'
|
||||
? Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 23,
|
||||
width: 23,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/ion_search-outline.png",
|
||||
height: 23,
|
||||
width: 23,
|
||||
),
|
||||
),
|
||||
),
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
Profilegetmethod().getFollowers(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
hintText: "Search people",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
StreamBuilder<FollowersModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return const Center(
|
||||
child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return followersobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
:
|
||||
// ListView.builder(
|
||||
// shrinkWrap: true,
|
||||
// itemCount: followersobj!.data!.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return Column(
|
||||
// children: [
|
||||
// followerWidget(
|
||||
// imagePath: followersobj?.data?[index]
|
||||
// .follower?.profilePhoto ??
|
||||
// "",
|
||||
// // followersData[index]["imagePath"],
|
||||
// title: followersobj?.data?[index].follower
|
||||
// ?.fullName ??
|
||||
// "",
|
||||
// // followersData[index]["title"],
|
||||
// subtitle: followersobj?.data?[index]
|
||||
// .follower?.userName ??
|
||||
// "",
|
||||
// blockonTap: () {
|
||||
// BlockUploadata(followersobj!
|
||||
// .data![index].follower!.id);
|
||||
// }
|
||||
// // followersData[index]["subtitle"]
|
||||
// ),
|
||||
// if (index != followersobj!.data!.length - 1)
|
||||
// commonDivider(),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
|
||||
ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: followersobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
var mainFollowersData =
|
||||
followersobj!.data![index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
mainFollowersData.follower!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(
|
||||
RouteName
|
||||
.profiletabindguest,
|
||||
arguments: {
|
||||
"FolloweridIndex":
|
||||
mainFollowersData
|
||||
.iamPrincipalXid!,
|
||||
})
|
||||
: Get.toNamed(
|
||||
RouteName
|
||||
.profiletabbusguest,
|
||||
arguments: {
|
||||
"FolloweridIndex":
|
||||
mainFollowersData
|
||||
.iamPrincipalXid!,
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
mainFollowersData.follower!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.profilePhoto!
|
||||
.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.fullName ==
|
||||
null ||
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.fullName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text16w400_FCFCFC(
|
||||
"Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.userName ==
|
||||
null ||
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.userName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
mainFollowersData
|
||||
.follower!
|
||||
.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(
|
||||
0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints
|
||||
.tightFor(
|
||||
width:
|
||||
176.w),
|
||||
offset:
|
||||
const Offset(0, 20),
|
||||
color: const Color(
|
||||
0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder:
|
||||
(BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
// onTap: () {},
|
||||
onTap:
|
||||
() async {
|
||||
setState(
|
||||
() {
|
||||
removeid =
|
||||
followersobj!.data![index].follower!.id ??
|
||||
0;
|
||||
followersobj!.data!.removeWhere((item) =>
|
||||
item.follower!.id ==
|
||||
removeid);
|
||||
RemoveUploadata();
|
||||
});
|
||||
},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Remove user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/fluent_delete-28-regular.png",
|
||||
height:
|
||||
15.h,
|
||||
width:
|
||||
15.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() {},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/fluent_chat-20-regular.png",
|
||||
height:
|
||||
20.h,
|
||||
width:
|
||||
20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() async {
|
||||
setState(
|
||||
() {
|
||||
blockid =
|
||||
followersobj!.data![index].follower!.id ??
|
||||
0;
|
||||
followersobj!.data!.removeWhere((item) =>
|
||||
item.follower!.id ==
|
||||
blockid);
|
||||
BlockUploadata();
|
||||
});
|
||||
},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Block user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/blockchat.png",
|
||||
height:
|
||||
25.h,
|
||||
width:
|
||||
25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
])
|
||||
])
|
||||
])
|
||||
: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 23,
|
||||
width: 23,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/ion_search-outline.png",
|
||||
height: 23,
|
||||
width: 23,
|
||||
),
|
||||
),
|
||||
),
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
if (fromBusFollower == 'GuestBusFollowers') {
|
||||
GuestProfileApi().getGuestfollowers(
|
||||
guestUserBusid, value,
|
||||
streamController: guestsearchcontroller);
|
||||
}
|
||||
GuestProfileApi().getGuestfollowers(
|
||||
guestUserid, value,
|
||||
streamController: guestsearchcontroller);
|
||||
},
|
||||
hintText: "Search people",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
StreamBuilder<GetGuestFollowers>(
|
||||
stream: guestsearchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return Expanded(
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return getguestfollowersobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
getguestfollowersobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
var guestFollowerData =
|
||||
getguestfollowersobj!.data![index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
guestFollowerData.follower!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(
|
||||
RouteName
|
||||
.profiletabindguest,
|
||||
arguments: {
|
||||
"FolloweridIndex":
|
||||
guestFollowerData
|
||||
.iamPrincipalXid,
|
||||
})
|
||||
: Get.toNamed(
|
||||
RouteName
|
||||
.profiletabbusguest,
|
||||
arguments: {
|
||||
"FolloweridIndex":
|
||||
guestFollowerData
|
||||
.iamPrincipalXid,
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
guestFollowerData.follower!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.profilePhoto!
|
||||
.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.fullName ==
|
||||
null ||
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.fullName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text16w400_FCFCFC(
|
||||
"Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.userName ==
|
||||
null ||
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.userName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
guestFollowerData
|
||||
.follower!
|
||||
.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(
|
||||
0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints
|
||||
.tightFor(
|
||||
width:
|
||||
176.w),
|
||||
offset:
|
||||
const Offset(0, 20),
|
||||
color: const Color(
|
||||
0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder:
|
||||
(BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
// onTap: () {},
|
||||
onTap:
|
||||
() async {
|
||||
// setState(
|
||||
// () {
|
||||
// removeid =
|
||||
// getguestfollowersobj!.data![index].follower!.id ??
|
||||
// 0;
|
||||
// getguestfollowersobj!.data!.removeWhere((item) =>
|
||||
// item.follower!.id ==
|
||||
// removeid);
|
||||
// RemoveUploadata();
|
||||
// });
|
||||
},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
""),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/fluent_delete-28-regular.png",
|
||||
height:
|
||||
15.h,
|
||||
width:
|
||||
15.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() {},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/fluent_chat-20-regular.png",
|
||||
height:
|
||||
20.h,
|
||||
width:
|
||||
20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() async {
|
||||
// setState(
|
||||
// () {
|
||||
// blockid =
|
||||
// getguestfollowersobj!.data![index].follower!.id ??
|
||||
// 0;
|
||||
// getguestfollowersobj!.data!.removeWhere((item) =>
|
||||
// item.follower!.id ==
|
||||
// blockid);
|
||||
// BlockUploadata();
|
||||
// });
|
||||
},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Block user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/blockchat.png",
|
||||
height:
|
||||
25.h,
|
||||
width:
|
||||
25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
])
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,670 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/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 Following extends StatefulWidget {
|
||||
const Following({super.key});
|
||||
|
||||
@override
|
||||
State<Following> createState() => _FollowingState();
|
||||
}
|
||||
|
||||
class _FollowingState extends State<Following> {
|
||||
StreamController<FollowingModel> searchcontroller = StreamController();
|
||||
StreamController<GetGuestFollowing> guestsearchcontroller =
|
||||
StreamController();
|
||||
|
||||
var guestUserid = Get.arguments['UpdataGuestIdfollowing'] ?? '';
|
||||
|
||||
var fromBusFollowing = Get.arguments['From'] ?? '';
|
||||
|
||||
var guestBusUserid = Get.arguments['UpdataGuestBusIdfollowing'] ?? '';
|
||||
|
||||
var fromMainBusProfile = Get.arguments['From'] ?? '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
var updata = "";
|
||||
if (fromMainBusProfile == 'MainBusProfile') {
|
||||
Profilegetmethod()
|
||||
.getFollowing(updata, streamController: searchcontroller);
|
||||
}
|
||||
|
||||
var guestupdata = "";
|
||||
if (fromBusFollowing == 'GuestBusFollowing') {
|
||||
GuestProfileApi().getGuestfollowing(guestBusUserid, guestupdata,
|
||||
streamController: guestsearchcontroller);
|
||||
} else {
|
||||
GuestProfileApi().getGuestfollowing(guestUserid, guestupdata,
|
||||
streamController: guestsearchcontroller);
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"following_iam_principal_xid": unfollowid,
|
||||
};
|
||||
final data = await Profilepostmethod().postunfollowuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("unfollow done");
|
||||
// setState(() {
|
||||
// // Assuming followingobj is a list of items, remove the item with matching user ID
|
||||
// followingobj!.data!.removeWhere((item) => item.following!.id == userid);
|
||||
// });
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("unfollow not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
int? unfollowid;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Following",
|
||||
),
|
||||
body: fromMainBusProfile == 'MainBusProfile'
|
||||
? Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
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 people",
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Profilegetmethod().getFollowing(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
StreamBuilder<FollowingModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return followingobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: followingobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
var mainFollowing =
|
||||
followingobj!.data![index];
|
||||
return
|
||||
// Column(
|
||||
// children: [
|
||||
// Followinglist(
|
||||
// imagePath: followingobj?.data?[index]
|
||||
// .following?.profilePhoto ??
|
||||
// '',
|
||||
// title: followingobj!
|
||||
// .data?[index].following?.fullName ??
|
||||
// '',
|
||||
// subtitle: followingobj!
|
||||
// .data?[index].following?.userName ??
|
||||
// '',
|
||||
// unfollowontap: (id) => Uploadata(id),
|
||||
// unfollowindex: followingobj!
|
||||
// .data![index].following!.id!,
|
||||
// ),
|
||||
// if (index != followingobj!.data!.length - 1)
|
||||
// commonDivider(),
|
||||
// ],
|
||||
// );
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
mainFollowing.following!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(
|
||||
RouteName.profiletabindguest,
|
||||
arguments: {
|
||||
"FollowingidIndex": mainFollowing
|
||||
.followingIamPrincipalXid!,
|
||||
})
|
||||
: Get.toNamed(
|
||||
RouteName.profiletabbusguest,
|
||||
arguments: {
|
||||
"FollowingidIndex": mainFollowing
|
||||
.followingIamPrincipalXid!,
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
mainFollowing.following!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
mainFollowing.following!
|
||||
.profilePhoto!.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage:
|
||||
NetworkImage(
|
||||
mainFollowing
|
||||
.following!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
mainFollowing.following!
|
||||
.fullName ==
|
||||
null ||
|
||||
mainFollowing
|
||||
.following!
|
||||
.fullName!
|
||||
.isEmpty
|
||||
? text16w400_FCFCFC(
|
||||
"Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
mainFollowing
|
||||
.following!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
mainFollowing.following!
|
||||
.userName ==
|
||||
null ||
|
||||
mainFollowing
|
||||
.following!
|
||||
.userName!
|
||||
.isEmpty
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
mainFollowing
|
||||
.following!
|
||||
.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints.tightFor(
|
||||
width: 176.w),
|
||||
offset: const Offset(0, 20),
|
||||
color:
|
||||
const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
unfollowid =
|
||||
mainFollowing
|
||||
.following!
|
||||
.id ??
|
||||
0;
|
||||
// followingobj!.data!.removeAt(index);
|
||||
followingobj!
|
||||
.data!
|
||||
.removeWhere((item) =>
|
||||
item.following!
|
||||
.id ==
|
||||
unfollowid);
|
||||
Uploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Unfollow user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black1323e.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-22.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
])
|
||||
]))
|
||||
])
|
||||
: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
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 people",
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// GuestProfileApi().getGuestfollowing(guestUserid, value,
|
||||
// streamController: guestsearchcontroller);
|
||||
if (fromBusFollowing == 'GuestBusFollowing') {
|
||||
GuestProfileApi().getGuestfollowing(
|
||||
guestBusUserid, value,
|
||||
streamController: guestsearchcontroller);
|
||||
} else {
|
||||
GuestProfileApi().getGuestfollowing(
|
||||
guestUserid, value,
|
||||
streamController: guestsearchcontroller);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
StreamBuilder<GetGuestFollowing>(
|
||||
stream: guestsearchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return const Center(
|
||||
child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return getguestfollowingobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
getguestfollowingobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
var guestFollowing =
|
||||
getguestfollowingobj!.data![index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
guestFollowing.following!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(
|
||||
RouteName
|
||||
.profiletabindguest,
|
||||
arguments: {
|
||||
"FollowingidIndex":
|
||||
guestFollowing
|
||||
.followingIamPrincipalXid!,
|
||||
})
|
||||
: Get.toNamed(
|
||||
RouteName
|
||||
.profiletabbusguest,
|
||||
arguments: {
|
||||
"FollowingidIndex":
|
||||
guestFollowing
|
||||
.followingIamPrincipalXid!,
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h,
|
||||
horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
guestFollowing.following!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
guestFollowing
|
||||
.following!
|
||||
.profilePhoto!
|
||||
.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage:
|
||||
const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage:
|
||||
NetworkImage(
|
||||
guestFollowing
|
||||
.following!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
guestFollowing.following!
|
||||
.fullName ==
|
||||
null ||
|
||||
guestFollowing
|
||||
.following!
|
||||
.fullName!
|
||||
.isEmpty
|
||||
? text16w400_FCFCFC(
|
||||
"Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
guestFollowing
|
||||
.following!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
guestFollowing.following!
|
||||
.userName ==
|
||||
null ||
|
||||
guestFollowing
|
||||
.following!
|
||||
.userName!
|
||||
.isEmpty
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
guestFollowing
|
||||
.following!
|
||||
.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(
|
||||
0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints
|
||||
.tightFor(
|
||||
width:
|
||||
176.w),
|
||||
offset:
|
||||
const Offset(0, 20),
|
||||
color: const Color(
|
||||
0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder:
|
||||
(BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() async {
|
||||
// setState(
|
||||
// () {
|
||||
// unfollowid =
|
||||
// getguestfollowingobj!.data![index].following!.id ??
|
||||
// 0;
|
||||
// // followingobj!.data!.removeAt(index);
|
||||
// getguestfollowingobj!.data!.removeWhere((item) =>
|
||||
// item.following!.id ==
|
||||
// unfollowid);
|
||||
// Uploadata();
|
||||
// });
|
||||
},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
""),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/Black1323e.png",
|
||||
height:
|
||||
20.h,
|
||||
width:
|
||||
20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap:
|
||||
() {},
|
||||
child:
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
12.w),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image
|
||||
.asset(
|
||||
"assets/images/png/fluent_chat-20-22.png",
|
||||
height:
|
||||
20.h,
|
||||
width:
|
||||
20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
])
|
||||
]))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
class GetGuestFollowers {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
GetGuestFollowers({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetGuestFollowers.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? followingIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
Follower? follower;
|
||||
|
||||
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
follower = json['follower'] != null
|
||||
? new Follower.fromJson(json['follower'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.follower != null) {
|
||||
data['follower'] = this.follower!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follower {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
int? principleTypeXid;
|
||||
|
||||
Follower(
|
||||
{this.id,
|
||||
this.userName,
|
||||
this.fullName,
|
||||
this.profilePhoto,
|
||||
this.principleTypeXid});
|
||||
|
||||
Follower.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
principleTypeXid = json['principal_type_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
data['principal_type_xid'] = this.principleTypeXid;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
class GetGuestFollowing {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
GetGuestFollowing({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetGuestFollowing.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? followingIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
Following? following;
|
||||
|
||||
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
following = json['following'] != null
|
||||
? new Following.fromJson(json['following'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.following != null) {
|
||||
data['following'] = this.following!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Following {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
int? principleTypeXid;
|
||||
|
||||
|
||||
Following({this.id, this.userName, this.fullName, this.profilePhoto, this.principleTypeXid});
|
||||
|
||||
Following.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
principleTypeXid = json['principal_type_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
data['principal_type_xid'] = this.principleTypeXid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,412 +0,0 @@
|
||||
class GuestGetProfileDataBus {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GuestGetProfileDataBus(
|
||||
{this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GuestGetProfileDataBus.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? businessTypeXid;
|
||||
String? businessOwnerName;
|
||||
String? businessName;
|
||||
String? businessUsername;
|
||||
String? businessLocation;
|
||||
String? businessContactNumber;
|
||||
String? businessEmail;
|
||||
String? businessHandle;
|
||||
String? websiteLink;
|
||||
String? googleReviewLink;
|
||||
String? businessLogo;
|
||||
String? tags;
|
||||
String? bannerImage;
|
||||
String? businessProfileImage;
|
||||
String? bio;
|
||||
Follows? follows;
|
||||
int? isIamFollowingToGuestUser;
|
||||
BusinessType? businessType;
|
||||
IamPrincipalData? iamPrincipalData;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.iamPrincipalXid,
|
||||
this.businessTypeXid,
|
||||
this.businessOwnerName,
|
||||
this.businessName,
|
||||
this.businessUsername,
|
||||
this.businessLocation,
|
||||
this.businessContactNumber,
|
||||
this.businessEmail,
|
||||
this.businessHandle,
|
||||
this.websiteLink,
|
||||
this.googleReviewLink,
|
||||
this.businessLogo,
|
||||
this.tags,
|
||||
this.bannerImage,
|
||||
this.businessProfileImage,
|
||||
this.bio,
|
||||
this.follows,
|
||||
this.isIamFollowingToGuestUser,
|
||||
this.businessType,
|
||||
this.iamPrincipalData});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
businessTypeXid = json['business_type_xid'];
|
||||
businessOwnerName = json['business_owner_name'];
|
||||
businessName = json['business_name'];
|
||||
businessUsername = json['business_username'];
|
||||
businessLocation = json['business_location'];
|
||||
businessContactNumber = json['business_contact_number'];
|
||||
businessEmail = json['business_email'];
|
||||
businessHandle = json['business_handle'];
|
||||
websiteLink = json['website_link'];
|
||||
googleReviewLink = json['google_review_link'];
|
||||
businessLogo = json['business_logo'];
|
||||
tags = json['tags'];
|
||||
bannerImage = json['banner_image'];
|
||||
businessProfileImage = json['business_profile_image'];
|
||||
bio = json['bio'];
|
||||
follows =
|
||||
json['follows'] != null ? Follows.fromJson(json['follows']) : null;
|
||||
isIamFollowingToGuestUser = json['is_iam_following_to_guest_user'];
|
||||
businessType = json['business_type'] != null
|
||||
? BusinessType.fromJson(json['business_type'])
|
||||
: null;
|
||||
iamPrincipalData = json['iam_principal_data'] != null
|
||||
? IamPrincipalData.fromJson(json['iam_principal_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['business_type_xid'] = businessTypeXid;
|
||||
data['business_owner_name'] = businessOwnerName;
|
||||
data['business_name'] = businessName;
|
||||
data['business_username'] = businessUsername;
|
||||
data['business_location'] = businessLocation;
|
||||
data['business_contact_number'] = businessContactNumber;
|
||||
data['business_email'] = businessEmail;
|
||||
data['business_handle'] = businessHandle;
|
||||
data['website_link'] = websiteLink;
|
||||
data['google_review_link'] = googleReviewLink;
|
||||
data['business_logo'] = businessLogo;
|
||||
data['tags'] = tags;
|
||||
data['banner_image'] = bannerImage;
|
||||
data['business_profile_image'] = businessProfileImage;
|
||||
data['bio'] = bio;
|
||||
if (follows != null) {
|
||||
data['follows'] = follows!.toJson();
|
||||
}
|
||||
data['is_iam_following_to_guest_user'] = isIamFollowingToGuestUser;
|
||||
if (businessType != null) {
|
||||
data['business_type'] = businessType!.toJson();
|
||||
}
|
||||
if (iamPrincipalData != null) {
|
||||
data['iam_principal_data'] = iamPrincipalData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follows {
|
||||
int? following;
|
||||
int? followers;
|
||||
|
||||
Follows({this.following, this.followers});
|
||||
|
||||
Follows.fromJson(Map<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['following'] = following;
|
||||
data['followers'] = followers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class BusinessType {
|
||||
int? id;
|
||||
String? name;
|
||||
String? image;
|
||||
String? description;
|
||||
int? isActive;
|
||||
String? createdBy;
|
||||
String? modifiedBy;
|
||||
String? deletedAt;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
|
||||
BusinessType(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.image,
|
||||
this.description,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.modifiedBy,
|
||||
this.deletedAt,
|
||||
this.createdAt,
|
||||
this.updatedAt});
|
||||
|
||||
BusinessType.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
image = json['image'];
|
||||
description = json['description'];
|
||||
isActive = json['is_active'];
|
||||
createdBy = json['created_by'];
|
||||
modifiedBy = json['modified_by'];
|
||||
deletedAt = json['deleted_at'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['image'] = image;
|
||||
data['description'] = description;
|
||||
data['is_active'] = isActive;
|
||||
data['created_by'] = createdBy;
|
||||
data['modified_by'] = modifiedBy;
|
||||
data['deleted_at'] = deletedAt;
|
||||
data['created_at'] = createdAt;
|
||||
data['updated_at'] = updatedAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class IamPrincipalData {
|
||||
int? id;
|
||||
int? principalTypeXid;
|
||||
int? principalSourceXid;
|
||||
String? oneSignalPlayerId;
|
||||
String? googleId;
|
||||
String? appleId;
|
||||
String? facebookId;
|
||||
String? microsoftId;
|
||||
String? userName;
|
||||
String? pin;
|
||||
String? fullName;
|
||||
String? gender;
|
||||
String? dateOfBirth;
|
||||
String? phoneNumber;
|
||||
String? otherPhoneNumber;
|
||||
String? emailAddress;
|
||||
String? addressLine1;
|
||||
String? addressLine2;
|
||||
String? cityXid;
|
||||
String? stateXid;
|
||||
String? countryXid;
|
||||
String? postCode;
|
||||
String? lastLoginDatetime;
|
||||
String? profilePhoto;
|
||||
String? referralCode;
|
||||
String? description;
|
||||
String? about;
|
||||
String? position;
|
||||
String? trainingScores;
|
||||
String? height;
|
||||
String? weight;
|
||||
String? battingAverage;
|
||||
int? isProfileUpdated;
|
||||
String? isActive;
|
||||
int? groupNotification;
|
||||
int? communityNotification;
|
||||
int? followerNotification;
|
||||
int? newFollowerNotification;
|
||||
int? directMessageNotification;
|
||||
int? isAccountVisibility;
|
||||
int? isDeleted;
|
||||
String? reason;
|
||||
String? createdBy;
|
||||
String? modifiedBy;
|
||||
String? deletedAt;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
String? profileImage;
|
||||
|
||||
IamPrincipalData(
|
||||
{this.id,
|
||||
this.principalTypeXid,
|
||||
this.principalSourceXid,
|
||||
this.oneSignalPlayerId,
|
||||
this.googleId,
|
||||
this.appleId,
|
||||
this.facebookId,
|
||||
this.microsoftId,
|
||||
this.userName,
|
||||
this.pin,
|
||||
this.fullName,
|
||||
this.gender,
|
||||
this.dateOfBirth,
|
||||
this.phoneNumber,
|
||||
this.otherPhoneNumber,
|
||||
this.emailAddress,
|
||||
this.addressLine1,
|
||||
this.addressLine2,
|
||||
this.cityXid,
|
||||
this.stateXid,
|
||||
this.countryXid,
|
||||
this.postCode,
|
||||
this.lastLoginDatetime,
|
||||
this.profilePhoto,
|
||||
this.referralCode,
|
||||
this.description,
|
||||
this.about,
|
||||
this.position,
|
||||
this.trainingScores,
|
||||
this.height,
|
||||
this.weight,
|
||||
this.battingAverage,
|
||||
this.isProfileUpdated,
|
||||
this.isActive,
|
||||
this.groupNotification,
|
||||
this.communityNotification,
|
||||
this.followerNotification,
|
||||
this.newFollowerNotification,
|
||||
this.directMessageNotification,
|
||||
this.isAccountVisibility,
|
||||
this.isDeleted,
|
||||
this.reason,
|
||||
this.createdBy,
|
||||
this.modifiedBy,
|
||||
this.deletedAt,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.profileImage});
|
||||
|
||||
IamPrincipalData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
principalTypeXid = json['principal_type_xid'];
|
||||
principalSourceXid = json['principal_source_xid'];
|
||||
oneSignalPlayerId = json['one_signal_player_id'];
|
||||
googleId = json['google_id'];
|
||||
appleId = json['apple_id'];
|
||||
facebookId = json['facebook_id'];
|
||||
microsoftId = json['microsoft_id'];
|
||||
userName = json['user_name'];
|
||||
pin = json['pin'];
|
||||
fullName = json['full_name'];
|
||||
gender = json['gender'];
|
||||
dateOfBirth = json['date_of_birth'];
|
||||
phoneNumber = json['phone_number'];
|
||||
otherPhoneNumber = json['other_phone_number'];
|
||||
emailAddress = json['email_address'];
|
||||
addressLine1 = json['address_line1'];
|
||||
addressLine2 = json['address_line2'];
|
||||
cityXid = json['city_xid'];
|
||||
stateXid = json['state_xid'];
|
||||
countryXid = json['country_xid'];
|
||||
postCode = json['post_code'];
|
||||
lastLoginDatetime = json['last_login_datetime'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
referralCode = json['referral_code'];
|
||||
description = json['description'];
|
||||
about = json['about'];
|
||||
position = json['position'];
|
||||
trainingScores = json['training_scores'];
|
||||
height = json['height'];
|
||||
weight = json['weight'];
|
||||
battingAverage = json['batting_average'];
|
||||
isProfileUpdated = json['is_profile_updated'];
|
||||
isActive = json['is_active'];
|
||||
groupNotification = json['group_notification'];
|
||||
communityNotification = json['community_notification'];
|
||||
followerNotification = json['follower_notification'];
|
||||
newFollowerNotification = json['new_follower_notification'];
|
||||
directMessageNotification = json['direct_message_notification'];
|
||||
isAccountVisibility = json['is_account_visibility'];
|
||||
isDeleted = json['is_deleted'];
|
||||
reason = json['reason'];
|
||||
createdBy = json['created_by'];
|
||||
modifiedBy = json['modified_by'];
|
||||
deletedAt = json['deleted_at'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
profileImage = json['profile_image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['principal_type_xid'] = principalTypeXid;
|
||||
data['principal_source_xid'] = principalSourceXid;
|
||||
data['one_signal_player_id'] = oneSignalPlayerId;
|
||||
data['google_id'] = googleId;
|
||||
data['apple_id'] = appleId;
|
||||
data['facebook_id'] = facebookId;
|
||||
data['microsoft_id'] = microsoftId;
|
||||
data['user_name'] = userName;
|
||||
data['pin'] = pin;
|
||||
data['full_name'] = fullName;
|
||||
data['gender'] = gender;
|
||||
data['date_of_birth'] = dateOfBirth;
|
||||
data['phone_number'] = phoneNumber;
|
||||
data['other_phone_number'] = otherPhoneNumber;
|
||||
data['email_address'] = emailAddress;
|
||||
data['address_line1'] = addressLine1;
|
||||
data['address_line2'] = addressLine2;
|
||||
data['city_xid'] = cityXid;
|
||||
data['state_xid'] = stateXid;
|
||||
data['country_xid'] = countryXid;
|
||||
data['post_code'] = postCode;
|
||||
data['last_login_datetime'] = lastLoginDatetime;
|
||||
data['profile_photo'] = profilePhoto;
|
||||
data['referral_code'] = referralCode;
|
||||
data['description'] = description;
|
||||
data['about'] = about;
|
||||
data['position'] = position;
|
||||
data['training_scores'] = trainingScores;
|
||||
data['height'] = height;
|
||||
data['weight'] = weight;
|
||||
data['batting_average'] = battingAverage;
|
||||
data['is_profile_updated'] = isProfileUpdated;
|
||||
data['is_active'] = isActive;
|
||||
data['group_notification'] = groupNotification;
|
||||
data['community_notification'] = communityNotification;
|
||||
data['follower_notification'] = followerNotification;
|
||||
data['new_follower_notification'] = newFollowerNotification;
|
||||
data['direct_message_notification'] = directMessageNotification;
|
||||
data['is_account_visibility'] = isAccountVisibility;
|
||||
data['is_deleted'] = isDeleted;
|
||||
data['reason'] = reason;
|
||||
data['created_by'] = createdBy;
|
||||
data['modified_by'] = modifiedBy;
|
||||
data['deleted_at'] = deletedAt;
|
||||
data['created_at'] = createdAt;
|
||||
data['updated_at'] = updatedAt;
|
||||
data['profile_image'] = profileImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,430 +0,0 @@
|
||||
class GuestGetProfileDataIndi {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GuestGetProfileDataIndi(
|
||||
{this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GuestGetProfileDataIndi.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
int? principalTypeXid;
|
||||
String? userName;
|
||||
String? location;
|
||||
String? fullName;
|
||||
String? gender;
|
||||
String? profilePhoto;
|
||||
String? dateOfBirth;
|
||||
List<Interest>? interest;
|
||||
String? about;
|
||||
String? position;
|
||||
String? trainingScores;
|
||||
String? height;
|
||||
String? weight;
|
||||
String? battingAverage;
|
||||
Follows? follows;
|
||||
List<Timelines>? timelines;
|
||||
int? accountVisibility;
|
||||
List<MyJoinedGroups>? myJoinedGroups;
|
||||
// List<MyJoinedSubgroups>? myJoinedSubgroups;
|
||||
List<Certifications>? certifications;
|
||||
int? daysBeforeJoined;
|
||||
int? isIamFollowingToGuestUser;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.principalTypeXid,
|
||||
this.userName,
|
||||
this.location,
|
||||
this.fullName,
|
||||
this.gender,
|
||||
this.profilePhoto,
|
||||
this.dateOfBirth,
|
||||
this.interest,
|
||||
this.about,
|
||||
this.position,
|
||||
this.trainingScores,
|
||||
this.height,
|
||||
this.weight,
|
||||
this.battingAverage,
|
||||
this.follows,
|
||||
this.timelines,
|
||||
this.accountVisibility,
|
||||
this.myJoinedGroups,
|
||||
// this.myJoinedSubgroups,
|
||||
this.certifications,
|
||||
this.daysBeforeJoined,
|
||||
this.isIamFollowingToGuestUser,
|
||||
});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
principalTypeXid = json['principal_type_xid'];
|
||||
userName = json['user_name'];
|
||||
location = json['location'];
|
||||
fullName = json['full_name'];
|
||||
gender = json['gender'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
dateOfBirth = json['date_of_birth'];
|
||||
if (json['interest'] != null) {
|
||||
interest = <Interest>[];
|
||||
json['interest'].forEach((v) {
|
||||
interest!.add(Interest.fromJson(v));
|
||||
});
|
||||
}
|
||||
about = json['about'];
|
||||
position = json['position'];
|
||||
trainingScores = json['training_scores'];
|
||||
height = json['height'];
|
||||
weight = json['weight'];
|
||||
battingAverage = json['batting_average'];
|
||||
follows =
|
||||
json['follows'] != null ? Follows.fromJson(json['follows']) : null;
|
||||
if (json['timelines'] != null) {
|
||||
timelines = <Timelines>[];
|
||||
json['timelines'].forEach((v) {
|
||||
timelines!.add(Timelines.fromJson(v));
|
||||
});
|
||||
}
|
||||
accountVisibility = json['account_visibility'];
|
||||
if (json['my_joined_groups'] != null) {
|
||||
myJoinedGroups = <MyJoinedGroups>[];
|
||||
json['my_joined_groups'].forEach((v) {
|
||||
myJoinedGroups!.add(MyJoinedGroups.fromJson(v));
|
||||
});
|
||||
}
|
||||
// if (json['my_joined_subgroups'] != null) {
|
||||
// myJoinedSubgroups = <MyJoinedSubgroups>[];
|
||||
// json['my_joined_subgroups'].forEach((v) {
|
||||
// myJoinedSubgroups!.add(new MyJoinedSubgroups.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
if (json['certifications'] != null) {
|
||||
certifications = <Certifications>[];
|
||||
json['certifications'].forEach((v) {
|
||||
certifications!.add(Certifications.fromJson(v));
|
||||
});
|
||||
}
|
||||
daysBeforeJoined = json['days_before_joined'];
|
||||
isIamFollowingToGuestUser = json['is_iam_following_to_guest_user'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['principal_type_xid'] = this.principalTypeXid;
|
||||
data['user_name'] = userName;
|
||||
data['location'] = this.location;
|
||||
data['full_name'] = fullName;
|
||||
data['gender'] = gender;
|
||||
data['profile_photo'] = profilePhoto;
|
||||
data['date_of_birth'] = dateOfBirth;
|
||||
if (interest != null) {
|
||||
data['interest'] = interest!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['about'] = about;
|
||||
data['position'] = position;
|
||||
data['training_scores'] = trainingScores;
|
||||
data['height'] = height;
|
||||
data['weight'] = weight;
|
||||
data['batting_average'] = battingAverage;
|
||||
if (follows != null) {
|
||||
data['follows'] = follows!.toJson();
|
||||
}
|
||||
if (timelines != null) {
|
||||
data['timelines'] = timelines!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['account_visibility'] = accountVisibility;
|
||||
if (myJoinedGroups != null) {
|
||||
data['my_joined_groups'] =
|
||||
myJoinedGroups!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
// if (this.myJoinedSubgroups != null) {
|
||||
// data['my_joined_subgroups'] =
|
||||
// this.myJoinedSubgroups!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
if (certifications != null) {
|
||||
data['certifications'] =
|
||||
certifications!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['days_before_joined'] = daysBeforeJoined;
|
||||
data['is_iam_following_to_guest_user'] = isIamFollowingToGuestUser;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
class Interest {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Interest({this.id, this.name});
|
||||
|
||||
Interest.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follows {
|
||||
int? following;
|
||||
int? followers;
|
||||
|
||||
Follows({this.following, this.followers});
|
||||
|
||||
Follows.fromJson(Map<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['following'] = following;
|
||||
data['followers'] = followers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Timelines {
|
||||
int? id;
|
||||
String? clubName;
|
||||
String? roleName;
|
||||
String? teamName;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
String? abilitiesXids;
|
||||
List<Abilities>? abilities;
|
||||
|
||||
Timelines(
|
||||
{this.id,
|
||||
this.clubName,
|
||||
this.roleName,
|
||||
this.teamName,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.abilitiesXids,
|
||||
this.abilities});
|
||||
|
||||
Timelines.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
clubName = json['club_name'];
|
||||
roleName = json['role_name'];
|
||||
teamName = json['team_name'];
|
||||
startDate = json['start_date'];
|
||||
endDate = json['end_date'];
|
||||
abilitiesXids = json['abilities_xids'];
|
||||
if (json['abilities'] != null) {
|
||||
abilities = <Abilities>[];
|
||||
json['abilities'].forEach((v) {
|
||||
abilities!.add(Abilities.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['club_name'] = clubName;
|
||||
data['role_name'] = roleName;
|
||||
data['team_name'] = teamName;
|
||||
data['start_date'] = startDate;
|
||||
data['end_date'] = endDate;
|
||||
data['abilities_xids'] = abilitiesXids;
|
||||
if (abilities != null) {
|
||||
data['abilities'] = abilities!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Abilities {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Abilities({this.id, this.name});
|
||||
|
||||
Abilities.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MyJoinedGroups {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? manageGroupXid;
|
||||
GroupData? groupData;
|
||||
|
||||
MyJoinedGroups(
|
||||
{this.id, this.iamPrincipalXid, this.manageGroupXid, this.groupData});
|
||||
|
||||
MyJoinedGroups.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
manageGroupXid = json['manage_group_xid'];
|
||||
groupData = json['group_data'] != null
|
||||
? GroupData.fromJson(json['group_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['manage_group_xid'] = manageGroupXid;
|
||||
if (groupData != null) {
|
||||
data['group_data'] = groupData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class GroupData {
|
||||
int? id;
|
||||
String? title;
|
||||
String? groupImage;
|
||||
|
||||
GroupData({this.id, this.title, this.groupImage});
|
||||
|
||||
GroupData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
groupImage = json['group_image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
data['group_image'] = groupImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MyJoinedSubgroups {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? manageGroupXid;
|
||||
int? manageSubGroupXid;
|
||||
SubGroupData? subGroupData;
|
||||
|
||||
MyJoinedSubgroups(
|
||||
{this.id,
|
||||
this.iamPrincipalXid,
|
||||
this.manageGroupXid,
|
||||
this.manageSubGroupXid,
|
||||
this.subGroupData});
|
||||
|
||||
MyJoinedSubgroups.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
manageGroupXid = json['manage_group_xid'];
|
||||
manageSubGroupXid = json['manage_sub_group_xid'];
|
||||
subGroupData = json['sub_group_data'] != null
|
||||
? SubGroupData.fromJson(json['sub_group_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['manage_group_xid'] = manageGroupXid;
|
||||
data['manage_sub_group_xid'] = manageSubGroupXid;
|
||||
if (subGroupData != null) {
|
||||
data['sub_group_data'] = subGroupData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class SubGroupData {
|
||||
int? id;
|
||||
String? title;
|
||||
String? subGroupImage;
|
||||
|
||||
SubGroupData({this.id, this.title, this.subGroupImage});
|
||||
|
||||
SubGroupData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
subGroupImage = json['sub_group_image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
data['sub_group_image'] = subGroupImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Certifications {
|
||||
int? id;
|
||||
String? certificationName;
|
||||
String? certificationImage;
|
||||
String? certificationReason;
|
||||
String? certificationDate;
|
||||
int? iamPrincipalXid;
|
||||
|
||||
Certifications(
|
||||
{this.id,
|
||||
this.certificationName,
|
||||
this.certificationImage,
|
||||
this.certificationReason,
|
||||
this.certificationDate,
|
||||
this.iamPrincipalXid});
|
||||
|
||||
Certifications.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
certificationName = json['certification_name'];
|
||||
certificationImage = json['certification_image'];
|
||||
certificationReason = json['certification_reason'];
|
||||
certificationDate = json['certification_date'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['certification_name'] = certificationName;
|
||||
data['certification_image'] = certificationImage;
|
||||
data['certification_reason'] = certificationReason;
|
||||
data['certification_date'] = certificationDate;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,73 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataBus.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataIndi.dart';
|
||||
|
||||
|
||||
GuestGetProfileDataIndi? guestGetProfileInd;
|
||||
GuestGetProfileDataBus? guestGetProfileBus;
|
||||
|
||||
GetGuestFollowers? getguestfollowersobj;
|
||||
GetGuestFollowing? getguestfollowingobj;
|
||||
|
||||
|
||||
class GuestProfileApi {
|
||||
GuestProfileApi();
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> getGuestProfileInd(updata) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getGuestProfileInd}?guest_user_id=$updata",
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
guestGetProfileInd = GuestGetProfileDataIndi.fromJson(response.data);
|
||||
log(guestGetProfileInd!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getGuestProfileBus(updata) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getGuestProfileBus}?guest_user_id=$updata",
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
guestGetProfileBus = GuestGetProfileDataBus.fromJson(response.data);
|
||||
log(guestGetProfileBus!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getGuestfollowers(gestUserid ,guestupdata , {required StreamController<GetGuestFollowers> streamController}) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getGuestfollowers}?guest_user_id=$gestUserid&search=$guestupdata",
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
getguestfollowersobj = GetGuestFollowers.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(getguestfollowersobj!);
|
||||
log(guestGetProfileInd!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getGuestfollowing(gestUserid ,guestupdata , {required StreamController<GetGuestFollowing> streamController}) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getGuestfollowing}?guest_user_id=$gestUserid&search=$guestupdata",
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
getguestfollowingobj = GetGuestFollowing.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(getguestfollowingobj!);
|
||||
log(guestGetProfileInd!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
class GetAccountSessionsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
GetAccountSessionsModel(
|
||||
{this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetAccountSessionsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? deviceName;
|
||||
String? ipAddress;
|
||||
String? country;
|
||||
String? state;
|
||||
String? city;
|
||||
String? zip;
|
||||
String? isp;
|
||||
String? lat;
|
||||
String? lon;
|
||||
String? timezone;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.deviceName,
|
||||
this.ipAddress,
|
||||
this.country,
|
||||
this.state,
|
||||
this.city,
|
||||
this.zip,
|
||||
this.isp,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.timezone});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
deviceName = json['device_name'];
|
||||
ipAddress = json['ip_address'];
|
||||
country = json['country'];
|
||||
state = json['state'];
|
||||
city = json['city'];
|
||||
zip = json['zip'];
|
||||
isp = json['isp'];
|
||||
lat = json['lat'];
|
||||
lon = json['lon'];
|
||||
timezone = json['timezone'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['device_name'] = deviceName;
|
||||
data['ip_address'] = ipAddress;
|
||||
data['country'] = country;
|
||||
data['state'] = state;
|
||||
data['city'] = city;
|
||||
data['zip'] = zip;
|
||||
data['isp'] = isp;
|
||||
data['lat'] = lat;
|
||||
data['lon'] = lon;
|
||||
data['timezone'] = timezone;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
class CertificateuserModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
CertificateuserModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
CertificateuserModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? certificationName;
|
||||
String? certificationImage;
|
||||
String? certificationReason;
|
||||
String? certificationDate;
|
||||
int? iamPrincipalXid;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.certificationName,
|
||||
this.certificationImage,
|
||||
this.certificationReason,
|
||||
this.certificationDate,
|
||||
this.iamPrincipalXid});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
certificationName = json['certification_name'];
|
||||
certificationImage = json['certification_image'];
|
||||
certificationReason = json['certification_reason'];
|
||||
certificationDate = json['certification_date'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['certification_name'] = this.certificationName;
|
||||
data['certification_image'] = this.certificationImage;
|
||||
data['certification_reason'] = this.certificationReason;
|
||||
data['certification_date'] = this.certificationDate;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
class GetEditTimelineModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GetEditTimelineModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetEditTimelineModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<Abilities>? abilities;
|
||||
TimelineData? timelineData;
|
||||
|
||||
Data({this.abilities, this.timelineData});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['abilities'] != null) {
|
||||
abilities = <Abilities>[];
|
||||
json['abilities'].forEach((v) {
|
||||
abilities!.add(new Abilities.fromJson(v));
|
||||
});
|
||||
}
|
||||
timelineData = json['timeline_data'] != null
|
||||
? new TimelineData.fromJson(json['timeline_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.abilities != null) {
|
||||
data['abilities'] = this.abilities!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.timelineData != null) {
|
||||
data['timeline_data'] = this.timelineData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Abilities {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Abilities({this.id, this.name});
|
||||
|
||||
Abilities.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TimelineData {
|
||||
int? id;
|
||||
String? clubName;
|
||||
String? roleName;
|
||||
String? teamName;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
String? abilitiesXids;
|
||||
|
||||
TimelineData(
|
||||
{this.id,
|
||||
this.clubName,
|
||||
this.roleName,
|
||||
this.teamName,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.abilitiesXids});
|
||||
|
||||
TimelineData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
clubName = json['club_name'];
|
||||
roleName = json['role_name'];
|
||||
teamName = json['team_name'];
|
||||
startDate = json['start_date'];
|
||||
endDate = json['end_date'];
|
||||
abilitiesXids = json['abilities_xids'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['club_name'] = this.clubName;
|
||||
data['role_name'] = this.roleName;
|
||||
data['team_name'] = this.teamName;
|
||||
data['start_date'] = this.startDate;
|
||||
data['end_date'] = this.endDate;
|
||||
data['abilities_xids'] = this.abilitiesXids;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
class FaqModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
FaqModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FaqModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? question;
|
||||
String? answer;
|
||||
|
||||
Data({this.id, this.question, this.answer});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
question = json['question'];
|
||||
answer = json['answer'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['question'] = this.question;
|
||||
data['answer'] = this.answer;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
class FollowersModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
FollowersModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FollowersModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? followingIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
Follower? follower;
|
||||
|
||||
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
follower = json['follower'] != null
|
||||
? new Follower.fromJson(json['follower'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.follower != null) {
|
||||
data['follower'] = this.follower!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follower {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
int? principleTypeXid;
|
||||
|
||||
|
||||
Follower({this.id, this.userName, this.fullName, this.profilePhoto, this.principleTypeXid});
|
||||
|
||||
Follower.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
principleTypeXid = json['principal_type_xid'];
|
||||
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
data['principal_type_xid'] = this.principleTypeXid;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
class FollowingModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
FollowingModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FollowingModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? followingIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
Following? following;
|
||||
|
||||
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
following = json['following'] != null
|
||||
? new Following.fromJson(json['following'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.following != null) {
|
||||
data['following'] = this.following!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Following {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
int? principleTypeXid;
|
||||
|
||||
Following(
|
||||
{this.id,
|
||||
this.userName,
|
||||
this.fullName,
|
||||
this.profilePhoto,
|
||||
this.principleTypeXid});
|
||||
|
||||
Following.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
principleTypeXid = json['principal_type_xid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
data['principal_type_xid'] = this.principleTypeXid;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
class PrivacypolicyModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
PrivacypolicyModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
PrivacypolicyModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? content;
|
||||
|
||||
Data({this.id, this.content});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
content = json['content'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['content'] = this.content;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
class TermsConditionsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
TermsConditionsModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
TermsConditionsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? content;
|
||||
|
||||
Data({this.id, this.content});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
content = json['content'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['content'] = this.content;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
class TimelineAbilityListModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
TimelineAbilityListModel(
|
||||
{this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
TimelineAbilityListModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Data({this.id, this.name});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,799 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/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 MyNetwork extends StatefulWidget {
|
||||
const MyNetwork({super.key});
|
||||
|
||||
@override
|
||||
State<MyNetwork> createState() => _MyNetworkState();
|
||||
}
|
||||
|
||||
class _MyNetworkState extends State<MyNetwork> {
|
||||
// var fromMainIndProfile = Get.arguments['From'] ?? '';
|
||||
// MainIndProfile
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "My networks",
|
||||
),
|
||||
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: [
|
||||
sizedBoxHeight(16.h),
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
CommonTabBar(tabs: const [
|
||||
Tab(
|
||||
text: 'Followers',
|
||||
),
|
||||
Tab(
|
||||
text: 'Following',
|
||||
),
|
||||
]),
|
||||
const Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
FollowersTab(),
|
||||
FollowingTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
])),
|
||||
)
|
||||
])
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FollowersTab extends StatefulWidget {
|
||||
const FollowersTab({super.key});
|
||||
|
||||
@override
|
||||
State<FollowersTab> createState() => _FollowersTabState();
|
||||
}
|
||||
|
||||
class _FollowersTabState extends State<FollowersTab> {
|
||||
StreamController<FollowersModel> searchcontroller = StreamController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var updata = "";
|
||||
|
||||
Profilegetmethod().getFollowers(updata, streamController: searchcontroller);
|
||||
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int? blockid;
|
||||
int? removeid;
|
||||
|
||||
RemoveUploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"iam_principal_xid": removeid,
|
||||
};
|
||||
final data = await Profilepostmethod().postRemoveuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("block done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("block not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
BlockUploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"blocked_iam_principal_xid": blockid,
|
||||
};
|
||||
final data = await Profilepostmethod().postBlockuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("block done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("block not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
List followersData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Fit fusion squad",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 37.png",
|
||||
"title": "Power pulse posse",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return
|
||||
// ListView(
|
||||
// scrollDirection: Axis.vertical,
|
||||
// physics: const ScrollPhysics(),
|
||||
// children: [
|
||||
Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.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,
|
||||
),
|
||||
),
|
||||
),
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
Profilegetmethod()
|
||||
.getFollowers(value, streamController: searchcontroller);
|
||||
},
|
||||
hintText: "Search people",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
StreamBuilder<FollowersModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return Expanded(
|
||||
child: Center(child: CircularProgressIndicator()));
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return followersobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: followersobj!.data!.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
followersobj!.data![index].follower!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(RouteName.profiletabindguest,
|
||||
arguments: {
|
||||
"FolloweridIndex": followersobj!
|
||||
.data![index].iamPrincipalXid!,
|
||||
})
|
||||
: Get.toNamed(RouteName.profiletabbusguest,
|
||||
arguments: {
|
||||
"FolloweridIndex": followersobj!
|
||||
.data![index].iamPrincipalXid!,
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
followersobj!.data![index].follower!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
followersobj!.data![index].follower!
|
||||
.profilePhoto!.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
followersobj!.data![index]
|
||||
.follower!.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
followersobj!.data![index].follower!
|
||||
.fullName ==
|
||||
null ||
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.fullName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text16w400_FCFCFC("Regroup")
|
||||
: text16w400_FCFCFC(followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
followersobj!.data![index].follower!
|
||||
.userName ==
|
||||
null ||
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.userName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text12w400_FCFCFC_blur("regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
followersobj!.data![index]
|
||||
.follower!.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor:
|
||||
const Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 176.w),
|
||||
offset: const Offset(0, 20),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
// onTap: () {},
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
removeid = followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.id ??
|
||||
0;
|
||||
followersobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.follower!.id ==
|
||||
removeid);
|
||||
RemoveUploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Remove user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_delete-28-regular.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-regular.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
blockid = followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.id ??
|
||||
0;
|
||||
followersobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.follower!.id ==
|
||||
blockid);
|
||||
BlockUploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Block user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/blocked.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FollowingTab extends StatefulWidget {
|
||||
const FollowingTab({super.key});
|
||||
|
||||
@override
|
||||
State<FollowingTab> createState() => _FollowingTabState();
|
||||
}
|
||||
|
||||
class _FollowingTabState extends State<FollowingTab> {
|
||||
StreamController<FollowingModel> searchcontroller = StreamController();
|
||||
|
||||
List followingData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Fit fusion squad",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 37.png",
|
||||
"title": "Power pulse posse",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
var updata = "";
|
||||
Profilegetmethod().getFollowing(updata, streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"following_iam_principal_xid": unfollowid,
|
||||
};
|
||||
final data = await Profilepostmethod().postunfollowuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("unfollow done");
|
||||
// setState(() {
|
||||
// // Assuming followingobj is a list of items, remove the item with matching user ID
|
||||
// followingobj!.data!.removeWhere((item) => item.following!.id == userid);
|
||||
// });
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("unfollow not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
int? unfollowid;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return
|
||||
// ListView(
|
||||
// physics: const ScrollPhysics(),
|
||||
// scrollDirection: Axis.vertical,
|
||||
// children: [
|
||||
Column(children: [
|
||||
sizedBoxHeight(25.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 people",
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Profilegetmethod()
|
||||
.getFollowing(value, streamController: searchcontroller);
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
StreamBuilder<FollowingModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return Expanded(child: Center(child: CircularProgressIndicator()));
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return followingobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: followingobj!.data!.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return
|
||||
// Column(
|
||||
// children: [
|
||||
// Followinglist(
|
||||
// imagePath: followingobj?.data?[index]
|
||||
// .following?.profilePhoto ??
|
||||
// '',
|
||||
// title: followingobj!
|
||||
// .data?[index].following?.fullName ??
|
||||
// '',
|
||||
// subtitle: followingobj!
|
||||
// .data?[index].following?.userName ??
|
||||
// '',
|
||||
// unfollowontap: (id) => Uploadata(id),
|
||||
// unfollowindex: followingobj!
|
||||
// .data![index].following!.id!,
|
||||
// ),
|
||||
// if (index != followingobj!.data!.length - 1)
|
||||
// commonDivider(),
|
||||
// ],
|
||||
// );
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
followingobj!.data![index].following!
|
||||
.principleTypeXid ==
|
||||
1
|
||||
? Get.toNamed(RouteName.profiletabindguest,
|
||||
arguments: {
|
||||
"FollowingidIndex": followingobj!
|
||||
.data![index]
|
||||
.followingIamPrincipalXid!,
|
||||
})
|
||||
: Get.toNamed(RouteName.profiletabbusguest,
|
||||
arguments: {
|
||||
"FollowingidIndex": followingobj!
|
||||
.data![index]
|
||||
.followingIamPrincipalXid!,
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
followingobj!.data![index].following!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
followingobj!.data![index].following!
|
||||
.profilePhoto!.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: const AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
followingobj!.data![index]
|
||||
.following!.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
followingobj!.data![index].following!
|
||||
.fullName ==
|
||||
null ||
|
||||
followingobj!.data![index]
|
||||
.following!.fullName!.isEmpty
|
||||
? text16w400_FCFCFC("Regroup")
|
||||
: text16w400_FCFCFC(followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
followingobj!.data![index].following!
|
||||
.userName ==
|
||||
null ||
|
||||
followingobj!.data![index]
|
||||
.following!.userName!.isEmpty
|
||||
? text12w400_FCFCFC_blur("regroup")
|
||||
: text12w400_FCFCFC_blur(followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.userName!)
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: const Color(0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints.tightFor(width: 176.w),
|
||||
offset: const Offset(0, 20),
|
||||
color: const Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
unfollowid = followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.id ??
|
||||
0;
|
||||
// followingobj!.data!.removeAt(index);
|
||||
followingobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.following!.id ==
|
||||
unfollowid);
|
||||
Uploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Unfollow user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black1323e.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-22.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class AccountSession extends StatefulWidget {
|
||||
const AccountSession({super.key});
|
||||
|
||||
@override
|
||||
State<AccountSession> createState() => _AccountSessionState();
|
||||
}
|
||||
|
||||
class _AccountSessionState extends State<AccountSession> {
|
||||
List sessionData = [
|
||||
"london, United Kingdom",
|
||||
"Elm street london, United Kingdom",
|
||||
"Elm street london, United Kingdom"
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Account sessions",
|
||||
),
|
||||
body:
|
||||
FutureBuilder(
|
||||
future: Profilegetmethod().getAccountSessions(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return accountsessionobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return
|
||||
|
||||
Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text18w400white("Last login sessions"),
|
||||
sizedBoxHeight(16.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const ScrollPhysics(),
|
||||
itemCount: accountsessionobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
final city = accountsessionobj!.data![index].city;
|
||||
final state = accountsessionobj!.data![index].state;
|
||||
final country = accountsessionobj!.data![index].country;
|
||||
|
||||
// Combine city, state, and country
|
||||
final locationTitle = '$city, $state, $country';
|
||||
return sessionCard(
|
||||
title: locationTitle,
|
||||
devicename: accountsessionobj!.data![index].deviceName!,
|
||||
ipaddress: accountsessionobj!.data![index].ipAddress!
|
||||
|
||||
);
|
||||
},
|
||||
)
|
||||
]),
|
||||
)
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
Widget sessionCard({required String title, required String devicename, required String ipaddress}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 90.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 25.w,
|
||||
height: 25.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 13.h,
|
||||
width: 9.w,
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxWidth(10.w),
|
||||
text16400white(title),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
text14400whiteblur(devicename),
|
||||
sizedBoxWidth(6.w),
|
||||
Icon(
|
||||
Icons.circle,
|
||||
size: 7.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text144005DFD63(ipaddress.toString())
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class AccountSettings extends StatefulWidget {
|
||||
const AccountSettings({super.key});
|
||||
|
||||
@override
|
||||
State<AccountSettings> createState() => _AccountSettingsState();
|
||||
}
|
||||
|
||||
class _AccountSettingsState extends State<AccountSettings> {
|
||||
// bool swichvalue = false;
|
||||
|
||||
String? accountTypeValue;
|
||||
String? accounTypeLogin;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setValues();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
setValues() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// Update state variables and trigger UI update with setState
|
||||
setState(() {
|
||||
accounTypeLogin = prefs.getString('accountTypefromLogin');
|
||||
print('account type login is $accounTypeLogin');
|
||||
accountTypeValue = prefs.getString('accountTypeValue');
|
||||
// print('account type value is $accountTypeValue');
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> UploadData() async {
|
||||
print("upload data called");
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
int? accountype ;
|
||||
if (accountvisibility == false) {
|
||||
accountype = 0;
|
||||
}
|
||||
else if (accountvisibility == true) {
|
||||
accountype = 1;
|
||||
}
|
||||
Map<String, dynamic> updata = {
|
||||
"is_account_visibility": accountype,
|
||||
};
|
||||
|
||||
final data = await Profilepostmethod().postAccountvisibility(updata);
|
||||
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
String? accountype;
|
||||
|
||||
accountype = prefs.getString('accountTypefromLogin');
|
||||
|
||||
if (accountype == "1") {
|
||||
EditProfileApi()
|
||||
.getEditProfileIndividual();
|
||||
}
|
||||
else if (accountype == "2") {
|
||||
EditProfileApi()
|
||||
.getEditProfileBusiness();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Account settings",
|
||||
),
|
||||
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),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text18w700_FCFCFC("Sign in & security"),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
accounTypeLogin == '1'
|
||||
?
|
||||
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
"assets/images/png/eyeIcon.png",
|
||||
height: 21.h,
|
||||
width: 21.w,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16w400_FCFCFC("Account visibility"),
|
||||
Spacer(),
|
||||
Transform.scale(
|
||||
scale: 0.9,
|
||||
child: CupertinoSwitch(
|
||||
value: accountvisibility,
|
||||
trackColor: Colors.white.withOpacity(0.4),
|
||||
activeColor: Color(0xFF34C759),
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
accountvisibility = value;
|
||||
UploadData();
|
||||
|
||||
// swichvalue = value ?? false;
|
||||
});
|
||||
}))
|
||||
]),
|
||||
),
|
||||
commonDivider(),
|
||||
],
|
||||
)
|
||||
: SizedBox(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.changepassword);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/BlackPass.png",
|
||||
text: "Change password"),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.accaountsession);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/clock.png",
|
||||
text: "Account sessions"),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.blockedusers);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/blocked.png",
|
||||
text: "Blocked users"),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.deleteaccount);
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
"assets/images/png/deleteIcon (2).png",
|
||||
height: 21.h,
|
||||
width: 21.w,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16w400_FF0000("Delete account"),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String imagePath,
|
||||
required String text,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
imagePath,
|
||||
height: 21.h,
|
||||
width: 21.w,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/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 ChangePassword extends StatefulWidget {
|
||||
const ChangePassword({super.key});
|
||||
|
||||
@override
|
||||
State<ChangePassword> createState() => _ChangePasswordState();
|
||||
}
|
||||
|
||||
class _ChangePasswordState extends State<ChangePassword> {
|
||||
TextEditingController currentpasscontroller = TextEditingController();
|
||||
TextEditingController newpasscontroller = TextEditingController();
|
||||
TextEditingController repeatpasscontroller = TextEditingController();
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpasscontroller.text,
|
||||
"new_password": newpasscontroller.text,
|
||||
"confirm_password": repeatpasscontroller.text,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("Change pass up done");
|
||||
|
||||
Get.toNamed(RouteName.verifycode,
|
||||
arguments: {
|
||||
"currentpass" : currentpasscontroller.text,
|
||||
"newpass" : newpasscontroller.text,
|
||||
"confirmpass" : repeatpasscontroller.text
|
||||
}
|
||||
);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Change password",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Current password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: currentpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("New password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: newpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Repeat password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: repeatpasscontroller,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (val != newpasscontroller.text) {
|
||||
return 'Password does not match';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(
|
||||
text: "Verify",
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.verifycode);
|
||||
if (currentpasscontroller.text.isBlank! &&
|
||||
newpasscontroller.text.isBlank! &&
|
||||
repeatpasscontroller.text.isBlank!) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
Uploadata();
|
||||
|
||||
}
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
import '../../../../Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
class ContactUs extends StatefulWidget {
|
||||
const ContactUs({super.key});
|
||||
|
||||
@override
|
||||
State<ContactUs> createState() => _ContactUsState();
|
||||
}
|
||||
|
||||
class _ContactUsState extends State<ContactUs> {
|
||||
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
|
||||
TextEditingController fullname = TextEditingController();
|
||||
TextEditingController email = TextEditingController();
|
||||
TextEditingController querycontroller = TextEditingController();
|
||||
|
||||
String _selectedreasontocontact = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedreasontocontact = value;
|
||||
});
|
||||
}
|
||||
|
||||
uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"full_name": fullname.text,
|
||||
"email": email.text,
|
||||
"reason_to_contact": _selectedreasontocontact,
|
||||
"query": querycontroller.text
|
||||
};
|
||||
final data = await Profilepostmethod().postContactus(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
Get.back();
|
||||
print("contact us done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("contact us not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Contact us",
|
||||
),
|
||||
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(horizontal: 16),
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formkey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Full name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: "Enter full name",
|
||||
textEditingController: fullname,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Email address"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: SizedBox(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your e-mail address';
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||
.hasMatch(value)) {
|
||||
return 'Enter a valid e-mail address';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
textEditingController: email,
|
||||
hintText: "Enter email address",
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Reason to contact"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: const [
|
||||
"Feature suggestion",
|
||||
"Issues with app",
|
||||
"Scoreboard",
|
||||
"Feedback"
|
||||
],
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/fluent_person-support-20-regular.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter query",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
textEditingController: querycontroller,
|
||||
),
|
||||
CustomButton(
|
||||
onPressed: () {
|
||||
// final isValid =
|
||||
// _formkey.currentState?.validate();
|
||||
if (fullname.text.isBlank! ||
|
||||
email.text.isBlank! ||
|
||||
querycontroller.text.isBlank! ||
|
||||
_selectedreasontocontact.isEmpty) {
|
||||
utils.showToast("Please fill all fields");
|
||||
} else {
|
||||
uploadata();
|
||||
}
|
||||
},
|
||||
text: "Send")
|
||||
]),
|
||||
),
|
||||
))
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/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';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class DeleteAccount extends StatefulWidget {
|
||||
const DeleteAccount({super.key});
|
||||
|
||||
@override
|
||||
State<DeleteAccount> createState() => _DeleteAccountState();
|
||||
}
|
||||
|
||||
class _DeleteAccountState extends State<DeleteAccount> {
|
||||
TextEditingController leavingcontroller = TextEditingController();
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"reason": leavingcontroller.text,
|
||||
};
|
||||
final data = await Profilepostmethod().postDeleteaccount(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("delete done");
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove('access-token');
|
||||
await prefs.remove('fullname');
|
||||
await prefs.remove('username');
|
||||
await prefs.remove('email');
|
||||
await prefs.remove('phone');
|
||||
await prefs.remove('accountTypefromLogin');
|
||||
await prefs.remove('principal_xid');
|
||||
await prefs.remove('accountTypeValue');
|
||||
|
||||
await prefs.clear();
|
||||
|
||||
Get.offNamed(RouteName.loginScreen);
|
||||
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("delete not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
// resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
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(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text20400white("Sad to see you go"),
|
||||
sizedBoxHeight(16.h),
|
||||
Image.asset(
|
||||
"assets/images/png/Frame 1.png",
|
||||
height: 119.h,
|
||||
width: 119.w,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
SizedBox(
|
||||
width: 311.w,
|
||||
child: text16400white(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type ",
|
||||
textAlign: TextAlign.center),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text18w400white("Tell us why you are leaving ?"),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter why are you leaving",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
textEditingController: leavingcontroller,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CommonBtn(
|
||||
text: "I don’t want to delete",
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(18.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (leavingcontroller.text.isBlank!) {
|
||||
utils.showToast('Please tell us why are you leaving');
|
||||
} else {
|
||||
Uploadata();
|
||||
}
|
||||
},
|
||||
child: text16400white(
|
||||
"Yes I am ready to delete my account")),
|
||||
]),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class FaqScreen extends StatefulWidget {
|
||||
const FaqScreen({super.key});
|
||||
|
||||
@override
|
||||
State<FaqScreen> createState() => _FaqScreenState();
|
||||
}
|
||||
|
||||
class _FaqScreenState extends State<FaqScreen> {
|
||||
late RxList<bool> isExpandedList;
|
||||
late Future myfuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// myfuture = Profilegetmethod().getfaqs().then((value) {
|
||||
// isExpandedList =
|
||||
// RxList.generate(faqobj!.data!.length, (index) => index == 0);
|
||||
// });
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void toggleExpansion(int index) {
|
||||
isExpandedList[index] = !isExpandedList[index];
|
||||
}
|
||||
|
||||
List<Map<String, String>> faqcard = [
|
||||
{
|
||||
'title': 'How can I get started with the application?',
|
||||
'content':
|
||||
"Getting started is easy! Simply download the app from the App Store or Google Play Store, create an account, set up your profile, and you're ready to explore all the features the app has to offer."
|
||||
},
|
||||
{
|
||||
'title': 'How can I get started with the application?',
|
||||
'content':
|
||||
"Getting started is easy! Simply download the app from the App Store or Google Play Store, create an account, set up your profile, and you're ready to explore all the features the app has to offer."
|
||||
},
|
||||
{
|
||||
'title': 'How can I get started with the application?',
|
||||
'content':
|
||||
"Getting started is easy! Simply download the app from the App Store or Google Play Store, create an account, set up your profile, and you're ready to explore all the features the app has to offer."
|
||||
},
|
||||
{
|
||||
'title': 'How can I get started with the application?',
|
||||
'content':
|
||||
"Getting started is easy! Simply download the app from the App Store or Google Play Store, create an account, set up your profile, and you're ready to explore all the features the app has to offer."
|
||||
},
|
||||
{
|
||||
'title': 'How can I get started with the application?',
|
||||
'content':
|
||||
"Getting started is easy! Simply download the app from the App Store or Google Play Store, create an account, set up your profile, and you're ready to explore all the features the app has to offer."
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
resizeToAvoidBottomInset: false,
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "FAQ’s",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: Profilegetmethod().getFaqs(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Color(0xFFC18948),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
isExpandedList =
|
||||
RxList.generate(faqobj!.data!.length, (index) => index == 0);
|
||||
return faqobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
controller: ScrollController(),
|
||||
shrinkWrap: true,
|
||||
itemCount: faqobj!.data!.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Obx(
|
||||
() {
|
||||
return customExpandableItem(
|
||||
isExpanded: isExpandedList[index],
|
||||
title: faqobj!.data![index].question ?? '',
|
||||
content: faqobj!.data![index].answer ?? '',
|
||||
toggleExpansion: () => toggleExpansion(index),
|
||||
);
|
||||
},
|
||||
);
|
||||
})
|
||||
]))))
|
||||
]);
|
||||
}
|
||||
|
||||
Widget customExpandableItem({
|
||||
required bool isExpanded,
|
||||
required String title,
|
||||
required String content,
|
||||
required VoidCallback toggleExpansion,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.h),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: isExpanded ? 250.h : 82.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: text16w700_FCFCFC(title)),
|
||||
GestureDetector(
|
||||
onTap: toggleExpansion,
|
||||
child: Icon(
|
||||
isExpanded
|
||||
? Icons.keyboard_arrow_up_outlined
|
||||
: Icons.keyboard_arrow_down_outlined,
|
||||
color: Colors.white,
|
||||
size: 25.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (isExpanded)
|
||||
Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text14400whiteblur(content)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class HelpAndSupport extends StatefulWidget {
|
||||
const HelpAndSupport({super.key});
|
||||
|
||||
@override
|
||||
State<HelpAndSupport> createState() => _HelpAndSupportState();
|
||||
}
|
||||
|
||||
class _HelpAndSupportState extends State<HelpAndSupport> {
|
||||
String? accountTypeValue;
|
||||
String? accounTypeLogin;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setValues();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
setValues() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// Update state variables and trigger UI update with setState
|
||||
setState(() {
|
||||
accounTypeLogin = prefs.getString('accountTypefromLogin');
|
||||
print('account type login is $accounTypeLogin');
|
||||
accountTypeValue = prefs.getString('accountTypeValue');
|
||||
// print('account type value is $accountTypeValue');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Help & Support",
|
||||
),
|
||||
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),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.faqscreen);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/Vectorftt.png",
|
||||
text: "FAQ",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.contactUs);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath:
|
||||
"assets/images/png/fluent_person-support-20-regular.png",
|
||||
text: "Contact us",
|
||||
),
|
||||
),
|
||||
accounTypeLogin == '1'
|
||||
? Column(
|
||||
children: [
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.reportabug);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/codicon_bug.png",
|
||||
text: "Report a bug",
|
||||
),
|
||||
),
|
||||
])
|
||||
: SizedBox(),
|
||||
],
|
||||
))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String imagePath,
|
||||
required String text,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
imagePath,
|
||||
height: 21.h,
|
||||
width: 21.w,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
class FetchBlockedUser {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
FetchBlockedUser({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FetchBlockedUser.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
data['status_code'] = this.statusCode;
|
||||
data['message'] = this.message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? blockedIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
BlockedProfile? blockedProfile;
|
||||
|
||||
Data(
|
||||
{this.blockedIamPrincipalXid, this.iamPrincipalXid, this.blockedProfile});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
blockedIamPrincipalXid = json['blocked_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
blockedProfile = json['blocked_profile'] != null
|
||||
? new BlockedProfile.fromJson(json['blocked_profile'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['blocked_iam_principal_xid'] = this.blockedIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.blockedProfile != null) {
|
||||
data['blocked_profile'] = this.blockedProfile!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class BlockedProfile {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
|
||||
BlockedProfile({this.id, this.userName, this.fullName, this.profilePhoto});
|
||||
|
||||
BlockedProfile.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
class FetchNotification {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
FetchNotification({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FetchNotification.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? groupNotification;
|
||||
int? communityNotification;
|
||||
int? followerNotification;
|
||||
int? newFollowerNotification;
|
||||
int? directMessageNotification;
|
||||
|
||||
Data(
|
||||
{this.groupNotification,
|
||||
this.communityNotification,
|
||||
this.followerNotification,
|
||||
this.newFollowerNotification,
|
||||
this.directMessageNotification});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
groupNotification = json['group_notification'];
|
||||
communityNotification = json['community_notification'];
|
||||
followerNotification = json['follower_notification'];
|
||||
newFollowerNotification = json['new_follower_notification'];
|
||||
directMessageNotification = json['direct_message_notification'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['group_notification'] = groupNotification;
|
||||
data['community_notification'] = communityNotification;
|
||||
data['follower_notification'] = followerNotification;
|
||||
data['new_follower_notification'] = newFollowerNotification;
|
||||
data['direct_message_notification'] = directMessageNotification;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class PrivacyPolicy extends StatefulWidget {
|
||||
const PrivacyPolicy({super.key});
|
||||
|
||||
@override
|
||||
State<PrivacyPolicy> createState() => _PrivacyPolicyState();
|
||||
}
|
||||
|
||||
class _PrivacyPolicyState extends State<PrivacyPolicy> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Privacy policy",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: Profilegetmethod().getPrivacypolicy(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return privacyobj!.data!.isBlank!
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
|
||||
Html(
|
||||
data: privacyobj!.data!.content,
|
||||
// style: {
|
||||
// "html": Style(
|
||||
// color: Colors.white,
|
||||
// fontFamily: "Poppins",
|
||||
// fontSize: FontSize(18.sp),
|
||||
// fontWeight: FontWeight.w700,
|
||||
// ),
|
||||
// },
|
||||
style: {
|
||||
"html": Style(
|
||||
color: Colors.white, // Text color
|
||||
fontFamily: "Poppins", // Font family
|
||||
fontSize: FontSize(18), // Font size
|
||||
fontWeight: FontWeight.w700, // Font weight
|
||||
),
|
||||
"p": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(18.sp),
|
||||
fontWeight: FontWeight.w500),
|
||||
"a": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(18.sp),
|
||||
fontWeight: FontWeight.w500
|
||||
// Link color
|
||||
),
|
||||
},
|
||||
)
|
||||
// text18w700white(
|
||||
// "Regroup is a community where everyone can belong"),
|
||||
// sizedBoxHeight(20.h),
|
||||
// text16400whiteblur(
|
||||
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
|
||||
// sizedBoxHeight(20.h),
|
||||
// text16400whiteblur(
|
||||
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
||||
]),
|
||||
),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,268 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class ReportABug extends StatefulWidget {
|
||||
const ReportABug({super.key});
|
||||
|
||||
@override
|
||||
State<ReportABug> createState() => _ReportABugState();
|
||||
}
|
||||
|
||||
class _ReportABugState extends State<ReportABug> {
|
||||
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
|
||||
TextEditingController deviceoscontroller = TextEditingController();
|
||||
TextEditingController versionoscontroller = TextEditingController();
|
||||
TextEditingController emailcontroller = TextEditingController();
|
||||
TextEditingController querycontroller = TextEditingController();
|
||||
|
||||
String _selectedreasontocontact = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedreasontocontact = value;
|
||||
});
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"device": deviceoscontroller.text,
|
||||
"version": versionoscontroller.text,
|
||||
"email": emailcontroller.text,
|
||||
"reason_to_contact": _selectedreasontocontact,
|
||||
"query": querycontroller.text,
|
||||
};
|
||||
final data = await Profilepostmethod().postReportandbug(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
Get.back();
|
||||
print("report done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("report not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Report a bug",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Form(
|
||||
key: _formkey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Device OS"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/VectorDevice.png",
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your device os';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
hintText: "Enter decice os",
|
||||
textEditingController: deviceoscontroller,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("OS version"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/setting2.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your os version';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
hintText: "Enter os verison",
|
||||
textEditingController: versionoscontroller,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Email address"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 24.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12.png",
|
||||
height: 17.h,
|
||||
width: 22.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your e-mail address';
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||
.hasMatch(value)) {
|
||||
return 'Enter a valid e-mail address';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
textEditingController: emailcontroller,
|
||||
hintText: "Enter email address",
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Reason to contact"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: [
|
||||
"Messaging",
|
||||
"Crashes",
|
||||
"Constant logout",
|
||||
"Unable to view post"
|
||||
],
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/codicon_bug.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
showOtherOption: true,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter query",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
textEditingController: querycontroller,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
onPressed: () {
|
||||
if (deviceoscontroller.text.isBlank! &&
|
||||
versionoscontroller.text.isBlank! &&
|
||||
querycontroller.text.isBlank! &&
|
||||
emailcontroller.text.isBlank! &&
|
||||
_selectedreasontocontact.isEmpty) {
|
||||
utils.showToast("Please fill all fields");
|
||||
} else {
|
||||
Uploadata();
|
||||
}
|
||||
},
|
||||
text: "Send")
|
||||
]),
|
||||
),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,268 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.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/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class Settings extends StatefulWidget {
|
||||
const Settings({super.key});
|
||||
|
||||
@override
|
||||
State<Settings> createState() => _SettingsState();
|
||||
}
|
||||
|
||||
class _SettingsState extends State<Settings> {
|
||||
String? accountTypeValue;
|
||||
String? accounTypeLogin;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setValues();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
setValues() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// Update state variables and trigger UI update with setState
|
||||
setState(() {
|
||||
accounTypeLogin = prefs.getString('accountTypefromLogin');
|
||||
print('account type login is $accounTypeLogin');
|
||||
accountTypeValue = prefs.getString('accountTypeValue');
|
||||
print('account type value is $accountTypeValue');
|
||||
});
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
final data = await Profilepostmethod().postLogoutaccount();
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("delete done");
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove('access-token');
|
||||
await prefs.remove('fullname');
|
||||
await prefs.remove('username');
|
||||
await prefs.remove('email');
|
||||
await prefs.remove('phone');
|
||||
await prefs.remove('accountTypefromLogin');
|
||||
await prefs.remove('principal_xid');
|
||||
await prefs.remove('accountTypeValue');
|
||||
|
||||
await prefs.clear();
|
||||
|
||||
Get.offNamed(RouteName.loginScreen);
|
||||
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("delete not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Settings",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.accountsettings);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/codicon_account.png",
|
||||
text: "Account settings",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.notifications);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/Frame 9.png",
|
||||
text: "Notification settings",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
accounTypeLogin == '1'
|
||||
? Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.editProfile);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/edit 1.png",
|
||||
text: "Edit profile",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
],
|
||||
)
|
||||
: SizedBox(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.helpandsupport);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath:
|
||||
"assets/images/png/fluent_person-support-20-regular.png",
|
||||
text: "Help & support",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.privacypolicy);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/iconoir_privacy-policy.png",
|
||||
text: "Privacy policy",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.termscondition);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/Vector (5)1.png",
|
||||
text: "Terms & condition",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
accounTypeLogin == '1'
|
||||
? SizedBox()
|
||||
: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.reportabug);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/codicon_bug.png",
|
||||
text: "Report a bug",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/Vector (6).png",
|
||||
text: "Logout",
|
||||
),
|
||||
),
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String imagePath,
|
||||
required String text,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
imagePath,
|
||||
height: 21.h,
|
||||
width: 21.w,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
dialogwidget() {
|
||||
Get.dialog(Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 200.h,
|
||||
borderradius: 14,
|
||||
opacity1: 0.09,
|
||||
opacity2: 0.13,
|
||||
border: 0.8,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w400_FCFCFC(
|
||||
"Are you sure you want to logout of Regroup community?",
|
||||
textAlign: TextAlign.center),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// SharedPreferences prefs =
|
||||
// await SharedPreferences.getInstance();
|
||||
// await prefs.clear();
|
||||
// Get.offAllNamed(RouteName.loginScreen);
|
||||
Uploadata();
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 130.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget:
|
||||
Center(child: text14400white("Yes, I want to")),
|
||||
border: 1),
|
||||
),
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 130.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text14400white("Keep using App")),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
|
||||
class TermsCondition extends StatefulWidget {
|
||||
const TermsCondition({super.key});
|
||||
|
||||
@override
|
||||
State<TermsCondition> createState() => _TermsConditionState();
|
||||
}
|
||||
|
||||
class _TermsConditionState extends State<TermsCondition> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "Terms & Condition",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: Profilegetmethod().getTermsConditions(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return termsobj!.data!.isBlank!
|
||||
? _buildNoDataBody(context)
|
||||
: _buildBody(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(context) {
|
||||
return Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Html(
|
||||
data: termsobj!.data!.content,
|
||||
style: {
|
||||
"html": Style(
|
||||
color: Colors.white, // Text color
|
||||
fontFamily: "Poppins", // Font family
|
||||
fontSize: FontSize(18), // Font size
|
||||
fontWeight: FontWeight.w700, // Font weight
|
||||
),
|
||||
"p": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(18.sp),
|
||||
fontWeight: FontWeight.w500),
|
||||
"a": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(18.sp),
|
||||
fontWeight: FontWeight.w500
|
||||
// Link color
|
||||
),
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,381 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Global.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:timer_button/timer_button.dart';
|
||||
|
||||
class VerifyCode extends StatefulWidget {
|
||||
const VerifyCode({super.key});
|
||||
|
||||
@override
|
||||
State<VerifyCode> createState() => _VerifyCodeState();
|
||||
}
|
||||
|
||||
class _VerifyCodeState extends State<VerifyCode> {
|
||||
TextEditingController pincodeController = TextEditingController();
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
String currentpassword = Get.arguments['currentpass'];
|
||||
String newpassword = Get.arguments['newpass'];
|
||||
String confirmpassword = Get.arguments['confirmpass'];
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"otp": pincodeController.text,
|
||||
"new_password": newpassword,
|
||||
};
|
||||
// final data = res
|
||||
final res = await Profilepostmethod().postChangepassverifyotp(updata);
|
||||
if (res.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("verification done");
|
||||
|
||||
Get.back();
|
||||
Get.back();
|
||||
|
||||
return utils.showToast(res.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
Uploadataresendotp() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpassword,
|
||||
"new_password": newpassword,
|
||||
"confirm_password": confirmpassword,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("otp done");
|
||||
|
||||
setState(() {
|
||||
pincodeController.clear();
|
||||
// turnValidation = false;
|
||||
});
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("otp not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF222935),
|
||||
appBar: CommonAppbar(titleTxt: ""),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text20700white("Check your email"),
|
||||
sizedBoxHeight(10.h),
|
||||
text14400whiteblur(
|
||||
"Enter the verification code that we sent to $emailid"),
|
||||
sizedBoxHeight(30.h),
|
||||
text16400white("Enter code"),
|
||||
sizedBoxHeight(20.h),
|
||||
PinCodeTextField(
|
||||
validator: (value) {
|
||||
if (value != null && value.isEmpty) {
|
||||
return "Please Enter verification code";
|
||||
} else if (value != null && value.length < 4) {
|
||||
return "OTP length should be at least 4";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
length: 4,
|
||||
obscureText: false,
|
||||
animationType: AnimationType.fade,
|
||||
pinTheme: PinTheme(
|
||||
selectedFillColor: Color(0xFF434A53),
|
||||
inactiveFillColor: Color(0xFF434A53),
|
||||
inactiveColor: Color(0xFF434A53),
|
||||
activeColor: Color(0xFF434A53),
|
||||
selectedColor: Color(0xFF434A53),
|
||||
shape: PinCodeFieldShape.underline,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
fieldHeight: 70,
|
||||
fieldWidth: 70,
|
||||
activeFillColor:
|
||||
// Colors.white
|
||||
Color(0xFF303030).withOpacity(0.4),
|
||||
// textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size
|
||||
),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
enableActiveFill: true,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
controller: pincodeController,
|
||||
onCompleted: (v) {
|
||||
print("Completed");
|
||||
},
|
||||
onChanged: (value) {
|
||||
print(value);
|
||||
setState(() {
|
||||
// currentText = value;
|
||||
});
|
||||
},
|
||||
cursorColor: Colors.white,
|
||||
textStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
beforeTextPaste: (text) {
|
||||
print("Allowing to paste $text");
|
||||
return true;
|
||||
},
|
||||
appContext: context,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Center(
|
||||
child: TimerButton(
|
||||
disabledTextStyle: TextStyle(color: Colors.red),
|
||||
activeTextStyle: TextStyle(color: Colors.white),
|
||||
disabledColor: Color(0XFF222935).withOpacity(0.10),
|
||||
buttonType: ButtonType.textButton,
|
||||
label: "Resend OTP",
|
||||
timeOutInSeconds: 6,
|
||||
//mobile.text.isEmpty ? 1 : 60,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
Uploadataresendotp();
|
||||
});
|
||||
},
|
||||
// disabledColor: Colors.white,
|
||||
color: Color(0XFF222935).withOpacity(0.10),
|
||||
),
|
||||
),
|
||||
// ),
|
||||
sizedBoxHeight(70.h),
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
if (pincodeController.text.isEmpty) {
|
||||
utils.showToast("Pin field is empty");
|
||||
} else if (pincodeController.text.length < 4) {
|
||||
utils.showToast("OTP length should be 4 digits");
|
||||
} else {
|
||||
Uploadata();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class CustomPinCodeField extends StatefulWidget {
|
||||
// final TextEditingController controller;
|
||||
// final ValueChanged<String> onChanged;
|
||||
// final ValueChanged<String> onCompleted;
|
||||
|
||||
// CustomPinCodeField({
|
||||
// required this.controller,
|
||||
// required this.onChanged,
|
||||
// required this.onCompleted,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// _CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||
// }
|
||||
|
||||
// class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
// late List<TextEditingController> _controllers;
|
||||
// late List<FocusNode> _focusNodes;
|
||||
// String _currentText = "";
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _controllers = List.generate(4, (_) => TextEditingController());
|
||||
// _focusNodes = List.generate(4, (_) => FocusNode());
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _controllers.forEach((controller) => controller.dispose());
|
||||
// _focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
// String? _validate(int index) {
|
||||
// if (_controllers[index].text.isEmpty) {
|
||||
// return "Please enter verification code";
|
||||
// } else if (_controllers[index].text.length > 1) {
|
||||
// return "Please enter only one digit";
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// void _onChanged(String value, int index) {
|
||||
// setState(() {
|
||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
||||
// });
|
||||
|
||||
// if (value.isNotEmpty) {
|
||||
// if (index < _controllers.length - 1) {
|
||||
// FocusScope.of(context).nextFocus();
|
||||
// } else {
|
||||
// // Last field, trigger onCompleted directly
|
||||
// if (_currentText.length == _controllers.length) {
|
||||
// widget.onCompleted(_currentText);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// // Empty value, focus to previous field if not the first field
|
||||
// if (index > 0) {
|
||||
// FocusScope.of(context).previousFocus();
|
||||
// }
|
||||
// }
|
||||
// widget.onChanged(_currentText);
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Form(
|
||||
// key: _formKey,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// commonGlassContainer(
|
||||
// width: double.infinity,
|
||||
// height: 50.h,
|
||||
// borderradius: 30.r,
|
||||
// border: 1,
|
||||
// customWidget: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: List.generate(4, (index) {
|
||||
// return Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Center(
|
||||
// child: Container(
|
||||
// width: 30,
|
||||
// height: 40,
|
||||
// child: Center(
|
||||
// child: TextFormField(
|
||||
// controller: _controllers[index],
|
||||
// focusNode: _focusNodes[index],
|
||||
// keyboardType: TextInputType.number,
|
||||
// inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(
|
||||
// RegExp('[0-9]')),
|
||||
// LengthLimitingTextInputFormatter(1),
|
||||
// ],
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 20,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// decoration: InputDecoration(
|
||||
// border: InputBorder.none,
|
||||
// errorStyle: TextStyle(height: 0),
|
||||
// ),
|
||||
// onChanged: (value) => _onChanged(value, index),
|
||||
// validator: (value) => _validate(index),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// if (index != 3)
|
||||
// Container(
|
||||
// width: 12,
|
||||
// height: 2,
|
||||
// color: Colors.white,
|
||||
// margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
// sizedBoxHeight(10.h),
|
||||
// Text(
|
||||
// _validateErrors(),
|
||||
// style: TextStyle(color: Colors.red),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
// String _validateErrors() {
|
||||
// for (int i = 0; i < _controllers.length; i++) {
|
||||
// String? error = _validate(i);
|
||||
// if (error != null) {
|
||||
// return error;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Check if OTP length is less than 4
|
||||
// if (_currentText.length < 4) {
|
||||
// return "OTP length should be 4 digits";
|
||||
// }
|
||||
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// // String _validateErrors() {
|
||||
// // List<String> errors = [];
|
||||
|
||||
// // // Validate each TextFormField
|
||||
// // for (int i = 0; i < _controllers.length; i++) {
|
||||
// // String? error = _validate(i);
|
||||
// // if (error != null && !errors.contains(error)) {
|
||||
// // errors.add(error);
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // // Check OTP length only if there are no other errors
|
||||
// // if (errors.isEmpty && _currentText.length < 4) {
|
||||
// // errors.add("OTP length should be 4 digits");
|
||||
// // }
|
||||
|
||||
// // // Return concatenated error messages
|
||||
// // return errors.isNotEmpty ? errors.join("\n") : "";
|
||||
// // }
|
||||
// }
|
||||
@@ -1,550 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
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';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.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';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class BlockedUsers extends StatefulWidget {
|
||||
const BlockedUsers({super.key});
|
||||
|
||||
@override
|
||||
State<BlockedUsers> createState() => _BlockedUsersState();
|
||||
}
|
||||
|
||||
class _BlockedUsersState extends State<BlockedUsers> {
|
||||
List blockedUserData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg1.png",
|
||||
"title": "Ryan Dorwart",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg2.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg3.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"title": "Kianna Donin",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Maria Herwitz",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
// late Future myfuture;
|
||||
double? blockedXid;
|
||||
|
||||
StreamController<FetchBlockedUser> searchcontroller = StreamController();
|
||||
|
||||
unblockDone(int index) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt('blockedprincipalxid',
|
||||
fetchblockuserobj!.data![index].blockedIamPrincipalXid!);
|
||||
blockedXid = prefs.getInt('blockedprincipalxid')!.toDouble();
|
||||
Map<String, String> updata = {
|
||||
"blocked_iam_principal_xid": blockedXid.toString(),
|
||||
};
|
||||
final resp = await BlockUserAPI().postBlockApi(updata);
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'Unblock user successfully',
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// utils.showToast('Unblock user successfully');
|
||||
|
||||
setState(() {
|
||||
fetchblockuserobj!.data!.removeAt(index);
|
||||
});
|
||||
print('success');
|
||||
} else {
|
||||
// btnController.error();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
resp.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var updata = "";
|
||||
// myfuture = BlockUserAPI().fetchBlockUser();
|
||||
BlockUserAPI().getBlockedusers(updata, streamController: searchcontroller);
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Blocked 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(25.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 people",
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
BlockUserAPI().getBlockedusers(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
|
||||
// Expanded(
|
||||
// child: ListView.builder(
|
||||
// shrinkWrap: true,
|
||||
// itemCount: fetchblockuser!.data!.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return Column(
|
||||
// children: [
|
||||
// blockedUser(
|
||||
// imagePath: fetchblockuser!.data![index]
|
||||
// .blockedProfile!.profilePhoto ??
|
||||
// '',
|
||||
// title: fetchblockuser!.data![index]
|
||||
// .blockedProfile!.fullName ??
|
||||
// '',
|
||||
// subtitle: fetchblockuser!.data![index]
|
||||
// .blockedProfile!.userName ??
|
||||
// '',
|
||||
// index: index),
|
||||
// // blockedUser(
|
||||
// // imagePath: blockedUserData[index]
|
||||
// // ["imagePath"],
|
||||
// // title: blockedUserData[index]["title"],
|
||||
// // subtitle: blockedUserData[index]
|
||||
// // ["subtitle"]),
|
||||
// if (index != fetchblockuser!.data!.length - 1)
|
||||
// commonDivider(),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
StreamBuilder<FetchBlockedUser>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return fetchblockuserobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: fetchblockuserobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
blockedUser(
|
||||
imagePath: fetchblockuserobj!.data![index]
|
||||
.blockedProfile!.profilePhoto ??
|
||||
'',
|
||||
title: fetchblockuserobj!.data![index]
|
||||
.blockedProfile!.fullName ??
|
||||
'',
|
||||
subtitle: fetchblockuserobj!.data![index]
|
||||
.blockedProfile!.userName ??
|
||||
'',
|
||||
index: index),
|
||||
],
|
||||
);
|
||||
|
||||
// Column(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: EdgeInsets.symmetric(
|
||||
// vertical: 16.h, horizontal: 16.w),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// followingobj!.data![index].following!
|
||||
// .profilePhoto ==
|
||||
// null ||
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .profilePhoto!
|
||||
// .isEmpty
|
||||
// ? CircleAvatar(
|
||||
// backgroundImage: AssetImage(
|
||||
// 'assets/images/png/Ellipse 43.png'),
|
||||
// radius: 25.r,
|
||||
// )
|
||||
// : CircleAvatar(
|
||||
// backgroundImage: NetworkImage(
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .profilePhoto!),
|
||||
// radius: 25.r,
|
||||
// ),
|
||||
// sizedBoxWidth(10.w),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .fullName ==
|
||||
// null ||
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .fullName!
|
||||
// .isEmpty
|
||||
// ? text16w400_FCFCFC("Regroup")
|
||||
// : text16w400_FCFCFC(
|
||||
// followingobj!.data![index]
|
||||
// .following!.fullName!),
|
||||
// sizedBoxHeight(4.h),
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .userName ==
|
||||
// null ||
|
||||
// followingobj!
|
||||
// .data![index]
|
||||
// .following!
|
||||
// .userName!
|
||||
// .isEmpty
|
||||
// ? text12w400_FCFCFC_blur(
|
||||
// "regroup")
|
||||
// : text12w400_FCFCFC_blur(
|
||||
// followingobj!.data![index]
|
||||
// .following!.userName!)
|
||||
// ],
|
||||
// ),
|
||||
// Spacer(),
|
||||
// PopupMenuButton(
|
||||
// surfaceTintColor: Color(0xFF222935),
|
||||
// constraints:
|
||||
// BoxConstraints.tightFor(
|
||||
// width: 176.w),
|
||||
// offset: Offset(0, 20),
|
||||
// color: Color(0xFF222935),
|
||||
// tooltip: "",
|
||||
// itemBuilder: (BuildContext
|
||||
// context) =>
|
||||
// <PopupMenuEntry>[
|
||||
// PopupMenuItem(
|
||||
// onTap: () async {
|
||||
// setState(() {
|
||||
// unfollowid =
|
||||
// followingobj!
|
||||
// .data![
|
||||
// index]
|
||||
// .following!
|
||||
// .id ??
|
||||
// 0;
|
||||
// // followingobj!.data!.removeAt(index);
|
||||
// followingobj!.data!
|
||||
// .removeWhere((item) =>
|
||||
// item.following!
|
||||
// .id ==
|
||||
// unfollowid);
|
||||
// Uploadata();
|
||||
// });
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding:
|
||||
// EdgeInsets.symmetric(
|
||||
// horizontal: 12.w),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// text14400white(
|
||||
// "Unfollow user"),
|
||||
// Spacer(),
|
||||
// Image.asset(
|
||||
// "assets/images/png/Black1323e.png",
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// PopupMenuDivider(),
|
||||
// PopupMenuItem(
|
||||
// onTap: () {},
|
||||
// child: Padding(
|
||||
// padding:
|
||||
// EdgeInsets.symmetric(
|
||||
// horizontal: 12.w),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// text14400white(
|
||||
// "Message user"),
|
||||
// Spacer(),
|
||||
// Image.asset(
|
||||
// "assets/images/png/fluent_chat-20-22.png",
|
||||
// height: 20.h,
|
||||
// width: 20.w,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// child: Container(
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// child: Center(
|
||||
// child: Image.asset(
|
||||
// "assets/images/png/Group 1000004071.png",
|
||||
// height: 22.h,
|
||||
// width: 4.w,
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
dialogwidget({required int index}) {
|
||||
Get.dialog(Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 200.h,
|
||||
borderradius: 14,
|
||||
opacity1: 0.09,
|
||||
opacity2: 0.13,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w400_FCFCFC(
|
||||
"Are you sure you want to unblock the user?",
|
||||
textAlign: TextAlign.center),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 110.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget: Center(child: text14400white("No")),
|
||||
border: 1),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.back();
|
||||
unblockDone(index);
|
||||
// await BlockUserAPI().fetchBlockUser();
|
||||
Get.back();
|
||||
// setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: 40.h,
|
||||
width: 110.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text14400white("Yes")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
border: 0.8)));
|
||||
}
|
||||
|
||||
Widget blockedUser({
|
||||
required String? imagePath,
|
||||
required String? title,
|
||||
required String? subtitle,
|
||||
required int index,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
imagePath == null || imagePath.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: AssetImage("assets/images/png/cimg3.png"),
|
||||
|
||||
// AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(imagePath),
|
||||
|
||||
// AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
title == null || title.isEmpty
|
||||
? text16w400_FCFCFC("Regroup")
|
||||
: text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(4.h),
|
||||
subtitle == null || subtitle.isEmpty
|
||||
? text12w400_FCFCFC_blur('regroup')
|
||||
: text12w400_FCFCFC_blur(subtitle),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
dialogwidget(index: index);
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 105.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(child: text14w400_FCFCFC("Unblock")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class NotificationScreen extends StatefulWidget {
|
||||
const NotificationScreen({super.key});
|
||||
|
||||
@override
|
||||
State<NotificationScreen> createState() => _NotificationScreenState();
|
||||
}
|
||||
|
||||
class _NotificationScreenState extends State<NotificationScreen> {
|
||||
var switchValues = List<bool>.generate(5, (index) => false).obs;
|
||||
|
||||
void toggleSwitch(int index, bool value) {
|
||||
switchValues[index] = value;
|
||||
}
|
||||
|
||||
String switchValueFinal(int index) {
|
||||
return switchValues[index] ? '1' : '0';
|
||||
}
|
||||
|
||||
void switchValueBool() {
|
||||
final notifications = [
|
||||
fetchNoti!.data!.groupNotification,
|
||||
fetchNoti!.data!.communityNotification,
|
||||
fetchNoti!.data!.followerNotification,
|
||||
fetchNoti!.data!.newFollowerNotification,
|
||||
fetchNoti!.data!.directMessageNotification,
|
||||
];
|
||||
|
||||
for (int i = 0; i < notifications.length; i++) {
|
||||
toggleSwitch(i, notifications[i] == 1);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateNotification() async {
|
||||
Map<String, String> updata = {
|
||||
"group_notification": switchValueFinal(0),
|
||||
"community_notification": switchValueFinal(1),
|
||||
"follower_notification": switchValueFinal(2),
|
||||
"new_follower_notification": switchValueFinal(3),
|
||||
"direct_message_notification": switchValueFinal(4),
|
||||
};
|
||||
final data = await NotificationAPI().notificationPostApi(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
utils.showToast('Notification updated');
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
late Future myfuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
myfuture = NotificationAPI().getNotification();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Notifications",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.blue,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
switchValueBool();
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
rowTile(text: "Group notification", index: 0),
|
||||
commonDivider(),
|
||||
rowTile(text: "Community notification", index: 1),
|
||||
commonDivider(),
|
||||
rowTile(text: "Follower notification", index: 2),
|
||||
commonDivider(),
|
||||
rowTile(text: "New follower notification", index: 3),
|
||||
commonDivider(),
|
||||
rowTile(text: "Direct message notification", index: 4),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTile({required String text, required int index}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(
|
||||
children: [
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Obx(
|
||||
() => Transform.scale(
|
||||
scaleY: 1,
|
||||
child: CupertinoSwitch(
|
||||
value: switchValues[index],
|
||||
trackColor: Colors.white.withOpacity(0.4),
|
||||
activeColor: Color(0xFF34C759),
|
||||
onChanged: (bool? value) {
|
||||
toggleSwitch(index, value ?? false);
|
||||
updateNotification();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart';
|
||||
|
||||
FetchBlockedUser? fetchblockuserobj;
|
||||
|
||||
class BlockUserAPI {
|
||||
BlockUserAPI();
|
||||
|
||||
// Future<ResponseData<dynamic>> fetchBlockUser() async {
|
||||
// final response = await NetworkApiServices().getApi(
|
||||
// ApiUrls.getblockuser,
|
||||
// );
|
||||
// fetchblockuser = FetchBlockedUser.fromJson(response.data);
|
||||
// if (response.status == ResponseStatus.SUCCESS) {
|
||||
// if (response.data["status"] == "success") {
|
||||
// print("Success---->");
|
||||
// return ResponseData<dynamic>(
|
||||
// response.data['message'], ResponseStatus.SUCCESS,
|
||||
// data: response.data);
|
||||
// } else {
|
||||
// return ResponseData<dynamic>(
|
||||
// response.data['message'], ResponseStatus.FAILED);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return response;
|
||||
// }
|
||||
|
||||
Future<ResponseData<dynamic>> postBlockApi(var data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.postblockuser,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
// data: response.data
|
||||
);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getBlockedusers(updata,
|
||||
{required StreamController<FetchBlockedUser> streamController}) async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getblockuser}?search=$updata",
|
||||
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
fetchblockuserobj = FetchBlockedUser.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(fetchblockuserobj!);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart';
|
||||
|
||||
FetchNotification? fetchNoti;
|
||||
|
||||
class NotificationAPI {
|
||||
NotificationAPI();
|
||||
// class otpAPI {
|
||||
// otpAPI(this.data);
|
||||
// var data;
|
||||
Future<ResponseData<dynamic>> notificationPostApi(var data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.postnotification,
|
||||
// "https://regroup.betadelivery.com/api/v1/forgot-password",
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
// data: response.data
|
||||
);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getNotification() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getnotification,
|
||||
);
|
||||
fetchNoti = FetchNotification.fromJson(response.data);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
import 'package:regroup/Common/CommonButton.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class ShareProfile extends StatefulWidget {
|
||||
const ShareProfile({super.key});
|
||||
|
||||
@override
|
||||
State<ShareProfile> createState() => _ShareProfileState();
|
||||
}
|
||||
|
||||
class _ShareProfileState extends State<ShareProfile> {
|
||||
List profileData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Fit fusion squad",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 37.png",
|
||||
"title": "Power pulse posse",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
List<bool> isCheckedList = [false, false, false, false, false, false, false];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Share profile",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
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",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: profileData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
profileWidget(
|
||||
index: index,
|
||||
imagePath: profileData[index]["imagePath"],
|
||||
title: profileData[index]["title"],
|
||||
subtitle: profileData[index]["subtitle"],
|
||||
isChecked: isCheckedList[index],
|
||||
onCheckedChanged: (bool? value) {
|
||||
setState(() {
|
||||
isCheckedList[index] = value ?? false;
|
||||
});
|
||||
},
|
||||
),
|
||||
if (index != profileData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CommonBtn(text: "Send"),
|
||||
)
|
||||
])
|
||||
])),
|
||||
]));
|
||||
}
|
||||
|
||||
Widget profileWidget({
|
||||
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: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(4.h),
|
||||
text12w400_FCFCFC_blur(subtitle),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Transform.scale(
|
||||
scale: 1.4,
|
||||
child: Checkbox(
|
||||
side: BorderSide(color: Color(0xFF434A53)),
|
||||
value: isChecked,
|
||||
activeColor: Colors.transparent,
|
||||
checkColor: Colors.white,
|
||||
onChanged: onCheckedChanged,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,978 +0,0 @@
|
||||
import 'dart:developer';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'
|
||||
as timelineabilist;
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.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/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';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:async/src/future_group.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class AddTimeline extends StatefulWidget {
|
||||
const AddTimeline({super.key});
|
||||
|
||||
@override
|
||||
State<AddTimeline> createState() => _AddTimelineState();
|
||||
}
|
||||
|
||||
class _AddTimelineState extends State<AddTimeline> {
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
TextEditingController clubNameController = TextEditingController();
|
||||
TextEditingController rollnameController = TextEditingController();
|
||||
TextEditingController teamnameController = TextEditingController();
|
||||
|
||||
int id = Get.arguments["id"];
|
||||
bool edited = Get.arguments["edit"];
|
||||
|
||||
RxBool isChecked = false.obs;
|
||||
|
||||
timelineabilist.TimelineAbilityListModel? abilityModel;
|
||||
List<timelineabilist.Data> timeline = [];
|
||||
List<String> _abilitydrop = [];
|
||||
|
||||
Future<void> fetchABilitylist() async {
|
||||
TimelineAbilityListApi abilityLsitAPI = TimelineAbilityListApi();
|
||||
ResponseData<dynamic> response = await abilityLsitAPI.getAbilitylistApi();
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
abilityModel =
|
||||
timelineabilist.TimelineAbilityListModel.fromJson(response.data!);
|
||||
setState(() {
|
||||
timeline = abilityModel!.data ?? []; // Store the fetched cities
|
||||
_abilitydrop =
|
||||
timeline.map((platform) => platform.name.toString()).toList();
|
||||
});
|
||||
log(timeline.toString());
|
||||
} else {
|
||||
print('Failed to fetch abilities');
|
||||
}
|
||||
}
|
||||
|
||||
List<int> selectedabilityid = [];
|
||||
|
||||
void getCatIdFromName(List<String> selectedAbilities) {
|
||||
selectedabilityid.clear(); // Clear existing selections
|
||||
for (var name in selectedAbilities) {
|
||||
for (var i = 0; i < timeline.length; i++) {
|
||||
if (name == timeline[i].name) {
|
||||
selectedabilityid.add(timeline[i].id!);
|
||||
break; // Assuming each name is unique, we break after finding a match
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// late Future myfuture;
|
||||
FutureGroup futureGroup = FutureGroup();
|
||||
RxBool isloading = true.obs;
|
||||
List<String> seelctedNameList = [];
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
if (edited == true) {
|
||||
// futureGroup.add(
|
||||
Profilegetmethod().getEditTimeline(id).then((value) {
|
||||
clubNameController.text =
|
||||
edittimelineobj!.data!.timelineData!.clubName ?? "";
|
||||
rollnameController.text =
|
||||
edittimelineobj!.data!.timelineData!.roleName ?? "";
|
||||
teamnameController.text =
|
||||
edittimelineobj!.data!.timelineData!.teamName ?? "";
|
||||
"";
|
||||
dateController.text =
|
||||
edittimelineobj!.data!.timelineData!.startDate ?? "";
|
||||
dateController2.text =
|
||||
edittimelineobj!.data!.timelineData!.endDate ?? "";
|
||||
|
||||
log(_abilityMap.length.toString());
|
||||
// futureGroup.add(
|
||||
fetchABilitylist().then((value) {
|
||||
String abilitiesXids =
|
||||
edittimelineobj!.data!.timelineData!.abilitiesXids ?? "";
|
||||
abilitiesIds = abilitiesXids
|
||||
.split(',')
|
||||
.map((e) => int.tryParse(e.trim()) ?? 0) // Trim spaces around IDs
|
||||
.toList();
|
||||
selectedabilityid = abilitiesIds;
|
||||
|
||||
print(selectedabilityid.toList());
|
||||
|
||||
for (int i = 0; i < _abilitydrop.length; i++) {
|
||||
_abilityMap.add({
|
||||
"id": i + 1,
|
||||
"name": _abilitydrop[i],
|
||||
});
|
||||
}
|
||||
getSelectedNames(selectedabilityid).then((value) {
|
||||
seelctedNameList = value;
|
||||
isloading = false.obs;
|
||||
});
|
||||
});
|
||||
// );
|
||||
});
|
||||
} else {
|
||||
fetchABilitylist().then((value) {
|
||||
isloading = false.obs;
|
||||
});
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
List<int> abilitiesIds = [];
|
||||
|
||||
UploadData() async {
|
||||
// SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
utils.loader();
|
||||
String abilitiesIds = selectedabilityid.join(',');
|
||||
print(abilitiesIds);
|
||||
Map<String, dynamic> updata = {
|
||||
"club_name": clubNameController.text,
|
||||
"role_name": rollnameController.text,
|
||||
"team_name": teamnameController.text,
|
||||
"start_date": dateController.text,
|
||||
"end_date": dateController2.text,
|
||||
"abilities_xids": abilitiesIds,
|
||||
};
|
||||
final data = await Profilepostmethod().postTimeline(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
// Get.back();
|
||||
// await EditProfileApi().getEditProfileIndividual().then((value) {
|
||||
// Get.back();
|
||||
// });
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
|
||||
print("timeline done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("timeline not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
EdituploadData() async {
|
||||
utils.loader();
|
||||
String abilitiesIds = selectedabilityid.join(',');
|
||||
print(abilitiesIds);
|
||||
Map<String, dynamic> updata = {
|
||||
"club_name": clubNameController.text,
|
||||
"role_name": rollnameController.text,
|
||||
"team_name": teamnameController.text,
|
||||
"start_date": dateController.text,
|
||||
"end_date": dateController2.text,
|
||||
"abilities_xids": abilitiesIds,
|
||||
"timeline_id": id,
|
||||
};
|
||||
final data = await Profilepostmethod().postEditTimeline(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("timeline done");
|
||||
// await EditProfileApi().getEditProfileIndividual().then((value) {
|
||||
// Get.back();
|
||||
// });
|
||||
|
||||
// utils.showToast(data.message);
|
||||
// await Future.delayed(
|
||||
// Duration(milliseconds: 500)); // Add a small delay if needed
|
||||
// Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 4);
|
||||
} else {
|
||||
Get.back();
|
||||
print("timeline not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
// List<Map<String, dynamic>> _abilityMap = [];
|
||||
List<Map<String, dynamic>> _abilityMap = [];
|
||||
List<String> listData = [];
|
||||
|
||||
// Function to get names from selected IDs
|
||||
Future<List<String>> getSelectedNames(List<int> selectedIds) async {
|
||||
List<String> selectedNames = [];
|
||||
for (int id in selectedIds) {
|
||||
for (Map<String, dynamic> ability in _abilityMap) {
|
||||
if (ability["id"] == id) {
|
||||
selectedNames.add(ability["name"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_abilitydrop =
|
||||
_abilityMap.map((ability) => ability["name"] as String).toList();
|
||||
}
|
||||
|
||||
return selectedNames;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Add timeline",
|
||||
),
|
||||
body: Obx(()
|
||||
// {
|
||||
=>
|
||||
isloading.value
|
||||
? Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
],
|
||||
))
|
||||
: edited == true
|
||||
? Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(physics: ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Club name"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
clubNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter club name',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your club name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Role in "),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
rollnameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter role in the club',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter role in the club';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Team name"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
teamnameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter team name',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your team name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-ZS0-9 ]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start date "),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(
|
||||
context,
|
||||
dateController),
|
||||
child: AbsorbPointer(
|
||||
child:
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
dateController,
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.h),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End date"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(
|
||||
context,
|
||||
dateController2),
|
||||
child: AbsorbPointer(
|
||||
child:
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
dateController2,
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget:
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Checkbox(
|
||||
side: BorderSide(
|
||||
color: Color(
|
||||
0xFF434A53)),
|
||||
value: isChecked
|
||||
.value,
|
||||
activeColor: Colors
|
||||
.transparent,
|
||||
checkColor:
|
||||
Colors.white,
|
||||
onChanged:
|
||||
((value) {
|
||||
// isChecked.value = value!;
|
||||
isChecked
|
||||
.value =
|
||||
value!;
|
||||
if (isChecked
|
||||
.value) {
|
||||
// Set end date to today's date
|
||||
dateController2
|
||||
.text = DateFormat(
|
||||
'yyyy-MM-dd')
|
||||
.format(DateTime
|
||||
.now());
|
||||
} else {
|
||||
// Clear end date when checkbox is unchecked
|
||||
dateController2
|
||||
.clear();
|
||||
}
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
sizedBoxWidth(8.w),
|
||||
text10400white("Present")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
text16400white("Ability"),
|
||||
sizedBoxHeight(15.h),
|
||||
// CustomDropDownCheckBoxTimeline(
|
||||
// header: 'Select ability',
|
||||
// title: '',
|
||||
// listData: _abilitydrop,
|
||||
// onItemSelected: getCatIdFromName,
|
||||
// initiallySelected: abilitiesIds
|
||||
// .map((id) => id.toString())
|
||||
// .toList(),
|
||||
// ),
|
||||
CustomDropDownCheckBoxTimeline(
|
||||
header: 'Select ability',
|
||||
title: '',
|
||||
listData: _abilitydrop,
|
||||
// _abilityMap.map((ability) => ability["name"]).toList(),
|
||||
onItemSelected: getCatIdFromName,
|
||||
// (selectedNames) {
|
||||
// // Convert selected names back to IDs if needed
|
||||
// List<int> selectedIds = [];
|
||||
// for (String name in selectedNames) {
|
||||
// for (Map<String, dynamic> ability
|
||||
// in _abilityMap) {
|
||||
// if (ability["name"] == name) {
|
||||
// selectedIds.add(ability["id"]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // Use selectedIds as needed
|
||||
// print(selectedIds);
|
||||
// },
|
||||
initiallySelected:
|
||||
seelctedNameList, // Pass initially selected names
|
||||
),
|
||||
sizedBoxHeight(80.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20.w),
|
||||
child: CustomButton(
|
||||
text: "Add timeline",
|
||||
onPressed: () {
|
||||
if (clubNameController.text.isBlank! ||
|
||||
rollnameController
|
||||
.text.isBlank! ||
|
||||
teamnameController
|
||||
.text.isBlank! ||
|
||||
dateController
|
||||
.text.isBlank! ||
|
||||
dateController2
|
||||
.text.isBlank! ||
|
||||
selectedabilityid.isEmpty) {
|
||||
utils.showToast(
|
||||
'Please fill all fields');
|
||||
} else {
|
||||
print(selectedabilityid
|
||||
.toString());
|
||||
|
||||
EdituploadData();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
])
|
||||
])
|
||||
: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(physics: ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Club name"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
clubNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter club name',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Role in the club"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
rollnameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter role in the club',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter role in the club';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Team name"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
teamnameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: 'Enter team name',
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your team name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-ZS0-9 ]')),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Start date "),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(
|
||||
context,
|
||||
dateController),
|
||||
child: AbsorbPointer(
|
||||
child:
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
dateController,
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.h),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("End date"),
|
||||
sizedBoxHeight(10.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(
|
||||
context,
|
||||
dateController2),
|
||||
child: AbsorbPointer(
|
||||
child:
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
dateController2,
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
borderradius: 2,
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget:
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Checkbox(
|
||||
side: BorderSide(
|
||||
color: Color(
|
||||
0xFF434A53)),
|
||||
value: isChecked
|
||||
.value,
|
||||
activeColor: Colors
|
||||
.transparent,
|
||||
checkColor:
|
||||
Colors.white,
|
||||
onChanged:
|
||||
((value) {
|
||||
// isChecked.value = value!;
|
||||
isChecked
|
||||
.value =
|
||||
value!;
|
||||
if (isChecked
|
||||
.value) {
|
||||
// Set end date to today's date
|
||||
dateController2
|
||||
.text = DateFormat(
|
||||
'yyyy-MM-dd')
|
||||
.format(DateTime
|
||||
.now());
|
||||
} else {
|
||||
// Clear end date when checkbox is unchecked
|
||||
dateController2
|
||||
.clear();
|
||||
}
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
sizedBoxWidth(8.w),
|
||||
text10400white("Present")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
text16400white("Ability"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownChexkBox(
|
||||
header: 'Select ability',
|
||||
title: '',
|
||||
listData: _abilitydrop,
|
||||
onItemSelected: getCatIdFromName,
|
||||
initiallySelected: [], // or pass initial values if needed
|
||||
),
|
||||
sizedBoxHeight(80.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20.w),
|
||||
child: CustomButton(
|
||||
text: "Add timeline",
|
||||
onPressed: () {
|
||||
if (clubNameController.text.isBlank! ||
|
||||
rollnameController
|
||||
.text.isBlank! ||
|
||||
teamnameController
|
||||
.text.isBlank! ||
|
||||
dateController
|
||||
.text.isBlank! ||
|
||||
dateController2
|
||||
.text.isBlank! ||
|
||||
selectedabilityid.isEmpty) {
|
||||
utils.showToast(
|
||||
'Please fill all fields');
|
||||
} else {
|
||||
print(selectedabilityid
|
||||
.toString());
|
||||
|
||||
UploadData();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
]),
|
||||
)
|
||||
])
|
||||
])
|
||||
|
||||
// }
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomDropDownCheckBoxTimeline extends StatefulWidget {
|
||||
const CustomDropDownCheckBoxTimeline({
|
||||
Key? key,
|
||||
required this.header,
|
||||
required this.title,
|
||||
required this.listData,
|
||||
required this.onItemSelected,
|
||||
this.leadingImage,
|
||||
this.showOtherOption = false,
|
||||
required this.initiallySelected,
|
||||
}) : super(key: key);
|
||||
|
||||
final String header;
|
||||
final String title;
|
||||
final List<String> listData;
|
||||
final Function(List<String>) onItemSelected;
|
||||
final Widget? leadingImage;
|
||||
final bool showOtherOption;
|
||||
final List<String> initiallySelected;
|
||||
|
||||
@override
|
||||
State<CustomDropDownCheckBoxTimeline> createState() =>
|
||||
_CustomDropDownCheckBoxTimelineState();
|
||||
}
|
||||
|
||||
class _CustomDropDownCheckBoxTimelineState
|
||||
extends State<CustomDropDownCheckBoxTimeline> {
|
||||
RxBool onDropTap = false.obs;
|
||||
RxList<String> selectedValues = <String>[].obs;
|
||||
final TextEditingController _textController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
selectedValues
|
||||
.addAll(widget.initiallySelected); // Initialize selectedValues
|
||||
}
|
||||
|
||||
List<DropdownMenuItem<String>> _buildDropdownMenuItems() {
|
||||
return widget.listData.asMap().entries.map((entry) {
|
||||
int index = entry.key;
|
||||
String item = entry.value;
|
||||
return DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (selectedValues.contains(item)) {
|
||||
selectedValues.remove(item);
|
||||
} else {
|
||||
selectedValues.add(item);
|
||||
}
|
||||
_textController.clear();
|
||||
widget.onItemSelected(selectedValues.toList());
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return Checkbox(
|
||||
value: selectedValues.contains(item),
|
||||
activeColor: Colors.white,
|
||||
checkColor: const Color(0xFFD90B2E),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
if (value == true) {
|
||||
selectedValues.add(item);
|
||||
} else {
|
||||
selectedValues.remove(item);
|
||||
}
|
||||
_textController.clear();
|
||||
widget.onItemSelected(selectedValues.toList());
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
maxLines: 1, // Adjust as needed
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (index != widget.listData.length - 1)
|
||||
const Divider(thickness: 1, color: Color(0xFF434A53)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(
|
||||
() => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onDropTap.value = !onDropTap.value;
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
// height: 50,
|
||||
padding:
|
||||
EdgeInsets.only(right: 22, left: 12, top: 15, bottom: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: onDropTap.value
|
||||
? const BorderRadius.vertical(
|
||||
top: Radius.circular(30),
|
||||
)
|
||||
: const BorderRadius.all(Radius.circular(30)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF434A53)),
|
||||
),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
widget.leadingImage == null
|
||||
? SizedBox()
|
||||
: widget.leadingImage!,
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
selectedValues.isEmpty
|
||||
? widget.header
|
||||
: selectedValues.join(', '),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
onDropTap.value
|
||||
? Image.asset('assets/images/png/arrowup.png')
|
||||
: Image.asset('assets/images/png/arrowdown.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (onDropTap.value)
|
||||
Scrollbar(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(30),
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF434A53)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: _buildDropdownMenuItems(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
|
||||
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart';
|
||||
|
||||
class TimelineAbilityListApi {
|
||||
TimelineAbilityListApi();
|
||||
var data = "";
|
||||
Future<ResponseData<dynamic>> getAbilitylistApi() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.gettimelineabilitylist,
|
||||
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
print("success");
|
||||
TimelineAbilityListModel timelineabilitylistobj =
|
||||
TimelineAbilityListModel.fromJson(responseData);
|
||||
} else {
|
||||
// return ResponseData<dynamic>(
|
||||
// responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
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/Feed%20Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/certificateModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/faqModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart';
|
||||
// import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart';
|
||||
|
||||
FaqModel? faqobj;
|
||||
PrivacypolicyModel? privacyobj;
|
||||
TermsConditionsModel? termsobj;
|
||||
FollowersModel? followersobj;
|
||||
FollowingModel? followingobj;
|
||||
GetEditTimelineModel? edittimelineobj;
|
||||
GetAccountSessionsModel? accountsessionobj;
|
||||
CertificateuserModel? certificateobj;
|
||||
|
||||
|
||||
|
||||
class Profilegetmethod {
|
||||
// Profilegetmethod();
|
||||
Future<ResponseData<dynamic>> getFaqs() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getfaqs,
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
faqobj = FaqModel.fromJson(response.data);
|
||||
log(faqobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getPrivacypolicy() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getprivacypolicy,
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
privacyobj = PrivacypolicyModel.fromJson(response.data);
|
||||
log(privacyobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getTermsConditions() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.gettermsconditios,
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
termsobj = TermsConditionsModel.fromJson(response.data);
|
||||
log(termsobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getFollowers(updata,
|
||||
{required StreamController<FollowersModel> streamController}) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getfollowers}?search=$updata",
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
followersobj = FollowersModel.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(followersobj!);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getFollowing(updata,
|
||||
{required StreamController<FollowingModel> streamController}) async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getfollowing}?search=$updata",
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
followingobj = FollowingModel.fromJson(response.data);
|
||||
if (!streamController.isClosed) streamController.sink.add(followingobj!);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getEditTimeline(int data) async {
|
||||
final response = await NetworkApiServices().getApi(ApiUrls.getedittimeline + "/?timeline_id=${data}");
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
edittimelineobj = GetEditTimelineModel.fromJson(response.data);
|
||||
log(edittimelineobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getAccountSessions() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getaccountsessions,
|
||||
// optionalpar: false
|
||||
);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
accountsessionobj = GetAccountSessionsModel.fromJson(response.data);
|
||||
log(accountsessionobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getUserCertificates(updata) async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(
|
||||
"${ApiUrls.getusercertificates}?user_id=$updata",
|
||||
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
certificateobj = CertificateuserModel.fromJson(response.data);
|
||||
log(certificateobj!.data.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,274 +0,0 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
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:shared_preferences/shared_preferences.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class Profilepostmethod {
|
||||
Profilepostmethod();
|
||||
Dio dio = Dio();
|
||||
|
||||
String basicAuth = 'Basic ' +
|
||||
base64.encode(
|
||||
utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'));
|
||||
|
||||
Future<ResponseData<dynamic>> postContactus(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postcontactus,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postReportandbug(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postreportbug,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postBlockuser(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postblock,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postunfollowuser(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postunfollow,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postRemoveuser(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postremoveuser,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postChangepassword(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postchangepassword,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postChangepassverifyotp(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postchangepassverify,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postTimeline(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.posttimeline,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postAccountvisibility(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postaccountvisibility,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postDeleteaccount(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postdeleteaccount,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postLogoutaccount() async {
|
||||
Response response;
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
String? token = prefs.getString('access-token');
|
||||
|
||||
try {
|
||||
response = await dio.post(
|
||||
ApiUrls.postlogoutaccount,
|
||||
options: Options(
|
||||
headers: {'authorization': basicAuth, 'access-token': token},
|
||||
),
|
||||
);
|
||||
log(response.toString());
|
||||
} on Exception catch (e) {
|
||||
if (e is DioException) {
|
||||
log(e.response.toString());
|
||||
if (e.response == null) {
|
||||
return ResponseData<dynamic>(
|
||||
'Oops something Went Wrong, Please try again!',
|
||||
ResponseStatus.FAILED,
|
||||
);
|
||||
}
|
||||
if (e.response!.statusCode == 401) {
|
||||
prefs.remove('token');
|
||||
prefs.remove('refreshToken');
|
||||
// Get.toNamed(RouteName.login);
|
||||
return ResponseData<dynamic>(
|
||||
'Oops something Went Wrong, Please try again!',
|
||||
ResponseStatus.FAILED,
|
||||
);
|
||||
}
|
||||
if (e.response!.statusCode == 403) {
|
||||
if (e.response!.data['message'] is List) {
|
||||
return ResponseData<dynamic>(
|
||||
e.response!.data['message'][0]!, ResponseStatus.FAILED,
|
||||
data: e.response!.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
e.response!.data['message'], ResponseStatus.FAILED,
|
||||
data: e.response!.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
'Oops something Went Wrong',
|
||||
ResponseStatus.FAILED,
|
||||
);
|
||||
}
|
||||
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else if (response.statusCode == 203) {
|
||||
print(response.data);
|
||||
return ResponseData<dynamic>("success", ResponseStatus.PRIVATE,
|
||||
data: response.data);
|
||||
} else {
|
||||
try {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'].toString(), ResponseStatus.FAILED);
|
||||
} catch (_) {
|
||||
return ResponseData<dynamic>(
|
||||
response.statusMessage!, ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postEditTimeline(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postedittimeline,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postRemoveTimeline(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postremovetimeline,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postRemoveCertification(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postremovecertification,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postCertification(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postcertification,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
// Future guestFollowuser(int userId) async {
|
||||
// print("followRecipe");
|
||||
// final apiUrl = ApiUrls.postunfollow;
|
||||
// // final body = {"following_iam_principal_xid": userId};
|
||||
// Map<String, dynamic> updata = {
|
||||
// "following_iam_principal_xid": userId,
|
||||
// };
|
||||
// SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// String? token = prefs.getString('access-token');
|
||||
// Response response;
|
||||
|
||||
// try {
|
||||
// response = await dio.post(
|
||||
// apiUrl,
|
||||
// data: updata,
|
||||
// options:
|
||||
// Options(
|
||||
// headers: {'authorization': basicAuth, 'access-token': token},
|
||||
// ),
|
||||
// );
|
||||
// log(response.toString());
|
||||
// if (response.statusCode == 200) {
|
||||
// final jsonResponse = json.decode(response.data);
|
||||
// print("resp from api ${jsonResponse["message"]}");
|
||||
// return jsonResponse["success"];
|
||||
// } else {
|
||||
// // API call failed
|
||||
// throw Exception('Failed to follow user');
|
||||
// }
|
||||
// } catch (e) {
|
||||
// // Error occurred while making the API call
|
||||
// throw Exception('Error: $e');
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -1,258 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class NotificationPage extends StatefulWidget {
|
||||
const NotificationPage({super.key});
|
||||
|
||||
@override
|
||||
State<NotificationPage> createState() => _NotificationPageState();
|
||||
}
|
||||
|
||||
class _NotificationPageState extends State<NotificationPage> {
|
||||
List notificationcontents = [
|
||||
{
|
||||
'image': "assets/images/png/notification1.png",
|
||||
'follow': false,
|
||||
'name': 'Lorem Ipsum is simply dummy text of \nthe printing and . . . ',
|
||||
'messagereq': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/notification2.png",
|
||||
'follow': true,
|
||||
'name': 'Davis Bothman',
|
||||
'messagereq': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/notification3.png",
|
||||
'follow': false,
|
||||
'name': 'Lorem Ipsum is simply dummy \ntext of the printing and . . . ',
|
||||
'messagereq': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/notification2.png",
|
||||
'follow': true,
|
||||
'name': 'Davis Bothman',
|
||||
'messagereq': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/notification3.png",
|
||||
'follow': false,
|
||||
'name': 'Lorem Ipsum is simply dummy \ntext of the printing and . . . ',
|
||||
'messagereq': false,
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: 'Notifications',
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
// const CommonBlurLeftRed(),
|
||||
const Positioned(top: 10, left: -30, child: CommonBlurLeftSecond()),
|
||||
// const CommonBlurRightRed(),
|
||||
// const CommonBlurLeft(),
|
||||
const Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
|
||||
const Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 6,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
const Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: const Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: notificationcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return Notificationlist(
|
||||
name: notificationcontents[index]['name'],
|
||||
followrequest: notificationcontents[index]['follow'],
|
||||
imageurl: notificationcontents[index]['image'],
|
||||
msgrequest: notificationcontents[index]['messagereq'],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Notificationlist extends StatefulWidget {
|
||||
final String imageurl;
|
||||
final bool msgrequest;
|
||||
final String name;
|
||||
final bool followrequest;
|
||||
|
||||
// const Notificationlist({super.key});
|
||||
const Notificationlist({
|
||||
Key? key,
|
||||
required this.imageurl,
|
||||
required this.msgrequest,
|
||||
required this.name,
|
||||
required this.followrequest,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<Notificationlist> createState() => _NotificationlistState();
|
||||
}
|
||||
|
||||
class _NotificationlistState extends State<Notificationlist> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
widget.msgrequest == true
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text14400white(widget.name),
|
||||
sizedBoxHeight(6.h),
|
||||
text12400white('3 mins ago'),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 135.w,
|
||||
height: 30.h,
|
||||
child:
|
||||
CustomButton(text: 'Accept', onPressed: () {})),
|
||||
sizedBoxWidth(10.w),
|
||||
SizedBox(
|
||||
width: 135.w,
|
||||
height: 30.h,
|
||||
child: CustomButton2(
|
||||
text: 'Message', onPressed: () {}))
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
: widget.followrequest == true
|
||||
? Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text14700white(widget.name),
|
||||
sizedBoxHeight(3.h),
|
||||
text12400white('wants to follow you'),
|
||||
sizedBoxHeight(6.h),
|
||||
text12400white('3 mins ago'),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80.w,
|
||||
height: 30.h,
|
||||
child: CustomButton(
|
||||
text: 'Confirm', onPressed: () {})),
|
||||
sizedBoxWidth(10.w),
|
||||
SizedBox(
|
||||
width: 80.w,
|
||||
height: 30.h,
|
||||
child: CustomButton2(
|
||||
text: 'Delete', onPressed: () {}))
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text14400white(widget.name),
|
||||
sizedBoxHeight(6.h),
|
||||
text12400white('3 mins ago'),
|
||||
],
|
||||
),
|
||||
// sizedBoxWidth(25.w),
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
child: Image.asset(
|
||||
'assets/images/png/notifcation.png',
|
||||
width: 90.w,
|
||||
height: 90.h,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class CommunitySetting extends StatefulWidget {
|
||||
const CommunitySetting({super.key});
|
||||
|
||||
@override
|
||||
State<CommunitySetting> createState() => _CommunitySettingState();
|
||||
}
|
||||
|
||||
class _CommunitySettingState extends State<CommunitySetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Community settings",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), Column(children: [
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.editcommunity);
|
||||
},
|
||||
child: rowTile(text: 'Edit community info')),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.managemembers);
|
||||
},
|
||||
child: rowTile(text: 'Manage members')),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.managegroups);
|
||||
},
|
||||
child: rowTile(text: 'Manage groups')),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.managetags);
|
||||
},
|
||||
child: rowTile(text: 'Manage tags')),
|
||||
sizedBoxHeight(20.h),
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String text,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Row(children: [
|
||||
text18w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,307 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.dart';
|
||||
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/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
class EditCommunity extends StatefulWidget {
|
||||
const EditCommunity({super.key});
|
||||
|
||||
@override
|
||||
State<EditCommunity> createState() => _EditCommunityState();
|
||||
}
|
||||
|
||||
class _EditCommunityState extends State<EditCommunity> {
|
||||
TextEditingController communitynameController = TextEditingController();
|
||||
TextEditingController descriptionController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
communitynameController.text = 'Active alliance network';
|
||||
descriptionController.text =
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer .";
|
||||
super.initState();
|
||||
}
|
||||
|
||||
List<File?> filePath = [];
|
||||
List<File?> bannerPath = [];
|
||||
bool isImageAdded = false;
|
||||
bool isbannerAdded = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Edit community info",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(30.h),
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
height: 100.h,
|
||||
width: 100.w,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border:
|
||||
Border.all(color: Color(0xFF434A53), width: 0.5.w),
|
||||
),
|
||||
child: Center(
|
||||
child: filePath.isNotEmpty
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset('assets/images/png/Ellipse 37.png',
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: -10,
|
||||
bottom: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
filePath.add(file);
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: Color(0xFFD90B2E), width: 0.5.w)),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/cameraicon.png',
|
||||
height: 14.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_white("Edit community profile picture"),
|
||||
sizedBoxHeight(30.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC("Community banner image"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
bannerPath.add(file);
|
||||
isbannerAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: DottedBorder(
|
||||
strokeWidth: 1,
|
||||
dashPattern: [7, 4],
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(14.r),
|
||||
color: Color(0xFF434A53),
|
||||
child: commonGlassContainer(
|
||||
border: 0,
|
||||
width: double.infinity,
|
||||
height: 150.h,
|
||||
borderradius: 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: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/cameraicon2.png",
|
||||
height: 36.h,
|
||||
width: 36.w,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text14w400white('Upload banner image'),
|
||||
sizedBoxHeight(8.h),
|
||||
SizedBox(
|
||||
width: 270.w,
|
||||
child: text10w400_whiteCenter(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(16.w),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 60.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(children: [
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.r)),
|
||||
child: Image.asset(
|
||||
"assets/images/png/img2.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text14400white("group1.png"),
|
||||
sizedBoxHeight(2.h),
|
||||
text12w400_FCFCFC_blur("10 kb")
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
'assets/images/png/cancelicon.png',
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Community name"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: communitynameController,
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter Community name';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Group description"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
textEditingController: descriptionController,
|
||||
),
|
||||
text16w400_FCFCFC("Type of community"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: ["Public", "Private - Request to join"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: SizedBox()),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Location*"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: ["Public", "Private", "Secret"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: SizedBox()),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Primary activity*"),
|
||||
sizedBoxHeight(14.h),
|
||||
CustomDropDownRadio(
|
||||
showOtherOption: true,
|
||||
header: "",
|
||||
title: "",
|
||||
listData: ["Sports", "Hobby"],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: SizedBox()),
|
||||
sizedBoxHeight(50.h),
|
||||
CustomButton(text: 'Save changes', onPressed: () {}),
|
||||
sizedBoxHeight(50.h),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class ManageGroups extends StatefulWidget {
|
||||
const ManageGroups({super.key});
|
||||
|
||||
@override
|
||||
State<ManageGroups> createState() => _ManageGroupsState();
|
||||
}
|
||||
|
||||
class _ManageGroupsState extends State<ManageGroups> {
|
||||
List groupData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/img45.png",
|
||||
"title": "Iron titans fitness crew",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 25.png",
|
||||
"title": "Body blitz brigade",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Fit fusion squad",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Power pulse posse",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Wellness warriors collective",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Manage groups",
|
||||
customActionWidget: InkWell(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(children: [
|
||||
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 groups",
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Black.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
)),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(8.w),
|
||||
text18w400_FCFCFC("Create group"),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_outlined,
|
||||
color: Colors.white,
|
||||
size: 14.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text18w700white("Groups"),
|
||||
sizedBoxHeight(20.h),
|
||||
]),
|
||||
),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: groupData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
groupWidget(
|
||||
imagePath: groupData[index]["imagePath"],
|
||||
title: groupData[index]["title"],
|
||||
subtitle: groupData[index]["subtitle"]),
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
Widget groupWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 20.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(4.h),
|
||||
text12w400_FCFCFC_blur(subtitle)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.clear,
|
||||
color: Color(0xFFFFFFFF),
|
||||
weight: 1.88,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,233 +0,0 @@
|
||||
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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class ManageTags extends StatefulWidget {
|
||||
const ManageTags({super.key});
|
||||
|
||||
@override
|
||||
State<ManageTags> createState() => _ManageTagsState();
|
||||
}
|
||||
|
||||
class _ManageTagsState extends State<ManageTags> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Manage tags",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
CommonTabBar(tabs: const [
|
||||
Tab(
|
||||
text: 'Tags',
|
||||
),
|
||||
Tab(
|
||||
text: 'Tag requests',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
tagsTab(),
|
||||
tagrequestsrTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
]))
|
||||
]))
|
||||
]),
|
||||
floatingActionButtonLocation: CustomFloatingActionButtonLocation(60.0),
|
||||
floatingActionButton: Container(
|
||||
height: 55.h,
|
||||
width: 55.w,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000), // Hex color with 40% opacity
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.newtag);
|
||||
},
|
||||
backgroundColor: Color(0xFFD90B2E),
|
||||
autofocus: true,
|
||||
shape: CircleBorder(),
|
||||
child: Image.asset(
|
||||
"assets/images/png/iconamoon_edit-thin.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Widget tagsTab() {
|
||||
List tags = ['Cycle', 'Sports', 'Fitness', 'Kayaking', 'Sports club'];
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text16400white("Special Announcement Tags"),
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: tags.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagsTile(text: tags[index]),
|
||||
if (index != tags.length - 1) commonDivider()
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTagsTile({
|
||||
required String text,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 18.h),
|
||||
child: Row(children: [
|
||||
text16w400_FCFCFC(text),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
width: 5.w,
|
||||
height: 22.h,
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tagrequestsrTab() {
|
||||
List tagrequest = [
|
||||
'Running',
|
||||
'Fit fam friday',
|
||||
];
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: tagrequest.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTagRequestTile(title: tagrequest[index]),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTagRequestTile({
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 60.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(children: [
|
||||
text16w700_FCFCFC(title),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 35.w,
|
||||
height: 35.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
weight: 1,
|
||||
)),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(16.w),
|
||||
Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.check,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
weight: 1,
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
border: 1),
|
||||
);
|
||||
}
|
||||
|
||||
class CustomFloatingActionButtonLocation extends FloatingActionButtonLocation {
|
||||
final double offset;
|
||||
|
||||
CustomFloatingActionButtonLocation(this.offset);
|
||||
|
||||
@override
|
||||
Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
|
||||
// Calculate the position
|
||||
double fabX = scaffoldGeometry.scaffoldSize.width -
|
||||
scaffoldGeometry.floatingActionButtonSize.width -
|
||||
16.0;
|
||||
double fabY = scaffoldGeometry.scaffoldSize.height -
|
||||
scaffoldGeometry.floatingActionButtonSize.height -
|
||||
16.0 -
|
||||
offset;
|
||||
return Offset(fabX, fabY);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class NewTag extends StatefulWidget {
|
||||
const NewTag({super.key});
|
||||
|
||||
@override
|
||||
State<NewTag> createState() => _NewTagState();
|
||||
}
|
||||
|
||||
class _NewTagState extends State<NewTag> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "New tag",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
sizedBoxHeight(30.h),
|
||||
text16w400_FCFCFC("Tag name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
hintText: "",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Enter a tag name';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(80.h),
|
||||
CustomButton(text: "Add", onPressed: () {})
|
||||
]),
|
||||
))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class AnnouncementRequest extends StatefulWidget {
|
||||
const AnnouncementRequest({super.key});
|
||||
|
||||
@override
|
||||
State<AnnouncementRequest> createState() => _AnnouncementRequestState();
|
||||
}
|
||||
|
||||
class _AnnouncementRequestState extends State<AnnouncementRequest> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Announcement requests",
|
||||
),
|
||||
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),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Announcementtile(
|
||||
profileImg: "assets/images/png/Ellipse 43.png",
|
||||
title: "title",
|
||||
mainImg: "assets/images/png/Rectangle 22.png")
|
||||
],
|
||||
)))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget Announcementtile({
|
||||
required String profileImg,
|
||||
required String title,
|
||||
required String mainImg,
|
||||
}) {
|
||||
return commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 400.h,
|
||||
borderradius: 10.r,
|
||||
border: 1,
|
||||
customWidget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
foregroundImage: AssetImage(profileImg),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(5.h),
|
||||
text12w400_FCFCFC_blur('Iron titans fitness crew'),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
text12w400_FCFCFC_blur("11-04-2024"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: Container(
|
||||
height: 109.h,
|
||||
width: double.infinity,
|
||||
decoration:
|
||||
BoxDecoration(borderRadius: BorderRadius.circular(5.r)),
|
||||
child: Image.asset(
|
||||
mainImg,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 149.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
borderradius: 30.r,
|
||||
customWidget: Center(child: text12w400_FCFCFC("Decline")),
|
||||
border: 1),
|
||||
Container(
|
||||
height: 30.h,
|
||||
width: 150.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text12w400_FCFCFC("Accept")),
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,618 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class ManageMembers extends StatefulWidget {
|
||||
const ManageMembers({super.key});
|
||||
|
||||
@override
|
||||
State<ManageMembers> createState() => _ManageMembersState();
|
||||
}
|
||||
|
||||
class _ManageMembersState extends State<ManageMembers> {
|
||||
List members = [
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Ryan Dorwart"},
|
||||
{"imagePath": "assets/images/png/cimg2.png", "title": "Ahmad Rhiel Madsen"},
|
||||
{"imagePath": "assets/images/png/cimg3.png", "title": "Kaylynn Vaccaro"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Kianna Donin"},
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
|
||||
{"imagePath": "assets/images/png/cimg1.png", "title": "Maria Herwitz"},
|
||||
{"imagePath": "assets/images/png/cimg4.png", "title": "Ahmad Rhiel Madsen"},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Manage members",
|
||||
customActionWidget: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x40000000),
|
||||
offset: Offset(0, 6),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(Icons.add, color: Colors.white, weight: 2),
|
||||
),
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
DefaultTabController(
|
||||
length: 4,
|
||||
child: Column(
|
||||
children: [
|
||||
CommonTabBar(tabs: const [
|
||||
Tab(
|
||||
text: 'Members',
|
||||
),
|
||||
Tab(
|
||||
text: 'Admins',
|
||||
),
|
||||
Tab(
|
||||
text: 'Requests',
|
||||
),
|
||||
Tab(
|
||||
text: 'Invites',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 655.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
membersTab(),
|
||||
AdminsTab(),
|
||||
RequestsTab(),
|
||||
InvitesTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
Widget membersTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
rowTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rowTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 5.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
dialogwidget() {
|
||||
Get.dialog(Dialog(
|
||||
// backgroundColor: Colors.transparent,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
color: Color(0xFF222935)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w700_FCFCFC("Availability"),
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("M")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Tu")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("W")),
|
||||
border: 0.5),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_FCFCFC("4pm - 8pm"),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Th")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("F")),
|
||||
border: 0.5),
|
||||
sizedBoxWidth(15.w),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(child: text16w400_FCFCFC("Sa")),
|
||||
border: 0.5),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/clock.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_FCFCFC("5pm - 9pm"),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
commonDivider(),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
GlassmorphicContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderRadius: 100,
|
||||
border: 0.5,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xFFD90B2E).withOpacity(0.18),
|
||||
const Color(0xFFD90B2E).withOpacity(0.4),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xffD90B2E),
|
||||
Color(0xFFD90B2E),
|
||||
],
|
||||
),
|
||||
blur: 6,
|
||||
child: Center(child: text16w400_FCFCFC("Su")),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text16w400_FCFCFC("Not available")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget AdminsTab() {
|
||||
return Column(
|
||||
children: [],
|
||||
);
|
||||
}
|
||||
|
||||
Widget RequestsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
requestsTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget requestsTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
width: 74.w,
|
||||
height: 25.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(23.r),
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
child: Center(child: text11w400white("Confirm")),
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
Icon(
|
||||
Icons.clear,
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget InvitesTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 58575.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Search members",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300.w,
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 17.h,
|
||||
width: 17.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Start date - End date",
|
||||
)),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/bi_filter.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
),
|
||||
border: 0.5)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(members.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
invitesTile(
|
||||
imagePath: members[index]["imagePath"],
|
||||
title: members[index]["title"]),
|
||||
if (index != members.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget invitesTile({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 17.5.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxWidth(8.w),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Image.asset(
|
||||
"assets/images/png/calender.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
width: 74.w,
|
||||
height: 25.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(23.r),
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
child: Center(child: text11w400white("Invite")),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
class NewAnnouncement extends StatefulWidget {
|
||||
const NewAnnouncement({super.key});
|
||||
|
||||
@override
|
||||
State<NewAnnouncement> createState() => _NewAnnouncementState();
|
||||
}
|
||||
|
||||
class _NewAnnouncementState extends State<NewAnnouncement> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "New announcement",
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
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: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Description"),
|
||||
sizedBoxHeight(30.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 150.h,
|
||||
borderradius: 10.r,
|
||||
customWidget: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 12.w, vertical: 12.h),
|
||||
child: text14w400_FCFCFCblur(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . .Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
|
||||
),
|
||||
border: 1),
|
||||
sizedBoxHeight(80.h),
|
||||
CustomButton(
|
||||
text: "Post",
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.announcement);
|
||||
})
|
||||
]),
|
||||
))
|
||||
]));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user