some ui changes

This commit is contained in:
cj201199
2024-07-26 15:27:50 +05:30
parent 79105e3813
commit 634b1a3bc4
12 changed files with 1255 additions and 712 deletions

View File

@@ -95,6 +95,9 @@ class ApiUrls {
// Individual
static const posteditprofile = "${baseUrl}update-profile";
static const geteditprofile = "${baseUrl}fetch-profile";
static const getinterestlist = "${baseUrl}fetch-interests";
// Business
static const posteditprofilebusiness = "${baseUrl}update-business-profile";

View File

@@ -0,0 +1,53 @@
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(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;
Null? 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 = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['image'] = this.image;
return data;
}
}

View File

@@ -66,7 +66,8 @@ class _BusEditProfileState extends State<BusEditProfile> {
setValues() {
if (isOnce) {
busNameController.text = getEditProfileBus!.data!.businessName ?? '';
busUserNameController.text = getEditProfileBus!.data!.businessName ?? 'victorygames _10';
busUserNameController.text =
getEditProfileBus!.data!.businessName ?? 'victorygames _10';
ownerNameController.text =
getEditProfileBus!.data!.businessOwnerName ?? 'James Bothman';
foundedonController.text =
@@ -164,13 +165,14 @@ class _BusEditProfileState extends State<BusEditProfile> {
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const ShimmerCommon();
return
// const ShimmerCommon();
// Center(
// child: CircularProgressIndicator(
// color: Colors.blue,
// ),
// );
Center(
child: CircularProgressIndicator(
color: Colors.blue,
),
);
}
if (snapshot.hasError) {

View File

@@ -1,3 +1,4 @@
import 'dart:developer';
import 'dart:io';
import 'package:dio/dio.dart';
@@ -7,7 +8,11 @@ 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/Model/GetEditProfileIndi.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart'
as interestlist;
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';
@@ -16,6 +21,7 @@ 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});
@@ -24,6 +30,8 @@ class EditProfile extends StatefulWidget {
State<EditProfile> createState() => _EditProfileState();
}
//location in normal profile individual api
class _EditProfileState extends State<EditProfile> {
TextEditingController fullNameController = TextEditingController();
TextEditingController userNameController = TextEditingController();
@@ -71,39 +79,102 @@ class _EditProfileState extends State<EditProfile> {
});
}
List<int> getSelectedSportsIds() {
if (getEditProfileIndi == null ||
getEditProfileIndi!.data!.interest == null) {
return [];
}
// List<int> getSelectedSportsIds() {
// if (getEditProfileIndi == null ||
// getEditProfileIndi!.data!.interest == null) {
// print("No interests found.");
// return [];
// }
return _selectedSports
.map((sportName) => getEditProfileIndi!.data!.interest!
.firstWhere((interest) => interest.name == sportName)
.id!)
.toList();
// print("Selected sports: $_selectedSports");
// List<int> selectedIds = _selectedSports
// .map((sportName) {
// var interest = getEditProfileIndi!.data!.interest!.firstWhere(
// (interest) => interest.name == sportName,
// orElse: () => Interest(id: -1, name: ''),
// );
// if (interest.id == -1) {
// print("No matching interest found for sport: $sportName");
// } else {
// print(
// "Found interest for sport: $sportName with ID: ${interest.id}");
// }
// return interest.id!;
// })
// .where((id) => id != -1)
// .toList();
// print("Selected IDs: $selectedIds");
// return selectedIds;
// }
//interestList
// int id = Get.arguments["id"];
// bool edited = Get.arguments["edit"];
interestlist.InterestModel? interestModel;
List<interestlist.Data> interest = [];
List<String> _interestdrop = [];
List<int> selectedinterestid = [];
List<String> selctedNameList = [];
RxBool isloading = true.obs;
Future<void> fetchInterestlist() async {
InterestListApi interestListAPI = InterestListApi();
ResponseData<dynamic> response = await interestListAPI.getinterestlistApi();
if (response.status == ResponseStatus.SUCCESS) {
interestModel = interestlist.InterestModel.fromJson(response.data!);
setState(() {
interest = interestModel!.data ?? [];
_interestdrop =
interest.map((platform) => platform.name.toString()).toList();
});
log(interest.toString());
} else {
print('Failed to fetch abilities');
}
}
void getCatIdFromName(List<String> selectedInterests) {
selectedinterestid.clear();
for (var name in selectedInterests) {
for (var i = 0; i < interest.length; i++) {
if (name == interest[i].name) {
selectedinterestid.add(interest[i].id!);
break;
}
}
}
}
@override
void initState() {
// TODO: implement initState
// if (edited == true) {
myfuture = EditProfileApi()
.getEditProfileIndividual()
.then((value) => {setValues()});
super.initState();
}
setValues() {
setValues() async {
if (isOnce) {
fullNameController.text = getEditProfileIndi!.data!.fullName ?? '';
userNameController.text = getEditProfileIndi!.data!.userName ?? '';
dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? '';
_selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
_selectedSports =
getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList();
_selectedsportType = _selectedSports.join(', ');
// _selectedSports =
// getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList();
// _selectedsportType = _selectedSports.join(', ');
locationController.text = getEditProfileIndi!.data!.about ?? '';
aboutController.text = getEditProfileIndi!.data!.about ?? '';
positionController.text =
getEditProfileIndi!.data!.position ?? 'Lorem lpsum';
@@ -115,86 +186,90 @@ class _EditProfileState extends State<EditProfile> {
battingAvgController.text =
getEditProfileIndi!.data!.battingAverage ?? '372';
isOnce = false;
setState(() {});
}
}
List<int> interestsIds = [];
List<Map<String, dynamic>> _interestsMap = [];
void saveEditProfileInd() async {
List<int> selectedSportsIds = getSelectedSportsIds();
// List<int> selectedSportsIds = getSelectedSportsIds();
// String interestsString = '[' +
// selectedSportsIds.join(', ') +
// ']';
// print("Interests String: $interestsString");
FormData? updata;
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',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (profilePicture == "") {
utils.showToast('Upload edit profile picture!');
String abilitiesIds = selectedinterestid.toString();
print("Interests String: $abilitiesIds");
updata = FormData.fromMap({
// "email_address": "priyanka14@yopmail.com",
"full_name": fullNameController.text,
"profile_image": await convertFileToMultiPart1(profilePicture),
// "profile_image": "ghjkk.png",
"user_name": userNameController.text,
"date_of_birth": dateController.text,
"gender": _selectedgenderType,
// "interest": "selectedSportsIds",
"interest": 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,
});
final data = await EditProfileApi().postEditProfileIndividual(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
// Get.snackbar(
// "Success!",
// 'success!',
// duration: const Duration(seconds: 2),
// colorText: Colors.white,
// backgroundColor: Colors.green,
// margin: const EdgeInsets.all(8),
// snackStyle: SnackStyle.FLOATING,
// snackPosition: SnackPosition.BOTTOM,
// );
Get.toNamed(RouteName.profiletab);
} else {
updata = FormData.fromMap({
"email_address": "priyanka12@yopmail.com",
"full_name": fullNameController.text,
"profile_image": await convertFileToMultiPart1(profilePicture),
// "profile_image": "ghjkk.png",
// 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;
}
}
"user_name": userNameController.text,
"date_of_birth": dateController.text,
"gender": _selectedgenderType,
// "interest": "selectedSportsIds",
"interest": ["1", "2", "3"].toList(),
"about": aboutController.text,
"position": positionController.text,
"training_scores": trainingScoresController.text,
"height": heightController.text,
"weight": weightController.text,
"batting_average": battingAvgController.text,
"address_line1": battingAvgController.text,
});
final data = await EditProfileApi().postEditProfileIndividual(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
Get.snackbar(
"Success!",
'success!',
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.back();
// Get.toNamed(RouteName.individualgroupstep3);
Get.back();
} else {
// 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;
Future<List<String>> getSelectedNames(List<int> selectedIds) async {
List<String> selectedNames = [];
for (int id in selectedIds) {
for (var interest in interest) {
if (interest.id == id) {
selectedNames.add(interest.name!);
break;
}
}
}
return selectedNames;
}
@override
@@ -250,18 +325,47 @@ class _EditProfileState extends State<EditProfile> {
size: Size.fromRadius(50.r),
child: Image.file(
File(profilePicture),
// filePath[0]!,
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,
);
},
),
),
)
: CircleAvatar(
backgroundImage: const AssetImage(
"assets/images/png/cimg3.png",
),
radius: 50.r,
),
: getEditProfileIndi?.data?.profilePhoto !=
null &&
getEditProfileIndi!
.data!.profilePhoto!.isNotEmpty
? Container(
width: 100.w,
height: 100.h,
decoration: ShapeDecoration(
image: DecorationImage(
image: NetworkImage(
getEditProfileIndi!
.data!.profilePhoto!,
),
fit: BoxFit.cover,
// onError: (error, stackTrace) {
// // Fallback to default image in case of error
// return const AssetImage("assets/images/png/cimg3.png");
// },
),
shape: const OvalBorder(),
),
)
: CircleAvatar(
backgroundImage: const AssetImage(
"assets/images/png/cimg3.png"),
radius: 50.r,
),
Positioned(
bottom: 0,
right: 0,
@@ -424,31 +528,7 @@ class _EditProfileState extends State<EditProfile> {
],
),
sizedBoxHeight(16.h),
CustomDropDownChexkBox(
header: _selectedsportType ??
"Rowing, Rugby, Swimming",
title: "",
listData: [
"Rowing",
"Cycling",
"Running",
"Swimming",
"Triathlon",
"Hiking",
"Football",
"Rugby"
],
onItemSelected: _onSportSelected,
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
showOtherOption: true,
initiallySelected: _selectedSports,
),
// CustomDropDownRadio(
// showOtherOption: true,
// CustomDropDownChexkBox(
// header: _selectedsportType ??
// "Rowing, Rugby, Swimming",
// title: "",
@@ -468,8 +548,28 @@ class _EditProfileState extends State<EditProfile> {
// width: 18.w,
// height: 17.h,
// ),
// showOtherOption: true,
// initiallySelected: _selectedSports,
// ),
Obx(() {
return CustomDropDownChexkBox(
header: 'Select interest',
title: "",
listData: _interestdrop,
onItemSelected: getCatIdFromName,
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
// showOtherOption: true,
initiallySelected: selctedNameList,
);
}),
sizedBoxHeight(20.h),
text16400white("About"),
sizedBoxHeight(16.h),
@@ -521,7 +621,31 @@ class _EditProfileState extends State<EditProfile> {
CommonBtn(
text: "Save",
onTap: () {
saveEditProfileInd();
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',
'Enter your credentials',
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),
@@ -532,5 +656,361 @@ class _EditProfileState extends State<EditProfile> {
}
return Container();
}));
// 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: [
// profilePicture != "" && isImageAdded
// ? ClipOval(
// child: SizedBox.fromSize(
// size: Size.fromRadius(50.r),
// child: Image.file(
// File(profilePicture),
// 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,
// );
// },
// ),
// ),
// )
// : getEditProfileIndi?.data?.profilePhoto !=
// null &&
// getEditProfileIndi!
// .data!.profilePhoto!.isNotEmpty
// ? Container(
// width: 100.w,
// height: 100.h,
// decoration: ShapeDecoration(
// image: DecorationImage(
// image: NetworkImage(
// getEditProfileIndi!
// .data!.profilePhoto!,
// ),
// fit: BoxFit.cover,
// // onError: (error, stackTrace) {
// // // Fallback to default image in case of error
// // return const AssetImage("assets/images/png/cimg3.png");
// // },
// ),
// shape: const OvalBorder(),
// ),
// )
// : 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 filenameresult =
// extractFileName1(result);
// 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: "Edward Hackett",
// ),
// 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: "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(
// initialSelectedValue: _selectedgenderType,
// header: _selectedgenderType ?? "Male",
// title: "",
// showOtherOption: true,
// listData: [
// "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: "Elm street london, United Kingdom",
// ),
// 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),
// // CustomDropDownChexkBox(
// // header: _selectedsportType ??
// // "Rowing, Rugby, Swimming",
// // title: "",
// // listData: [
// // "Rowing",
// // "Cycling",
// // "Running",
// // "Swimming",
// // "Triathlon",
// // "Hiking",
// // "Football",
// // "Rugby"
// // ],
// // onItemSelected: _onSportSelected,
// // leadingImage: Image.asset(
// // "assets/images/png/Vector (4).png",
// // width: 18.w,
// // height: 17.h,
// // ),
// // showOtherOption: true,
// // initiallySelected: _selectedSports,
// // ),
// // CustomDropDownRadio(
// // showOtherOption: true,
// // header: _selectedsportType ??
// // "Rowing, Rugby, Swimming",
// // title: "",
// // listData: [
// // "Rowing",
// // "Cycling",
// // "Running",
// // "Swimming",
// // "Triathlon",
// // "Hiking",
// // "Football",
// // "Rugby"
// // ],
// // onItemSelected: _onSportSelected,
// // leadingImage: Image.asset(
// // "assets/images/png/Vector (4).png",
// // width: 18.w,
// // height: 17.h,
// // ),
// // ),
// 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: "Lorem Ipsum",
// ),
// sizedBoxHeight(20.h),
// text16400white("Training Scores"),
// sizedBoxHeight(16.h),
// CustomTextFormField(
// textEditingController:
// trainingScoresController,
// hintText: "50",
// ),
// sizedBoxHeight(20.h),
// text16400white("Height"),
// sizedBoxHeight(16.h),
// CustomTextFormField(
// textEditingController: heightController,
// hintText: "6 feet",
// ),
// sizedBoxHeight(20.h),
// text16400white("Weight"),
// sizedBoxHeight(16.h),
// CustomTextFormField(
// textEditingController: weightController,
// hintText: "70kg",
// ),
// sizedBoxHeight(20.h),
// text16400white("Batting Average"),
// sizedBoxHeight(16.h),
// CustomTextFormField(
// textEditingController: battingAvgController,
// hintText: "372",
// ),
// sizedBoxHeight(20.h),
// sizedBoxHeight(60.h),
// CommonBtn(
// text: "Save",
// onTap: () {
// saveEditProfileInd();
// },
// ),
// sizedBoxHeight(60.h),
// ],
// )
// ])))
// ]);
// }
// return Container();
// }));
}
}

View File

@@ -35,13 +35,35 @@ class EditProfileApi {
getEditProfileIndi = GetEditProfileIndi.fromJson(response.data);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data["status"] == "success") {
print("Success---->");
if (getEditProfileIndi!.data!.accountVisibility == 1) {
accountvisibility = true;
} else {
accountvisibility = false;
}
print(accountvisibility.toString());
// await fetchInterestlist().then((value) {
// String interestsXids =
// getEditProfileIndi!.data!.interest!.map((e) => e.id!).join(',');
// interestsIds = interestsXids
// .split(',')
// .map((e) => int.tryParse(e.trim()) ?? 0)
// .toList();
// selectedinterestid = interestsIds;
// print(selectedinterestid.toList());
// for (int i = 0; i < interest.length; i++) {
// _interestsMap.add({
// "id": interest[i].id!,
// "name": interest[i].name!,
// });
// }
// getSelectedNames(selectedinterestid).then((value) {
// setState(() {
// selctedNameList = value;
// });
// });
// });
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
data: response.data);
@@ -54,6 +76,7 @@ class EditProfileApi {
return response;
}
Future<ResponseData<dynamic>> postEditProfileBusiness(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()

View File

@@ -0,0 +1,29 @@
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';
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") {
print("success");
InterestModel interestlistobj =
InterestModel.fromJson(responseData);
} else {
// return ResponseData<dynamic>(
// responseData['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -119,8 +119,7 @@ class _FollowersState extends State<Followers> {
AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Column(children: [
Column(children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -448,7 +447,7 @@ class _FollowersState extends State<Followers> {
},
),
])
]))
])
])
: Stack(children: [
Container(
@@ -458,8 +457,7 @@ class _FollowersState extends State<Followers> {
AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Column(children: [
Column(children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -501,8 +499,10 @@ class _FollowersState extends State<Followers> {
if (snapshot.connectionState ==
ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return const Center(
child: CircularProgressIndicator());
return Expanded(
child: const Center(
child: CircularProgressIndicator()),
);
} else if (snapshot.hasError) {
// Handle error state
return Center(
@@ -762,7 +762,7 @@ class _FollowersState extends State<Followers> {
},
),
])
]))
])
]));
}

View File

@@ -45,13 +45,14 @@ class _profiletabBusGestState extends State<profiletabBusGest> {
future: guestBusfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return ShimmerCommon();
return
// ShimmerCommon();
// Center(
// child: CircularProgressIndicator(
// color: Colors.blue,
// ),
// );
Center(
child: CircularProgressIndicator(
color: Colors.blue,
),
);
}
if (snapshot.hasError) {

View File

@@ -190,9 +190,9 @@ class _ContactUsState extends State<ContactUs> {
onPressed: () {
// final isValid =
// _formkey.currentState?.validate();
if (fullname.text.isBlank! &&
email.text.isBlank! &&
querycontroller.text.isBlank! &&
if (fullname.text.isBlank! ||
email.text.isBlank! ||
querycontroller.text.isBlank! ||
_selectedreasontocontact.isEmpty) {
utils.showToast("Please fill all fields");
} else {

View File

@@ -115,7 +115,12 @@ class _DeleteAccountState extends State<DeleteAccount> {
textEditingController: leavingcontroller,
),
sizedBoxHeight(20.h),
CommonBtn(text: "I dont want to delete"),
CommonBtn(
text: "I dont want to delete",
onTap: () {
Get.toNamed(RouteName.mainscreen);
},
),
sizedBoxHeight(18.h),
GestureDetector(
onTap: () {

View File

@@ -752,6 +752,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
}
}
class CustomDropDownChexkBox extends StatefulWidget {
const CustomDropDownChexkBox({
Key? key,