Files
Regroup/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart
2024-06-25 20:14:03 +05:30

335 lines
15 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/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';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class SelectIndividualCommunity extends StatefulWidget {
const SelectIndividualCommunity({super.key});
@override
State<SelectIndividualCommunity> createState() =>
_SelectIndividualCommunityState();
}
class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
TextEditingController searchcontroller = TextEditingController();
// StreamController<BlogsModel> blogsController = StreamController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 400, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()),
SingleChildScrollView(
child: GlassmorphicContainer(
width: MediaQuery.of(context).size.width,
height:
// 500.h,
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: 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 4 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: [
Expanded(
child: Container(
width: double.infinity,
child: Container(
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: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
text20400white('Find your community'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png',
)
],
)),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 108.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
CustomTextFormField(
textEditingController: searchcontroller,
texttype: TextInputType.text,
hintText: "Search community",
leadingIcon:
// const Icon(Icons.mail_outline),
// SvgPicture.asset(
// // width: 23.w,
// // height: 23.h,
// 'assets/images/svg/search.svg',
// ),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Icon(
Icons.search,
size: 35,
color: Colors.white,
),
),
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'Liverpool FC ',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'The athletic town',
image:
'assets/images/png/groupindividual3.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
],
),
// Spacer(flex: 1),
sizedBoxHeight(40.h),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.communitycommitscreen);
})
],
),
),
)),
),
],
));
}
}
class CommunitySelect extends StatefulWidget {
final String titleString;
final String image;
CommunitySelect({
Key? key,
required this.titleString,
required this.image,
}) : super(key: key);
@override
State<CommunitySelect> createState() => _CommunitySelectState();
}
class _CommunitySelectState extends State<CommunitySelect> {
bool _text = false;
@override
Widget build(BuildContext context) {
return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
Container(
width: 73.w,
height: 73.h,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(
// "https://via.placeholder.com/169x74"
widget.image),
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100),
),
),
),
sizedBoxHeight(15.h),
SizedBox(width: 94.w, child: text12400white(widget.titleString)),
sizedBoxHeight(15.h),
GestureDetector(
onTap: () {
setState(() {
_text = !_text;
});
},
child: Container(
width: 100.w,
height: 23.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Color(0xFFFF002B)),
borderRadius: BorderRadius.circular(30),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_text ? text10400white('Regrouping') : text10400white('Join')
],
),
),
),
]);
}
}