diff --git a/lib/Common/CommonWidget.dart b/lib/Common/CommonWidget.dart index c0ed6d9..afb32f8 100644 --- a/lib/Common/CommonWidget.dart +++ b/lib/Common/CommonWidget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -265,6 +266,73 @@ Widget stackContainers({ ); } +Widget stackContainersGroups({ + required String number, + required List containerImages, +}) { + // Define the maximum number of images to display + const maxImagesToShow = 3; + + // Calculate the number of images to show and the remaining count + final remainingCount = containerImages.length - maxImagesToShow; + final imagesToShow = containerImages.take(maxImagesToShow).toList(); + + return Row( + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + Container( + height: 30, + width: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFD90B2E), + border: Border.all(color: Color(0xFF2C3742), width: 1), + ), + child: Center( + child: Text( + remainingCount > 0 ? '+$remainingCount' : '', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w400, + fontSize: 8, + ), + ), + ), + ), + Positioned( + left: 22.w, + child: SizedBox( + height: 30, + width: 30 * maxImagesToShow.toDouble(), + child: Stack( + clipBehavior: Clip.none, + children: List.generate(imagesToShow.length, (index) { + return Positioned( + left: index * 22.0, + child: Container( + height: 30, + width: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: Color(0xFF2C3742), width: 1), + ), + child: CircleAvatar( + backgroundImage: NetworkImage(imagesToShow[index]), + ), + ), + ); + }), + ), + ), + ), + ], + ), + ], + ); +} + Widget stackContainers2({ required List containerImages, }) { diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index 73385c8..afd85c2 100644 --- a/lib/Common/api_urls.dart +++ b/lib/Common/api_urls.dart @@ -34,7 +34,6 @@ class ApiUrls { static const getuserdetails = "${baseUrl}get-auth-user-data"; - static const getfaqs = "${baseUrl}fetch-faqs"; static const getprivacypolicy = "${baseUrl}fetch-privacy-policy"; @@ -83,11 +82,9 @@ class ApiUrls { static const postuserdevice = "${baseUrl}store-account-session"; + static const getmyjoinedgroups = "${baseUrl}my-joined-groups"; - - - - + static const getusercertificates = "${baseUrl}my-certificates"; static const postnotification = "${baseUrl}update-notification-settings"; static const getnotification = "${baseUrl}fetch-notification-settings"; @@ -95,7 +92,6 @@ class ApiUrls { static const getblockuser = "${baseUrl}fetch-blocked-profile"; static const postblockuser = "${baseUrl}block-profile"; - // Individual static const posteditprofile = "${baseUrl}update-profile"; static const geteditprofile = "${baseUrl}fetch-profile"; @@ -106,13 +102,11 @@ class ApiUrls { //Guest - static const getGuestProfileInd = "${baseUrl}get-guest-view-of-individual-user-profile"; - static const getGuestProfileBus = "${baseUrl}get-guest-view-of-business-user-profile"; - + static const getGuestProfileInd = + "${baseUrl}get-guest-view-of-individual-user-profile"; + static const getGuestProfileBus = + "${baseUrl}get-guest-view-of-business-user-profile"; static const getGuestfollowers = "${baseUrl}get-guest-user-followers"; static const getGuestfollowing = "${baseUrl}get-guest-user-following"; - - - } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart index b7c02ec..a1ffd3a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart @@ -15,6 +15,7 @@ import 'package:regroup/Utils/Common/ImageUpload.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.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'; import 'package:path/path.dart' as path; @@ -115,7 +116,8 @@ class _AddCertificateState extends State { final data = await Profilepostmethod().postCertification(formdata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - Get.back(); + // Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); return utils.showToast(data.message); } else { Get.back(); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart index 370bcb3..6748349 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -40,6 +41,17 @@ class _CertificateState extends State { }, ]; + late Future myfuture; + int id = Get.arguments["id"]; + + @override + void initState() { + // TODO: implement initState + + myfuture = Profilegetmethod().getUserCertificates(id); + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -51,7 +63,7 @@ class _CertificateState extends State { ), resizeToAvoidBottomInset: false, body: FutureBuilder( - future: EditProfileApi().getEditProfileIndividual(), + future: myfuture, builder: (ctx, snapshot) { if (snapshot.data == null) { return const Column( @@ -76,7 +88,7 @@ class _CertificateState extends State { ); } } - return getEditProfileIndi!.data!.certifications!.isEmpty + return certificateobj!.data!.isEmpty ? _buildNoDataBody(context) : _buildBody(context); }, @@ -126,51 +138,43 @@ class _CertificateState extends State { crossAxisSpacing: 8, childAspectRatio: 0.65, ), - itemCount: - getEditProfileIndi!.data!.certifications!.length, + itemCount: certificateobj!.data!.length, itemBuilder: (context, index) { return Column( // mainAxisAlignment: MainAxisAlignment.start, children: [ - getEditProfileIndi!.data!.certifications![index] - .certificationImage == + certificateobj!.data![index].certificationImage == null || - getEditProfileIndi! - .data! - .certifications![index] - .certificationImage! - .isEmpty + certificateobj!.data![index] + .certificationImage!.isEmpty ? Image.asset( CertificateData[index]["imagePath"], height: 100.h, width: 105.w, ) : Image.network( - getEditProfileIndi! - .data! - .certifications![index] - .certificationImage!, + certificateobj! + .data![index].certificationImage!, height: 100.h, width: 105.w, - ), + errorBuilder: (context, error, stackTrace) { + // Error handling when image fails to load + return Image.asset( + CertificateData[index]["imagePath"], + fit: BoxFit.cover, + ); + }), Expanded( child: Center( child: text14w400_FCFCFC( - getEditProfileIndi! - .data! - .certifications![index] + certificateobj!.data![index] .certificationName == null || - getEditProfileIndi! - .data! - .certifications![index] - .certificationName! - .isEmpty + certificateobj!.data![index] + .certificationName!.isEmpty ? CertificateData[index]["text"] - : getEditProfileIndi! - .data! - .certifications![index] - .certificationName, + : certificateobj! + .data![index].certificationName, textAlign: TextAlign.center, ), ), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart index 20a07ed..b1bd745 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart @@ -61,20 +61,23 @@ class _BusEditProfileState extends State { 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 { 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 { 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 { ).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 { 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 { ), ), ), - hintText: "victorygames _10", + hintText: "", ), sizedBoxHeight(20.h), text16400white("Owner name"), @@ -325,7 +328,7 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "James Bothman", + hintText: "", ), sizedBoxHeight(20.h), text16400white("Founded on"), @@ -346,7 +349,7 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "12-04-2024", + hintText: "", textEditingController: foundedonController, ), @@ -368,7 +371,7 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "victorygames _10", + hintText: "", ), sizedBoxHeight(25.h), Row( @@ -396,15 +399,14 @@ class _BusEditProfileState extends State { ), ), ), - 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), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart index d4568b9..4ab2574 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart @@ -104,6 +104,16 @@ class _EditProfileState extends State { _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 { 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 { 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 { 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 { ), ) : CircleAvatar( - backgroundImage: AssetImage( + backgroundImage: const AssetImage( "assets/images/png/cimg3.png", ), radius: 50.r, @@ -273,7 +283,7 @@ class _EditProfileState extends State { 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 { text16400white("Gender"), sizedBoxHeight(16.h), CustomDropDownRadio( + initialSelectedValue: _selectedgenderType, header: _selectedgenderType ?? "Male", title: "", showOtherOption: true, diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart index e3c1880..d7f25c0 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart @@ -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 createState() => _ProfileTabState(); } +//location + class _ProfileTabState extends State { List cardtile = [ { @@ -114,8 +114,10 @@ class _ProfileTabState extends State { setValues() async { if (isOnce) { SharedPreferences prefs = await SharedPreferences.getInstance(); - accountTypeValue = prefs.getString('accountTypeValue'); + // accountTypeValue = prefs.getString('accountTypeValue'); accounTypeLogin = prefs.getString('accountTypefromLogin'); + print('account tupe login is $accounTypeLogin'); + // print('account tupe value is $accountTypeValue'); if (getEditProfileIndi!.data!.interest != null) { // Join all interest names with a comma separator @@ -130,8 +132,10 @@ class _ProfileTabState extends State { setValues2() async { if (isOnce) { SharedPreferences prefs = await SharedPreferences.getInstance(); - accountTypeValue = prefs.getString('accountTypeValue'); + // accountTypeValue = prefs.getString('accountTypeValue'); accounTypeLogin = prefs.getString('accountTypefromLogin'); + print('account tupe login is $accounTypeLogin'); + // print('account tupe value is $accountTypeValue'); // foodItemDropdownController.selectedFooddynamic.clear(); // foodItemDropdownController.foodItemQControllerList.clear(); // foodItemDropdownController.OtherFoodIngredientList.clear(); @@ -194,21 +198,23 @@ class _ProfileTabState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, // accountTypeValue == '1' || - body: accounTypeLogin == '1' || accountTypeValue == '1' + body: accounTypeLogin == '1' + // || accountTypeValue == '1' ? FutureBuilder( future: individualfuture, 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) { @@ -239,16 +245,33 @@ class _ProfileTabState extends State { Stack( children: [ Container( - height: 484.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/profileimg.png", - fit: BoxFit.cover, - ), - ), + height: 484.h, + width: double.infinity, + child: getEditProfileIndi! + .data!.profilePhoto == + null || + getEditProfileIndi! + .data!.profilePhoto!.isEmpty + ? Image.asset( + "assets/images/png/profileimg.png", + fit: BoxFit.cover, + ) + : Image.network( + getEditProfileIndi! + .data!.profilePhoto!, + fit: BoxFit.cover, + errorBuilder: + (context, error, stackTrace) { + // Error handling when image fails to load + return Image.asset( + "assets/images/png/profileimg.png", + fit: BoxFit.cover, + ); + }, + )), Positioned.fill( child: Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -315,8 +338,8 @@ class _ProfileTabState extends State { BorderRadius.circular( 41.r), border: Border.all( - color: - Color(0xFFD90B2E), + color: const Color( + 0xFFD90B2E), width: 0.84)), child: Row( mainAxisAlignment: @@ -350,7 +373,8 @@ class _ProfileTabState extends State { 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 +395,7 @@ class _ProfileTabState extends State { ), sizedBoxWidth(12.w), text14400whiteblur( + "Elm street london, United Kingdom"), ], ), @@ -414,7 +439,7 @@ class _ProfileTabState extends State { Row( children: [ text18w700white("Timeline"), - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed(RouteName.addtimeline, @@ -516,7 +541,7 @@ class _ProfileTabState extends State { child: Container( height: 11.h, width: 11.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors .white, shape: BoxShape @@ -528,7 +553,7 @@ class _ProfileTabState extends State { width: 1.w, height: 170.h, decoration: - BoxDecoration( + const BoxDecoration( color: Colors .white), ), @@ -574,7 +599,7 @@ class _ProfileTabState extends State { 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 +625,7 @@ class _ProfileTabState extends State { child: SizedBox( width: 20.w, height: 20.h, - child: Icon( + child: const Icon( Icons.delete, color: Colors.white, )), @@ -746,10 +771,15 @@ class _ProfileTabState extends State { getEditProfileIndi!.data!.timelines![index].abilities!.length, itemBuilder: (context, innerIndex) { - List abilityName = getEditProfileIndi!.data!.timelines![index].abilities![innerIndex].name!.split('pattern'); + String abilityName = getEditProfileIndi!.data!.timelines![index].abilities![innerIndex].name!; + // List abilityName = getEditProfileIndi!.data!.timelines![index].abilities![innerIndex].name!.split(','); + // String formattedNames = abilityName.join(', '); + List abilityNames = abilityName.split(',').map((e) => e.trim()).toList(); + String formattedNames = abilityNames.join(', '); + print(formattedNames); return Padding( padding: EdgeInsets.only(right: 8.w), - child: text10400whiteblur(abilityName.toString()), + child: text10400whiteblur(formattedNames), ); }, ), @@ -778,11 +808,14 @@ class _ProfileTabState extends State { children: [ text18w700white( "Certifications/Qualifications"), - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed( RouteName.certificate, + arguments: { + 'id': getEditProfileIndi!.data!.id, + } ); }, child: text16400white('View more')) @@ -801,7 +834,7 @@ class _ProfileTabState extends State { scrollDirection: Axis.horizontal, // padding: // EdgeInsets.only(left: 16.w), - physics: ScrollPhysics(), + physics: const ScrollPhysics(), itemCount: getEditProfileIndi! .data!.certifications!.length, itemBuilder: (context, index) { @@ -915,7 +948,7 @@ class _ProfileTabState extends State { 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 +956,7 @@ class _ProfileTabState extends State { 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 +979,8 @@ class _ProfileTabState extends State { RemoveCertificationUploadata(); }); }, - child: Icon( + child: + const Icon( Icons .delete, color: Colors @@ -969,17 +1003,28 @@ class _ProfileTabState extends State { }, child: Align( alignment: Alignment.centerRight, - child: text16400white( + child: text18w400white( 'Add certificate'))), - sizedBoxHeight(10.h), + sizedBoxHeight(25.h), ]), ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ text18w700white("Groups"), + InkWell( + onTap: () { + Get.toNamed( + RouteName.group, + arguments: { + 'id': getEditProfileIndi!.data!.id, + } + ); + }, + child: text16400white('View more')) ], ), ), @@ -1041,7 +1086,7 @@ class _ProfileTabState extends State { sizedBoxHeight(20.h), Row( children: [ - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed(RouteName.settings); @@ -1078,7 +1123,13 @@ class _ProfileTabState extends State { future: businessfuture, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return ShimmerCommon(); + return + // ShimmerCommon(); + Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); } if (snapshot.hasError) { @@ -1118,7 +1169,7 @@ class _ProfileTabState extends State { ), Positioned.fill( child: Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -1192,7 +1243,7 @@ class _ProfileTabState extends State { width: 1.0, ), boxShadow: [ - BoxShadow( + const BoxShadow( color: Color(0x66000000), offset: Offset(0, 4), @@ -1254,7 +1305,7 @@ class _ProfileTabState extends State { height: 40.h, width: 170.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r), ), @@ -1417,7 +1468,7 @@ class _ProfileTabState extends State { sizedBoxHeight(20.h), Row( children: [ - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed(RouteName.settings); @@ -1475,7 +1526,7 @@ class _ProfileTabState extends State { child: Container( height: 11.h, width: 11.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.white, shape: BoxShape.circle)), ), Positioned( @@ -1483,7 +1534,7 @@ class _ProfileTabState extends State { child: Container( width: 1.w, height: 170.h, - decoration: BoxDecoration(color: Colors.white), + decoration: const BoxDecoration(color: Colors.white), ), ), ], @@ -1511,7 +1562,7 @@ class _ProfileTabState extends State { imagePath == null || imagePath.isEmpty ? CircleAvatar( radius: 10.r, - backgroundImage: AssetImage( + backgroundImage: const AssetImage( 'assets/images/png/cimg1.png')) : CircleAvatar( radius: 10.r, @@ -1588,7 +1639,7 @@ class _ProfileTabState extends State { child: text10400whiteblur(abilityName), ); } else { - return SizedBox(); + return const SizedBox(); } }, ), @@ -1652,7 +1703,7 @@ class _ProfileTabState extends State { sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -1661,12 +1712,12 @@ class _ProfileTabState extends State { ) ], ), - 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) => [ PopupMenuItem( @@ -1684,7 +1735,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -1694,7 +1745,7 @@ class _ProfileTabState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -1710,7 +1761,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -1720,7 +1771,7 @@ class _ProfileTabState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -1736,7 +1787,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -1801,7 +1852,7 @@ class _ProfileTabState extends State { '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 +1935,12 @@ class _ProfileTabState extends State { 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 +2013,7 @@ class _ProfileTabState extends State { 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), @@ -1973,14 +2025,25 @@ class _ProfileTabState extends State { return Column( children: [ Container( - height: 109.h, - width: 100.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.r), - ), - child: imagePath == null || imagePath.isEmpty - ? Image.asset('assets/images/png/Rectangle 29ss.png') - : Image.network(imagePath)), + height: 109.h, + width: 100.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + ), + child: imagePath == null || imagePath.isEmpty + ? Image.asset('assets/images/png/Rectangle 29ss.png') + : Image.network( + imagePath, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) { + // Error handling when image fails to load + return Image.asset( + 'assets/images/png/Rectangle 29ss.png', + fit: BoxFit.cover, + ); + }, + ), + ), sizedBoxHeight(10.h), SizedBox( width: 100.w, diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart index aee5e5d..6aec043 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart @@ -88,4 +88,6 @@ class EditProfileApi { return response; } + + } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart index 97a9af1..9e8fe7d 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart @@ -47,6 +47,7 @@ class Data { // List? myJoinedSubgroups; List? certifications; int? daysBeforeJoined; + int? isIamFollowingToGuestUser; Data( {this.id, @@ -68,7 +69,9 @@ class Data { this.myJoinedGroups, // this.myJoinedSubgroups, this.certifications, - this.daysBeforeJoined}); + this.daysBeforeJoined, + this.isIamFollowingToGuestUser, + }); Data.fromJson(Map json) { id = json['id']; @@ -117,6 +120,7 @@ class Data { }); } daysBeforeJoined = json['days_before_joined']; + isIamFollowingToGuestUser = json['is_iam_following_to_guest_user']; } Map toJson() { @@ -156,6 +160,7 @@ class Data { this.certifications!.map((v) => v.toJson()).toList(); } data['days_before_joined'] = this.daysBeforeJoined; + data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart index 48aa32d..15c712b 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart @@ -5,11 +5,15 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; +import 'package:intl/intl.dart'; class ProfileTabIndGuest extends StatefulWidget { const ProfileTabIndGuest({super.key}); @@ -97,6 +101,38 @@ class _ProfileTabIndGuestState extends State { super.initState(); } + int? followunfollowid; + + FollowUnfollowUploadata() async { + utils.loader(); + Map updata = { + "following_iam_principal_xid": followunfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + // void _handleFollowButton(id) async { + // try { + // var resp = await Profilepostmethod().guestFollowuser(id ?? ""); + // if (resp) { + // setState(() { + // // isFollow = !isFollow!; + // }); + // } + // } catch (e) { + // // Handle error here + // print('Error Following user: $e'); + // } + // } + @override Widget build(BuildContext context) { return Scaffold( @@ -221,11 +257,10 @@ class _ProfileTabIndGuestState extends State { children: [ text16400white( guestGetProfileInd! - .data! - .follows! - .followers - .toString() ?? - "254"), + .data! + .follows! + .followers + .toString()), sizedBoxHeight(6.h), text12400whiteblur( "Followers") @@ -264,11 +299,10 @@ class _ProfileTabIndGuestState extends State { children: [ text16400white( guestGetProfileInd! - .data! - .follows! - .following - .toString() ?? - "254"), + .data! + .follows! + .following + .toString()), sizedBoxHeight(6.h), text12400whiteblur( "Following") @@ -329,19 +363,40 @@ class _ProfileTabIndGuestState extends State { children: [ GestureDetector( onTap: () { - Get.toNamed(RouteName.editProfile); + // Get.toNamed(RouteName.editProfile); + followunfollowid = + guestGetProfileInd!.data!.id; + FollowUnfollowUploadata(); + print(followunfollowid); + // _handleFollowButton(followunfollowid); }, - child: Container( - height: 40.h, - width: 170.w, - decoration: BoxDecoration( - color: const Color(0xFFD90B2E), - borderRadius: - BorderRadius.circular(30.r), - ), - child: Center( - child: text16w400_FCFCFC("Follow")), - ), + child: guestGetProfileInd!.data! + .isIamFollowingToGuestUser == + 0 + ? Container( + height: 40.h, + width: 170.w, + decoration: BoxDecoration( + color: const Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r), + ), + child: Center( + child: text16w400_FCFCFC( + "Follow")), + ) + : Container( + height: 40.h, + width: 170.w, + decoration: BoxDecoration( + color: const Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r), + ), + child: Center( + child: text16w400_FCFCFC( + "Unfollow")), + ), ), GestureDetector( onTap: () { @@ -367,8 +422,11 @@ class _ProfileTabIndGuestState extends State { sizedBoxHeight(30.h), text18w700white("About"), sizedBoxHeight(10.h), - text14400white( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), + guestGetProfileInd!.data!.about == null || + guestGetProfileInd!.data!.about!.isEmpty + ? text14400white("No about added") + : text14400white( + guestGetProfileInd!.data!.about!), sizedBoxHeight(25.h), Row( children: [ @@ -412,7 +470,7 @@ class _ProfileTabIndGuestState extends State { text14400whiteblur( 'Rowing, Football, Swimming'), // interestText - // text14400whiteblur(getEditProfileIndi! + // text14400whiteblur(guestGetProfileInd! // .data!.interest! // .join(', ')), // text14400whiteblur( @@ -485,16 +543,16 @@ class _ProfileTabIndGuestState extends State { 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), @@ -507,39 +565,262 @@ class _ProfileTabIndGuestState extends State { "No Timeline Found")), ) : SizedBox( - height: 300.h, + height: 200.h, child: ListView.builder( shrinkWrap: true, itemCount: guestGetProfileInd! .data!.timelines!.length, itemBuilder: (context, index) { - var abilities; - abilities = guestGetProfileInd! - .data! - .timelines![index] - .abilities! - .map((e) => e.name) - .join(', '); - return commonTimelineCard( - imagePath: timeline[index] - ["imagePath"], - title: guestGetProfileInd! - .data! - .timelines![index] - .teamName ?? - '', - teamName: guestGetProfileInd! - .data! - .timelines![index] - .teamName ?? - '', - abilities: abilities, - startendDate: - "${guestGetProfileInd!.data!.timelines![index].startDate} - ${guestGetProfileInd!.data!.timelines![index].endDate} " ?? - '', + DateTime startDate = + DateTime.parse( + guestGetProfileInd! + .data! + .timelines![index] + .startDate!); + DateTime endDate = DateTime.parse( + guestGetProfileInd! + .data! + .timelines![index] + .endDate!); + + String formattedStartDate = + DateFormat('dd MMMM yyyy') + .format(startDate); + String formattedEndDate = + DateFormat('dd MMMM yyyy') + .format(endDate); + + // Combine formatted dates + String startToEnd = + '$formattedStartDate - $formattedEndDate'; + + var timeline = guestGetProfileInd! + .data!.timelines![index]; + + // List> + // abilities = + // timeline.abilities! + // .map((ability) => { + // 'id': ability.id, + // 'name': + // ability.name, + // }) + // .toList(); + return Row( + children: [ + Container( + width: 10, + height: 170.h, + child: Stack( + clipBehavior: Clip.none, + children: [ + Positioned( + top: 50.h, + child: Container( + height: 11.h, + width: 11.w, + decoration: BoxDecoration( + color: Colors + .white, + shape: BoxShape + .circle)), + ), + Positioned( + right: 3.w, + child: Container( + width: 1.w, + height: 170.h, + decoration: + BoxDecoration( + color: Colors + .white), + ), + ), + ], + ), + ), + sizedBoxWidth(20.w), + Expanded( + child: Column( + children: [ + commonGlassUI( + width: + double.infinity, + height: 155.h, + borderRadius: + BorderRadius + .circular( + 10.r), + customWidget: Padding( + padding: + EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 10.h), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Row( + children: [ + guestGetProfileInd?.data?.profilePhoto == null || + guestGetProfileInd!.data!.profilePhoto!.isEmpty + ? CircleAvatar(radius: 10.r, backgroundImage: AssetImage('assets/images/png/cimg1.png')) + : CircleAvatar(radius: 10.r, backgroundImage: NetworkImage(guestGetProfileInd!.data!.profilePhoto!)), + sizedBoxWidth( + 8.w), + guestGetProfileInd!.data!.timelines![index].clubName == null || + guestGetProfileInd!.data!.timelines![index].clubName!.isEmpty + ? text14700white('Regroup') + : text14700white(guestGetProfileInd!.data!.timelines![index].clubName!) + ], + ), + ], + ), + sizedBoxHeight( + 10.h), + guestGetProfileInd!.data!.timelines![index].roleName == + null || + guestGetProfileInd! + .data! + .timelines![ + index] + .roleName! + .isEmpty + ? text12700white( + 'regroup') + : text12700white(guestGetProfileInd! + .data! + .timelines![ + index] + .roleName!), + sizedBoxHeight( + 10.h), + guestGetProfileInd!.data!.timelines![index].teamName == + null || + guestGetProfileInd! + .data! + .timelines![ + index] + .teamName! + .isEmpty + ? text12700white( + 'regroup') + : text12700white(guestGetProfileInd! + .data! + .timelines![ + index] + .teamName!), + sizedBoxHeight( + 10.h), + startToEnd + .isEmpty + ? text12400white( + 'No date') + : text12400white( + startToEnd), + sizedBoxHeight( + 10.h), + guestGetProfileInd!.data!.timelines![index].abilities == + null || + guestGetProfileInd! + .data! + .timelines![ + index] + .abilities! + .isEmpty + ? text10400whiteblur( + 'No data') + : Container( + height: + 30.h, // Adjust the height as needed + child: ListView + .builder( + shrinkWrap: + true, + scrollDirection: + Axis.horizontal, + itemCount: guestGetProfileInd! + .data! + .timelines![index] + .abilities! + .length, + itemBuilder: + (context, innerIndex) { + String + abilityName = + guestGetProfileInd!.data!.timelines![index].abilities![innerIndex].name!; + // List abilityName = guestGetProfileInd!.data!.timelines![index].abilities![innerIndex].name!.split(','); + // String formattedNames = abilityName.join(', '); + List + abilityNames = + abilityName.split(',').map((e) => e.trim()).toList(); + String + formattedNames = + abilityNames.join(', '); + print(formattedNames); + return Padding( + padding: EdgeInsets.only(right: 8.w), + child: text10400whiteblur(formattedNames), + ); + }, + ), + ), + ], + ), + ), + // border: 1 + ), + ], + ), + ), + ], ); }, - )), + ) + + // ListView.builder( + // shrinkWrap: true, + // itemCount: guestGetProfileInd! + // .data!.timelines!.length, + // itemBuilder: (context, index) { + // var abilities; + // abilities = guestGetProfileInd! + // .data! + // .timelines![index] + // .abilities! + // .map((e) => e.name) + // .join(', '); + // return commonTimelineCard( + // imagePath: timeline[index] + // ["imagePath"], + // title: guestGetProfileInd! + // .data! + // .timelines![index] + // .teamName ?? + // '', + // teamName: guestGetProfileInd! + // .data! + // .timelines![index] + // .teamName ?? + // '', + // abilities: abilities, + // startendDate: + // "${guestGetProfileInd!.data!.timelines![index].startDate} - ${guestGetProfileInd!.data!.timelines![index].endDate} " ?? + // '', + // ); + // }, + // ) + ), sizedBoxHeight(30.h), Row( children: [ @@ -548,7 +829,11 @@ class _ProfileTabIndGuestState extends State { const Spacer(), InkWell( onTap: () { - Get.toNamed(RouteName.certificate); + Get.toNamed(RouteName.certificate, + arguments: { + 'id': guestGetProfileInd! + .data!.id, + }); }, child: text12400white("View more")), ], @@ -564,44 +849,161 @@ class _ProfileTabIndGuestState extends State { "No Certifications Found")), ) : SizedBox( - height: 85.h, + height: 100.h, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, - itemCount: guestGetProfileInd!.data! - .certifications!.length ?? - certificationData.length, + // padding: + // EdgeInsets.only(left: 16.w), + physics: ScrollPhysics(), + itemCount: guestGetProfileInd! + .data!.certifications!.length, itemBuilder: (context, index) { - var certifiData = - guestGetProfileInd!.data! - .certifications![index]; - return Padding( - padding: EdgeInsets.only( - right: 20.w), - child: certificationCardTile( - imagePath: certifiData - .certificationImage ?? - certificationData[index] - ["imagePath"], - title: certifiData - .certificationName ?? - certificationData[index] - ["title"], - subtitle: certifiData - .certificationReason ?? - certificationData[index] - ["subtitle"], - date: - ("Issued ${certifiData.certificationDate}") ?? - (certificationData[ - index] - ["date"])), + return Row( + children: [ + commonGlassUI( + width: 266.w, + height: 70.h, + borderRadius: + BorderRadius.circular( + 10.r), + customWidget: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 16.w, + vertical: 5.h), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + guestGetProfileInd! + .data! + .certifications![ + index] + .certificationImage == + null || + guestGetProfileInd! + .data! + .certifications![ + index] + .certificationImage! + .isEmpty + ? Image.asset( + 'assets/images/png/image 17.png', + width: 57.w, + height: + 40.h, + ) + : Image.network( + guestGetProfileInd! + .data! + .certifications![ + index] + .certificationImage!, + width: 77.w, + height: + 100.h, + ), + sizedBoxWidth(20.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + guestGetProfileInd!.data!.certifications![index].certificationName == + null || + guestGetProfileInd! + .data! + .certifications![ + index] + .certificationName! + .isEmpty + ? text12400white( + 'Regroup') + : text12400white(guestGetProfileInd! + .data! + .certifications![ + index] + .certificationName!), + sizedBoxHeight( + 4.h), + guestGetProfileInd!.data!.certifications![index].certificationReason == + null || + guestGetProfileInd! + .data! + .certifications![ + index] + .certificationReason! + .isEmpty + ? text9400white( + 'Regroup') + : text9400white(guestGetProfileInd! + .data! + .certifications![ + index] + .certificationName!), + sizedBoxHeight( + 4.h), + guestGetProfileInd!.data!.certifications![index].certificationDate == + null || + guestGetProfileInd! + .data! + .certifications![index] + .certificationDate! + .isEmpty + ? Text( + 'Regroup', + style: TextStyle( + fontSize: + 9.sp, + fontWeight: FontWeight.w400, + color: Color(0xffFFFFFF).withOpacity(0.70), + fontFamily: 'Helvetica'), + ) + : Text( + 'Issued ${DateFormat('MMM yyyy').format(DateTime.parse(guestGetProfileInd!.data!.certifications![index].certificationDate!))}', + style: TextStyle( + fontSize: + 9.sp, + fontWeight: FontWeight.w400, + color: Color(0xffFFFFFF).withOpacity(0.70), + fontFamily: 'Helvetica'), + ) + ], + ), + ], + ), + )), + sizedBoxWidth(20.w), + ], ); }, - ), - ), + )), sizedBoxHeight(30.h), - text18w400white("Groups"), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + text18w700white("Groups"), + InkWell( + onTap: () { + Get.toNamed(RouteName.group, + arguments: { + 'id': guestGetProfileInd! + .data!.id, + }); + }, + child: text12400white('View more')) + ], + ), ]), ), sizedBoxHeight(20.h), @@ -609,11 +1011,12 @@ class _ProfileTabIndGuestState extends State { ? Padding( padding: EdgeInsets.symmetric(vertical: 30.h), child: Center( - child: text18w700white( - "No groups Found")), + child: + text18w700white("No groups Found")), ) : SizedBox( height: 190.h, + width: double.infinity, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, @@ -621,18 +1024,24 @@ class _ProfileTabIndGuestState extends State { itemCount: guestGetProfileInd! .data!.myJoinedGroups!.length, itemBuilder: (context, index) { - var subGroupData = guestGetProfileInd! - .data! - .myJoinedGroups![index] - .groupData!; return Padding( padding: EdgeInsets.only(right: 20.w), child: profilecardtile( - imagePath: subGroupData + imagePath: guestGetProfileInd! + .data! + .myJoinedGroups![index] + .groupData! .groupImage ?? - cardtile[index]["imagePath"], - title: subGroupData.title ?? - cardtile[index]["title"]), + '', + // cardtile[index]["imagePath"], + title: guestGetProfileInd! + .data! + .myJoinedGroups![index] + .groupData! + .title! + + // cardtile[index]["title"] + ), ); }, ), @@ -1304,34 +1713,35 @@ class _ProfileTabIndGuestState extends State { )); } - Widget profilecardtile({required String imagePath, required String title}) { + Widget profilecardtile({required String? imagePath, required String? title}) { return Column( children: [ - guestGetProfileInd!.data!.myJoinedGroups!.isNotEmpty - ? Container( - width: 100.w, - height: 109.h, - decoration: ShapeDecoration( - image: DecorationImage( - image: Image( - image: NetworkImage(imagePath), - ).image, - fit: BoxFit.cover, - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.r)), + Container( + height: 109.h, + width: 100.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + ), + child: imagePath == null || imagePath.isEmpty + ? Image.asset('assets/images/png/Rectangle 29ss.png') + : Image.network( + imagePath, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) { + // Error handling when image fails to load + return Image.asset( + 'assets/images/png/Rectangle 29ss.png', + fit: BoxFit.cover, + ); + }, ), - ) - : Container( - height: 109.h, - width: 100.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.r), - ), - child: Image.asset(imagePath), - ), + ), sizedBoxHeight(10.h), - SizedBox(width: 100.w, child: text12w700_FCFCFC(title)), + SizedBox( + width: 100.w, + child: title == null || title.isEmpty + ? text12w700_FCFCFC('Reegroup') + : text12w700_FCFCFC(title)), ], ); } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/certificateModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/certificateModel.dart new file mode 100644 index 0000000..f5c80a2 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/certificateModel.dart @@ -0,0 +1,68 @@ +class CertificateuserModel { + String? status; + int? statusCode; + String? message; + List? data; + + CertificateuserModel({this.status, this.statusCode, this.message, this.data}); + + CertificateuserModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + 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? certificationName; + String? certificationImage; + String? certificationReason; + String? certificationDate; + int? iamPrincipalXid; + + Data( + {this.id, + this.certificationName, + this.certificationImage, + this.certificationReason, + this.certificationDate, + this.iamPrincipalXid}); + + Data.fromJson(Map json) { + id = json['id']; + certificationName = json['certification_name']; + certificationImage = json['certification_image']; + certificationReason = json['certification_reason']; + certificationDate = json['certification_date']; + iamPrincipalXid = json['iam_principal_xid']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['certification_name'] = this.certificationName; + data['certification_image'] = this.certificationImage; + data['certification_reason'] = this.certificationReason; + data['certification_date'] = this.certificationDate; + data['iam_principal_xid'] = this.iamPrincipalXid; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart b/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart index 923be90..e25a73c 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart @@ -465,21 +465,19 @@ class _FollowersTabState extends State { } 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), + ) + ], ), ); } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart index 9e9d517..9818002 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart @@ -24,6 +24,26 @@ class AccountSettings extends StatefulWidget { class _AccountSettingsState extends State { // bool swichvalue = false; + String? accountTypeValue; + String? accounTypeLogin; + + @override + void initState() { + setValues(); + super.initState(); + } + + setValues() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + // Update state variables and trigger UI update with setState + setState(() { + accounTypeLogin = prefs.getString('accountTypefromLogin'); + print('account type login is $accounTypeLogin'); + // accountTypeValue = prefs.getString('accountTypeValue'); + // print('account type value is $accountTypeValue'); + }); + } + Future UploadData() async { print("upload data called"); SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -91,35 +111,43 @@ else if (accountype == "2") { child: text18w700_FCFCFC("Sign in & security"), ), sizedBoxHeight(20.h), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), - child: Row(children: [ - Image.asset( - "assets/images/png/eyeIcon.png", - height: 21.h, - width: 21.w, - ), - sizedBoxWidth(12.w), - text16w400_FCFCFC("Account visibility"), - Spacer(), - Transform.scale( - scale: 0.9, - child: CupertinoSwitch( - value: accountvisibility, - trackColor: Colors.white.withOpacity(0.4), - activeColor: Color(0xFF34C759), - onChanged: (bool value) { - setState(() { - accountvisibility = value; - UploadData(); + accounTypeLogin == '1' + ? - // swichvalue = value ?? false; - }); - })) - ]), - ), + Column( + children: [ + Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), + child: Row(children: [ + Image.asset( + "assets/images/png/eyeIcon.png", + height: 21.h, + width: 21.w, + ), + sizedBoxWidth(12.w), + text16w400_FCFCFC("Account visibility"), + Spacer(), + Transform.scale( + scale: 0.9, + child: CupertinoSwitch( + value: accountvisibility, + trackColor: Colors.white.withOpacity(0.4), + activeColor: Color(0xFF34C759), + onChanged: (bool value) { + setState(() { + accountvisibility = value; + UploadData(); + + // swichvalue = value ?? false; + }); + })) + ]), + ), commonDivider(), + ], + ) + : SizedBox(), GestureDetector( onTap: () { Get.toNamed(RouteName.changepassword); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart index abcdaeb..037ec29 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart @@ -7,6 +7,7 @@ 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:shared_preferences/shared_preferences.dart'; class HelpAndSupport extends StatefulWidget { const HelpAndSupport({super.key}); @@ -16,6 +17,26 @@ class HelpAndSupport extends StatefulWidget { } class _HelpAndSupportState extends State { + String? accountTypeValue; + String? accounTypeLogin; + + @override + void initState() { + setValues(); + super.initState(); + } + + setValues() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + // Update state variables and trigger UI update with setState + setState(() { + accounTypeLogin = prefs.getString('accountTypefromLogin'); + print('account type login is $accounTypeLogin'); + // accountTypeValue = prefs.getString('accountTypeValue'); + // print('account type value is $accountTypeValue'); + }); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -30,44 +51,51 @@ class _HelpAndSupportState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.faqscreen); - }, - child: rowTile( - imagePath: "assets/images/png/Vectorftt.png", - text: "FAQ", - ), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.faqscreen); + }, + child: rowTile( + imagePath: "assets/images/png/Vectorftt.png", + text: "FAQ", ), - commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.contactUs); - }, - child: rowTile( - imagePath: - "assets/images/png/fluent_person-support-20-regular.png", - text: "Contact us", - ), + ), + commonDivider(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.contactUs); + }, + child: rowTile( + imagePath: + "assets/images/png/fluent_person-support-20-regular.png", + text: "Contact us", ), - commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.reportabug); - }, - child: rowTile( - imagePath: "assets/images/png/codicon_bug.png", - text: "Report a bug", - ), - ), - ])) + ), + accounTypeLogin == '1' + ? Column( + children: [ + commonDivider(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.reportabug); + }, + child: rowTile( + imagePath: "assets/images/png/codicon_bug.png", + text: "Report a bug", + ), + ), + ]) + : SizedBox(), + ], + )) ])); } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart index 0d18b33..8504040 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart @@ -23,6 +23,25 @@ class Settings extends StatefulWidget { } class _SettingsState extends State { + String? accountTypeValue; + String? accounTypeLogin; + + @override + void initState() { + setValues(); + super.initState(); + } + + setValues() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + // Update state variables and trigger UI update with setState + setState(() { + accounTypeLogin = prefs.getString('accountTypefromLogin'); + print('account type login is $accounTypeLogin'); + // accountTypeValue = prefs.getString('accountTypeValue'); + // print('account type value is $accountTypeValue'); + }); + } Uploadata() async { utils.loader(); @@ -38,7 +57,7 @@ class _SettingsState extends State { await prefs.remove('phone'); await prefs.remove('accountTypefromLogin'); await prefs.remove('principal_xid'); - await prefs.remove('accountTypeValue'); + // await prefs.remove('accountTypeValue'); await prefs.clear(); @@ -52,7 +71,6 @@ class _SettingsState extends State { } } - @override Widget build(BuildContext context) { return Scaffold( @@ -91,16 +109,22 @@ class _SettingsState extends State { ), ), commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.editProfile); - }, - child: rowTile( - imagePath: "assets/images/png/edit 1.png", - text: "Edit profile", - ), - ), - commonDivider(), + accounTypeLogin == '1' + ? Column( + children: [ + GestureDetector( + onTap: () { + Get.toNamed(RouteName.editProfile); + }, + child: rowTile( + imagePath: "assets/images/png/edit 1.png", + text: "Edit profile", + ), + ), + commonDivider(), + ], + ) + : SizedBox(), GestureDetector( onTap: () { Get.toNamed(RouteName.helpandsupport); @@ -132,6 +156,22 @@ class _SettingsState extends State { ), ), commonDivider(), + accounTypeLogin == '1' + ? SizedBox() + : Column( + children: [ + GestureDetector( + onTap: () { + Get.toNamed(RouteName.reportabug); + }, + child: rowTile( + imagePath: "assets/images/png/codicon_bug.png", + text: "Report a bug", + ), + ), + commonDivider(), + ], + ), GestureDetector( onTap: () { dialogwidget(); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart index e54acb0..ca67740 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart @@ -6,6 +6,7 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart' as timelineabilist; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart'; @@ -18,6 +19,7 @@ import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.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'; import 'package:intl/intl.dart'; import 'package:async/src/future_group.dart'; @@ -127,7 +129,6 @@ class _AddTimelineState extends State { }); // ); }); - } else { fetchABilitylist().then((value) { isloading = false.obs; @@ -155,7 +156,12 @@ class _AddTimelineState extends State { final data = await Profilepostmethod().postTimeline(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - Get.back(); + // Get.back(); + // await EditProfileApi().getEditProfileIndividual().then((value) { + // Get.back(); + // }); + Get.toNamed(RouteName.mainscreen, arguments: 4); + print("timeline done"); return utils.showToast(data.message); } else { @@ -182,7 +188,15 @@ class _AddTimelineState extends State { if (data.status == ResponseStatus.SUCCESS) { Get.back(); print("timeline done"); - return utils.showToast(data.message); + // await EditProfileApi().getEditProfileIndividual().then((value) { + // Get.back(); + // }); + + // utils.showToast(data.message); + // await Future.delayed( + // Duration(milliseconds: 500)); // Add a small delay if needed + // Get.toNamed(RouteName.mainscreen, arguments: 4); + Get.toNamed(RouteName.mainscreen, arguments: 4); } else { Get.back(); print("timeline not done"); @@ -223,577 +237,544 @@ class _AddTimelineState extends State { appBar: CommonAppbar( titleTxt: "Add timeline", ), - body: - Obx(() - // { - => - isloading.value - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CircularProgressIndicator(), - ], - )) - : edited == true - ? Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - ListView(physics: ScrollPhysics(), children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Column( + body: Obx(() + // { + => + isloading.value + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(), + ], + )) + : edited == true + ? Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + ListView(physics: ScrollPhysics(), children: [ + Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Club name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + clubNameController, + texttype: TextInputType.text, + hintText: 'Enter club name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Role in the club"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + rollnameController, + texttype: TextInputType.text, + hintText: 'Enter role in club', + validator: (value) { + if (value!.isEmpty) { + return 'Enter role in club'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Team name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + teamnameController, + texttype: TextInputType.text, + hintText: 'Enter team name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your team name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-ZS0-9 ]')), + ], + ), + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(20.h), - text16400white("Club name"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - clubNameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(25.h), - text16400white("Role in the club"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - rollnameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(25.h), - text16400white("Team name"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - teamnameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp( - '[a-zA-ZS0-9 ]')), - ], - ), - sizedBoxHeight(25.h), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - text16400white( - "Start date "), - sizedBoxHeight(10.h), - GestureDetector( - onTap: () => datePicker( - context, - dateController), - child: AbsorbPointer( - child: - CustomTextFormField( - textEditingController: - dateController, - leadingIcon: - Container( + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text16400white("Start date "), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController, + leadingIcon: Container( + height: 20.h, + width: 20.w, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", height: 20.h, width: 20.w, - child: Center( - child: - Image.asset( - "assets/images/png/calender.png", - height: 20.h, - width: 20.w, - ), - ), - ), - ), - ), - ) - ], - ), - ), - sizedBoxWidth(10.h), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - text16400white( - "End date"), - sizedBoxHeight(10.h), - GestureDetector( - onTap: () => datePicker( - context, - dateController2), - child: AbsorbPointer( - child: - CustomTextFormField( - textEditingController: - dateController2, - leadingIcon: - Container( - height: 20.h, - width: 20.w, - child: Center( - child: - Image.asset( - "assets/images/png/calender.png", - height: 20.h, - width: 20.w, - ), - ), ), ), ), ), - sizedBoxHeight(10.h), - Row( - children: [ - Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, - height: 20.h, - width: 20.w, - opacity1: 0.24, - opacity2: 0.24, - customWidget: - Transform - .scale( - scale: 1.2, - child: Checkbox( - side: BorderSide( - color: Color( - 0xFF434A53)), - value: - isChecked - .value, - activeColor: - Colors - .transparent, - checkColor: - Colors - .white, - onChanged: - ((value) { - // isChecked.value = value!; - isChecked - .value = - value!; - if (isChecked - .value) { - // Set end date to today's date - dateController2 - .text = DateFormat( - 'yyyy-MM-dd') - .format( - DateTime.now()); - } else { - // Clear end date when checkbox is unchecked - dateController2 - .clear(); - } - }), - ), - ), - ); - }), - sizedBoxWidth(8.w), - text10400white( - "Present") - ], - ), - ], - ), - ) - ], - ), - text16400white("Ability"), - sizedBoxHeight(15.h), - // CustomDropDownCheckBoxTimeline( - // header: 'Select ability', - // title: '', - // listData: _abilitydrop, - // onItemSelected: getCatIdFromName, - // initiallySelected: abilitiesIds - // .map((id) => id.toString()) - // .toList(), - // ), - CustomDropDownCheckBoxTimeline( - header: 'Select ability', - title: '', - listData: _abilitydrop, - // _abilityMap.map((ability) => ability["name"]).toList(), - onItemSelected: getCatIdFromName, - // (selectedNames) { - // // Convert selected names back to IDs if needed - // List selectedIds = []; - // for (String name in selectedNames) { - // for (Map ability - // in _abilityMap) { - // if (ability["name"] == name) { - // selectedIds.add(ability["id"]); - // break; - // } - // } - // } - // // Use selectedIds as needed - // print(selectedIds); - // }, - initiallySelected: - seelctedNameList, // Pass initially selected names - ), - sizedBoxHeight(80.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.w), - child: CustomButton( - text: "Add timeline", - onPressed: () { - if (clubNameController.text.isBlank! || - rollnameController - .text.isBlank! || - teamnameController - .text.isBlank! || - dateController - .text.isBlank! || - dateController2 - .text.isBlank! || - selectedabilityid - .isEmpty) { - utils.showToast( - 'Please fill all fields'); - } else { - print(selectedabilityid - .toString()); - - // EdituploadData(); - } - }, + ), + ) + ], ), ), - ]), - ) - ]) - ]) - : Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - ListView(physics: ScrollPhysics(), children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w), - child: Column( + sizedBoxWidth(10.h), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text16400white("End date"), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController2), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController2, + leadingIcon: Container( + height: 20.h, + width: 20.w, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ), + sizedBoxHeight(10.h), + Row( + children: [ + Obx(() { + return commonGlassContainer( + border: 1, + borderradius: 2, + height: 20.h, + width: 20.w, + opacity1: 0.24, + opacity2: 0.24, + customWidget: + Transform.scale( + scale: 1.2, + child: Checkbox( + side: BorderSide( + color: Color( + 0xFF434A53)), + value: isChecked + .value, + activeColor: Colors + .transparent, + checkColor: + Colors.white, + onChanged: + ((value) { + // isChecked.value = value!; + isChecked + .value = + value!; + if (isChecked + .value) { + // Set end date to today's date + dateController2 + .text = DateFormat( + 'yyyy-MM-dd') + .format(DateTime + .now()); + } else { + // Clear end date when checkbox is unchecked + dateController2 + .clear(); + } + }), + ), + ), + ); + }), + sizedBoxWidth(8.w), + text10400white("Present") + ], + ), + ], + ), + ) + ], + ), + text16400white("Ability"), + sizedBoxHeight(15.h), + // CustomDropDownCheckBoxTimeline( + // header: 'Select ability', + // title: '', + // listData: _abilitydrop, + // onItemSelected: getCatIdFromName, + // initiallySelected: abilitiesIds + // .map((id) => id.toString()) + // .toList(), + // ), + CustomDropDownCheckBoxTimeline( + header: 'Select ability', + title: '', + listData: _abilitydrop, + // _abilityMap.map((ability) => ability["name"]).toList(), + onItemSelected: getCatIdFromName, + // (selectedNames) { + // // Convert selected names back to IDs if needed + // List selectedIds = []; + // for (String name in selectedNames) { + // for (Map ability + // in _abilityMap) { + // if (ability["name"] == name) { + // selectedIds.add(ability["id"]); + // break; + // } + // } + // } + // // Use selectedIds as needed + // print(selectedIds); + // }, + initiallySelected: + seelctedNameList, // Pass initially selected names + ), + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.w), + child: CustomButton( + text: "Add timeline", + onPressed: () { + if (clubNameController.text.isBlank! || + rollnameController + .text.isBlank! || + teamnameController + .text.isBlank! || + dateController + .text.isBlank! || + dateController2 + .text.isBlank! || + selectedabilityid.isEmpty) { + utils.showToast( + 'Please fill all fields'); + } else { + print(selectedabilityid + .toString()); + + EdituploadData(); + } + }, + ), + ), + ]), + ) + ]) + ]) + : Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + ListView(physics: ScrollPhysics(), children: [ + Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Club name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + clubNameController, + texttype: TextInputType.text, + hintText: 'Enter club name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Role in the club"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + rollnameController, + texttype: TextInputType.text, + hintText: 'Enter role in club', + validator: (value) { + if (value!.isEmpty) { + return 'Enter role in club'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Team name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + teamnameController, + texttype: TextInputType.text, + hintText: 'Enter team name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your team name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-ZS0-9 ]')), + ], + ), + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(20.h), - text16400white("Club name"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - clubNameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(25.h), - text16400white("Role in the club"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - rollnameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(25.h), - text16400white("Team name"), - sizedBoxHeight(15.h), - CustomTextFormField( - textEditingController: - teamnameController, - texttype: TextInputType.text, - hintText: 'Enter club name', - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter - .allow(RegExp( - '[a-zA-ZS0-9 ]')), - ], - ), - sizedBoxHeight(25.h), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - text16400white( - "Start date "), - sizedBoxHeight(10.h), - GestureDetector( - onTap: () => datePicker( - context, - dateController), - child: AbsorbPointer( - child: - CustomTextFormField( - textEditingController: - dateController, - leadingIcon: - Container( + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text16400white("Start date "), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController, + leadingIcon: Container( + height: 20.h, + width: 20.w, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", height: 20.h, width: 20.w, - child: Center( - child: - Image.asset( - "assets/images/png/calender.png", - height: 20.h, - width: 20.w, - ), - ), - ), - ), - ), - ) - ], - ), - ), - sizedBoxWidth(10.h), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - text16400white( - "End date"), - sizedBoxHeight(10.h), - GestureDetector( - onTap: () => datePicker( - context, - dateController2), - child: AbsorbPointer( - child: - CustomTextFormField( - textEditingController: - dateController2, - leadingIcon: - Container( - height: 20.h, - width: 20.w, - child: Center( - child: - Image.asset( - "assets/images/png/calender.png", - height: 20.h, - width: 20.w, - ), - ), ), ), ), ), - sizedBoxHeight(10.h), - Row( - children: [ - Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, - height: 20.h, - width: 20.w, - opacity1: 0.24, - opacity2: 0.24, - customWidget: - Transform - .scale( - scale: 1.2, - child: Checkbox( - side: BorderSide( - color: Color( - 0xFF434A53)), - value: - isChecked - .value, - activeColor: - Colors - .transparent, - checkColor: - Colors - .white, - onChanged: - ((value) { - // isChecked.value = value!; - isChecked - .value = - value!; - if (isChecked - .value) { - // Set end date to today's date - dateController2 - .text = DateFormat( - 'yyyy-MM-dd') - .format( - DateTime.now()); - } else { - // Clear end date when checkbox is unchecked - dateController2 - .clear(); - } - }), - ), - ), - ); - }), - sizedBoxWidth(8.w), - text10400white( - "Present") - ], - ), - ], - ), - ) - ], - ), - text16400white("Ability"), - sizedBoxHeight(15.h), - CustomDropDownChexkBox( - header: 'Select ability', - title: '', - listData: _abilitydrop, - onItemSelected: getCatIdFromName, - initiallySelected: [], // or pass initial values if needed - ), - sizedBoxHeight(80.h), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.w), - child: CustomButton( - text: "Add timeline", - onPressed: () { - if (clubNameController.text.isBlank! || - rollnameController - .text.isBlank! || - teamnameController - .text.isBlank! || - dateController - .text.isBlank! || - dateController2 - .text.isBlank! || - selectedabilityid - .isEmpty) { - utils.showToast( - 'Please fill all fields'); - } else { - print(selectedabilityid - .toString()); - - UploadData(); - } - }, + ), + ) + ], ), ), - ]), - ) - ]) - ]) + sizedBoxWidth(10.h), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text16400white("End date"), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController2), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController2, + leadingIcon: Container( + height: 20.h, + width: 20.w, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ), + sizedBoxHeight(10.h), + Row( + children: [ + Obx(() { + return commonGlassContainer( + border: 1, + borderradius: 2, + height: 20.h, + width: 20.w, + opacity1: 0.24, + opacity2: 0.24, + customWidget: + Transform.scale( + scale: 1.2, + child: Checkbox( + side: BorderSide( + color: Color( + 0xFF434A53)), + value: isChecked + .value, + activeColor: Colors + .transparent, + checkColor: + Colors.white, + onChanged: + ((value) { + // isChecked.value = value!; + isChecked + .value = + value!; + if (isChecked + .value) { + // Set end date to today's date + dateController2 + .text = DateFormat( + 'yyyy-MM-dd') + .format(DateTime + .now()); + } else { + // Clear end date when checkbox is unchecked + dateController2 + .clear(); + } + }), + ), + ), + ); + }), + sizedBoxWidth(8.w), + text10400white("Present") + ], + ), + ], + ), + ) + ], + ), + text16400white("Ability"), + sizedBoxHeight(15.h), + CustomDropDownChexkBox( + header: 'Select ability', + title: '', + listData: _abilitydrop, + onItemSelected: getCatIdFromName, + initiallySelected: [], // or pass initial values if needed + ), + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.w), + child: CustomButton( + text: "Add timeline", + onPressed: () { + if (clubNameController.text.isBlank! || + rollnameController + .text.isBlank! || + teamnameController + .text.isBlank! || + dateController + .text.isBlank! || + dateController2 + .text.isBlank! || + selectedabilityid.isEmpty) { + utils.showToast( + 'Please fill all fields'); + } else { + print(selectedabilityid + .toString()); - // } - )), + UploadData(); + } + }, + ), + ), + ]), + ) + ]) + ]) + + // } + )), ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart index e60ef28..15eb216 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart @@ -5,6 +5,7 @@ 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/Model/accountSessionModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/certificateModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/faqModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; @@ -20,6 +21,8 @@ FollowersModel? followersobj; FollowingModel? followingobj; GetEditTimelineModel? edittimelineobj; GetAccountSessionsModel? accountsessionobj; +CertificateuserModel? certificateobj; + class Profilegetmethod { @@ -107,4 +110,18 @@ class Profilegetmethod { } return response; } + + Future> getUserCertificates(updata) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getusercertificates}?user_id=$updata", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + certificateobj = CertificateuserModel.fromJson(response.data); + log(certificateobj!.data.toString()); + } + return response; + } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart index 2e3e64d..0fc9289 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart @@ -6,16 +6,16 @@ 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:shared_preferences/shared_preferences.dart'; +import 'package:http/http.dart' as http; class Profilepostmethod { Profilepostmethod(); Dio dio = Dio(); - String basicAuth = 'Basic ' + + String basicAuth = 'Basic ' + base64.encode( utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&')); - Future> postContactus(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( @@ -38,7 +38,7 @@ class Profilepostmethod { return response; } - Future> postBlockuser(updata) async { + Future> postBlockuser(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -49,7 +49,7 @@ class Profilepostmethod { return response; } - Future> postunfollowuser(updata) async { + Future> postunfollowuser(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -60,7 +60,7 @@ class Profilepostmethod { return response; } - Future> postRemoveuser(updata) async { + Future> postRemoveuser(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -71,7 +71,7 @@ class Profilepostmethod { return response; } - Future> postChangepassword(updata) async { + Future> postChangepassword(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -82,7 +82,7 @@ class Profilepostmethod { return response; } - Future> postChangepassverifyotp(updata) async { + Future> postChangepassverifyotp(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -93,7 +93,7 @@ class Profilepostmethod { return response; } - Future> postTimeline(updata) async { + Future> postTimeline(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -104,7 +104,7 @@ class Profilepostmethod { return response; } - Future> postAccountvisibility(updata) async { + Future> postAccountvisibility(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -115,7 +115,7 @@ class Profilepostmethod { return response; } - Future> postDeleteaccount(updata) async { + Future> postDeleteaccount(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -126,19 +126,17 @@ class Profilepostmethod { return response; } - - Future> postLogoutaccount() async { + Future> postLogoutaccount() async { Response response; SharedPreferences prefs = await SharedPreferences.getInstance(); String? token = prefs.getString('access-token'); - try { + try { response = await dio.post( ApiUrls.postlogoutaccount, - options: - Options( - headers: {'authorization': basicAuth, 'access-token': token}, - ), + options: Options( + headers: {'authorization': basicAuth, 'access-token': token}, + ), ); log(response.toString()); } on Exception catch (e) { @@ -193,14 +191,13 @@ class Profilepostmethod { response.statusMessage!, ResponseStatus.FAILED); } } - } - Future> postEditTimeline(updata) async { + Future> postEditTimeline(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, - ApiUrls.posttimeline, + ApiUrls.postedittimeline, ); print("response is ${response.data}"); print("response message is ${response.message}"); @@ -218,7 +215,7 @@ class Profilepostmethod { return response; } - Future> postRemoveCertification(updata) async { + Future> postRemoveCertification(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -229,7 +226,7 @@ class Profilepostmethod { return response; } - Future> postCertification(updata) async { + Future> postCertification(updata) async { print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, @@ -239,5 +236,39 @@ class Profilepostmethod { print("response message is ${response.message}"); return response; } - + +// Future guestFollowuser(int userId) async { +// print("followRecipe"); +// final apiUrl = ApiUrls.postunfollow; +// // final body = {"following_iam_principal_xid": userId}; +// Map updata = { +// "following_iam_principal_xid": userId, +// }; +// SharedPreferences prefs = await SharedPreferences.getInstance(); +// String? token = prefs.getString('access-token'); +// Response response; + +// try { +// response = await dio.post( +// apiUrl, +// data: updata, +// options: +// Options( +// headers: {'authorization': basicAuth, 'access-token': token}, +// ), +// ); +// log(response.toString()); +// if (response.statusCode == 200) { +// final jsonResponse = json.decode(response.data); +// print("resp from api ${jsonResponse["message"]}"); +// return jsonResponse["success"]; +// } else { +// // API call failed +// throw Exception('Failed to follow user'); +// } +// } catch (e) { +// // Error occurred while making the API call +// throw Exception('Error: $e'); +// } +// } } diff --git a/lib/Feed Module/sidemenu/Community/Group/view/Group.dart b/lib/Feed Module/sidemenu/Community/Group/view/Group.dart index 053cb1f..11ba615 100644 --- a/lib/Feed Module/sidemenu/Community/Group/view/Group.dart +++ b/lib/Feed Module/sidemenu/Community/Group/view/Group.dart @@ -1,7 +1,10 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Feed%20Module/sidemenu/view_model/getmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -36,215 +39,521 @@ class _GroupState extends State { }, ]; + late Future myfuture; + int id = Get.arguments["id"]; + + @override + void initState() { + // TODO: implement initState + + myfuture = Sidegetmethod().getJoinedusergroups(id); + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Groups", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: SingleChildScrollView( - child: Column( - children: [ - Column( - children: List.generate(GroupData.length, (index) { - return groupCard( - imagepath: GroupData[index]["imagepath"] ?? '', - title: GroupData[index]["title"] ?? '', - ontap: () {}, - subtitle: GroupData[index]["subtitle"], - members: GroupData[index]["members"] ?? ''); - }), - ) - ], - ))) - ])); - } - - Widget groupCard({ - required String imagepath, - required String title, - required void Function()? ontap, - required String members, - required String subtitle, - }) { - return Padding( - padding: EdgeInsets.only(bottom: 25.h), - child: GestureDetector( - onTap: ontap, - child: commonGlassContainer( - border: 0.9, - width: double.infinity, - height: 162.h, - borderradius: 10.r, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 65.h, - width: 65.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - // color: Colors.amber, - ), - child: - // Center( - // child: Image.asset(imagepath, fit: BoxFit.cover)), - - CircleAvatar( - backgroundImage: AssetImage( - imagepath, - ), - ), - ), - sizedBoxWidth(13.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text18w700_FCFCFC(title), - sizedBoxHeight(10.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - width: 18.w, - height: 18.h, - ), - sizedBoxWidth(4.w), - text14w400_FCFCFCblur(subtitle) - ], - ), - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: Offset(0, 30), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Mute community"), - Spacer(), - Image.asset( - "assets/images/png/Black (1).png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Hide post"), - Spacer(), - Image.asset( - "assets/images/png/mingcute_eye-close-line.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Pin"), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Leave community"), - Spacer(), - Image.asset( - "assets/images/png/logout 1 (traced).png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 13.h, - width: 3.w, - )), - ], + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Groups", + ), + resizeToAvoidBottomInset: false, + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), ), - sizedBoxHeight(16.h), - commonDivider(), - sizedBoxHeight(10.h), - Row( - children: [ - stackContainers( - number: "+2", - containerImages: [ - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - ], - ), - sizedBoxWidth(95.w), - text12w400_FCFCFC_blur(members), - ], - ) - ], - ), - )), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return joinedgroupsobj!.data!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, ), ); } + + Widget _buildNoDataBody(context) { + 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), + ) + ], + ), + ); + } + + Widget _buildBody(context) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: joinedgroupsobj!.data!.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: () {}, + child: commonGlassContainer( + border: 0.9, + width: double.infinity, + height: 162.h, + borderradius: 10.r, + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + joinedgroupsobj! + .data![index] + .groupData! + .groupImage == + null || + joinedgroupsobj! + .data![index] + .groupData! + .groupImage! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/img45.png', + ), + ) + : CircleAvatar( + backgroundImage: + NetworkImage( + joinedgroupsobj! + .data![index] + .groupData! + .groupImage!), + )), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Container( + // // width: 250.w, + // // color: Colors.red, + // width: double.infinity, + // child: + joinedgroupsobj!.data![index].groupData! + .title == + null || + joinedgroupsobj!.data![index] + .groupData!.title!.isEmpty + ? text18w700_FCFCFC('Regroup') + : SizedBox( + width: 200.w, + child: text18w700_FCFCFC( + joinedgroupsobj! + .data![index] + .groupData! + .title!), + ), + // ), + sizedBoxHeight(10.h), + joinedgroupsobj!.data![index] + .myJoinedCommunityDetails == + null || + joinedgroupsobj! + .data![index] + .myJoinedCommunityDetails! + .communityData! + .communityName! + .isEmpty + ? SizedBox() + : Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + width: 18.w, + height: 18.h, + ), + sizedBoxWidth(4.w), + text14w400_FCFCFCblur( + joinedgroupsobj! + .data![index] + .myJoinedCommunityDetails! + .communityData! + .communityName!) + ], + ), + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: BoxConstraints.tightFor( + width: 200.w), + offset: Offset(0, 30), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Mute community"), + Spacer(), + Image.asset( + "assets/images/png/Black (1).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Hide post"), + Spacer(), + Image.asset( + "assets/images/png/mingcute_eye-close-line.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC("Pin"), + Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Leave community"), + Spacer(), + Image.asset( + "assets/images/png/logout 1 (traced).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 13.h, + width: 3.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Row( + children: [ + + stackContainersGroups( + number: joinedgroupsobj! + .data![index].membersCount + .toString(), + containerImages: joinedgroupsobj! + .data![index].membersProfilePhotos! + .map((photo) => photo.profilePhoto!) + .toList(), + ), + sizedBoxWidth(75.w), + joinedgroupsobj!.data![index] + .membersCount == + null || + joinedgroupsobj!.data![index] + .membersCount.isBlank! + ? SizedBox() + : text16w400_FCFCFC_blur( + '${joinedgroupsobj!.data![index].membersCount} members', + ), + ], + ) + ], + ), + )), + ), + ); + }, + ) + ], + ))) + ]); + } + + // Widget groupCard({ + // required String? imagepath, + // required String? title, + // required void Function()? ontap, + // required String? members, + // required String? subtitle, + // }) { + // return Padding( + // padding: EdgeInsets.only(bottom: 25.h), + // child: GestureDetector( + // onTap: ontap, + // child: commonGlassContainer( + // border: 0.9, + // width: double.infinity, + // height: 162.h, + // borderradius: 10.r, + // customWidget: Padding( + // padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), + // child: Column( + // children: [ + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // height: 65.h, + // width: 65.h, + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // // color: Colors.amber, + // ), + // child: + // // Center( + // // child: Image.asset(imagepath, fit: BoxFit.cover)), + // imagepath == null || imagepath.isEmpty + // ? + // CircleAvatar( + // backgroundImage: AssetImage( + // 'assets/images/png/img45.png', + // ), + // ) + // : + // CircleAvatar( + // backgroundImage: NetworkImage( + // imagepath + // ), + // ) + + // ), + // sizedBoxWidth(13.w), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // title == null || title.isEmpty + // ? + // text18w700_FCFCFC('Regroup') + // : + // text18w700_FCFCFC(title), + // sizedBoxHeight(10.h), + // Row( + // children: [ + // Image.asset( + // 'assets/images/png/community 1 (traced).png', + // width: 18.w, + // height: 18.h, + // ), + // sizedBoxWidth(4.w), + // text14w400_FCFCFCblur(subtitle) + // ], + // ), + // ], + // ), + // Spacer(), + // PopupMenuButton( + // surfaceTintColor: Color(0xFF222935), + // constraints: BoxConstraints.tightFor(width: 200.w), + // offset: Offset(0, 30), + // color: Color(0xFF222935), + // tooltip: "", + // itemBuilder: (BuildContext context) => + // [ + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric(horizontal: 8.w), + // child: Row( + // children: [ + // text14w400_FCFCFC("Mute community"), + // Spacer(), + // Image.asset( + // "assets/images/png/Black (1).png", + // height: 18.h, + // width: 18.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric(horizontal: 8.w), + // child: Row( + // children: [ + // text14w400_FCFCFC("Hide post"), + // Spacer(), + // Image.asset( + // "assets/images/png/mingcute_eye-close-line.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric(horizontal: 8.w), + // child: Row( + // children: [ + // text14w400_FCFCFC("Pin"), + // Spacer(), + // Image.asset( + // "assets/images/png/f7_pin-fill (2).png", + // height: 25.h, + // width: 25.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric(horizontal: 8.w), + // child: Row( + // children: [ + // text14w400_FCFCFC("Leave community"), + // Spacer(), + // Image.asset( + // "assets/images/png/logout 1 (traced).png", + // height: 18.h, + // width: 18.w, + // ) + // ], + // ), + // ), + // ), + // ], + // child: Image.asset( + // "assets/images/png/Group 1000004071.png", + // height: 13.h, + // width: 3.w, + // )), + // ], + // ), + // sizedBoxHeight(16.h), + // commonDivider(), + // sizedBoxHeight(10.h), + // Row( + // children: [ + // stackContainers( + // number: "+2", + // containerImages: [ + // "assets/images/png/cimg3.png", + // "assets/images/png/cimg2.png", + // "assets/images/png/cimg3.png", + // "assets/images/png/cimg2.png", + // ], + // ), + // sizedBoxWidth(95.w), + // text12w400_FCFCFC_blur(members), + // ], + // ) + // ], + // ), + // )), + // ), + // ); + // } } diff --git a/lib/Feed Module/sidemenu/Model/joineGroupsModel.dart b/lib/Feed Module/sidemenu/Model/joineGroupsModel.dart new file mode 100644 index 0000000..58c49a7 --- /dev/null +++ b/lib/Feed Module/sidemenu/Model/joineGroupsModel.dart @@ -0,0 +1,184 @@ +class GetmyJoinedGroupsModel { + String? status; + int? statusCode; + String? message; + List? data; + + GetmyJoinedGroupsModel( + {this.status, this.statusCode, this.message, this.data}); + + GetmyJoinedGroupsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + 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; + int? iamPrincipalXid; + int? manageGroupXid; + MyJoinedCommunityDetails? myJoinedCommunityDetails; + int? membersCount; + List? membersProfilePhotos; + GroupData? groupData; + + Data( + {this.id, + this.iamPrincipalXid, + this.manageGroupXid, + this.myJoinedCommunityDetails, + this.membersCount, + this.membersProfilePhotos, + this.groupData}); + + Data.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageGroupXid = json['manage_group_xid']; + myJoinedCommunityDetails = json['my_joined_community_details'] != null + ? new MyJoinedCommunityDetails.fromJson( + json['my_joined_community_details']) + : null; + membersCount = json['membersCount']; + if (json['members_profile_photos'] != null) { + membersProfilePhotos = []; + json['members_profile_photos'].forEach((v) { + membersProfilePhotos!.add(new MembersProfilePhotos.fromJson(v)); + }); + } + groupData = json['group_data'] != null + ? new GroupData.fromJson(json['group_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['iam_principal_xid'] = this.iamPrincipalXid; + data['manage_group_xid'] = this.manageGroupXid; + if (this.myJoinedCommunityDetails != null) { + data['my_joined_community_details'] = + this.myJoinedCommunityDetails!.toJson(); + } + data['membersCount'] = this.membersCount; + if (this.membersProfilePhotos != null) { + data['members_profile_photos'] = + this.membersProfilePhotos!.map((v) => v.toJson()).toList(); + } + if (this.groupData != null) { + data['group_data'] = this.groupData!.toJson(); + } + return data; + } +} + +class MyJoinedCommunityDetails { + int? id; + int? manageGroupXid; + int? manageCommunityXid; + CommunityData? communityData; + + MyJoinedCommunityDetails( + {this.id, + this.manageGroupXid, + this.manageCommunityXid, + this.communityData}); + + MyJoinedCommunityDetails.fromJson(Map json) { + id = json['id']; + manageGroupXid = json['manage_group_xid']; + manageCommunityXid = json['manage_community_xid']; + communityData = json['community_data'] != null + ? new CommunityData.fromJson(json['community_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['manage_group_xid'] = this.manageGroupXid; + data['manage_community_xid'] = this.manageCommunityXid; + if (this.communityData != null) { + data['community_data'] = this.communityData!.toJson(); + } + return data; + } +} + +class CommunityData { + int? id; + String? communityName; + + CommunityData({this.id, this.communityName}); + + CommunityData.fromJson(Map json) { + id = json['id']; + communityName = json['community_name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['community_name'] = this.communityName; + return data; + } +} + +class MembersProfilePhotos { + int? id; + String? profilePhoto; + + MembersProfilePhotos({this.id, this.profilePhoto}); + + MembersProfilePhotos.fromJson(Map json) { + id = json['id']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['profile_photo'] = this.profilePhoto; + return data; + } +} + +class GroupData { + int? id; + String? title; + String? groupImage; + + GroupData({this.id, this.title, this.groupImage}); + + GroupData.fromJson(Map json) { + id = json['id']; + title = json['title']; + groupImage = json['group_image']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['group_image'] = this.groupImage; + return data; + } +} diff --git a/lib/Feed Module/sidemenu/view_model/getmethod.dart b/lib/Feed Module/sidemenu/view_model/getmethod.dart new file mode 100644 index 0000000..9b839b8 --- /dev/null +++ b/lib/Feed Module/sidemenu/view_model/getmethod.dart @@ -0,0 +1,26 @@ +import 'dart:developer'; + +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/sidemenu/Model/joineGroupsModel.dart'; + +GetmyJoinedGroupsModel? joinedgroupsobj; + + +class Sidegetmethod { + + Future> getJoinedusergroups(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getmyjoinedgroups}?user_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + joinedgroupsobj = GetmyJoinedGroupsModel.fromJson(response.data); + log(joinedgroupsobj!.data.toString()); + } + return response; + } + + +} \ No newline at end of file diff --git a/lib/Feed Module/sidemenu/view_model/postmethod.dart b/lib/Feed Module/sidemenu/view_model/postmethod.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index bea237a..18e8c47 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -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 createState() => _CustomDropDownRadioState(); @@ -522,9 +524,14 @@ class CustomDropDownRadio extends StatefulWidget { class _CustomDropDownRadioState extends State { 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> _buildDropdownMenuItems() { List> items = @@ -570,7 +577,6 @@ class _CustomDropDownRadioState extends State { ), ], ), - // 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 { ), ], ), - sizedBoxHeight(10.h), + SizedBox(height: 10.h), ], ), ), @@ -718,10 +724,8 @@ class _CustomDropDownRadioState extends State { ), 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 { ), ), child: Column( - // shrinkWrap: true, - // reverse: true, children: _buildDropdownMenuItems(), ), ), diff --git a/lib/Utils/texts.dart b/lib/Utils/texts.dart index 7d77341..9fd534b 100644 --- a/lib/Utils/texts.dart +++ b/lib/Utils/texts.dart @@ -584,6 +584,17 @@ Widget text12w400_FCFCFC_blur(String text) { ); } +Widget text16w400_FCFCFC_blur(String text) { + return Text( + text, + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFFFCFCFC).withOpacity(0.8), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ); +} + Widget text10w400_FCFCFC_blur(String text) { return Text( text, diff --git a/lib/onboarding/Signup/view_model/getUserprofile.dart b/lib/onboarding/Signup/view_model/getUserprofile.dart index e847129..d7ba6b8 100644 --- a/lib/onboarding/Signup/view_model/getUserprofile.dart +++ b/lib/onboarding/Signup/view_model/getUserprofile.dart @@ -31,6 +31,8 @@ class Getuserdetails { await prefs.setString('username', getuserobj?.data?.userData?.userName ?? ""); await prefs.setString('email', getuserobj?.data?.userData?.emailAddress ?? ""); await prefs.setString('phone', getuserobj?.data?.userData?.phoneNumber ?? ""); + await prefs.setString('accountTypefromLogin', + getuserobj?.data?.userData?.principalTypeXid.toString() ?? ""); emailid = prefs.getString('email'); myusername = prefs.getString('username');