Files
Regroup/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/EditProfile.dart
2024-07-01 19:58:39 +05:30

277 lines
12 KiB
Dart

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/CommonDropDown.dart';
import 'package:regroup/Common/CommonWidget.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/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:intl/intl.dart';
class EditProfile extends StatefulWidget {
const EditProfile({super.key});
@override
State<EditProfile> createState() => _EditProfileState();
}
class _EditProfileState extends State<EditProfile> {
TextEditingController dateController = TextEditingController();
List<File?> filePath = [];
bool? isImageAdded = false;
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
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),
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: 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: 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(
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: "Edward Hackett",
),
sizedBoxHeight(20.h),
text16400white("User name"),
sizedBoxHeight(16.h),
CustomTextFormField(
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: "edward_01",
),
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(
header: "Male",
title: "",
showOtherOption: true,
listData: ["Male", "Female", "Prefer not to say"],
onItemSelected: (p0) {},
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(
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: "Elm street london, United Kingdom",
),
sizedBoxHeight(20.h),
Row(
children: [
text16400white("Primary sport"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomDropDownRadio(
showOtherOption: true,
header: "Rowing, Rugby, Swimming",
title: "",
listData: [
"Rowing",
"Cycling",
"Running",
"Swimming",
"Triathlon",
"Hiking",
"Football",
"Rugby"
],
onItemSelected: (p0) {},
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
),
// CommonDropdownradioBtn(
// hint: "Rowing, Rugby, Swimming",
// items: [
// "Rowing",
// "Cycling",
// "Running",
// "Swimming",
// "Triathlon",
// "Hiking",
// "Football",
// "Rugby"
// ],
// leadingIcon: Image.asset(
// "assets/images/png/Vector (4).png",
// width: 18.w,
// height: 17.h,
// ),
// showOtherOption: true,
// ),
sizedBoxHeight(20.h),
text16400white("Bio"),
sizedBoxHeight(16.h),
CustomTextFormField2(
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(60.h),
CommonBtn(text: "Save"),
sizedBoxHeight(60.h),
],
)
])))
]));
}
}