222 lines
9.5 KiB
Dart
222 lines
9.5 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:glassmorphism/glassmorphism.dart';
|
|
import 'package:regroup/Common/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/blureffect.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: Color(0xFF222935),
|
|
extendBody: true,
|
|
resizeToAvoidBottomInset: false,
|
|
appBar: 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: []),
|
|
sizedBoxHeight(18.h),
|
|
text16400white("Select sport"),
|
|
sizedBoxHeight(15.h),
|
|
CommonDropdownBtn(hint: "", items: []),
|
|
sizedBoxHeight(18.h),
|
|
text16400white("Select role "),
|
|
sizedBoxHeight(15.h),
|
|
CommonDropdownBtn(hint: "", items: []),
|
|
sizedBoxHeight(18.h),
|
|
text16400white("Space selection"),
|
|
sizedBoxHeight(15.h),
|
|
CommonDropdownBtn(hint: "", items: []),
|
|
sizedBoxHeight(18.h),
|
|
Row(
|
|
children: [
|
|
text16w400_white("Availability"),
|
|
Spacer(),
|
|
Transform.scale(
|
|
scaleY: 1,
|
|
child: CupertinoSwitch(
|
|
value: swichvalue,
|
|
trackColor: Colors.white.withOpacity(0.4),
|
|
activeColor: 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)
|
|
],
|
|
),
|
|
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)
|
|
? Color(0xFFD90B2E).withOpacity(0.4)
|
|
: Color(0xFFFFFFFF).withOpacity(0.2),
|
|
border: selectedContainerIndices.contains(index)
|
|
? Border.all(color: Color(0xFFD90B2E), width: 1)
|
|
: null),
|
|
child: Center(child: text16w400_FCFCFC(text)),
|
|
),
|
|
);
|
|
});
|
|
}
|
|
}
|