some changes in profile tab

This commit is contained in:
cj201199
2024-07-25 15:41:58 +05:30
parent a67bcf9100
commit 435cdf0909
6 changed files with 129 additions and 112 deletions

View File

@@ -61,20 +61,23 @@ class _BusEditProfileState extends State<BusEditProfile> {
super.initState();
}
//Founded on & bio data not there
//Founded on & bio , businessUsername data not there
setValues() {
if (isOnce) {
busNameController.text = getEditProfileBus!.data!.businessName ?? '';
busUserNameController.text = getEditProfileBus!.data!.businessName ?? '';
busUserNameController.text = getEditProfileBus!.data!.businessName ?? 'victorygames _10';
ownerNameController.text =
getEditProfileBus!.data!.businessOwnerName ?? '';
getEditProfileBus!.data!.businessOwnerName ?? 'James Bothman';
foundedonController.text =
getEditProfileBus!.data!.businessOwnerName ?? '';
websiteLinkController.text = getEditProfileBus!.data!.websiteLink ?? '';
locationController.text = getEditProfileBus!.data!.businessLocation ?? '';
getEditProfileBus!.data!.businessType!.createdAt ?? '12-04-2024';
websiteLinkController.text =
getEditProfileBus!.data!.websiteLink ?? 'victorygames _10';
locationController.text = getEditProfileBus!.data!.businessLocation ??
'Elm street london, United Kingdom';
bioController.text = getEditProfileBus!.data!.businessOwnerName ?? '';
bioController.text =
getEditProfileBus!.data!.businessType!.description ?? "";
// _selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
// _selectedsportType = getEditProfileIndi!.data!.interest!.join(', ') ?? '';
@@ -136,10 +139,10 @@ class _BusEditProfileState extends State<BusEditProfile> {
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
@@ -152,16 +155,16 @@ class _BusEditProfileState extends State<BusEditProfile> {
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
backgroundColor: const Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
appBar: const CommonAppbar(
titleTxt: "",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return ShimmerCommon();
return const ShimmerCommon();
// Center(
// child: CircularProgressIndicator(
@@ -224,11 +227,11 @@ class _BusEditProfileState extends State<BusEditProfile> {
).image,
fit: BoxFit.cover,
),
shape: OvalBorder(),
shape: const OvalBorder(),
),
)
: CircleAvatar(
backgroundImage: AssetImage(
backgroundImage: const AssetImage(
"assets/images/png/Ellipse 37 (1).png",
),
radius: 50.r,
@@ -254,7 +257,7 @@ class _BusEditProfileState extends State<BusEditProfile> {
child: Container(
height: 35.h,
width: 35.w,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFD90B2E)),
child: Center(
@@ -307,7 +310,7 @@ class _BusEditProfileState extends State<BusEditProfile> {
),
),
),
hintText: "victorygames _10",
hintText: "",
),
sizedBoxHeight(20.h),
text16400white("Owner name"),
@@ -325,7 +328,7 @@ class _BusEditProfileState extends State<BusEditProfile> {
),
),
),
hintText: "James Bothman",
hintText: "",
),
sizedBoxHeight(20.h),
text16400white("Founded on"),
@@ -346,7 +349,7 @@ class _BusEditProfileState extends State<BusEditProfile> {
),
),
),
hintText: "12-04-2024",
hintText: "",
textEditingController:
foundedonController,
),
@@ -368,7 +371,7 @@ class _BusEditProfileState extends State<BusEditProfile> {
),
),
),
hintText: "victorygames _10",
hintText: "",
),
sizedBoxHeight(25.h),
Row(
@@ -396,15 +399,14 @@ class _BusEditProfileState extends State<BusEditProfile> {
),
),
),
hintText: "Elm street london, United Kingdom",
hintText: "",
),
sizedBoxHeight(20.h),
text16400white("Bio"),
sizedBoxHeight(16.h),
CustomTextFormField2(
textEditingController: bioController,
hintText:
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
hintText: "",
maxlines: 3,
),
sizedBoxHeight(60.h),

View File

@@ -104,6 +104,16 @@ class _EditProfileState extends State<EditProfile> {
_selectedSports =
getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList();
_selectedsportType = _selectedSports.join(', ');
positionController.text =
getEditProfileIndi!.data!.position ?? 'Lorem lpsum';
trainingScoresController.text =
getEditProfileIndi!.data!.trainingScores ?? '50';
heightController.text = getEditProfileIndi!.data!.height ?? '6 feet';
weightController.text = getEditProfileIndi!.data!.weight ?? '70kg';
battingAvgController.text =
getEditProfileIndi!.data!.battingAverage ?? '372';
isOnce = false;
setState(() {});
@@ -159,10 +169,10 @@ class _EditProfileState extends State<EditProfile> {
Get.snackbar(
"Success!",
'success!',
duration: Duration(seconds: 2),
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
@@ -175,10 +185,10 @@ class _EditProfileState extends State<EditProfile> {
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
@@ -191,16 +201,16 @@ class _EditProfileState extends State<EditProfile> {
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
backgroundColor: const Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
appBar: const CommonAppbar(
titleTxt: "",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
return const Center(
child: CircularProgressIndicator(
color: Colors.blue,
),
@@ -247,7 +257,7 @@ class _EditProfileState extends State<EditProfile> {
),
)
: CircleAvatar(
backgroundImage: AssetImage(
backgroundImage: const AssetImage(
"assets/images/png/cimg3.png",
),
radius: 50.r,
@@ -273,7 +283,7 @@ class _EditProfileState extends State<EditProfile> {
child: Container(
height: 35.h,
width: 35.w,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFD90B2E)),
child: Center(
@@ -357,6 +367,7 @@ class _EditProfileState extends State<EditProfile> {
text16400white("Gender"),
sizedBoxHeight(16.h),
CustomDropDownRadio(
initialSelectedValue: _selectedgenderType,
header: _selectedgenderType ?? "Male",
title: "",
showOtherOption: true,

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -8,7 +7,6 @@ import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/MainScreen.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
@@ -28,6 +26,8 @@ class ProfileTab extends StatefulWidget {
State<ProfileTab> createState() => _ProfileTabState();
}
//location
class _ProfileTabState extends State<ProfileTab> {
List cardtile = [
{
@@ -194,7 +194,7 @@ class _ProfileTabState extends State<ProfileTab> {
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
backgroundColor: const Color(0xFF222935),
extendBody: true,
// accountTypeValue == '1' ||
body: accounTypeLogin == '1' || accountTypeValue == '1'
@@ -202,7 +202,7 @@ class _ProfileTabState extends State<ProfileTab> {
future: individualfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return ShimmerCommon();
return const ShimmerCommon();
// Center(
// child: CircularProgressIndicator(
@@ -248,7 +248,7 @@ class _ProfileTabState extends State<ProfileTab> {
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -315,8 +315,8 @@ class _ProfileTabState extends State<ProfileTab> {
BorderRadius.circular(
41.r),
border: Border.all(
color:
Color(0xFFD90B2E),
color: const Color(
0xFFD90B2E),
width: 0.84)),
child: Row(
mainAxisAlignment:
@@ -350,7 +350,8 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxHeight(30.h),
text18w700white("About"),
sizedBoxHeight(10.h),
text14400white(
text14400white(getEditProfileIndi!
.data!.about ??
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."),
sizedBoxHeight(25.h),
Row(
@@ -371,6 +372,7 @@ class _ProfileTabState extends State<ProfileTab> {
),
sizedBoxWidth(12.w),
text14400whiteblur(
"Elm street london, United Kingdom"),
],
),
@@ -414,7 +416,7 @@ class _ProfileTabState extends State<ProfileTab> {
Row(
children: [
text18w700white("Timeline"),
Spacer(),
const Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.addtimeline,
@@ -516,7 +518,7 @@ class _ProfileTabState extends State<ProfileTab> {
child: Container(
height: 11.h,
width: 11.w,
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors
.white,
shape: BoxShape
@@ -528,7 +530,7 @@ class _ProfileTabState extends State<ProfileTab> {
width: 1.w,
height: 170.h,
decoration:
BoxDecoration(
const BoxDecoration(
color: Colors
.white),
),
@@ -574,7 +576,7 @@ class _ProfileTabState extends State<ProfileTab> {
Row(
children: [
getEditProfileIndi?.data?.profilePhoto == null || getEditProfileIndi!.data!.profilePhoto!.isEmpty
? CircleAvatar(radius: 10.r, backgroundImage: AssetImage('assets/images/png/cimg1.png'))
? CircleAvatar(radius: 10.r, backgroundImage: const AssetImage('assets/images/png/cimg1.png'))
: CircleAvatar(radius: 10.r, backgroundImage: NetworkImage(getEditProfileIndi!.data!.profilePhoto!)),
sizedBoxWidth(
8.w),
@@ -600,7 +602,7 @@ class _ProfileTabState extends State<ProfileTab> {
child: SizedBox(
width: 20.w,
height: 20.h,
child: Icon(
child: const Icon(
Icons.delete,
color: Colors.white,
)),
@@ -778,7 +780,7 @@ class _ProfileTabState extends State<ProfileTab> {
children: [
text18w700white(
"Certifications/Qualifications"),
Spacer(),
const Spacer(),
InkWell(
onTap: () {
Get.toNamed(
@@ -801,7 +803,7 @@ class _ProfileTabState extends State<ProfileTab> {
scrollDirection: Axis.horizontal,
// padding:
// EdgeInsets.only(left: 16.w),
physics: ScrollPhysics(),
physics: const ScrollPhysics(),
itemCount: getEditProfileIndi!
.data!.certifications!.length,
itemBuilder: (context, index) {
@@ -915,7 +917,7 @@ class _ProfileTabState extends State<ProfileTab> {
style: TextStyle(
fontSize: 9.sp,
fontWeight: FontWeight.w400,
color: Color(0xffFFFFFF).withOpacity(0.70),
color: const Color(0xffFFFFFF).withOpacity(0.70),
fontFamily: 'Helvetica'),
)
: Text(
@@ -923,7 +925,7 @@ class _ProfileTabState extends State<ProfileTab> {
style: TextStyle(
fontSize: 9.sp,
fontWeight: FontWeight.w400,
color: Color(0xffFFFFFF).withOpacity(0.70),
color: const Color(0xffFFFFFF).withOpacity(0.70),
fontFamily: 'Helvetica'),
)
],
@@ -946,7 +948,8 @@ class _ProfileTabState extends State<ProfileTab> {
RemoveCertificationUploadata();
});
},
child: Icon(
child:
const Icon(
Icons
.delete,
color: Colors
@@ -1041,7 +1044,7 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxHeight(20.h),
Row(
children: [
Spacer(),
const Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.settings);
@@ -1078,7 +1081,7 @@ class _ProfileTabState extends State<ProfileTab> {
future: businessfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return ShimmerCommon();
return const ShimmerCommon();
}
if (snapshot.hasError) {
@@ -1118,7 +1121,7 @@ class _ProfileTabState extends State<ProfileTab> {
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -1192,7 +1195,7 @@ class _ProfileTabState extends State<ProfileTab> {
width: 1.0,
),
boxShadow: [
BoxShadow(
const BoxShadow(
color:
Color(0x66000000),
offset: Offset(0, 4),
@@ -1254,7 +1257,7 @@ class _ProfileTabState extends State<ProfileTab> {
height: 40.h,
width: 170.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
color: const Color(0xFFD90B2E),
borderRadius:
BorderRadius.circular(30.r),
),
@@ -1417,7 +1420,7 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxHeight(20.h),
Row(
children: [
Spacer(),
const Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.settings);
@@ -1475,7 +1478,7 @@ class _ProfileTabState extends State<ProfileTab> {
child: Container(
height: 11.h,
width: 11.w,
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white, shape: BoxShape.circle)),
),
Positioned(
@@ -1483,7 +1486,7 @@ class _ProfileTabState extends State<ProfileTab> {
child: Container(
width: 1.w,
height: 170.h,
decoration: BoxDecoration(color: Colors.white),
decoration: const BoxDecoration(color: Colors.white),
),
),
],
@@ -1511,7 +1514,7 @@ class _ProfileTabState extends State<ProfileTab> {
imagePath == null || imagePath.isEmpty
? CircleAvatar(
radius: 10.r,
backgroundImage: AssetImage(
backgroundImage: const AssetImage(
'assets/images/png/cimg1.png'))
: CircleAvatar(
radius: 10.r,
@@ -1588,7 +1591,7 @@ class _ProfileTabState extends State<ProfileTab> {
child: text10400whiteblur(abilityName),
);
} else {
return SizedBox();
return const SizedBox();
}
},
),
@@ -1652,7 +1655,7 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxWidth(7.w),
Icon(
Icons.circle,
color: Color(0xFFFCFCFC),
color: const Color(0xFFFCFCFC),
size: 4.sp,
),
sizedBoxWidth(6.w),
@@ -1661,12 +1664,12 @@ class _ProfileTabState extends State<ProfileTab> {
)
],
),
Spacer(),
const Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
surfaceTintColor: const Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: Offset(0, 50),
color: Color(0xFF222935),
offset: const Offset(0, 50),
color: const Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
@@ -1684,7 +1687,7 @@ class _ProfileTabState extends State<ProfileTab> {
fontFamily: "Nunito Sans",
),
),
Spacer(),
const Spacer(),
Image.asset(
"assets/images/png/Vector (5).png",
height: 15.h,
@@ -1694,7 +1697,7 @@ class _ProfileTabState extends State<ProfileTab> {
),
),
),
PopupMenuDivider(),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
@@ -1710,7 +1713,7 @@ class _ProfileTabState extends State<ProfileTab> {
fontFamily: "Nunito Sans",
),
),
Spacer(),
const Spacer(),
Image.asset(
"assets/images/png/share.png",
height: 20.h,
@@ -1720,7 +1723,7 @@ class _ProfileTabState extends State<ProfileTab> {
),
),
),
PopupMenuDivider(),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
@@ -1736,7 +1739,7 @@ class _ProfileTabState extends State<ProfileTab> {
fontFamily: "Nunito Sans",
),
),
Spacer(),
const Spacer(),
Image.asset(
"assets/images/png/f7_pin-fill (2).png",
height: 25.h,
@@ -1801,7 +1804,7 @@ class _ProfileTabState extends State<ProfileTab> {
'assets/images/png/heart 2.png',
'assets/images/png/party-popper 2.png'
]),
Spacer(),
const Spacer(),
commonContainer(
width: 30.w,
height: 30.h,
@@ -1884,11 +1887,12 @@ class _ProfileTabState extends State<ProfileTab> {
boxRadius: 30,
itemsSpacing: 8,
itemScale: 0.4,
itemSize: Size(45, 45),
boxPadding: EdgeInsets.all(8),
boxAnimationDuration: Duration(milliseconds: 200),
itemAnimationDuration: Duration(milliseconds: 500),
hoverDuration: Duration(milliseconds: 700),
itemSize: const Size(45, 45),
boxPadding: const EdgeInsets.all(8),
boxAnimationDuration: const Duration(milliseconds: 200),
itemAnimationDuration:
const Duration(milliseconds: 500),
hoverDuration: const Duration(milliseconds: 700),
// toggle: false,
child: _buildReactionsIcon(mainImage.value),
@@ -1961,7 +1965,7 @@ class _ProfileTabState extends State<ProfileTab> {
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderColor: Color(0xFFD90B2E),
borderColor: const Color(0xFFD90B2E),
borderwidth: 0.9,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),

View File

@@ -485,16 +485,16 @@ class _ProfileTabIndGuestState extends State<ProfileTabIndGuest> {
children: [
text18w700white("Timeline"),
const Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.addtimeline);
},
child: Image.asset(
"assets/images/png/iconamoon_edit-thin.png",
height: 20.h,
width: 20.w,
),
)
// InkWell(
// onTap: () {
// Get.toNamed(RouteName.addtimeline);
// },
// child: Image.asset(
// "assets/images/png/iconamoon_edit-thin.png",
// height: 20.h,
// width: 20.w,
// ),
// )
],
),
sizedBoxHeight(20.h),
@@ -609,8 +609,8 @@ class _ProfileTabIndGuestState extends State<ProfileTabIndGuest> {
? Padding(
padding: EdgeInsets.symmetric(vertical: 30.h),
child: Center(
child: text18w700white(
"No groups Found")),
child:
text18w700white("No groups Found")),
)
: SizedBox(
height: 190.h,

View File

@@ -465,21 +465,19 @@ class _FollowersTabState extends State<FollowersTab> {
}
Widget _buildNoDataBody(context) {
return Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"No Data Found",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
)
],
),
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"No Data Found",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
)
],
),
);
}

View File

@@ -507,6 +507,7 @@ class CustomDropDownRadio extends StatefulWidget {
required this.onItemSelected,
required this.leadingImage,
this.showOtherOption = false,
this.initialSelectedValue = '',
}) : super(key: key);
final String header;
@@ -515,6 +516,7 @@ class CustomDropDownRadio extends StatefulWidget {
final Function(String) onItemSelected;
final Widget? leadingImage;
final bool showOtherOption;
final String initialSelectedValue;
@override
State<CustomDropDownRadio> createState() => _CustomDropDownRadioState();
@@ -522,9 +524,14 @@ class CustomDropDownRadio extends StatefulWidget {
class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
RxBool onDropTap = false.obs;
RxString selectedValue = "".obs;
final TextEditingController _textController =
TextEditingController(); // Add a text controller
RxString selectedValue = ''.obs;
final TextEditingController _textController = TextEditingController();
@override
void initState() {
super.initState();
selectedValue.value = widget.initialSelectedValue;
}
List<DropdownMenuItem<String>> _buildDropdownMenuItems() {
List<DropdownMenuItem<String>> items =
@@ -570,7 +577,6 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
],
),
// SizedBox(height: 5.h),
if (index != widget.listData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
],
@@ -646,7 +652,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
],
),
sizedBoxHeight(10.h),
SizedBox(height: 10.h),
],
),
),
@@ -718,10 +724,8 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
if (onDropTap.value)
Scrollbar(
// thumbVisibility: true,
child: Container(
width: double.infinity,
//height: widget.listData.length > 4 ? 250.h : null,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: BorderRadius.vertical(
@@ -738,8 +742,6 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
),
child: Column(
// shrinkWrap: true,
// reverse: true,
children: _buildDropdownMenuItems(),
),
),