439 lines
18 KiB
Dart
439 lines
18 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:glassmorphism/glassmorphism.dart';
|
|
import 'package:regroup/Common/CommonDropDown.dart';
|
|
import 'package:regroup/Utils/Common/CommonDropdown.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 SelectIndividualActivity extends StatefulWidget {
|
|
const SelectIndividualActivity({super.key});
|
|
|
|
@override
|
|
State<SelectIndividualActivity> createState() =>
|
|
_SelectIndividualActivityState();
|
|
}
|
|
|
|
class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|
final List<int> _selectedIndices = [];
|
|
|
|
void _onContainerTap(int index) {
|
|
setState(() {
|
|
if (_selectedIndices.contains(index)) {
|
|
_selectedIndices.remove(index);
|
|
} else {
|
|
if (_selectedIndices.length < 2) {
|
|
_selectedIndices.add(index);
|
|
} else {
|
|
_selectedIndices[1] = index;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
Color _getGradientColor(int index) {
|
|
if (_selectedIndices.isEmpty) {
|
|
return Colors.transparent;
|
|
} else if (_selectedIndices.length == 1 &&
|
|
_selectedIndices.contains(index)) {
|
|
return Color(0XFFD90B2E);
|
|
} else if (_selectedIndices.length == 2) {
|
|
if (_selectedIndices[0] == index) {
|
|
return Color(0XFFD90B2E);
|
|
} else if (_selectedIndices[1] == index) {
|
|
return Color(0xFF009DAB);
|
|
}
|
|
}
|
|
return Colors.transparent;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
|
body: Stack(
|
|
children: [
|
|
Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
|
|
Positioned(top: 450, right: -30, child: CommonBlurRightSecond()),
|
|
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
|
GlassmorphicContainer(
|
|
width: MediaQuery.of(context).size.width,
|
|
height: MediaQuery.of(context).size.height,
|
|
borderRadius: 2,
|
|
blur: 10,
|
|
alignment: Alignment.bottomLeft,
|
|
border: 2,
|
|
linearGradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
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),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
],
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
|
|
child: Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Align(
|
|
alignment: Alignment.topRight,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.communitycommitscreen);
|
|
},
|
|
child: Text(
|
|
'Skip',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 16.sp,
|
|
fontFamily: 'Helvetica',
|
|
fontWeight: FontWeight.w400,
|
|
decoration: TextDecoration.underline,
|
|
decorationColor: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
sizedBoxHeight(30.h),
|
|
Align(
|
|
alignment: Alignment.center,
|
|
child: text16400white('Step 2 of 4')),
|
|
sizedBoxHeight(20.h),
|
|
Container(
|
|
width: double.infinity,
|
|
height: 25.h,
|
|
decoration: ShapeDecoration(
|
|
shape: RoundedRectangleBorder(
|
|
side: BorderSide(
|
|
width: 1, color: Color(0xFF434A53)),
|
|
borderRadius: BorderRadius.circular(30),
|
|
),
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: 8.w, vertical: 2.h),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 120.w,
|
|
height: 15.h,
|
|
decoration: ShapeDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment(0.98, -0.21),
|
|
end: Alignment(-0.98, 0.21),
|
|
colors: [
|
|
Color(0xA5D90B2E),
|
|
Color(0x42D90B2E)
|
|
],
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(30),
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
Container(
|
|
width: 15,
|
|
height: 15,
|
|
decoration: ShapeDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment(0.98, -0.21),
|
|
end: Alignment(-0.98, 0.21),
|
|
colors: [
|
|
Color(0xFFD90B2E),
|
|
Color(0x60D90B2E)
|
|
],
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius:
|
|
BorderRadius.circular(30),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
))
|
|
],
|
|
),
|
|
),
|
|
),
|
|
sizedBoxHeight(40.h),
|
|
Center(
|
|
child: _selectedIndices.isEmpty
|
|
? text20400white('What is your main activity ?')
|
|
: text20400white('What else do you do?')),
|
|
sizedBoxHeight(10.w),
|
|
Center(
|
|
child: Container(
|
|
width: 154.w,
|
|
decoration: ShapeDecoration(
|
|
shape: RoundedRectangleBorder(
|
|
side: BorderSide(
|
|
width: 1,
|
|
strokeAlign: BorderSide.strokeAlignCenter,
|
|
color: Color(0xFF858585),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
sizedBoxHeight(30.h),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
ActivityContainer(
|
|
index: 0,
|
|
titleString: 'Rowing',
|
|
image: 'assets/images/svg/individualact1.svg',
|
|
isSelected: _selectedIndices.contains(0),
|
|
gradientColor: _getGradientColor(0),
|
|
onTap: _onContainerTap,
|
|
),
|
|
ActivityContainer(
|
|
index: 1,
|
|
titleString: 'Badminton',
|
|
image: 'assets/images/svg/badminton.svg',
|
|
isSelected: _selectedIndices.contains(1),
|
|
gradientColor: _getGradientColor(1),
|
|
onTap: _onContainerTap,
|
|
),
|
|
ActivityContainer(
|
|
index: 2,
|
|
titleString: 'Cycling',
|
|
image: 'assets/images/svg/individualact2.svg',
|
|
isSelected: _selectedIndices.contains(2),
|
|
gradientColor: _getGradientColor(2),
|
|
onTap: _onContainerTap,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 20.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
ActivityContainer(
|
|
index: 3,
|
|
titleString: 'Football',
|
|
image: 'assets/images/svg/individualact7.svg',
|
|
isSelected: _selectedIndices.contains(3),
|
|
gradientColor: _getGradientColor(3),
|
|
onTap: _onContainerTap,
|
|
),
|
|
ActivityContainer(
|
|
index: 4,
|
|
titleString: 'Weightlifting',
|
|
image: 'assets/images/svg/weightlifting.svg',
|
|
isSelected: _selectedIndices.contains(4),
|
|
gradientColor: _getGradientColor(4),
|
|
onTap: _onContainerTap,
|
|
),
|
|
ActivityContainer(
|
|
index: 5,
|
|
titleString: 'Running',
|
|
image: 'assets/images/svg/individualact3.svg',
|
|
isSelected: _selectedIndices.contains(5),
|
|
gradientColor: _getGradientColor(5),
|
|
onTap: _onContainerTap,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 20.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
ActivityContainer(
|
|
index: 6,
|
|
titleString: 'Social',
|
|
image: 'assets/images/svg/individualact7.svg',
|
|
isSelected: _selectedIndices.contains(6),
|
|
gradientColor: _getGradientColor(6),
|
|
onTap: _onContainerTap,
|
|
),
|
|
SizedBox(width: 20.w),
|
|
ActivityContainer(
|
|
index: 7,
|
|
titleString: 'Special Interest (Societies)',
|
|
image:
|
|
'assets/images/svg/special interest.svg',
|
|
isSelected: _selectedIndices.contains(7),
|
|
gradientColor: _getGradientColor(7),
|
|
onTap: _onContainerTap,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
sizedBoxHeight(30.h),
|
|
text20400FCFCFC("Select other activity"),
|
|
sizedBoxHeight(25.h),
|
|
CustomDropDownRadio(
|
|
header: "",
|
|
title: "",
|
|
listData: [
|
|
"American football",
|
|
"Archery",
|
|
"Athletics",
|
|
"Baseball",
|
|
"Basketball",
|
|
"Boxing",
|
|
"Canoeing",
|
|
"Clay pigeon shooting",
|
|
"Climbing",
|
|
"Combat sports",
|
|
"Cricket",
|
|
"Dodgeball",
|
|
"Equestrian",
|
|
"Fencing",
|
|
"Gaelic football",
|
|
"Golf",
|
|
"Gymnastics",
|
|
"Handball",
|
|
"Hockey",
|
|
"Lacrosse",
|
|
"Modern biathlon and pentathlon",
|
|
"Netball",
|
|
"Orienteering",
|
|
"Pool and snooker",
|
|
"Powerlifting",
|
|
"Rifle",
|
|
"Rugby league",
|
|
"Rugby union",
|
|
"Sailing",
|
|
"Snowsports",
|
|
"Squash",
|
|
"Surfing",
|
|
"Swimming",
|
|
"Softball",
|
|
"Table tennis",
|
|
"Tennis",
|
|
"Touch rugby",
|
|
"Trampoline",
|
|
"Triathlon",
|
|
"Ultimate frisbee",
|
|
"Volleyball",
|
|
"Water polo",
|
|
"Windsurfing"
|
|
],
|
|
onItemSelected: (p0) {},
|
|
leadingImage: SizedBox()),
|
|
// Spacer(flex: 1),
|
|
sizedBoxHeight(35.h),
|
|
CustomButton(
|
|
text: "Continue",
|
|
onPressed: () {
|
|
Get.toNamed(RouteName.individualgroupstep3);
|
|
})
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
));
|
|
}
|
|
}
|
|
|
|
class ActivityContainer extends StatelessWidget {
|
|
final int index;
|
|
final String titleString;
|
|
final String image;
|
|
final bool isSelected;
|
|
final Color gradientColor;
|
|
final Function(int) onTap;
|
|
|
|
ActivityContainer({
|
|
required this.index,
|
|
required this.titleString,
|
|
required this.image,
|
|
required this.isSelected,
|
|
required this.gradientColor,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () => onTap(index),
|
|
child: Container(
|
|
width: 110.w,
|
|
height: 120.h,
|
|
decoration: ShapeDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment(0.98, -0.21),
|
|
end: Alignment(-0.98, 0.21),
|
|
colors: isSelected
|
|
? [
|
|
gradientColor.withOpacity(0.80),
|
|
gradientColor.withOpacity(0.77),
|
|
gradientColor.withOpacity(0.66),
|
|
gradientColor.withOpacity(0.18),
|
|
]
|
|
: [
|
|
Colors.white.withOpacity(0.06),
|
|
Colors.white.withOpacity(0.08),
|
|
],
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SvgPicture.asset(
|
|
image,
|
|
width: 50.w,
|
|
height: 50.h,
|
|
),
|
|
SizedBox(height: 10.h),
|
|
SizedBox(
|
|
child: Text(
|
|
titleString,
|
|
style: TextStyle(
|
|
fontSize: 14.sp,
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|