diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 30a4ef8..e21146d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -19,7 +19,9 @@ android:label="ReGroup" android:requestLegacyExternalStorage="true" android:name="${applicationName}" - android:icon="@mipmap/ic_launcher"> + android:icon="@mipmap/launcher_icon" + android:allowBackup="false" + android:fullBackupContent="false"> { Color(0xFFffffff).withOpacity(0.8), Color(0xFFFFFFFF).withOpacity(0.8), ], - stops: [ + stops: const [ 0.1, 1, ]), @@ -245,7 +244,7 @@ class _CommonDropdownradioBtnState extends State { Color(0xFFffffff).withOpacity(0.8), Color(0xFFFFFFFF).withOpacity(0.8), ], - stops: [0.1, 1], + stops: const [0.1, 1], ), borderRadius: BorderRadius.circular(30), border: Border.all( @@ -589,7 +588,7 @@ class _CommonDropdownCheckboxState extends State { Color(0xFFffffff).withOpacity(0.8), Color(0xFFFFFFFF).withOpacity(0.8), ], - stops: [0.1, 1], + stops: const [0.1, 1], ), borderRadius: BorderRadius.circular(30.r), border: Border.all( diff --git a/lib/Common/CommonGlassmorphism.dart b/lib/Common/CommonGlassmorphism.dart index 0163d9f..1054f77 100644 --- a/lib/Common/CommonGlassmorphism.dart +++ b/lib/Common/CommonGlassmorphism.dart @@ -12,7 +12,10 @@ Widget commonGlassContainer({ double opacity2 = 0.05, Color borderColor = const Color(0xff434A53), }) { - return GlassmorphicContainer( + return + + + GlassmorphicContainer( width: width, height: height, borderRadius: borderradius, @@ -23,7 +26,7 @@ Widget commonGlassContainer({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFFFFFFF).withOpacity(opacity1), + const Color(0xFFFFFFFF).withOpacity(opacity1), const Color(0xFFFFFFFF).withOpacity(opacity2), ], stops: const [ @@ -61,8 +64,8 @@ Widget commonGlassContainerblue({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFF009DAB).withOpacity(0.48), - Color(0xFF009DAB).withOpacity(0.12), + const Color(0xFF009DAB).withOpacity(0.48), + const Color(0xFF009DAB).withOpacity(0.12), ], stops: const [ 0.1, @@ -99,8 +102,8 @@ Widget commonGlassUIBlue({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFF009DAB).withOpacity(0.48), - Color(0xFF009DAB).withOpacity(0.12), + const Color(0xFF009DAB).withOpacity(0.48), + const Color(0xFF009DAB).withOpacity(0.12), ], stops: const [ 0.1, @@ -133,7 +136,7 @@ Widget commonGlassUI({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFFFFFFF).withOpacity(opacity1), + const Color(0xFFFFFFFF).withOpacity(opacity1), const Color(0xFFFFFFFF).withOpacity(opacity2), ], stops: const [ @@ -167,7 +170,7 @@ Widget commonContainer({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFFFFFFF).withOpacity(opacity1), + const Color(0xFFFFFFFF).withOpacity(opacity1), const Color(0xFFFFFFFF).withOpacity(opacity2), ], stops: const [ diff --git a/lib/Common/CommonTabBar.dart b/lib/Common/CommonTabBar.dart index b5b8751..8b2293b 100644 --- a/lib/Common/CommonTabBar.dart +++ b/lib/Common/CommonTabBar.dart @@ -5,15 +5,16 @@ class CommonTabBar extends StatelessWidget { // Set the desired height final List tabs; - CommonTabBar({required this.tabs,}); + const CommonTabBar({super.key, required this.tabs,}); @override Widget build(BuildContext context) { return TabBar( - dividerColor: Color(0xFFFFFFFF).withOpacity(0.07), + + dividerColor: const Color(0xFFFFFFFF).withOpacity(0.07), labelStyle: TextStyle( fontSize: 14.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), indicatorSize: TabBarIndicatorSize.tab, @@ -21,7 +22,7 @@ class CommonTabBar extends StatelessWidget { // labelColor: Colors.white, indicatorWeight: 2.h, dividerHeight: 2.h, - unselectedLabelColor: Color(0xFFFCFCFC), + unselectedLabelColor: const Color(0xFFFCFCFC), overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)), tabs: tabs); } diff --git a/lib/Common/CommonWidget.dart b/lib/Common/CommonWidget.dart index e6cceea..3ad8a7e 100644 --- a/lib/Common/CommonWidget.dart +++ b/lib/Common/CommonWidget.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -78,13 +77,13 @@ Widget MessageTextInputField( labelStyle: const TextStyle(color: Colors.black), errorStyle: TextStyle( fontSize: 13.sp, - color: Color.fromARGB(255, 245, 130, 122), + color: const Color.fromARGB(255, 245, 130, 122), ), contentPadding: const EdgeInsets.symmetric( vertical: 12.0, horizontal: 16), //<-- Adjust the vertical padding as needed filled: true, - fillColor: Color(0xFFFFF3E4), + fillColor: const Color(0xFFFFF3E4), border: OutlineInputBorder( borderRadius: BorderRadius.circular(5), borderSide: const BorderSide(color: Color(0xFFE8C69F80), width: 1), @@ -124,7 +123,7 @@ Widget commonDivider() { return Container( height: 1.5.h, width: double.infinity, - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -154,7 +153,7 @@ Future datePicker( onSecondary: Colors.white), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( - foregroundColor: Color(0xFFD90B2E), + foregroundColor: const Color(0xFFD90B2E), ), )); final DateTime? picked = await showDatePicker( @@ -171,7 +170,7 @@ Future datePicker( ); if (picked != null) { - controller.text = DateFormat('dd-MM-yyyy').format(picked); + controller.text = DateFormat('yyyy-MM-dd').format(picked); } } @@ -186,11 +185,11 @@ Future showCustomTimePicker(BuildContext context, onSurface: Colors.white, ), textTheme: Theme.of(context).textTheme.copyWith( - headline6: TextStyle(color: Colors.blue), // Change the title color + titleLarge: const TextStyle(color: Colors.blue), // Change the title color ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( - foregroundColor: Color(0xFFD90B2E), + foregroundColor: const Color(0xFFD90B2E), ), )); return showTimePicker( @@ -219,13 +218,13 @@ Widget stackContainers({ width: 30, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0xFFD90B2E), - border: Border.all(color: Color(0xFF2C3742), width: 1), + color: const Color(0xFFD90B2E), + border: Border.all(color: const Color(0xFF2C3742), width: 1), ), child: Center( child: Text( number, - style: TextStyle( + style: const TextStyle( color: Colors.white, fontWeight: FontWeight.w400, fontSize: 8, @@ -248,7 +247,7 @@ Widget stackContainers({ width: 30, decoration: BoxDecoration( shape: BoxShape.circle, - border: Border.all(color: Color(0xFF2C3742), width: 1), + border: Border.all(color: const Color(0xFF2C3742), width: 1), ), child: CircleAvatar( foregroundImage: AssetImage(containerImages[index]), @@ -265,6 +264,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: const Color(0xFFD90B2E), + border: Border.all(color: const Color(0xFF2C3742), width: 1), + ), + child: Center( + child: Text( + remainingCount > 0 ? '+$remainingCount' : '', + style: const 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: const Color(0xFF2C3742), width: 1), + ), + child: CircleAvatar( + backgroundImage: NetworkImage(imagesToShow[index]), + ), + ), + ); + }), + ), + ), + ), + ], + ), + ], + ); +} + Widget stackContainers2({ required List containerImages, }) { @@ -284,7 +350,7 @@ Widget stackContainers2({ width: 40, decoration: BoxDecoration( shape: BoxShape.circle, - border: Border.all(color: Color(0xFF2C3742), width: 1), + border: Border.all(color: const Color(0xFF2C3742), width: 1), ), child: CircleAvatar( foregroundImage: AssetImage(containerImages[index]), @@ -321,7 +387,7 @@ Widget stackReaction({ begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFFFFFFF).withOpacity(0.1), + const Color(0xFFFFFFFF).withOpacity(0.1), const Color(0xFFFFFFFF).withOpacity(0.06), ], stops: const [ @@ -329,7 +395,7 @@ Widget stackReaction({ 1, ], ), - border: Border.all(color: Color(0xFF1E3A46), width: 1.71)), + border: Border.all(color: const Color(0xFF1E3A46), width: 1.71)), child: Center( child: Image.asset( containerImages[index], diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index 057a17c..11613b9 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"; @@ -59,7 +58,33 @@ class ApiUrls { static const postchangepassverify = "${baseUrl}verify-update-password-otp"; + static const gettimelineabilitylist = "${baseUrl}list-of-abilities"; + static const posttimeline = "${baseUrl}create-timeline"; + + static const postaccountvisibility = "${baseUrl}account-visibility"; + + static const postdeleteaccount = "${baseUrl}delete-my-account"; + + static const postlogoutaccount = "${baseUrl}logout"; + + static const getedittimeline = "${baseUrl}get-timeline-data"; + + static const postedittimeline = "${baseUrl}update-timeline"; + + static const postremovetimeline = "${baseUrl}delete-timeline"; + + static const postremovecertification = "${baseUrl}delete-certification"; + + static const postcertification = "${baseUrl}store-certification"; + + static const getaccountsessions = "${baseUrl}get-account-session"; + + 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"; @@ -67,15 +92,24 @@ 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"; + static const getinterestlist = "${baseUrl}fetch-interests"; + + // Business static const posteditprofilebusiness = "${baseUrl}update-business-profile"; static const geteditprofilebusiness = "${baseUrl}fetch-business-profile"; +//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 getGuestfollowers = "${baseUrl}get-guest-user-followers"; + static const getGuestfollowing = "${baseUrl}get-guest-user-following"; } diff --git a/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart b/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart index f040e6a..ff085af 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart @@ -9,10 +9,8 @@ import 'package:regroup/Common/CommonDropDown.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -33,8 +31,8 @@ class _AddEventState extends State { TextEditingController dateController = TextEditingController(); TextEditingController dateController2 = TextEditingController(); - TimeOfDay? starttime = TimeOfDay(hour: 15, minute: 0); - TimeOfDay? endtime = TimeOfDay(hour: 15, minute: 0); + TimeOfDay? starttime = const TimeOfDay(hour: 15, minute: 0); + TimeOfDay? endtime = const TimeOfDay(hour: 15, minute: 0); String formatTimeOfDay(TimeOfDay time) { final now = DateTime.now(); @@ -48,10 +46,10 @@ class _AddEventState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), body: Stack(children: [ @@ -69,7 +67,7 @@ class _AddEventState extends State { text16400white("Event Title"), sizedBoxHeight(14.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -101,10 +99,10 @@ class _AddEventState extends State { }, child: DottedBorder( strokeWidth: 1, - dashPattern: [7, 4], + dashPattern: const [7, 4], borderType: BorderType.RRect, radius: Radius.circular(14.r), - color: Color(0xFF434A53), + color: const Color(0xFF434A53), child: commonGlassContainer( border: 0, width: double.infinity, @@ -130,12 +128,12 @@ class _AddEventState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), @@ -190,7 +188,7 @@ class _AddEventState extends State { text12w400_FCFCFC_blur("10 kb") ], ), - Spacer(), + const Spacer(), Image.asset( 'assets/images/png/cancelicon.png', height: 20.h, @@ -205,8 +203,8 @@ class _AddEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: 'Race', - items: [], - leadingImage: Container( + items: const ['', ''], + leadingImage: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -221,8 +219,8 @@ class _AddEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: 'Cycling', - items: [], - leadingImage: Container( + items: const [], + leadingImage: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -250,7 +248,7 @@ class _AddEventState extends State { child: CustomTextFormField( textEditingController: dateController, hintText: "1-4-2024", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -281,7 +279,7 @@ class _AddEventState extends State { child: CustomTextFormField( textEditingController: dateController2, hintText: "4-4-2024", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -336,7 +334,7 @@ class _AddEventState extends State { ) ], ), - Spacer(), + const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -390,7 +388,7 @@ class _AddEventState extends State { customWidget: Transform.scale( scale: 1.4, child: Checkbox( - side: BorderSide(color: Color(0xFF434A53)), + side: const BorderSide(color: Color(0xFF434A53)), value: isChecked.value, activeColor: Colors.transparent, checkColor: Colors.white, @@ -410,8 +408,8 @@ class _AddEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: '', - items: [], - leadingImage: Container( + items: const [], + leadingImage: SizedBox( height: 22.h, width: 28.w, child: Center( @@ -426,7 +424,7 @@ class _AddEventState extends State { onTap: () { Get.toNamed(RouteName.addUsers); }, - leadingIcon: Container( + leadingIcon: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -440,7 +438,7 @@ class _AddEventState extends State { ), hintText: "", suffixIcon: - Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)), + const Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)), ), sizedBoxHeight(20.h), containerWidget( @@ -458,7 +456,7 @@ class _AddEventState extends State { text16400white("Location"), sizedBoxHeight(14.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 19.h, width: 15.w, child: Center( @@ -495,7 +493,7 @@ class _AddEventState extends State { children: [ text16400white("Minutes"), sizedBoxWidth(5.w), - Icon( + const Icon( Icons.keyboard_arrow_down, color: Colors.white, ) @@ -532,7 +530,7 @@ class _AddEventState extends State { ), sizedBoxWidth(8.w), text16400white(title), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/cancelicon.png", height: 20.h, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart b/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart index c857f56..f8c366c 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart @@ -64,21 +64,22 @@ class _AddUsersState extends State { return Scaffold( // key: _scaffoldKey1, resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Add users", ), body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + ), + SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ sizedBoxHeight(10.h), Padding( padding: const EdgeInsets.symmetric(horizontal: 16), @@ -102,7 +103,7 @@ class _AddUsersState extends State { length: 3, // initialIndex: selectedIndex.value, child: Column(children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Group', ), @@ -117,9 +118,9 @@ class _AddUsersState extends State { height: 600.h, child: TabBarView( children: [ - GroupTab(), - SubgroupTab(), - FollowersTab(), + groupTab(), + subgroupTab(), + followersTab(), ], ), ), @@ -128,7 +129,7 @@ class _AddUsersState extends State { ])); } - Widget GroupTab() { + Widget groupTab() { return Column( children: [ sizedBoxHeight(30.h), @@ -137,7 +138,7 @@ class _AddUsersState extends State { child: Row( children: [ text18w700_FCFCFC("Group members"), - Spacer(), + const Spacer(), commonGlassContainer( width: 35.w, height: 35.h, @@ -236,7 +237,7 @@ class _AddUsersState extends State { text12w400_FCFCFC_blur(subtitle), ], ), - Spacer(), + const Spacer(), commonGlassContainer( border: 1, borderradius: 2, @@ -247,7 +248,7 @@ class _AddUsersState extends State { customWidget: Transform.scale( scale: 1.4, child: Checkbox( - side: BorderSide(color: Color(0xFF434A53)), + side: const BorderSide(color: Color(0xFF434A53)), value: isChecked, activeColor: Colors.transparent, checkColor: Colors.white, @@ -270,7 +271,7 @@ class _AddUsersState extends State { Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.r), - color: Color(0xFF222935)), + color: const Color(0xFF222935)), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), child: Column( @@ -306,7 +307,7 @@ class _AddUsersState extends State { opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), border: 0.5), - Spacer(), + const Spacer(), Row( children: [ Image.asset( @@ -351,7 +352,7 @@ class _AddUsersState extends State { opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), border: 0.5), - Spacer(), + const Spacer(), Row( children: [ Image.asset( @@ -379,7 +380,7 @@ class _AddUsersState extends State { begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFD90B2E).withOpacity(0.18), + const Color(0xFFD90B2E).withOpacity(0.18), const Color(0xFFD90B2E).withOpacity(0.4), ], stops: const [ @@ -387,7 +388,7 @@ class _AddUsersState extends State { 1, ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -411,14 +412,14 @@ class _AddUsersState extends State { )); } - Widget SubgroupTab() { - return Column( + Widget subgroupTab() { + return const Column( children: [], ); } - Widget FollowersTab() { - return Column( + Widget followersTab() { + return const Column( children: [], ); } diff --git a/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart b/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart index 5afe764..5bd96ca 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; class Availability extends StatefulWidget { @@ -29,13 +28,13 @@ class _AvailabilityState extends State { endTime: DateTime(2024, 6, 26, 10, 30), subject: 'Development Meeting', resourceIds: [4], - color: Color(0XFFFC571D)), + color: const Color(0XFFFC571D)), Appointment( startTime: DateTime(2024, 6, 26, 18, 0), endTime: DateTime(2024, 6, 26, 18, 30), subject: 'GeneralMeeting', resourceIds: [2], - color: Color(0xFF8B1FA9)), + color: const Color(0xFF8B1FA9)), Appointment( startTime: DateTime(2024, 6, 28, 9, 0), endTime: DateTime(2024, 6, 28, 10, 30), @@ -50,13 +49,13 @@ class _AvailabilityState extends State { ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Match day', resourceIds: [3], ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Muharram/Ashura', resourceIds: [3], ), @@ -64,37 +63,37 @@ class _AvailabilityState extends State { _employeeCollection = [ CalendarResource( id: 1, - image: AssetImage("assets/images/png/cimg1.png"), + image: const AssetImage("assets/images/png/cimg1.png"), displayName: 'Kaylly Vaccaro', color: Colors.transparent, ), CalendarResource( id: 2, - image: AssetImage("assets/images/png/cimg2.png"), + image: const AssetImage("assets/images/png/cimg2.png"), displayName: 'Ryan Dorwart', color: Colors.transparent, ), CalendarResource( id: 3, - image: AssetImage("assets/images/png/cimg3.png"), + image: const AssetImage("assets/images/png/cimg3.png"), displayName: 'Ahmad Rhiel', color: Colors.transparent, ), CalendarResource( id: 4, - image: AssetImage("assets/images/png/cimg3.png"), + image: const AssetImage("assets/images/png/cimg3.png"), displayName: 'Ahmad Rhiel', color: Colors.transparent, ), CalendarResource( id: 5, - image: AssetImage("assets/images/png/Ellipse 52.png"), + image: const AssetImage("assets/images/png/Ellipse 52.png"), displayName: 'Ahmad Rhiel', color: Colors.transparent, ), CalendarResource( id: 6, - image: AssetImage("assets/images/png/Ellipse 48.png"), + image: const AssetImage("assets/images/png/Ellipse 48.png"), displayName: 'Ahmad Rhiel', color: Colors.transparent, ), @@ -105,10 +104,10 @@ class _AvailabilityState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Availability", ), body: Stack(children: [ @@ -129,16 +128,16 @@ class _AvailabilityState extends State { border: 0, customWidget: SfCalendar( view: CalendarView.timelineMonth, - appointmentTextStyle: TextStyle(color: Colors.white), - headerStyle: CalendarHeaderStyle( + appointmentTextStyle: const TextStyle(color: Colors.white), + headerStyle: const CalendarHeaderStyle( textStyle: TextStyle( color: Colors.blue, )), // blackoutDatesTextStyle: TextStyle(color: Colors.white), - weekNumberStyle: WeekNumberStyle( + weekNumberStyle: const WeekNumberStyle( textStyle: TextStyle(color: Colors.white)), - viewHeaderStyle: ViewHeaderStyle( + viewHeaderStyle: const ViewHeaderStyle( // backgroundColor: Colors.amber, dateTextStyle: TextStyle(color: Colors.white), dayTextStyle: TextStyle( @@ -150,18 +149,18 @@ class _AvailabilityState extends State { backgroundColor: Colors.transparent, // firstDayOfWeek: 3, cellBorderColor: Colors.white, - todayHighlightColor: Color(0xFFD90B2E), + todayHighlightColor: const Color(0xFFD90B2E), todayTextStyle: const TextStyle(color: Colors.white), controller: _calendarController, showNavigationArrow: true, allowViewNavigation: true, showDatePickerButton: true, - monthViewSettings: MonthViewSettings( + monthViewSettings: const MonthViewSettings( navigationDirection: MonthNavigationDirection.horizontal, ), allowDragAndDrop: true, - allowedViews: [ + allowedViews: const [ // CalendarView.month, // CalendarView.day, // CalendarView.schedule, @@ -175,7 +174,7 @@ class _AvailabilityState extends State { onTap: calendarTapped, timeSlotViewSettings: TimeSlotViewSettings( // minimumAppointmentDuration: Duration(hours: 5), - timeTextStyle: TextStyle( + timeTextStyle: const TextStyle( color: Colors.white, ), timelineAppointmentHeight: 60.h, @@ -186,20 +185,20 @@ class _AvailabilityState extends State { ), monthCellBuilder: (context, details) { return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.transparent, ), child: Center( child: Text( details.date.day.toString(), - style: TextStyle( + style: const TextStyle( color: Colors.white), // Set text color to white ), ), ); }, - resourceViewSettings: ResourceViewSettings( + resourceViewSettings: const ResourceViewSettings( displayNameTextStyle: TextStyle(color: Colors.white, fontSize: 10), showAvatar: true, @@ -244,7 +243,7 @@ class _AvailabilityState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Event Details'), + title: const Text('Event Details'), content: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -255,7 +254,7 @@ class _AvailabilityState extends State { ), actions: [ ElevatedButton( - child: Text('Close'), + child: const Text('Close'), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart b/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart index a7bc2b9..6e67068 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart @@ -7,8 +7,6 @@ import 'package:regroup/Common/CommonBottomNavigationBar.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/controller/MainScreen.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -72,12 +70,12 @@ class _CalenderTabState extends State { startTime: DateTime(2024, 6, 26, 9, 0), endTime: DateTime(2024, 6, 26, 10, 30), subject: 'Development Meeting', - color: Color(0XFFFC571D)), + color: const Color(0XFFFC571D)), Appointment( startTime: DateTime(2024, 6, 26, 18, 0), endTime: DateTime(2024, 6, 26, 18, 30), subject: 'GeneralMeeting', - color: Color(0xFF8B1FA9)), + color: const Color(0xFF8B1FA9)), Appointment( startTime: DateTime(2024, 6, 28, 9, 0), endTime: DateTime(2024, 6, 28, 10, 30), @@ -90,12 +88,12 @@ class _CalenderTabState extends State { ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Match day', ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Muharram/Ashura', ), ]; @@ -107,11 +105,11 @@ class _CalenderTabState extends State { return Scaffold( resizeToAvoidBottomInset: false, // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, appBar: AppBar( scrolledUnderElevation: 0.0, - backgroundColor: Color(0xff222935), + backgroundColor: const Color(0xff222935), elevation: 0, automaticallyImplyLeading: false, title: text20700white("Sessions"), @@ -123,7 +121,7 @@ class _CalenderTabState extends State { child: Container( height: 35.h, width: 35.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Color(0xFFD90B2E), shape: BoxShape.circle, boxShadow: [ @@ -135,7 +133,7 @@ class _CalenderTabState extends State { ), ], ), - child: Icon(Icons.add, color: Colors.white, weight: 2), + child: const Icon(Icons.add, color: Colors.white, weight: 2), ), ), sizedBoxWidth(14.w), @@ -179,7 +177,10 @@ class _CalenderTabState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar( + + + tabs: [ Tab( text: 'My sessions', ), @@ -189,9 +190,10 @@ class _CalenderTabState extends State { ]), Expanded( child: TabBarView( + children: [ - MySessionsTab(), - ComSessionTab(), + mySessionsTab(), + comSessionTab(), ], ), ), @@ -206,7 +208,7 @@ class _CalenderTabState extends State { ); } - Widget MySessionsTab() { + Widget mySessionsTab() { return SingleChildScrollView( child: Column( children: [ @@ -239,7 +241,7 @@ class _CalenderTabState extends State { ], ), ), - Spacer(), + const Spacer(), Image.asset("assets/images/png/Rectangle 45.png") ], ), @@ -254,16 +256,16 @@ class _CalenderTabState extends State { border: 0, customWidget: SfCalendar( view: CalendarView.month, - appointmentTextStyle: TextStyle(color: Colors.white), - headerStyle: CalendarHeaderStyle( + appointmentTextStyle: const TextStyle(color: Colors.white), + headerStyle: const CalendarHeaderStyle( textStyle: TextStyle( color: Color(0xFFD90B2E), )), // blackoutDatesTextStyle: TextStyle(color: Colors.white), - weekNumberStyle: WeekNumberStyle( + weekNumberStyle: const WeekNumberStyle( textStyle: TextStyle(color: Colors.white)), - viewHeaderStyle: ViewHeaderStyle( + viewHeaderStyle: const ViewHeaderStyle( // backgroundColor: Colors.amber, dateTextStyle: TextStyle(color: Colors.white), dayTextStyle: TextStyle( @@ -275,17 +277,17 @@ class _CalenderTabState extends State { backgroundColor: Colors.transparent, // firstDayOfWeek: 3, cellBorderColor: Colors.white, - todayHighlightColor: Color(0xFFD90B2E), + todayHighlightColor: const Color(0xFFD90B2E), todayTextStyle: const TextStyle(color: Colors.white), controller: _sessionCalController, showNavigationArrow: true, allowViewNavigation: true, allowDragAndDrop: true, showDatePickerButton: true, - monthViewSettings: MonthViewSettings( + monthViewSettings: const MonthViewSettings( navigationDirection: MonthNavigationDirection.horizontal, ), - allowedViews: [ + allowedViews: const [ CalendarView.month, // CalendarView.day, CalendarView.schedule, @@ -296,7 +298,7 @@ class _CalenderTabState extends State { onTap: calendarTapped, timeSlotViewSettings: TimeSlotViewSettings( // minimumAppointmentDuration: Duration(hours: 5), - timeTextStyle: TextStyle( + timeTextStyle: const TextStyle( color: Colors.white, ), timelineAppointmentHeight: 60.h, @@ -307,19 +309,19 @@ class _CalenderTabState extends State { ), monthCellBuilder: (context, details) { return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.transparent, ), child: Center( child: Text( details.date.day.toString(), - style: TextStyle( + style: const TextStyle( color: Colors.white), // Set text color to white ), ), ); }, - resourceViewSettings: ResourceViewSettings( + resourceViewSettings: const ResourceViewSettings( displayNameTextStyle: TextStyle(color: Colors.white, fontSize: 10), showAvatar: true, @@ -327,7 +329,7 @@ class _CalenderTabState extends State { // scheduleViewSettings: ScheduleViewSettings( // appointmentTextStyle: TextStyle(color: Colors.red)), - scheduleViewSettings: ScheduleViewSettings( + scheduleViewSettings: const ScheduleViewSettings( placeholderTextStyle: TextStyle(color: Colors.white), dayHeaderSettings: DayHeaderSettings( dateTextStyle: TextStyle(color: Colors.white), @@ -368,7 +370,7 @@ class _CalenderTabState extends State { height: 25.h, decoration: BoxDecoration( border: Border.all( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), ), borderRadius: BorderRadius.circular(15.r)), child: Padding( @@ -528,7 +530,7 @@ class _CalenderTabState extends State { CircleAvatar( radius: 12.r, backgroundImage: - AssetImage("assets/images/png/Ellipse 52.png"), + const AssetImage("assets/images/png/Ellipse 52.png"), ), sizedBoxWidth(8.w), text14w400_FCFCFC("Ryan dorwat"), @@ -542,7 +544,7 @@ class _CalenderTabState extends State { ); } - Widget ComSessionTab() { + Widget comSessionTab() { return SingleChildScrollView( child: Column( children: [ @@ -556,16 +558,16 @@ class _CalenderTabState extends State { border: 0, customWidget: SfCalendar( view: CalendarView.month, - appointmentTextStyle: TextStyle(color: Colors.white), - headerStyle: CalendarHeaderStyle( + appointmentTextStyle: const TextStyle(color: Colors.white), + headerStyle: const CalendarHeaderStyle( textStyle: TextStyle( color: Color(0xFFD90B2E), )), // blackoutDatesTextStyle: TextStyle(color: Colors.white), - weekNumberStyle: WeekNumberStyle( + weekNumberStyle: const WeekNumberStyle( textStyle: TextStyle(color: Colors.white)), - viewHeaderStyle: ViewHeaderStyle( + viewHeaderStyle: const ViewHeaderStyle( // backgroundColor: Colors.amber, dateTextStyle: TextStyle(color: Colors.white), dayTextStyle: TextStyle( @@ -577,17 +579,17 @@ class _CalenderTabState extends State { backgroundColor: Colors.transparent, // firstDayOfWeek: 3, cellBorderColor: Colors.white, - todayHighlightColor: Color(0xFFD90B2E), + todayHighlightColor: const Color(0xFFD90B2E), todayTextStyle: const TextStyle(color: Colors.white), controller: _comCalController, showNavigationArrow: true, allowViewNavigation: true, allowDragAndDrop: true, showDatePickerButton: true, - monthViewSettings: MonthViewSettings( + monthViewSettings: const MonthViewSettings( navigationDirection: MonthNavigationDirection.horizontal, ), - allowedViews: [ + allowedViews: const [ CalendarView.month, // CalendarView.day, CalendarView.schedule, @@ -598,7 +600,7 @@ class _CalenderTabState extends State { onTap: calendarTapped, timeSlotViewSettings: TimeSlotViewSettings( // minimumAppointmentDuration: Duration(hours: 5), - timeTextStyle: TextStyle( + timeTextStyle: const TextStyle( color: Colors.white, ), timelineAppointmentHeight: 60.h, @@ -609,19 +611,19 @@ class _CalenderTabState extends State { ), monthCellBuilder: (context, details) { return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.transparent, ), child: Center( child: Text( details.date.day.toString(), - style: TextStyle( + style: const TextStyle( color: Colors.white), // Set text color to white ), ), ); }, - resourceViewSettings: ResourceViewSettings( + resourceViewSettings: const ResourceViewSettings( displayNameTextStyle: TextStyle(color: Colors.white, fontSize: 10), showAvatar: true, @@ -776,7 +778,7 @@ class _CalenderTabState extends State { sizedBoxWidth(16.w), CircleAvatar( radius: 12.r, - backgroundImage: AssetImage( + backgroundImage: const AssetImage( "assets/images/png/Ellipse 52.png"), ), sizedBoxWidth(8.w), @@ -784,12 +786,12 @@ class _CalenderTabState extends State { ], ), ]), - Spacer(), + const Spacer(), Container( height: 138.h, width: 143.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.only( bottomRight: Radius.circular(10.r), ), @@ -821,7 +823,7 @@ class _CalenderTabState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Event Details'), + title: const Text('Event Details'), content: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -832,7 +834,7 @@ class _CalenderTabState extends State { ), actions: [ ElevatedButton( - child: Text('Close'), + child: const Text('Close'), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart b/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart index f17ed4c..6a10e56 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart @@ -26,7 +26,7 @@ class _EventDetailsState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: CommonAppbar( @@ -306,7 +306,7 @@ class _EventDetailsState extends State { ), sizedBoxWidth(10.w), text16w400_white("Send message to invites"), - Spacer(), + const Spacer(), commonGlassContainer( width: 98.w, height: 30.h, @@ -327,7 +327,7 @@ class _EventDetailsState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - CircleAvatar( + const CircleAvatar( radius: 33.5, backgroundImage: AssetImage("assets/images/png/cimg1.png"), @@ -345,7 +345,7 @@ class _EventDetailsState extends State { children: [ CircleAvatar( radius: 12.5.r, - backgroundImage: AssetImage( + backgroundImage: const AssetImage( "assets/images/png/img322.png"), ), sizedBoxWidth(8.w), @@ -374,7 +374,7 @@ class _EventDetailsState extends State { Image.asset("assets/images/png/Red.png", height: 22.h, width: 16.w), sizedBoxWidth(10.w), SizedBox(width: 250.w, child: text16w400_white(text)), - Spacer(), + const Spacer(), text16400white(count), ], ), diff --git a/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart b/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart index 34cb9b8..4572b80 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart @@ -6,7 +6,6 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -60,7 +59,7 @@ class _ManageMembersCalState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: CommonAppbar( @@ -72,7 +71,7 @@ class _ManageMembersCalState extends State { child: Container( height: 35.h, width: 35.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Color(0xFFD90B2E), shape: BoxShape.circle, boxShadow: [ @@ -84,7 +83,7 @@ class _ManageMembersCalState extends State { ), ], ), - child: Icon(Icons.add, color: Colors.white, weight: 2), + child: const Icon(Icons.add, color: Colors.white, weight: 2), ), ), ), @@ -180,13 +179,13 @@ class _ManageMembersCalState extends State { text12w400_FCFCFC_blur(subtitle), ], ), - Spacer(), + const Spacer(), Container( height: 25.h, width: 72.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5.r), - border: Border.all(color: Color(0xFFFF002B), width: 1.w)), + border: Border.all(color: const Color(0xFFFF002B), width: 1.w)), child: Center(child: text10400white("Attending")), ), sizedBoxWidth(8.w), @@ -235,7 +234,7 @@ class _ManageMembersCalState extends State { Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.r), - color: Color(0xFF222935)), + color: const Color(0xFF222935)), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), child: Column( @@ -271,7 +270,7 @@ class _ManageMembersCalState extends State { opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), border: 0.5), - Spacer(), + const Spacer(), Row( children: [ Image.asset( @@ -316,7 +315,7 @@ class _ManageMembersCalState extends State { opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), border: 0.5), - Spacer(), + const Spacer(), Row( children: [ Image.asset( @@ -344,7 +343,7 @@ class _ManageMembersCalState extends State { begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFD90B2E).withOpacity(0.18), + const Color(0xFFD90B2E).withOpacity(0.18), const Color(0xFFD90B2E).withOpacity(0.4), ], stops: const [ @@ -352,7 +351,7 @@ class _ManageMembersCalState extends State { 1, ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ diff --git a/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart b/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart index 0bb7986..68a0fa5 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart @@ -5,10 +5,8 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; class ResourcePool extends StatefulWidget { const ResourcePool({super.key}); @@ -42,9 +40,9 @@ class _ResourcePoolState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Resource pool", ), resizeToAvoidBottomInset: false, @@ -103,7 +101,7 @@ class _ResourcePoolState extends State { children: [ CircleAvatar( backgroundImage: - AssetImage("assets/images/png/Ellipse 52.png"), + const AssetImage("assets/images/png/Ellipse 52.png"), radius: 25.r, ), sizedBoxWidth(8.w), @@ -115,7 +113,7 @@ class _ResourcePoolState extends State { text12w400_FCFCFC_blur("Row row row your boat") ], ), - Spacer(), + const Spacer(), InkWell( onTap: () { inviteBottomSheet(); @@ -124,7 +122,7 @@ class _ResourcePoolState extends State { height: 30.h, width: 95.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r)), child: Center(child: text14400white("Invite")), ), @@ -192,7 +190,7 @@ class _ResourcePoolState extends State { topLeft: Radius.circular(30.r), topRight: Radius.circular(30.r), ), - color: Color(0xFF222935), + color: const Color(0xFF222935), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), @@ -259,7 +257,7 @@ class _ResourcePoolState extends State { ), sizedBoxWidth(10.w), text16w400_FCFCFC(title), - Spacer(), + const Spacer(), commonGlassContainer( border: 1, borderradius: 2, @@ -270,7 +268,7 @@ class _ResourcePoolState extends State { customWidget: Transform.scale( scale: 1.4, child: Checkbox( - side: BorderSide(color: Color(0xFF434A53)), + side: const BorderSide(color: Color(0xFF434A53)), value: isChecked, activeColor: Colors.transparent, checkColor: Colors.white, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart b/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart index edc83c3..1dd6be0 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart +++ b/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart @@ -2,12 +2,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonDropDown.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -35,10 +33,10 @@ class _SetAvailabillityState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Set availability", ), body: Stack(children: [ @@ -57,30 +55,30 @@ class _SetAvailabillityState extends State { sizedBoxHeight(10.h), text16400white("Select event type"), sizedBoxHeight(15.h), - CommonDropdownBtn(hint: "", items: []), + CommonDropdownBtn(hint: "", items: const ['']), sizedBoxHeight(18.h), text16400white("Select sport"), sizedBoxHeight(15.h), - CommonDropdownBtn(hint: "", items: []), + CommonDropdownBtn(hint: "", items: const ['']), sizedBoxHeight(18.h), text16400white("Select role "), sizedBoxHeight(15.h), - CommonDropdownBtn(hint: "", items: []), + CommonDropdownBtn(hint: "", items: const ['']), sizedBoxHeight(18.h), text16400white("Space selection"), sizedBoxHeight(15.h), - CommonDropdownBtn(hint: "", items: []), + CommonDropdownBtn(hint: "", items: const ['']), sizedBoxHeight(18.h), Row( children: [ text16w400_white("Availability"), - Spacer(), + const Spacer(), Transform.scale( scaleY: 1, child: CupertinoSwitch( value: swichvalue, trackColor: Colors.white.withOpacity(0.4), - activeColor: Color(0xFF3192D8), + activeColor: const Color(0xFF3192D8), onChanged: (bool? value) { setState(() { swichvalue = value ?? false; @@ -159,7 +157,7 @@ class _SetAvailabillityState extends State { border: 1) ], ), - Spacer(), + const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -208,10 +206,10 @@ class _SetAvailabillityState extends State { decoration: BoxDecoration( shape: BoxShape.circle, color: selectedContainerIndices.contains(index) - ? Color(0xFFD90B2E).withOpacity(0.4) - : Color(0xFFFFFFFF).withOpacity(0.2), + ? const Color(0xFFD90B2E).withOpacity(0.4) + : const Color(0xFFFFFFFF).withOpacity(0.2), border: selectedContainerIndices.contains(index) - ? Border.all(color: Color(0xFFD90B2E), width: 1) + ? Border.all(color: const Color(0xFFD90B2E), width: 1) : null), child: Center(child: text16w400_FCFCFC(text)), ), diff --git a/lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart b/lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart index 4a6530b..09ea55c 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart +++ b/lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart @@ -4,7 +4,6 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonBottomNavigationBar.dart'; import 'package:regroup/Common/controller/MainScreen.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -19,7 +18,7 @@ class ChatsMainScreen extends StatefulWidget { class _ChatsMainScreenState extends State { TextEditingController searchcontroller = TextEditingController(); - GlobalKey _scaffoldKey1 = GlobalKey(); + final GlobalKey _scaffoldKey1 = GlobalKey(); List chatcontents = [ { @@ -121,10 +120,10 @@ class _ChatsMainScreenState extends State { child: Scaffold( resizeToAvoidBottomInset: false, key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), appBar: AppBar( scrolledUnderElevation: 0.0, - backgroundColor: Color(0xff222935), + backgroundColor: const Color(0xff222935), elevation: 0, automaticallyImplyLeading: false, titleSpacing: 0, @@ -174,7 +173,7 @@ class _ChatsMainScreenState extends State { hintText: "Search chats", leadingIcon: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -196,7 +195,7 @@ class _ChatsMainScreenState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - MyTabBar(), + const MyTabBar(), Expanded( child: TabBarView( children: [feedTab(), clubsTab(), teamsTab()], @@ -223,7 +222,7 @@ class _ChatsMainScreenState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: chatcontents.length, @@ -263,7 +262,7 @@ class _ChatsMainScreenState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: clubcontents.length, @@ -298,7 +297,7 @@ class _ChatsMainScreenState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: teamcontents.length, @@ -326,15 +325,17 @@ class _ChatsMainScreenState extends State { } class MyTabBar extends StatelessWidget { + const MyTabBar({super.key}); + // Set the desired height @override Widget build(BuildContext context) { return TabBar( - dividerColor: Color(0xFFFFFFFF).withOpacity(0.07), + dividerColor: const Color(0xFFFFFFFF).withOpacity(0.07), labelStyle: TextStyle( fontSize: 14.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), indicatorSize: TabBarIndicatorSize.tab, @@ -342,7 +343,7 @@ class MyTabBar extends StatelessWidget { // labelColor: Colors.white, indicatorWeight: 2.h, dividerHeight: 2.h, - unselectedLabelColor: Color(0xFFFCFCFC), + unselectedLabelColor: const Color(0xFFFCFCFC), overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)), tabs: const [ Tab( @@ -386,7 +387,7 @@ class ChatList extends StatefulWidget { class _ChatListState extends State { void _showContextMenu(BuildContext context, Offset offset) { showMenu( - color: Color(0XFf222935), + color: const Color(0XFf222935), context: context, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)), position: @@ -398,7 +399,7 @@ class _ChatListState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Mute chat", style: TextStyle(color: Colors.white)), + const Text("Mute chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/mute.png', width: 19.w, @@ -408,7 +409,7 @@ class _ChatListState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ]), ), @@ -419,7 +420,7 @@ class _ChatListState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Pin chat", style: TextStyle(color: Colors.white)), + const Text("Pin chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/pin.png', width: 19.w, @@ -429,7 +430,7 @@ class _ChatListState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -439,7 +440,7 @@ class _ChatListState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Delete chat", style: TextStyle(color: Colors.red)), + const Text("Delete chat", style: TextStyle(color: Colors.red)), // Icon(Icons.delete, color: Colors.red), Image.asset( 'assets/images/png/deletetred.png', @@ -503,7 +504,7 @@ class _ChatListState extends State { ? Container( width: 10.w, height: 10.h, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( color: Color(0xFF32D74B), shape: OvalBorder(), ), @@ -511,7 +512,7 @@ class _ChatListState extends State { : Container( width: 10.w, height: 10.h, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( color: Color(0xFFFF453A), shape: OvalBorder(), )), @@ -535,7 +536,7 @@ class _ChatListState extends State { child: Text( widget.message, style: TextStyle( - color: Color(0xCCFCFCFC), + color: const Color(0xCCFCFCFC), fontSize: 12.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, @@ -546,7 +547,7 @@ class _ChatListState extends State { ), ], ), - Spacer(), + const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -557,7 +558,7 @@ class _ChatListState extends State { children: [ widget.ispinned == true ? Image.asset('assets/images/png/pin.png') - : SizedBox( + : const SizedBox( width: 25, ), sizedBoxWidth(3.w), @@ -565,7 +566,7 @@ class _ChatListState extends State { ? Container( width: 18, height: 18, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( color: Color(0xFFD90B2E), shape: OvalBorder(), ), @@ -573,14 +574,14 @@ class _ChatListState extends State { '1', textAlign: TextAlign.center, style: TextStyle( - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontSize: 12.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, ), ), ) - : SizedBox() + : const SizedBox() ], ) ], @@ -598,7 +599,7 @@ class SecondChatList extends StatefulWidget { final String message; final bool isMessageRead; - SecondChatList({ + const SecondChatList({ Key? key, required this.name, required this.imageurl, @@ -613,7 +614,7 @@ class SecondChatList extends StatefulWidget { class _SecondChatListState extends State { void _showContextMenu(BuildContext context, Offset offset) { showMenu( - color: Color(0XFf222935), + color: const Color(0XFf222935), context: context, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)), position: @@ -625,7 +626,7 @@ class _SecondChatListState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Mute chat", style: TextStyle(color: Colors.white)), + const Text("Mute chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/mute.png', width: 19.w, @@ -635,7 +636,7 @@ class _SecondChatListState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ]), ), @@ -646,7 +647,7 @@ class _SecondChatListState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Pin chat", style: TextStyle(color: Colors.white)), + const Text("Pin chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/pin.png', width: 19.w, @@ -656,7 +657,7 @@ class _SecondChatListState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -666,7 +667,7 @@ class _SecondChatListState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Delete chat", style: TextStyle(color: Colors.red)), + const Text("Delete chat", style: TextStyle(color: Colors.red)), // Icon(Icons.delete, color: Colors.red), Image.asset( 'assets/images/png/deletetred.png', @@ -750,7 +751,7 @@ class _SecondChatListState extends State { Text( widget.message, style: TextStyle( - color: Color(0xCCFCFCFC), + color: const Color(0xCCFCFCFC), fontSize: 12.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, diff --git a/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart b/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart index 14b240c..8cad5e0 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart +++ b/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart @@ -7,7 +7,6 @@ import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; @@ -54,7 +53,7 @@ class _GroupChatPageState extends State { void _showContextMenu(BuildContext context, Offset offset) { showMenu( - color: Color(0XFf222935), + color: const Color(0XFf222935), context: context, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)), position: @@ -67,7 +66,7 @@ class _GroupChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Mute chat", style: TextStyle(color: Colors.white)), + const Text("Mute chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/mute.png', width: 19.w, @@ -77,7 +76,7 @@ class _GroupChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ]), ), @@ -88,7 +87,7 @@ class _GroupChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Pin chat", style: TextStyle(color: Colors.white)), + const Text("Pin chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/pin.png', width: 19.w, @@ -98,7 +97,7 @@ class _GroupChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -107,7 +106,7 @@ class _GroupChatPageState extends State { value: 1, child: Column( children: [ - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("Search", style: TextStyle(color: Colors.white)), @@ -120,7 +119,7 @@ class _GroupChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -132,7 +131,7 @@ class _GroupChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Profile", style: TextStyle(color: Colors.white)), + const Text("Profile", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/profile.png', width: 19.w, @@ -142,7 +141,7 @@ class _GroupChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -154,7 +153,7 @@ class _GroupChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Block chat", style: TextStyle(color: Colors.white)), + const Text("Block chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/blockchat.png', width: 19.w, @@ -164,7 +163,7 @@ class _GroupChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -176,7 +175,7 @@ class _GroupChatPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Delete chat", style: TextStyle(color: Colors.red)), + const Text("Delete chat", style: TextStyle(color: Colors.red)), // Icon(Icons.delete, color: Colors.red), Image.asset( 'assets/images/png/deletetred.png', @@ -246,11 +245,11 @@ class _GroupChatPageState extends State { Get.focusScope?.unfocus(); }, child: Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), appBar: AppBar( elevation: 0, automaticallyImplyLeading: false, - backgroundColor: Color(0xFF222935).withOpacity(0.50), + backgroundColor: const Color(0xFF222935).withOpacity(0.50), flexibleSpace: SafeArea( child: Container( // height: 90.h, @@ -292,7 +291,7 @@ class _GroupChatPageState extends State { height: 40.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(25.h), - image: DecorationImage( + image: const DecorationImage( image: AssetImage("assets/images/png/groupchat.png"), fit: BoxFit.cover)), @@ -325,7 +324,7 @@ class _GroupChatPageState extends State { Text( "Ryan, Jaxson, Dulce, Nolan ", style: TextStyle( - color: Color(0xffFCFCFC).withOpacity(0.80), + color: const Color(0xffFCFCFC).withOpacity(0.80), fontSize: 12.sp, fontWeight: FontWeight.w400), ), @@ -369,18 +368,18 @@ class _GroupChatPageState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), ], ), borderGradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), ], ), child: Stack( @@ -415,7 +414,7 @@ class _GroupChatPageState extends State { ), fit: BoxFit.fill, ), - shape: OvalBorder(), + shape: const OvalBorder(), ), ), sizedBoxWidth(2.w), @@ -423,8 +422,8 @@ class _GroupChatPageState extends State { child: Container( decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(1.00, -0.03), - end: Alignment(-1, 0.03), + begin: const Alignment(1.00, -0.03), + end: const Alignment(-1, 0.03), colors: [ Colors.white.withOpacity( 0.05999999865889549), @@ -432,7 +431,7 @@ class _GroupChatPageState extends State { 0.07999999821186066) ], ), - shape: RoundedRectangleBorder( + shape: const RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20), @@ -489,7 +488,7 @@ class _GroupChatPageState extends State { children: [ Flexible( child: Container( - decoration: ShapeDecoration( + decoration: const ShapeDecoration( gradient: LinearGradient( begin: Alignment(1.00, 0.05), end: Alignment(-1, -0.05), @@ -545,7 +544,7 @@ class _GroupChatPageState extends State { ), fit: BoxFit.fill, ), - shape: OvalBorder(), + shape: const OvalBorder(), ), ), ], @@ -559,7 +558,7 @@ class _GroupChatPageState extends State { Align( alignment: Alignment.bottomCenter, child: Padding( - padding: EdgeInsets.only(top: 15, bottom: 15), + padding: const EdgeInsets.only(top: 15, bottom: 15), child: Row( children: [ sizedBoxWidth(16.w), @@ -578,6 +577,7 @@ class _GroupChatPageState extends State { const Color(0xFFffffff).withOpacity(0.24), const Color(0xFFFFFFFF).withOpacity(0.24), ], + // ignore: prefer_const_literals_to_create_immutables stops: [ 0.1, 1, @@ -611,7 +611,7 @@ class _GroupChatPageState extends State { border: InputBorder.none, hintStyle: TextStyle( fontSize: 14.sp, - color: Color(0XFFFCFCFC) + color: const Color(0XFFFCFCFC) .withOpacity(0.80), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), @@ -640,12 +640,12 @@ class _GroupChatPageState extends State { height: 30.h, decoration: BoxDecoration( color: - Color(0xFFD90B2E), + const Color(0xFFD90B2E), borderRadius: BorderRadius .circular( 30.r)), - child: Center( + child: const Center( child: Icon( Icons.send_outlined, color: Colors.white, diff --git a/lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart b/lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart index 1e7816d..0b43fd5 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart +++ b/lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -74,9 +72,9 @@ class _NewChatPageState extends State { onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( // backgroundColor: Color(0xFF222935), - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), - appBar: CommonAppbar(titleTxt: 'New chat'), + appBar: const CommonAppbar(titleTxt: 'New chat'), body: Stack(children: [ Container( decoration: const BoxDecoration( @@ -96,7 +94,7 @@ class _NewChatPageState extends State { hintText: "Search people", leadingIcon: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -127,13 +125,13 @@ class _NewChatPageState extends State { width: 50, height: 50, decoration: ShapeDecoration( - image: DecorationImage( + image: const DecorationImage( image: AssetImage( 'assets/images/png/chatgroup.png'), ), gradient: LinearGradient( - begin: Alignment(0.71, -0.70), - end: Alignment(-0.71, 0.7), + begin: const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -141,7 +139,7 @@ class _NewChatPageState extends State { .withOpacity(0.30000001192092896) ], ), - shape: OvalBorder( + shape: const OvalBorder( side: BorderSide( width: 0.50, color: Color(0xFF434A53)), ), @@ -166,7 +164,7 @@ class _NewChatPageState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: chatcontents.length, @@ -199,7 +197,7 @@ class SecondChatList extends StatefulWidget { final String imageurl; final String message; - SecondChatList({ + const SecondChatList({ Key? key, required this.name, required this.imageurl, @@ -250,7 +248,7 @@ class _SecondChatListState extends State { Text( widget.message, style: TextStyle( - color: Color(0xCCFCFCFC), + color: const Color(0xCCFCFCFC), fontSize: 12.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, diff --git a/lib/Feed Module/Main_Screens/Chats/View/newgroup.dart b/lib/Feed Module/Main_Screens/Chats/View/newgroup.dart index a6b2d95..2626057 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/newgroup.dart +++ b/lib/Feed Module/Main_Screens/Chats/View/newgroup.dart @@ -3,13 +3,13 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; + import 'package:regroup/Common/controller/MainScreen.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; @@ -80,8 +80,8 @@ class _NewGroupPageState extends State { return GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), - appBar: CommonAppbar(titleTxt: 'New group'), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + appBar: const CommonAppbar(titleTxt: 'New group'), body: Stack( children: [ Container( @@ -121,14 +121,14 @@ class _NewGroupPageState extends State { // image: AssetImage('assets/images/png/camera1.png'), // ), gradient: LinearGradient( - begin: Alignment(0.71, -0.70), - end: Alignment(-0.71, 0.7), + begin: const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), colors: [ Colors.white.withOpacity(0.30000001192092896), Colors.white.withOpacity(0.30000001192092896) ], ), - shape: OvalBorder( + shape: const OvalBorder( side: BorderSide( width: 0.50, color: Color(0xFF434A53)), ), @@ -189,7 +189,7 @@ class _NewGroupPageState extends State { hintText: "Search people", leadingIcon: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -207,7 +207,7 @@ class _NewGroupPageState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: chatcontents.length, @@ -234,7 +234,7 @@ class _NewGroupPageState extends State { // Get.toNamed(RouteName.mainscreen); Get.offUntil( MaterialPageRoute( - builder: (context) => MainScreen()), + builder: (context) => const MainScreen()), (Route route) => false); }), ), @@ -254,7 +254,7 @@ class GroupsList extends StatefulWidget { final String imageurl; final String message; - GroupsList({ + const GroupsList({ Key? key, required this.name, required this.imageurl, @@ -308,7 +308,7 @@ class _GroupsListState extends State { Text( widget.message, style: TextStyle( - color: Color(0xCCFCFCFC), + color: const Color(0xCCFCFCFC), fontSize: 12.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, @@ -323,8 +323,8 @@ class _GroupsListState extends State { Checkbox( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, side: BorderSide( - color: Color(0xFF434A53).withOpacity(0.72), width: 1.5.w), - activeColor: Color(0xFF434A53).withOpacity(0.72), + color: const Color(0xFF434A53).withOpacity(0.72), width: 1.5.w), + activeColor: const Color(0xFF434A53).withOpacity(0.72), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(0.0)), ), diff --git a/lib/Feed Module/Main_Screens/Chats/View/userchat.dart b/lib/Feed Module/Main_Screens/Chats/View/userchat.dart index 15c0059..a63d0fb 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/userchat.dart +++ b/lib/Feed Module/Main_Screens/Chats/View/userchat.dart @@ -55,7 +55,7 @@ class _UserChatPageState extends State { void _showContextMenu(BuildContext context, Offset offset) { showMenu( - color: Color(0XFf222935), + color: const Color(0XFf222935), context: context, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)), position: @@ -68,7 +68,7 @@ class _UserChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Mute chat", style: TextStyle(color: Colors.white)), + const Text("Mute chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/mute.png', width: 19.w, @@ -78,7 +78,7 @@ class _UserChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ]), ), @@ -89,7 +89,7 @@ class _UserChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Pin chat", style: TextStyle(color: Colors.white)), + const Text("Pin chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/pin.png', width: 19.w, @@ -99,7 +99,7 @@ class _UserChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -108,7 +108,7 @@ class _UserChatPageState extends State { value: 1, child: Column( children: [ - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("Search", style: TextStyle(color: Colors.white)), @@ -121,7 +121,7 @@ class _UserChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -133,7 +133,7 @@ class _UserChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Profile", style: TextStyle(color: Colors.white)), + const Text("Profile", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/profile.png', width: 19.w, @@ -143,7 +143,7 @@ class _UserChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -155,7 +155,7 @@ class _UserChatPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Block chat", style: TextStyle(color: Colors.white)), + const Text("Block chat", style: TextStyle(color: Colors.white)), Image.asset( 'assets/images/png/blockchat.png', width: 19.w, @@ -165,7 +165,7 @@ class _UserChatPageState extends State { ), Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ) ], ), @@ -177,7 +177,7 @@ class _UserChatPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Delete chat", style: TextStyle(color: Colors.red)), + const Text("Delete chat", style: TextStyle(color: Colors.red)), // Icon(Icons.delete, color: Colors.red), Image.asset( 'assets/images/png/deletetred.png', @@ -247,11 +247,11 @@ class _UserChatPageState extends State { Get.focusScope?.unfocus(); }, child: Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), appBar: AppBar( elevation: 0, automaticallyImplyLeading: false, - backgroundColor: Color(0xFF222935).withOpacity(0.50), + backgroundColor: const Color(0xFF222935).withOpacity(0.50), flexibleSpace: SafeArea( child: Container( // height: 90.h, @@ -293,7 +293,7 @@ class _UserChatPageState extends State { height: 40.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(25.h), - image: DecorationImage( + image: const DecorationImage( image: AssetImage("assets/images/png/Ellipse 52.png"), fit: BoxFit.fill)), @@ -319,7 +319,7 @@ class _UserChatPageState extends State { Text( "Ryan_01", style: TextStyle( - color: Color(0xffFCFCFC).withOpacity(0.80), + color: const Color(0xffFCFCFC).withOpacity(0.80), fontSize: 12.sp, fontWeight: FontWeight.w400), ), @@ -371,8 +371,8 @@ class _UserChatPageState extends State { child: Container( decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(1.00, -0.03), - end: Alignment(-1, 0.03), + begin: const Alignment(1.00, -0.03), + end: const Alignment(-1, 0.03), colors: [ Colors.white .withOpacity(0.05999999865889549), @@ -380,7 +380,7 @@ class _UserChatPageState extends State { .withOpacity(0.07999999821186066) ], ), - shape: RoundedRectangleBorder( + shape: const RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20), @@ -428,7 +428,7 @@ class _UserChatPageState extends State { children: [ Flexible( child: Container( - decoration: ShapeDecoration( + decoration: const ShapeDecoration( gradient: LinearGradient( begin: Alignment(1.00, 0.05), end: Alignment(-1, -0.05), @@ -476,7 +476,7 @@ class _UserChatPageState extends State { Align( alignment: Alignment.bottomCenter, child: Padding( - padding: EdgeInsets.only(top: 15, bottom: 15), + padding: const EdgeInsets.only(top: 15, bottom: 15), child: Row( children: [ sizedBoxWidth(16.w), @@ -524,7 +524,7 @@ class _UserChatPageState extends State { border: InputBorder.none, hintStyle: TextStyle( fontSize: 14.sp, - color: Color(0XFFFCFCFC).withOpacity(0.80), + color: const Color(0XFFFCFCFC).withOpacity(0.80), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), hintText: "Type your message", @@ -548,10 +548,10 @@ class _UserChatPageState extends State { width: 45.w, height: 30.h, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r)), - child: Center( + child: const Center( child: Icon( Icons.send_outlined, color: Colors.white, diff --git a/lib/Feed Module/Main_Screens/Community/Community.dart b/lib/Feed Module/Main_Screens/Community/Community.dart index a7ba48d..72961d5 100644 --- a/lib/Feed Module/Main_Screens/Community/Community.dart +++ b/lib/Feed Module/Main_Screens/Community/Community.dart @@ -29,7 +29,7 @@ final List titles = [ ]; class _CommunityScreenState extends State { - GlobalKey _scaffoldKey1 = GlobalKey(); + final GlobalKey _scaffoldKey1 = GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( @@ -105,7 +105,7 @@ class _CommunityScreenState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Feed', ), @@ -483,7 +483,7 @@ Widget normalcardtile2({ commonContainer( width: 30.w, height: 30.h, - borderColor: Color(0xFF434A53), + borderColor: const Color(0xFF434A53), borderwidth: 0.43, opacity1: 0.2, opacity2: 0.2, @@ -502,7 +502,7 @@ Widget normalcardtile2({ commonContainer( width: 30.w, height: 30.h, - borderColor: Color(0xFF434A53), + borderColor: const Color(0xFF434A53), borderwidth: 0.43, opacity1: 0.2, opacity2: 0.2, @@ -1136,7 +1136,7 @@ Widget announcecardtile({ onTap: () { // Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( @@ -1185,7 +1185,7 @@ Widget announcecardtile({ commonContainer( width: 30.w, height: 30.h, - borderColor: Color(0xFF434A53), + borderColor: const Color(0xFF434A53), borderwidth: 0.43, opacity1: 0.2, opacity2: 0.2, @@ -1204,7 +1204,7 @@ Widget announcecardtile({ commonContainer( width: 30.w, height: 30.h, - borderColor: Color(0xFF434A53), + borderColor: const Color(0xFF434A53), borderwidth: 0.43, opacity1: 0.2, opacity2: 0.2, @@ -1367,7 +1367,7 @@ Widget containertile2({required String text}) { width: 130.w, height: 30.h, borderRadius: BorderRadius.circular(30.r), - borderColor: Color(0xFFD90B2E), + borderColor: const Color(0xFFD90B2E), opacity1: 0.04, opacity2: 0.05, customWidget: Padding( diff --git a/lib/Feed Module/Main_Screens/Community/CycleScreen.dart b/lib/Feed Module/Main_Screens/Community/CycleScreen.dart index 8d5eb5f..799e14e 100644 --- a/lib/Feed Module/Main_Screens/Community/CycleScreen.dart +++ b/lib/Feed Module/Main_Screens/Community/CycleScreen.dart @@ -23,7 +23,7 @@ class _CycleScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: CommonAppbar( @@ -46,7 +46,7 @@ class _CycleScreenState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Popular', ), @@ -58,8 +58,8 @@ class _CycleScreenState extends State { height: 670.h, child: TabBarView( children: [ - CyclepopularTab(), - CyclelatestTab(), + cyclepopularTab(), + cyclelatestTab(), ], ), ), @@ -70,7 +70,7 @@ class _CycleScreenState extends State { } } -Widget CyclepopularTab() { +Widget cyclepopularTab() { return SingleChildScrollView( child: Column(children: [ sizedBoxHeight(20.h), @@ -101,7 +101,7 @@ Widget CyclepopularTab() { ); } -Widget CyclelatestTab() { +Widget cyclelatestTab() { return SingleChildScrollView( child: Column(children: [ sizedBoxHeight(20.h), @@ -172,7 +172,7 @@ Widget normalcardtile({ sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -181,12 +181,12 @@ Widget normalcardtile({ ) ], ), - 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( @@ -204,7 +204,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -214,7 +214,7 @@ Widget normalcardtile({ ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -230,7 +230,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -240,7 +240,7 @@ Widget normalcardtile({ ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -256,7 +256,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -282,7 +282,7 @@ Widget normalcardtile({ onTap: () { Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( @@ -326,7 +326,7 @@ Widget normalcardtile({ 'assets/images/png/party-popper 2.png' ]), ), - Spacer(), + const Spacer(), commonGlassContainer( border: 0.43, width: 30.w, @@ -411,11 +411,11 @@ Widget normalcardtile({ 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), diff --git a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart index 4233d18..d028ed2 100644 --- a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart +++ b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart @@ -6,7 +6,6 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -23,9 +22,9 @@ class _PostDetailsScreenState extends State { Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Post", ), body: Stack(children: [ @@ -59,7 +58,7 @@ class _PostDetailsScreenState extends State { children: [ CircleAvatar( radius: 20.r, - foregroundImage: AssetImage( + foregroundImage: const AssetImage( "assets/images/png/Ellipse 48.png", ), ), @@ -81,13 +80,13 @@ class _PostDetailsScreenState extends State { Align( alignment: Alignment.bottomCenter, child: Padding( - padding: EdgeInsets.only(top: 15, bottom: 15), + padding: const EdgeInsets.only(top: 15, bottom: 15), child: Row( children: [ Expanded( child: CustomTextFormField( hintText: "Add comment", - suffixIcon: Container( + suffixIcon: SizedBox( height: 20.h, width: 25.w, child: Center( @@ -151,22 +150,22 @@ class _PostDetailsScreenState extends State { Row( children: [ text16w400_FCFCFC(title), - Spacer(), + const Spacer(), commonGlassContainer( width: 72.w, height: 26.h, borderradius: 5.r, - borderColor: Color(0xFFD90B2E), + borderColor: const Color(0xFFD90B2E), customWidget: Center(child: text14400white("Follow")), border: 1), sizedBoxWidth(6.w), 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) => [ @@ -186,7 +185,7 @@ class _PostDetailsScreenState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -196,7 +195,7 @@ class _PostDetailsScreenState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -213,7 +212,7 @@ class _PostDetailsScreenState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -223,7 +222,7 @@ class _PostDetailsScreenState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -240,7 +239,7 @@ class _PostDetailsScreenState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -272,7 +271,7 @@ class _PostDetailsScreenState extends State { sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -290,7 +289,7 @@ class _PostDetailsScreenState extends State { onTap: () { Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( @@ -329,7 +328,7 @@ class _PostDetailsScreenState extends State { 'assets/images/png/heart 2.png', 'assets/images/png/party-popper 2.png' ]), - Spacer(), + const Spacer(), commonGlassContainer( border: 0.9, width: 30.w, @@ -414,13 +413,13 @@ class _PostDetailsScreenState extends State { boxRadius: 30, itemsSpacing: 8, itemScale: 0.4, - itemSize: Size(45, 45), - boxPadding: EdgeInsets.all(8), + itemSize: const Size(45, 45), + boxPadding: const EdgeInsets.all(8), boxAnimationDuration: - Duration(milliseconds: 200), + const Duration(milliseconds: 200), itemAnimationDuration: - Duration(milliseconds: 500), - hoverDuration: Duration(milliseconds: 700), + const Duration(milliseconds: 500), + hoverDuration: const Duration(milliseconds: 700), // toggle: false, child: _buildReactionsIcon(mainImage.value), @@ -458,7 +457,7 @@ class _PostDetailsScreenState extends State { width: 100.w, height: 30.h, borderradius: 30.r, - borderColor: Color(0xFFD90B2E), + borderColor: const Color(0xFFD90B2E), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Center(child: text14w400_FCFCFC(text)), diff --git a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart index df8db14..56c4680 100644 --- a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart +++ b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart @@ -67,9 +67,9 @@ class _ReactionViewState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Post", ), resizeToAvoidBottomInset: false, @@ -89,13 +89,13 @@ class _ReactionViewState extends State { // initialIndex: selectedIndex.value, child: Column(children: [ CommonTabBar(tabs: [ - Tab( + const Tab( text: 'All', ), Tab( child: Row(children: [ commonGlassContainer( - borderColor: Color(0xFF1E3A46), + borderColor: const Color(0xFF1E3A46), opacity1: 0.05, opacity2: 0.06, width: 30.w, @@ -109,14 +109,14 @@ class _ReactionViewState extends State { ), ), border: 1.71), - Spacer(), + const Spacer(), text14400white("110K"), ]), ), Tab( child: Row(children: [ commonGlassContainer( - borderColor: Color(0xFF1E3A46), + borderColor: const Color(0xFF1E3A46), opacity1: 0.05, opacity2: 0.06, width: 30.w, @@ -130,14 +130,14 @@ class _ReactionViewState extends State { ), ), border: 1.71), - Spacer(), + const Spacer(), text14400white("9.7K"), ]), ), Tab( child: Row(children: [ commonGlassContainer( - borderColor: Color(0xFF1E3A46), + borderColor: const Color(0xFF1E3A46), opacity1: 0.05, opacity2: 0.06, width: 30.w, @@ -151,7 +151,7 @@ class _ReactionViewState extends State { ), ), border: 1.71), - Spacer(), + const Spacer(), text14400white("7.4K"), ]), ), @@ -294,9 +294,9 @@ class _ReactionViewState extends State { width: 22.w, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0xFF1E3A46), + color: const Color(0xFF1E3A46), border: Border.all( - color: Color(0xFFFCFCFC).withOpacity(0.18), + color: const Color(0xFFFCFCFC).withOpacity(0.18), width: 0.6)), child: Center( child: Image.asset( diff --git a/lib/Feed Module/Main_Screens/Community/PostScreen.dart b/lib/Feed Module/Main_Screens/Community/PostScreen.dart index 18cbe83..bd8b154 100644 --- a/lib/Feed Module/Main_Screens/Community/PostScreen.dart +++ b/lib/Feed Module/Main_Screens/Community/PostScreen.dart @@ -3,17 +3,16 @@ import 'dart:io'; import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; -import 'package:regroup/Common/CommonDropDown.dart'; + import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -42,10 +41,10 @@ class _PostScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Create a post", ), body: Stack(children: [ @@ -88,15 +87,15 @@ class _PostScreenState extends State { }, child: DottedBorder( strokeWidth: 1, - dashPattern: [7, 4], + dashPattern: const [7, 4], borderType: BorderType.RRect, radius: Radius.circular(14.r), - color: Color(0xFF434A53), - child: commonGlassContainer( - border: 0, + color: const Color(0xFF434A53), + child: commonGlassUI( width: double.infinity, height: 130.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r), + borderColor: Colors.transparent, customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ Image.file( @@ -117,13 +116,13 @@ class _PostScreenState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), @@ -155,14 +154,14 @@ class _PostScreenState extends State { CustomDropDownTag1( header: "Enter tags", title: "Enter tags", - listData: [ + listData: const [ "#Race", "#Swimming", "#Cycle", "#Swimming", "#Race" ], - rowData: [ + rowData: const [ "23,233 Recently use tags", "15,123 Recently use tags", "15,123 Recently use tags", @@ -170,7 +169,7 @@ class _PostScreenState extends State { "15,123 Available tags" ], onItemSelected: (p0) {}, - leadingImage: SizedBox()), + leadingImage: const SizedBox()), // CustomTextFormField( // suffixIcon: Container( // height: 20.h, @@ -224,9 +223,9 @@ class _PostScreenState extends State { CustomDropDownRadio( header: "", title: "", - listData: ['Individual', 'Anonymous'], + listData: const ['Individual', 'Anonymous'], onItemSelected: (p0) {}, - leadingImage: SizedBox()), + leadingImage: const SizedBox()), // CommonDropdownradioBtn( // hint: '', items: ['Individual', 'Anonymous']), @@ -236,20 +235,20 @@ class _PostScreenState extends State { CustomDropDownCheckBox( header: "", title: "", - listData: [ + listData: const [ 'Active alliance network', 'Fitfam federation', 'The athletic town', 'Football fever' ], onItemSelected: (p0) {}, - images: [ + images: const [ 'assets/images/png/Rectangle 65.png', 'assets/images/png/Rectangle 66.png', 'assets/images/png/Rectangle 60.png', 'assets/images/png/Rectangle 68.png' ], - leadingImage: SizedBox()), + leadingImage: const SizedBox()), // CommonDropdownCheckbox( // hint: '', // items: [ @@ -284,7 +283,7 @@ class _PostScreenState extends State { Get.bottomSheet(Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(14.r), - color: Color(0xFF222935)), + color: const Color(0xFF222935)), child: Padding( padding: EdgeInsets.symmetric(horizontal: 30.w), child: Column(mainAxisSize: MainAxisSize.min, children: [ @@ -306,7 +305,7 @@ class _PostScreenState extends State { height: 35.h, width: 216.w, decoration: BoxDecoration( - border: Border.all(color: Color(0xFF434A53), width: 1), + border: Border.all(color: const Color(0xFF434A53), width: 1), gradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, @@ -341,12 +340,12 @@ class _PostScreenState extends State { height: 35, decoration: BoxDecoration( color: selectedContainerIndices.contains(index) - ? Color(0xFFD90B2E).withOpacity(0.4) - : Color(0xFFFFFFFF).withOpacity(0.2), + ? const Color(0xFFD90B2E).withOpacity(0.4) + : const Color(0xFFFFFFFF).withOpacity(0.2), borderRadius: BorderRadius.circular(30), - border: Border.all(color: Color(0xFFD90B2E), width: 1)), + border: Border.all(color: const Color(0xFFD90B2E), width: 1)), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.symmetric(horizontal: 20), child: Center(child: text14w400_FCFCFC(text)), ), ), diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart b/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart index 4ae37a2..110c852 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart +++ b/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart @@ -5,7 +5,6 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/controller/CommonTextFormField.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -20,7 +19,7 @@ class _DetailExploreState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, body: SafeArea( @@ -46,13 +45,13 @@ class _DetailExploreState extends State { width: 40.w, height: 40.h, borderradius: 100, - customWidget: Center( + customWidget: const Center( child: Icon( Icons.arrow_back, color: Colors.white, )), border: 1, - borderColor: Color(0xFF55434F)), + borderColor: const Color(0xFF55434F)), ), sizedBoxWidth(12.w), Expanded( @@ -80,7 +79,7 @@ class _DetailExploreState extends State { length: 4, // initialIndex: selectedIndex.value, child: Column(children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'All', ), @@ -164,7 +163,7 @@ class _DetailExploreState extends State { height: 30.h, width: 30.w, decoration: BoxDecoration( - border: Border.all(color: Color(0xFF434A53), width: 0.5.w), + border: Border.all(color: const Color(0xFF434A53), width: 0.5.w), shape: BoxShape.circle, ), child: Center(child: Image.asset(imagePath, fit: BoxFit.fill)), @@ -177,19 +176,19 @@ class _DetailExploreState extends State { } Widget eventsTab() { - return Column( + return const Column( children: [], ); } Widget groupsTab() { - return Column( + return const Column( children: [], ); } Widget communitiesTab() { - return Column( + return const Column( children: [], ); } diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart b/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart index 9703903..20b4b60 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart +++ b/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart @@ -5,7 +5,6 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/Common/global.dart' as global; @@ -20,7 +19,7 @@ class ExploreScreen extends StatefulWidget { class _ExploreScreenState extends State { GoogleMapController? _mapController; - double _zoomLevel = 18.0; + final double _zoomLevel = 18.0; // BitmapDescriptor? _customIcon1; // BitmapDescriptor? _customIcon2; @@ -46,14 +45,14 @@ class _ExploreScreenState extends State { // } Future _showInitialBottomSheet() async { - await Future.delayed(Duration(milliseconds: 400)); + await Future.delayed(const Duration(milliseconds: 400)); exploreBottomSheet(); } @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, // appBar: CommonAppbar( // titleTxt: "", @@ -87,7 +86,7 @@ class _ExploreScreenState extends State { ), markers: { Marker( - markerId: MarkerId('currentP'), + markerId: const MarkerId('currentP'), icon: BitmapDescriptor.defaultMarker, position: global.latlong!, onTap: () { @@ -95,9 +94,9 @@ class _ExploreScreenState extends State { }, ), Marker( - markerId: MarkerId('currentP'), + markerId: const MarkerId('currentP'), icon: BitmapDescriptor.defaultMarker, - position: LatLng(19.155001, 72.84998), + position: const LatLng(19.155001, 72.84998), onTap: () { exploreBottomSheet2(); }, @@ -114,7 +113,7 @@ class _ExploreScreenState extends State { }, child: AbsorbPointer( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16), + padding: const EdgeInsets.symmetric(horizontal: 16), child: CustomTextFormField( leadingIcon: SizedBox( height: 23, @@ -144,7 +143,7 @@ class _ExploreScreenState extends State { topLeft: Radius.circular(10.r), topRight: Radius.circular(10.r), ), - color: Color(0xFF222935), + color: const Color(0xFF222935), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), @@ -173,7 +172,7 @@ class _ExploreScreenState extends State { child: Container( height: 85.h, width: 85.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, ), child: Image.asset("assets/images/png/Ellipse 37.png", @@ -206,7 +205,7 @@ class _ExploreScreenState extends State { border: 0.5), sizedBoxWidth(10.w), text16400white("10 subgroups "), - Spacer(), + const Spacer(), commonGlassContainer( width: 30.w, height: 30.h, @@ -233,12 +232,12 @@ class _ExploreScreenState extends State { borderradius: 30.r, customWidget: Center(child: text14w400_FCFCFC("Message")), border: 1), - Spacer(), + const Spacer(), Container( width: 170.w, height: 35.h, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r)), child: Center(child: text14400white("Visit group")), ), @@ -277,7 +276,7 @@ class _ExploreScreenState extends State { topLeft: Radius.circular(10.r), topRight: Radius.circular(10.r), ), - color: Color(0xFF222935), + color: const Color(0xFF222935), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart b/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart index 5a17d8e..255ab64 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart +++ b/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart @@ -4,8 +4,8 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/controller/CommonTextFormField.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -21,7 +21,7 @@ class _SearchGroupState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, body: SafeArea( child: Stack(children: [ @@ -64,7 +64,7 @@ class _SearchGroupState extends State { Row( children: [ text18w700white("Recent"), - Spacer(), + const Spacer(), text16w400_FCFCFCblur("See all"), ], ), @@ -85,12 +85,12 @@ class _SearchGroupState extends State { CircleAvatar( radius: 15.r, backgroundImage: - AssetImage("assets/images/png/cimg3.png"), + const AssetImage("assets/images/png/cimg3.png"), ), sizedBoxWidth(12.w), text16400white("Kartikey gautam"), - Spacer(), - Icon( + const Spacer(), + const Icon( Icons.clear, color: Colors.white, ) @@ -139,8 +139,8 @@ class _SearchGroupState extends State { border: 0.5), sizedBoxWidth(12.w), text16400white(title), - Spacer(), - Icon( + const Spacer(), + const Icon( Icons.clear, color: Colors.white, ) diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart b/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart index 4509f77..14d0c1f 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart +++ b/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart @@ -1,13 +1,11 @@ import 'package:flutter/material.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/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; class ConnectCommunity extends StatefulWidget { const ConnectCommunity({super.key}); @@ -34,10 +32,10 @@ class _ConnectCommunityState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Connect with communities", ), body: Stack(children: [ @@ -54,7 +52,7 @@ class _ConnectCommunityState extends State { Expanded( child: ListView.builder( shrinkWrap: true, - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), itemCount: communityData.length, itemBuilder: (context, index) { return communityCard( @@ -95,7 +93,7 @@ class _ConnectCommunityState extends State { Container( height: 65.h, width: 65.h, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, // color: Colors.amber, ), @@ -128,7 +126,7 @@ class _ConnectCommunityState extends State { ), ], ), - Spacer(), + const Spacer(), ], ), sizedBoxHeight(16.h), @@ -148,13 +146,13 @@ class _ConnectCommunityState extends State { ), sizedBoxWidth(95.w), text12w400_FCFCFC_blur(members), - Spacer(), + const Spacer(), Container( height: 30.h, width: 123.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.r), - color: Color(0xFFD90B2E)), + color: const Color(0xFFD90B2E)), child: Center( child: text14w400_FCFCFC("Request to join")), ) diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart b/lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart index 6eb5044..905e038 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart +++ b/lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.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/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -35,10 +33,10 @@ class _GroupSettingsState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Group settings", ), body: Stack(children: [ @@ -60,7 +58,7 @@ class _GroupSettingsState extends State { child: Row( children: [ text18w400_FCFCFC("Group type"), - Spacer(), + const Spacer(), Icon( Icons.arrow_forward_ios_outlined, color: Colors.white, @@ -82,7 +80,7 @@ class _GroupSettingsState extends State { child: Row( children: [ text18w400_FCFCFC("Manage members"), - Spacer(), + const Spacer(), Icon( Icons.arrow_forward_ios_outlined, color: Colors.white, @@ -106,7 +104,7 @@ class _GroupSettingsState extends State { topLeft: Radius.circular(30.r), topRight: Radius.circular(30.r), ), - color: Color(0xFF222935), + color: const Color(0xFF222935), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart b/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart index 4e43c7d..ca7f802 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart +++ b/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart @@ -7,7 +7,7 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -60,13 +60,13 @@ class _GroupDetailState extends State { ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Match day', // color: Colors.red, ), Appointment( startTime: DateTime.now(), - endTime: DateTime.now().add(Duration(hours: 3)), + endTime: DateTime.now().add(const Duration(hours: 3)), subject: 'Muharram/Ashura', // color: Colors.red, ), @@ -77,18 +77,18 @@ class _GroupDetailState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, appBar: CommonAppbar( titleTxt: "", customActionWidget: Row(children: [ PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor( width: 150.w, ), - offset: Offset(0, 40), - color: Color(0xFF222935), + offset: const Offset(0, 40), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -100,7 +100,7 @@ class _GroupDetailState extends State { child: text14w400white("Create post"), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { Get.toNamed(RouteName.sessions); @@ -128,12 +128,12 @@ class _GroupDetailState extends State { ), sizedBoxWidth(16.w), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor( width: 210.w, ), - offset: Offset(0, 40), - color: Color(0xFF222935), + offset: const Offset(0, 40), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -143,7 +143,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Add members"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/uiw_user-add.png", height: 15.h, @@ -153,7 +153,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -161,7 +161,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Share"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -171,7 +171,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { Get.toNamed(RouteName.groupinfo); @@ -181,7 +181,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Group info"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector1a.png", height: 20.h, @@ -191,7 +191,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -199,7 +199,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Search"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Frame 58575.png", height: 18.h, @@ -209,7 +209,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -217,7 +217,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Mute Notification"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Black1233.png", height: 16.h, @@ -227,7 +227,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { Get.toNamed(RouteName.groupsettings); @@ -237,7 +237,7 @@ class _GroupDetailState extends State { child: Row( children: [ text14w400white("Edit group settings"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/setting2.png", height: 18.h, @@ -290,7 +290,7 @@ class _GroupDetailState extends State { color: Colors.white, width: 2, ), - boxShadow: [ + boxShadow: const [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.25), blurRadius: 12, @@ -301,7 +301,7 @@ class _GroupDetailState extends State { child: CircleAvatar( radius: 42.5.r, foregroundImage: - AssetImage("assets/images/png/group111.png"), + const AssetImage("assets/images/png/group111.png"), ), )) ]), @@ -382,7 +382,7 @@ class _GroupDetailState extends State { Row( children: [ text16w700white("Badges"), - Spacer(), + const Spacer(), GestureDetector( onTap: () { // Get.toNamed(RouteName.badges); @@ -439,8 +439,8 @@ class _GroupDetailState extends State { ], number: "+2"), sizedBoxWidth(100.w), text16400white("7 members"), - Spacer(), - Icon( + const Spacer(), + const Icon( Icons.arrow_forward, color: Colors.white, ) @@ -452,7 +452,7 @@ class _GroupDetailState extends State { Row( children: [ text18w400white("Subgroups"), - Spacer(), + const Spacer(), GestureDetector( onTap: () { Get.toNamed(RouteName.subgroups); @@ -506,7 +506,7 @@ class _GroupDetailState extends State { "11 New Announcements Request"), ], ), - Spacer(), + const Spacer(), GestureDetector( onTap: () { // Get.toNamed(RouteName.addEvent); @@ -516,7 +516,7 @@ class _GroupDetailState extends State { width: 43.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.r), - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), ), child: Center(child: text12400white("11")), ), @@ -533,7 +533,7 @@ class _GroupDetailState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Announcement', ), @@ -637,7 +637,7 @@ class _GroupDetailState extends State { sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -646,12 +646,12 @@ class _GroupDetailState 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( @@ -669,7 +669,7 @@ class _GroupDetailState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -679,7 +679,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -695,7 +695,7 @@ class _GroupDetailState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -705,7 +705,7 @@ class _GroupDetailState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -721,7 +721,7 @@ class _GroupDetailState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -747,7 +747,7 @@ class _GroupDetailState extends State { onTap: () { // Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( @@ -791,7 +791,7 @@ class _GroupDetailState extends State { 'assets/images/png/party-popper 2.png' ]), ), - Spacer(), + const Spacer(), commonContainer( width: 30.w, height: 30.h, @@ -876,11 +876,11 @@ class _GroupDetailState 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), @@ -957,7 +957,7 @@ class _GroupDetailState extends State { height: 30.h, borderRadius: BorderRadius.circular(30.r), borderwidth: 1, - borderColor: Color(0xFFD90B2E), + borderColor: const Color(0xFFD90B2E), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Center(child: text14w400_FCFCFC(text)), @@ -974,16 +974,16 @@ class _GroupDetailState extends State { borderRadius: BorderRadius.circular(1), customWidget: SfCalendar( view: CalendarView.day, - appointmentTextStyle: TextStyle(color: Colors.white), - headerStyle: CalendarHeaderStyle( + appointmentTextStyle: const TextStyle(color: Colors.white), + headerStyle: const CalendarHeaderStyle( textStyle: TextStyle( color: Color(0xFFD90B2E), )), // blackoutDatesTextStyle: TextStyle(color: Colors.white), weekNumberStyle: - WeekNumberStyle(textStyle: TextStyle(color: Colors.white)), - viewHeaderStyle: ViewHeaderStyle( + const WeekNumberStyle(textStyle: TextStyle(color: Colors.white)), + viewHeaderStyle: const ViewHeaderStyle( // backgroundColor: Colors.amber, dateTextStyle: TextStyle(color: Colors.white), dayTextStyle: TextStyle(color: Color(0xFFD90B2E)), @@ -993,18 +993,18 @@ class _GroupDetailState extends State { backgroundColor: Colors.transparent, firstDayOfWeek: 1, cellBorderColor: Colors.white, - todayHighlightColor: Color(0xFFD90B2E), + todayHighlightColor: const Color(0xFFD90B2E), todayTextStyle: const TextStyle(color: Colors.white), controller: _calendarController, showNavigationArrow: true, allowViewNavigation: true, showDatePickerButton: true, - monthViewSettings: MonthViewSettings( + monthViewSettings: const MonthViewSettings( // agendaStyle: AgendaStyle( // dateTextStyle: TextStyle(color: Colors.amber), // ), ), - allowedViews: [ + allowedViews: const [ CalendarView.month, CalendarView.day, CalendarView.schedule, @@ -1013,20 +1013,20 @@ class _GroupDetailState extends State { showCurrentTimeIndicator: true, dataSource: MeetingDataSource(_appointments!), onTap: calendarTapped, - timeSlotViewSettings: TimeSlotViewSettings( + timeSlotViewSettings: const TimeSlotViewSettings( timeTextStyle: TextStyle( color: Colors.white, ), ), monthCellBuilder: (context, details) { return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.transparent, ), child: Center( child: Text( details.date.day.toString(), - style: TextStyle( + style: const TextStyle( color: Colors.white), // Set text color to white ), ), @@ -1065,7 +1065,7 @@ class _GroupDetailState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Event Details'), + title: const Text('Event Details'), content: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -1076,7 +1076,7 @@ class _GroupDetailState extends State { ), actions: [ ElevatedButton( - child: Text('Close'), + child: const Text('Close'), onPressed: () { Navigator.of(context).pop(); }, @@ -1094,7 +1094,7 @@ class _GroupDetailState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Event Details'), + title: const Text('Event Details'), content: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -1105,7 +1105,7 @@ class _GroupDetailState extends State { ), actions: [ ElevatedButton( - child: Text('Close'), + child: const Text('Close'), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart b/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart index f8e2a0f..9462d67 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart +++ b/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart @@ -33,8 +33,8 @@ class _GroupEventState extends State { TextEditingController dateController = TextEditingController(); TextEditingController dateController2 = TextEditingController(); - TimeOfDay? starttime = TimeOfDay(hour: 15, minute: 0); - TimeOfDay? endtime = TimeOfDay(hour: 15, minute: 0); + TimeOfDay? starttime = const TimeOfDay(hour: 15, minute: 0); + TimeOfDay? endtime = const TimeOfDay(hour: 15, minute: 0); String formatTimeOfDay(TimeOfDay time) { final now = DateTime.now(); @@ -49,9 +49,9 @@ class _GroupEventState extends State { return Scaffold( // key: _scaffoldKey1, resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), body: Stack(children: [ @@ -69,7 +69,7 @@ class _GroupEventState extends State { text16400white("Event Title"), sizedBoxHeight(14.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -108,10 +108,10 @@ class _GroupEventState extends State { }, child: DottedBorder( strokeWidth: 1, - dashPattern: [7, 4], + dashPattern: const [7, 4], borderType: BorderType.RRect, radius: Radius.circular(14.r), - color: Color(0xFF434A53), + color: const Color(0xFF434A53), child: commonGlassContainer( border: 0, width: double.infinity, @@ -137,12 +137,12 @@ class _GroupEventState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), @@ -197,7 +197,7 @@ class _GroupEventState extends State { text12w400_FCFCFC_blur("10 kb") ], ), - Spacer(), + const Spacer(), Image.asset( 'assets/images/png/cancelicon.png', height: 20.h, @@ -212,8 +212,8 @@ class _GroupEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: '', - items: [], - leadingImage: Container( + items: const [], + leadingImage: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -228,8 +228,8 @@ class _GroupEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: '', - items: [], - leadingImage: Container( + items: const [], + leadingImage: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -257,7 +257,7 @@ class _GroupEventState extends State { child: CustomTextFormField( textEditingController: dateController, hintText: "", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -288,7 +288,7 @@ class _GroupEventState extends State { child: CustomTextFormField( textEditingController: dateController2, hintText: "", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -343,7 +343,7 @@ class _GroupEventState extends State { ) ], ), - Spacer(), + const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -397,7 +397,7 @@ class _GroupEventState extends State { customWidget: Transform.scale( scale: 1.4, child: Checkbox( - side: BorderSide(color: Color(0xFF434A53)), + side: const BorderSide(color: Color(0xFF434A53)), value: isChecked.value, activeColor: Colors.transparent, checkColor: Colors.white, @@ -417,8 +417,8 @@ class _GroupEventState extends State { sizedBoxHeight(14.h), CommonDropdownBtn( hint: '', - items: [], - leadingImage: Container( + items: const [], + leadingImage: SizedBox( height: 22.h, width: 28.w, child: Center( @@ -447,7 +447,7 @@ class _GroupEventState extends State { ), hintText: "", suffixIcon: - Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)), + const Icon(Icons.arrow_forward, color: Color(0xFFFFFFFF)), ), // sizedBoxHeight(20.h), // containerWidget( @@ -509,7 +509,7 @@ class _GroupEventState extends State { children: [ text16400white("Minutes"), sizedBoxWidth(5.w), - Icon( + const Icon( Icons.keyboard_arrow_down, color: Colors.white, ) @@ -546,7 +546,7 @@ class _GroupEventState extends State { ), sizedBoxWidth(8.w), text16400white(title), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/cancelicon.png", height: 20.h, diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart b/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart index 13d2fee..93640e3 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart +++ b/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart @@ -41,11 +41,11 @@ class _SessionsState extends State { onSurface: Colors.white, ), textTheme: Theme.of(context).textTheme.copyWith( - headline6: TextStyle(color: Colors.blue), + titleLarge: const TextStyle(color: Colors.blue), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( - foregroundColor: Color(0xFFD90B2E), + foregroundColor: const Color(0xFFD90B2E), ), )); return showTimePicker( @@ -71,11 +71,11 @@ class _SessionsState extends State { // onSecondary: Colors.red, ), textTheme: Theme.of(context).textTheme.copyWith( - headline6: TextStyle(color: Colors.blue), + titleLarge: const TextStyle(color: Colors.blue), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( - foregroundColor: Color(0xFFD90B2E), + foregroundColor: const Color(0xFFD90B2E), ), ), ); @@ -130,9 +130,9 @@ class _SessionsState extends State { return Scaffold( // key: _scaffoldKey1, resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Sessions", ), body: Stack(children: [ @@ -153,7 +153,7 @@ class _SessionsState extends State { sizedBoxHeight(25.h), CustomTextFormField( hintText: "", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -195,20 +195,28 @@ class _SessionsState extends State { CustomDropDownRadio( header: "", title: "", - listData: ["hhh"], + listData: const ["hhh"], onItemSelected: (p0) {}, leadingImage: Image.asset( - "assets/images/png/Vector (5)12.png")), + "assets/images/png/Vector (5)12.png", + height: 20.h, + width: 20.w, + )), sizedBoxHeight(25.h), text16w400_FCFCFC('Sport'), sizedBoxHeight(25.h), CustomDropDownRadio( header: "", title: "", - listData: ["hhh"], + listData: const ["hhh"], onItemSelected: (p0) {}, - leadingImage: Image.asset( - "assets/images/png/Vector (4).png")), + leadingImage: Center( + child: Image.asset( + "assets/images/png/Vector (4).png", + height: 20.h, + width: 20.w, + ), + )), sizedBoxHeight(25.h), text16w400_FCFCFC('Starts'), sizedBoxHeight(25.h), @@ -218,7 +226,7 @@ class _SessionsState extends State { }, child: AbsorbPointer( child: CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -247,7 +255,8 @@ class _SessionsState extends State { customWidget: Transform.scale( scale: 1.4, child: Checkbox( - side: BorderSide(color: Color(0xFF434A53)), + side: const BorderSide( + color: Color(0xFF434A53)), value: isChecked.value, activeColor: Colors.transparent, checkColor: Colors.white, @@ -267,7 +276,7 @@ class _SessionsState extends State { sizedBoxHeight(20.h), CustomTextFormField( hintText: "", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -285,16 +294,19 @@ class _SessionsState extends State { CustomDropDownRadio( header: "", title: "", - listData: ["hryy"], + listData: const ["hryy"], onItemSelected: (p0) {}, - leadingImage: - Image.asset("assets/images/png/Black.png")), + leadingImage: Image.asset( + "assets/images/png/Black.png", + height: 20.h, + width: 20.w, + )), sizedBoxHeight(25.h), text16w400_FCFCFC("Add Users"), sizedBoxHeight(25.h), CustomTextFormField( hintText: "", - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -304,7 +316,7 @@ class _SessionsState extends State { width: 20.w, ), )), - suffixIcon: Container( + suffixIcon: SizedBox( height: 20.h, width: 20.h, child: Center( @@ -342,7 +354,7 @@ class _SessionsState extends State { children: [ text16400white("Minutes"), sizedBoxWidth(5.w), - Icon( + const Icon( Icons.keyboard_arrow_down, color: Colors.white, ) @@ -369,10 +381,10 @@ class _SessionsState extends State { }, child: DottedBorder( strokeWidth: 1, - dashPattern: [7, 4], + dashPattern: const [7, 4], borderType: BorderType.RRect, radius: Radius.circular(14.r), - color: Color(0xFF434A53), + color: const Color(0xFF434A53), child: commonGlassContainer( border: 0, width: double.infinity, @@ -399,7 +411,8 @@ class _SessionsState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: + const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: @@ -407,7 +420,7 @@ class _SessionsState extends State { .circular( 5)), ), - child: Icon( + child: const Icon( Icons .delete_outline_outlined, color: Colors.white, @@ -439,9 +452,9 @@ class _SessionsState extends State { CustomDropDownRadio( header: "More options", title: "", - listData: [""], + listData: const [""], onItemSelected: (p0) {}, - leadingImage: SizedBox()), + leadingImage: const SizedBox()), sizedBoxHeight(30.h), CommonBtn(text: "Create event"), sizedBoxHeight(50.h), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart new file mode 100644 index 0000000..a1ffd3a --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart @@ -0,0 +1,400 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +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; + +class AddCertificate extends StatefulWidget { + const AddCertificate({super.key}); + + @override + State createState() => _AddCertificateState(); +} + +class _AddCertificateState extends State { + final GlobalKey _formkey = GlobalKey(); + TextEditingController certicationname = TextEditingController(); + TextEditingController certificationreason = TextEditingController(); + TextEditingController datecontroller = TextEditingController(); + + TextEditingController querycontroller = TextEditingController(); + + DateTime? _selectedDate; + + Future _selectDate(BuildContext context) async { + DateTime yesterday = DateTime.now().subtract(const Duration(days: 1)); + DateTime eighteenYearsAgo = + DateTime.now().subtract(const Duration(days: 365 * 18)); + + final ThemeData customTheme = Theme.of(context).copyWith( + colorScheme: const ColorScheme.light( + primary: Color(0xFFD90B2E), + surfaceTint: Color(0xFF222935), + surface: Color(0xFF222935), + onPrimary: Colors.white, + onSurface: Colors.white, + onSecondary: Colors.white), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + foregroundColor: const Color(0xFFD90B2E), + ), + )); + + final DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: yesterday, + firstDate: DateTime(1950), + lastDate: DateTime(2026), + builder: (BuildContext context, Widget? child) { + return Theme( + data: customTheme, + // ThemeData.light().copyWith( + // colorScheme: ColorScheme.dark( + // primary: Color(0XFF222935).withOpacity(0.60), + // onPrimary: Colors.white, // Change text color + // ), + // textButtonTheme: TextButtonThemeData( + // style: TextButton.styleFrom( + // foregroundColor: Colors.white, // Change button text color + // ), + // ), + // dialogBackgroundColor: Color(0XFF222935) + // .withOpacity(0.60), // Change dialog background color + // ), + child: child!, + ); + }, + ); + + if (pickedDate != null) { + // if (pickedDate.isBefore(eighteenYearsAgo)) { + setState(() { + _selectedDate = pickedDate; + datecontroller.text = + "${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}"; + }); + // } + } + } + + List filePath = []; + bool isImageAdded = false; + + UploadData() async { + utils.loader(); + List certificatelist = []; + + for (var file in filePath.where((file) => file != null)) { + certificatelist.add( + await MultipartFile.fromFile( + file!.path, + filename: path.basename(file.path), + ), + ); + } + FormData formdata = FormData.fromMap({ + "certification_name": certicationname.text, + "certification_reason": certificationreason.text, + "certification_date": datecontroller.text, + "certification_image": certificatelist[0], + }); + final data = await Profilepostmethod().postCertification(formdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Add certifications", + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: Form( + key: _formkey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Certification name"), + sizedBoxHeight(16.h), + CustomTextFormField( + leadingIcon: Container( + height: 17.h, + width: 18.w, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + height: 17.h, + width: 18.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your certification name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + hintText: "Enter certification name", + textEditingController: certicationname, + ), + sizedBoxHeight(10.h), + text16400white("Certification reason"), + sizedBoxHeight(16.h), + CustomTextFormField( + leadingIcon: Container( + height: 17.h, + width: 18.w, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + height: 17.h, + width: 18.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your certification reason '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + hintText: "Enter certification reason", + textEditingController: certificationreason, + ), + sizedBoxHeight(10.h), + text16400white("Certification date"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: datecontroller, + readonly: true, + onTap: () { + _selectDate(context); + }, + // texttype: TextInputType.text, + hintText: "Enter your certification date", + leadingIcon: + // const Icon(Icons.mail_outline), + Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/dateimage.png', + ), + // validatorText: "Enter date of birth", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your certification date'; + } + return null; + }, + ), + sizedBoxHeight(10.h), + text16400white("Certification image"), + sizedBoxHeight(16.h), + filePath.isNotEmpty && isImageAdded + ? Container( + height: 167.h, + width: double.infinity, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Colors.white + .withOpacity(0.30000001192092896), + Colors.white + .withOpacity(0.2800000011920929) + ], + ), + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF7E7E7E)), + borderRadius: BorderRadius.circular(10), + ), + ), + child: Stack(children: [ + Image.file( + filePath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + Positioned( + // top: 0, + // left: 0, + right: 12, + bottom: 12, + child: GestureDetector( + onTap: () { + // Clear the list and show the upload button + filePath.clear(); + isImageAdded = false; + setState(() {}); + }, + child: Container( + width: 27, + height: 27, + decoration: ShapeDecoration( + color: Colors.black, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5)), + ), + child: Icon( + Icons.delete_outline_outlined, + color: Colors.white, + ))), + ), + // ), + ]), + ) + : GestureDetector( + // onTap: () { + // ImageUploadBottomSheet().showModal( + // context, + // false, + // (result) { + // var file = File(result); + // filePath.add(file); + // // isImageAdded = true; + // setState(() { + // isImageAdded = true; + + // }); + // }, + // ); + // }, + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + var file = File(result); + + filePath.add(file); + isImageAdded = true; + setState(() { + // Navigator.of(context).pop(); + Get.back(); + }); + }, + ); + }, + child: Container( + width: double.infinity, + height: 167, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Colors.white + .withOpacity(0.30000001192092896), + Colors.white + .withOpacity(0.2800000011920929) + ], + ), + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF7E7E7E)), + borderRadius: BorderRadius.circular(10), + ), + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/png/onlycamera.png'), + sizedBoxHeight(5.h), + Text( + 'Upload certification \nimage', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ), + sizedBoxHeight(50.h), + CustomButton( + onPressed: () { + // final isValid = + // _formkey.currentState?.validate(); + if (certicationname.text.isBlank! && + certificationreason.text.isBlank! && + datecontroller.text.isBlank! && + filePath.isEmpty) { + utils.showToast("Please fill all fields"); + } else { + UploadData(); + } + }, + text: "Send") + ]), + ), + )) + ])), + ); + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart index 7a7a94f..6748349 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.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/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -42,60 +41,149 @@ 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( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Certifications/Qualifications", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - Container( - height: 600.h, - child: GridView.builder( - scrollDirection: Axis.vertical, - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - mainAxisSpacing: 20, - crossAxisSpacing: 8, - childAspectRatio: 0.65, - ), - itemCount: CertificateData.length, - itemBuilder: (context, index) { - return Column( - children: [ - Image.asset( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Certifications/Qualifications", + ), + 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), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return certificateobj!.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)), + ), + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + Container( + height: 600.h, + child: GridView.builder( + scrollDirection: Axis.vertical, + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + mainAxisSpacing: 20, + crossAxisSpacing: 8, + childAspectRatio: 0.65, + ), + itemCount: certificateobj!.data!.length, + itemBuilder: (context, index) { + return Column( + // mainAxisAlignment: MainAxisAlignment.start, + children: [ + certificateobj!.data![index].certificationImage == + null || + certificateobj!.data![index] + .certificationImage!.isEmpty + ? Image.asset( + CertificateData[index]["imagePath"], + height: 100.h, + width: 105.w, + ) + : Image.network( + 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"], - height: 100.h, - width: 105.w, - ), - Expanded( - child: Center( - child: text14w400_FCFCFC( - CertificateData[index]["text"], - textAlign: TextAlign.center, - ), - ), - ), - ], - ); - }), - ) - ]))) - ])); + fit: BoxFit.cover, + ); + }), + Expanded( + child: Center( + child: text14w400_FCFCFC( + certificateobj!.data![index] + .certificationName == + null || + certificateobj!.data![index] + .certificationName!.isEmpty + ? CertificateData[index]["text"] + : certificateobj! + .data![index].certificationName, + textAlign: TextAlign.center, + ), + ), + ), + ], + ); + }), + ) + ]))) + ]); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart index 34054e6..99bc39b 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart @@ -27,9 +27,12 @@ class GetEditProfileBus { class Data { int? id; + int? iamPrincipalXid; int? businessTypeXid; + String? foundedon; String? businessOwnerName; String? businessName; + String? businessUsername; String? businessLocation; String? businessContactNumber; String? businessEmail; @@ -39,14 +42,20 @@ class Data { String? businessLogo; String? tags; String? bannerImage; + String? businessProfileImage; + String? bio; Follows? follows; + int? isIamFollowingToGuestUser; BusinessType? businessType; + IamPrincipalData? iamPrincipalData; Data( {this.id, + this.iamPrincipalXid, this.businessTypeXid, this.businessOwnerName, this.businessName, + this.businessUsername, this.businessLocation, this.businessContactNumber, this.businessEmail, @@ -56,14 +65,21 @@ class Data { this.businessLogo, this.tags, this.bannerImage, + this.businessProfileImage, + this.bio, this.follows, - this.businessType}); + this.isIamFollowingToGuestUser, + this.businessType, + this.iamPrincipalData}); Data.fromJson(Map json) { id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; businessTypeXid = json['business_type_xid']; + foundedon = json['founded_on']; businessOwnerName = json['business_owner_name']; businessName = json['business_name']; + businessUsername = json['business_username']; businessLocation = json['business_location']; businessContactNumber = json['business_contact_number']; businessEmail = json['business_email']; @@ -73,19 +89,28 @@ class Data { businessLogo = json['business_logo']; tags = json['tags']; bannerImage = json['banner_image']; + businessProfileImage = json['business_profile_image']; + bio = json['bio']; follows = json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + isIamFollowingToGuestUser = json['is_iam_following_to_guest_user']; businessType = json['business_type'] != null ? new BusinessType.fromJson(json['business_type']) : null; + iamPrincipalData = json['iam_principal_data'] != null + ? new IamPrincipalData.fromJson(json['iam_principal_data']) + : null; } Map toJson() { final Map data = new Map(); data['id'] = this.id; + data['iam_principal_xid'] = this.iamPrincipalXid; data['business_type_xid'] = this.businessTypeXid; + data['founded_on'] = this.foundedon; data['business_owner_name'] = this.businessOwnerName; data['business_name'] = this.businessName; + data['business_username'] = this.businessUsername; data['business_location'] = this.businessLocation; data['business_contact_number'] = this.businessContactNumber; data['business_email'] = this.businessEmail; @@ -95,12 +120,18 @@ class Data { data['business_logo'] = this.businessLogo; data['tags'] = this.tags; data['banner_image'] = this.bannerImage; + data['business_profile_image'] = this.businessProfileImage; + data['bio'] = this.bio; if (this.follows != null) { data['follows'] = this.follows!.toJson(); } + data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; if (this.businessType != null) { data['business_type'] = this.businessType!.toJson(); } + if (this.iamPrincipalData != null) { + data['iam_principal_data'] = this.iamPrincipalData!.toJson(); + } return data; } } @@ -176,3 +207,208 @@ class BusinessType { return data; } } + +class IamPrincipalData { + int? id; + int? principalTypeXid; + int? principalSourceXid; + String? oneSignalPlayerId; + String? googleId; + String? appleId; + String? facebookId; + String? microsoftId; + String? userName; + String? pin; + String? fullName; + String? gender; + String? dateOfBirth; + String? phoneNumber; + String? otherPhoneNumber; + String? emailAddress; + String? addressLine1; + String? addressLine2; + String? cityXid; + String? stateXid; + String? countryXid; + String? postCode; + String? lastLoginDatetime; + String? profilePhoto; + String? referralCode; + String? description; + String? about; + String? position; + String? trainingScores; + String? height; + String? weight; + String? battingAverage; + int? isProfileUpdated; + String? isActive; + int? groupNotification; + int? communityNotification; + int? followerNotification; + int? newFollowerNotification; + int? directMessageNotification; + int? isAccountVisibility; + int? isDeleted; + String? reason; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + String? profileImage; + + IamPrincipalData( + {this.id, + this.principalTypeXid, + this.principalSourceXid, + this.oneSignalPlayerId, + this.googleId, + this.appleId, + this.facebookId, + this.microsoftId, + this.userName, + this.pin, + this.fullName, + this.gender, + this.dateOfBirth, + this.phoneNumber, + this.otherPhoneNumber, + this.emailAddress, + this.addressLine1, + this.addressLine2, + this.cityXid, + this.stateXid, + this.countryXid, + this.postCode, + this.lastLoginDatetime, + this.profilePhoto, + this.referralCode, + this.description, + this.about, + this.position, + this.trainingScores, + this.height, + this.weight, + this.battingAverage, + this.isProfileUpdated, + this.isActive, + this.groupNotification, + this.communityNotification, + this.followerNotification, + this.newFollowerNotification, + this.directMessageNotification, + this.isAccountVisibility, + this.isDeleted, + this.reason, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt, + this.profileImage}); + + IamPrincipalData.fromJson(Map json) { + id = json['id']; + principalTypeXid = json['principal_type_xid']; + principalSourceXid = json['principal_source_xid']; + oneSignalPlayerId = json['one_signal_player_id']; + googleId = json['google_id']; + appleId = json['apple_id']; + facebookId = json['facebook_id']; + microsoftId = json['microsoft_id']; + userName = json['user_name']; + pin = json['pin']; + fullName = json['full_name']; + gender = json['gender']; + dateOfBirth = json['date_of_birth']; + phoneNumber = json['phone_number']; + otherPhoneNumber = json['other_phone_number']; + emailAddress = json['email_address']; + addressLine1 = json['address_line1']; + addressLine2 = json['address_line2']; + cityXid = json['city_xid']; + stateXid = json['state_xid']; + countryXid = json['country_xid']; + postCode = json['post_code']; + lastLoginDatetime = json['last_login_datetime']; + profilePhoto = json['profile_photo']; + referralCode = json['referral_code']; + description = json['description']; + about = json['about']; + position = json['position']; + trainingScores = json['training_scores']; + height = json['height']; + weight = json['weight']; + battingAverage = json['batting_average']; + isProfileUpdated = json['is_profile_updated']; + isActive = json['is_active']; + groupNotification = json['group_notification']; + communityNotification = json['community_notification']; + followerNotification = json['follower_notification']; + newFollowerNotification = json['new_follower_notification']; + directMessageNotification = json['direct_message_notification']; + isAccountVisibility = json['is_account_visibility']; + isDeleted = json['is_deleted']; + reason = json['reason']; + createdBy = json['created_by']; + modifiedBy = json['modified_by']; + deletedAt = json['deleted_at']; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + profileImage = json['profile_image']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['principal_type_xid'] = this.principalTypeXid; + data['principal_source_xid'] = this.principalSourceXid; + data['one_signal_player_id'] = this.oneSignalPlayerId; + data['google_id'] = this.googleId; + data['apple_id'] = this.appleId; + data['facebook_id'] = this.facebookId; + data['microsoft_id'] = this.microsoftId; + data['user_name'] = this.userName; + data['pin'] = this.pin; + data['full_name'] = this.fullName; + data['gender'] = this.gender; + data['date_of_birth'] = this.dateOfBirth; + data['phone_number'] = this.phoneNumber; + data['other_phone_number'] = this.otherPhoneNumber; + data['email_address'] = this.emailAddress; + data['address_line1'] = this.addressLine1; + data['address_line2'] = this.addressLine2; + data['city_xid'] = this.cityXid; + data['state_xid'] = this.stateXid; + data['country_xid'] = this.countryXid; + data['post_code'] = this.postCode; + data['last_login_datetime'] = this.lastLoginDatetime; + data['profile_photo'] = this.profilePhoto; + data['referral_code'] = this.referralCode; + data['description'] = this.description; + data['about'] = this.about; + data['position'] = this.position; + data['training_scores'] = this.trainingScores; + data['height'] = this.height; + data['weight'] = this.weight; + data['batting_average'] = this.battingAverage; + data['is_profile_updated'] = this.isProfileUpdated; + data['is_active'] = this.isActive; + data['group_notification'] = this.groupNotification; + data['community_notification'] = this.communityNotification; + data['follower_notification'] = this.followerNotification; + data['new_follower_notification'] = this.newFollowerNotification; + data['direct_message_notification'] = this.directMessageNotification; + data['is_account_visibility'] = this.isAccountVisibility; + data['is_deleted'] = this.isDeleted; + data['reason'] = this.reason; + data['created_by'] = this.createdBy; + data['modified_by'] = this.modifiedBy; + data['deleted_at'] = this.deletedAt; + data['created_at'] = this.createdAt; + data['updated_at'] = this.updatedAt; + data['profile_image'] = this.profileImage; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart index 9558581..51ca91f 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart @@ -28,7 +28,10 @@ class GetEditProfileIndi { class Data { int? id; String? userName; + String? location; String? fullName; + // String? profileImage; + String? profilePhoto; String? gender; String? dateOfBirth; List? interest; @@ -39,11 +42,18 @@ class Data { String? weight; String? battingAverage; Follows? follows; + List? timelines; + int? accountVisibility; + List? myJoinedGroups; + List? certifications; + int? daysBeforeJoined; Data( {this.id, this.userName, this.fullName, + // this.profileImage, + this.profilePhoto, this.gender, this.dateOfBirth, this.interest, @@ -53,12 +63,21 @@ class Data { this.height, this.weight, this.battingAverage, - this.follows}); + this.follows, + this.timelines, + this.accountVisibility, + this.myJoinedGroups, + this.certifications, + this.daysBeforeJoined}); Data.fromJson(Map json) { id = json['id']; userName = json['user_name']; + location = json['location']; + fullName = json['full_name']; + // profileImage = json['profile_image']; + profilePhoto = json['profile_photo']; gender = json['gender']; dateOfBirth = json['date_of_birth']; if (json['interest'] != null) { @@ -75,13 +94,37 @@ class Data { battingAverage = json['batting_average']; follows = json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + if (json['timelines'] != null) { + timelines = []; + json['timelines'].forEach((v) { + timelines!.add(new Timelines.fromJson(v)); + }); + } + accountVisibility = json['account_visibility']; + if (json['my_joined_groups'] != null) { + myJoinedGroups = []; + json['my_joined_groups'].forEach((v) { + myJoinedGroups!.add(new MyJoinedGroups.fromJson(v)); + }); + } + if (json['certifications'] != null) { + certifications = []; + json['certifications'].forEach((v) { + certifications!.add(new Certifications.fromJson(v)); + }); + } + daysBeforeJoined = json['days_before_joined']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['user_name'] = this.userName; + data['location'] = this.location; + data['full_name'] = this.fullName; + // data['profile_image'] = this.profileImage; + data['profile_photo'] = this.profilePhoto; data['gender'] = this.gender; data['date_of_birth'] = this.dateOfBirth; if (this.interest != null) { @@ -96,6 +139,19 @@ class Data { if (this.follows != null) { data['follows'] = this.follows!.toJson(); } + if (this.timelines != null) { + data['timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + } + data['account_visibility'] = this.accountVisibility; + if (this.myJoinedGroups != null) { + data['my_joined_groups'] = + this.myJoinedGroups!.map((v) => v.toJson()).toList(); + } + if (this.certifications != null) { + data['certifications'] = + this.certifications!.map((v) => v.toJson()).toList(); + } + data['days_before_joined'] = this.daysBeforeJoined; return data; } } @@ -119,6 +175,77 @@ class Interest { } } +class Timelines { + int? id; + String? clubName; + String? roleName; + String? teamName; + String? startDate; + String? endDate; + String? abilitiesXids; + List? abilities; + + Timelines( + {this.id, + this.clubName, + this.roleName, + this.teamName, + this.startDate, + this.endDate, + this.abilitiesXids, + this.abilities}); + + Timelines.fromJson(Map json) { + id = json['id']; + clubName = json['club_name']; + roleName = json['role_name']; + teamName = json['team_name']; + startDate = json['start_date']; + endDate = json['end_date']; + abilitiesXids = json['abilities_xids']; + if (json['abilities'] != null) { + abilities = []; + json['abilities'].forEach((v) { + abilities!.add(new Abilities.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['club_name'] = this.clubName; + data['role_name'] = this.roleName; + data['team_name'] = this.teamName; + data['start_date'] = this.startDate; + data['end_date'] = this.endDate; + data['abilities_xids'] = this.abilitiesXids; + if (this.abilities != null) { + data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Abilities { + int? id; + String? name; + + Abilities({this.id, this.name}); + + Abilities.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + class Follows { int? following; int? followers; @@ -137,3 +264,92 @@ class Follows { return data; } } + +class Certifications { + int? id; + String? certificationName; + String? certificationImage; + String? certificationReason; + String? certificationDate; + int? iamPrincipalXid; + + Certifications( + {this.id, + this.certificationName, + this.certificationImage, + this.certificationReason, + this.certificationDate, + this.iamPrincipalXid}); + + Certifications.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; + } +} + +class MyJoinedGroups { + int? id; + int? iamPrincipalXid; + int? manageGroupXid; + GroupData? groupData; + + MyJoinedGroups( + {this.id, this.iamPrincipalXid, this.manageGroupXid, this.groupData}); + + MyJoinedGroups.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageGroupXid = json['manage_group_xid']; + 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.groupData != null) { + data['group_data'] = this.groupData!.toJson(); + } + 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/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart new file mode 100644 index 0000000..c75e49d --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart @@ -0,0 +1,53 @@ +class InterestModel { + String? status; + int? statusCode; + String? message; + List? data; + + InterestModel({this.status, this.statusCode, this.message, this.data}); + + InterestModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? name; + String? image; + + Data({this.id, this.name, this.image}); + + Data.fromJson(Map json) { + id = json['id']; + name = json['name']; + image = json['image']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['name'] = name; + data['image'] = image; + return data; + } +} 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 c134233..e2a0d0c 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart @@ -7,10 +7,9 @@ import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; @@ -60,20 +59,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!.businessOwnerName ?? '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!.foundedon ?? '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!.bio ?? ""; // _selectedgenderType = getEditProfileIndi!.data!.gender ?? ''; // _selectedsportType = getEditProfileIndi!.data!.interest!.join(', ') ?? ''; @@ -84,6 +86,16 @@ class _BusEditProfileState extends State { } void saveEditProfileBus() async { + var imageFile; + + if (editProfileImage.usserprofilePicPath.value.isNotEmpty) { + imageFile = await MultipartFile.fromFile( + editProfileImage.usserprofilePicPath.value, + filename: path.basename(profilePicture), + ); + + } + FormData? updata; if (busNameController.text.isBlank! || busUserNameController.text.isBlank! || @@ -99,9 +111,12 @@ class _BusEditProfileState extends State { backgroundColor: Colors.red, colorText: Colors.white, ); - } else if (profilePicture == "") { - utils.showToast('Upload edit profile picture!'); - } else { + } + // else if (profilePicture == "") { + // utils.showToast('Upload edit profile picture!'); + // } + else { + utils.loader(); updata = FormData.fromMap({ "business_name": busNameController.text, "business_username": busUserNameController.text, @@ -110,11 +125,14 @@ class _BusEditProfileState extends State { "website_link": websiteLinkController.text, "business_location": locationController.text, "bio": bioController.text, - "business_profile": await convertFileToMultiPart(profilePicture), + "business_profile": + editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null, + // await convertFileToMultiPart(profilePicture), }); final data = await EditProfileApi().postEditProfileBusiness(updata); if (data.status == ResponseStatus.SUCCESS) { + Get.back(); // await global.setname(); // Get.snackbar( // "Success!", @@ -128,17 +146,18 @@ class _BusEditProfileState extends State { // ); utils.showToast("Data Saved Successfully"); // Get.back(); - Get.toNamed(RouteName.profiletab); + Get.toNamed(RouteName.mainscreen, arguments: 4); // Get.back(result: true); } else { + Get.back(); // btnController.reset(); 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, ); @@ -147,277 +166,322 @@ class _BusEditProfileState extends State { } } + final UserProfileImageController editProfileImage = + Get.put(UserProfileImageController()); + @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "", - ), - body: FutureBuilder( - future: myfuture, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - color: Colors.blue, - ), - ); - } + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return + // const ShimmerCommon(); - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18.spMin), - ), - ); - } + const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - print("Data fetched-->"); - return Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - Stack( - children: [ - profilePicture != "" && isImageAdded - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(50.r), - child: Image.file( - File(profilePicture), - // filePath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - ), - ) - : getEditProfileBus!.data!.businessLogo != - null - ? Container( - width: 100.w, - height: 100.h, - decoration: ShapeDecoration( - image: DecorationImage( - image: Image( - image: NetworkImage( - getEditProfileBus!.data! - .businessLogo ?? - ''), - ).image, - fit: BoxFit.cover, - ), - shape: OvalBorder(), - ), + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + print("Data fetched-->"); + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + Stack( + children: [ + Obx( + () => editProfileImage + .usserprofilePicPath.value != + '' + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: editProfileImage + .usserprofilePicPath + .value != + '' + ? Image( + // File(profilePicture), + image: FileImage( + File( + editProfileImage + .usserprofilePicPath + .value, + ), + ), + fit: BoxFit.cover, + width: double.infinity, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace? + stackTrace) { + return CircleAvatar( + backgroundImage: + const AssetImage( + "assets/images/png/Ellipse 37 (1).png"), + radius: 50.r, + ); + }, + ) + : Image.asset( + 'assets/images/png/Ellipse 37 (1).png')), ) - : CircleAvatar( - backgroundImage: AssetImage( - "assets/images/png/Ellipse 37 (1).png", - ), - radius: 50.r, + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(60.r), + child: getEditProfileBus!.data! + .businessProfileImage != + null + ? ClipOval( + child: + SizedBox.fromSize( + size: Size.fromRadius( + 25.r), + child: CircleAvatar( + backgroundImage: + NetworkImage( + getEditProfileBus! + .data! + .businessProfileImage!), + radius: 25.r, + ), + ), + ) + : Image.asset( + "assets/images/png/Ellipse 37 (1).png")), ), - Positioned( - bottom: 0, - right: 0, - child: InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - true, - (result) { - var filenameresult = - extractFileName(result); + ), + Positioned( + bottom: 0, + right: 0, + child: InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + true, + (result) { + editProfileImage + .usserprofilePicPath + .value = result; + var filenameresult = + extractFileName(result); - profilePicture = result; - isImageAdded = true; - setState(() {}); - }, - ); - }, - child: Container( - height: 35.h, - width: 35.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFD90B2E)), - child: Center( - child: Image.asset( - "assets/images/png/cameraicon2.png", - height: 19.h, - width: 19.w, + print( + "File name is $filenameresult"); + + profilePicture = result; + isImageAdded = true; + setState(() {}); + }, + ); + }, + child: Container( + height: 35.h, + width: 35.w, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFD90B2E)), + child: Center( + child: Image.asset( + "assets/images/png/cameraicon2.png", + height: 19.h, + width: 19.w, + ), ), ), - ), - )) - ], - ), - sizedBoxHeight(15.h), - text16400white("Edit profile picture"), - sizedBoxHeight(30.h), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16400white("Business name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: busNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "Victory gear sports emporium", - ), - sizedBoxHeight(20.h), - text16400white("Business username"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: busUserNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "victorygames _10", - ), - sizedBoxHeight(20.h), - text16400white("Owner name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: ownerNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "James Bothman", - ), - sizedBoxHeight(20.h), - text16400white("Founded on"), - sizedBoxHeight(16.h), - GestureDetector( - onTap: () => - datePicker(context, foundedonController), - child: AbsorbPointer( - child: CustomTextFormField( - leadingIcon: Container( - width: 18.0, - height: 17.0, - child: Center( - child: Image.asset( - "assets/images/png/calender.png", - width: 18.0, - height: 17.0, - ), + )) + ], + ), + sizedBoxHeight(15.h), + text16400white("Edit profile picture"), + sizedBoxHeight(30.h), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white("Business name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: busNameController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, ), ), - hintText: "12-04-2024", - textEditingController: - foundedonController, ), + hintText: "Victory gear sports emporium", ), - ), - sizedBoxHeight(20.h), - text16400white("Website link"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: websiteLinkController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Vector2a.png", - width: 18.w, - height: 17.h, + sizedBoxHeight(20.h), + text16400white("Business username"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: + busUserNameController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "", + ), + sizedBoxHeight(20.h), + text16400white("Owner name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: ownerNameController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "", + ), + sizedBoxHeight(20.h), + text16400white("Founded on"), + sizedBoxHeight(16.h), + GestureDetector( + onTap: () => datePicker( + context, foundedonController), + child: AbsorbPointer( + child: CustomTextFormField( + leadingIcon: SizedBox( + width: 18.0, + height: 17.0, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", + width: 18.0, + height: 17.0, + ), + ), + ), + hintText: "", + textEditingController: + foundedonController, ), ), ), - hintText: "victorygames _10", - ), - sizedBoxHeight(25.h), - Row( - children: [ - text16400white("Location"), - sizedBoxWidth(6.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: locationController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Group 58645.png", - width: 18.w, - height: 17.h, + sizedBoxHeight(20.h), + text16400white("Website link"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: + websiteLinkController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Vector2a.png", + width: 18.w, + height: 17.h, + ), ), ), + hintText: "", ), - hintText: "Elm street london, United Kingdom", - ), - 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", - maxlines: 3, - ), - sizedBoxHeight(60.h), - CommonBtn( - text: "Save", - onTap: () { - saveEditProfileBus(); - }, - ), - sizedBoxHeight(60.h), - ], - ) - ]))) - ]); - } - return Container(); - })); + sizedBoxHeight(25.h), + Row( + children: [ + text16400white("Location"), + sizedBoxWidth(6.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], + ), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: locationController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "", + ), + sizedBoxHeight(20.h), + text16400white("Bio"), + sizedBoxHeight(16.h), + CustomTextFormField2( + textEditingController: bioController, + hintText: "", + maxlines: 3, + ), + sizedBoxHeight(60.h), + CommonBtn( + text: "Save", + onTap: () { + saveEditProfileBus(); + }, + ), + sizedBoxHeight(60.h), + ], + ) + ]))) + ]); + } + return Container(); + })), + ); } } 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..66a275f 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart @@ -1,3 +1,4 @@ +import 'dart:developer'; import 'dart:io'; import 'package:dio/dio.dart'; @@ -7,7 +8,9 @@ import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; @@ -16,6 +19,7 @@ import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:path/path.dart' as path; +import 'package:regroup/resources/routes/route_name.dart'; class EditProfile extends StatefulWidget { const EditProfile({super.key}); @@ -24,6 +28,8 @@ class EditProfile extends StatefulWidget { State createState() => _EditProfileState(); } +//location in normal profile individual api + class _EditProfileState extends State { TextEditingController fullNameController = TextEditingController(); TextEditingController userNameController = TextEditingController(); @@ -61,49 +67,51 @@ class _EditProfileState extends State { }); } - String _selectedsportType = ''; - List _selectedSports = []; + List selectedinterestid = []; + RxBool isloading = true.obs; - void _onSportSelected(List selectedValues) { - setState(() { - _selectedSports = selectedValues; - _selectedsportType = _selectedSports.join(', '); - }); - } - - List getSelectedSportsIds() { - if (getEditProfileIndi == null || - getEditProfileIndi!.data!.interest == null) { - return []; + void getCatIdFromName(List selectedInterests) { + selectedinterestid.clear(); + for (var name in selectedInterests) { + for (var i = 0; i < interestlistobj!.data!.length; i++) { + if (name == interestlistobj!.data![i].name) { + selectedinterestid.add(interestlistobj!.data![i].id!); + break; + } + } } - - return _selectedSports - .map((sportName) => getEditProfileIndi!.data!.interest! - .firstWhere((interest) => interest.name == sportName) - .id!) - .toList(); } @override void initState() { - // TODO: implement initState - myfuture = EditProfileApi() .getEditProfileIndividual() .then((value) => {setValues()}); + super.initState(); } - setValues() { + setValues() async { if (isOnce) { fullNameController.text = getEditProfileIndi!.data!.fullName ?? ''; userNameController.text = getEditProfileIndi!.data!.userName ?? ''; dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? ''; _selectedgenderType = getEditProfileIndi!.data!.gender ?? ''; - _selectedSports = - getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList(); - _selectedsportType = _selectedSports.join(', '); + locationController.text = getEditProfileIndi!.data!.location ?? ''; + + locationController.text = getEditProfileIndi!.data!.about ?? ''; + aboutController.text = getEditProfileIndi!.data!.about ?? ''; + 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(() {}); @@ -111,415 +119,822 @@ class _EditProfileState extends State { } void saveEditProfileInd() async { - List selectedSportsIds = getSelectedSportsIds(); + utils.loader(); + FormData? updata; - if (fullNameController.text.isBlank! || - userNameController.text.isBlank! || - dateController.text.isBlank! || - locationController.text.isBlank! || - aboutController.text.isBlank! || - positionController.text.isBlank! || - trainingScoresController.text.isBlank! || - heightController.text.isBlank! || - weightController.text.isBlank! || - battingAvgController.text.isBlank!) { - Get.snackbar( - 'Error', - 'Enter your credentials', - snackPosition: SnackPosition.BOTTOM, - backgroundColor: Colors.red, - colorText: Colors.white, + + var imageFile; + + String abilitiesIds = selectedinterestid.toString(); + print("Interests String: $abilitiesIds"); + + if (editProfileImage.usserprofilePicPath.value.isNotEmpty) { + imageFile = await MultipartFile.fromFile( + editProfileImage.usserprofilePicPath.value, + filename: path.basename(profilePicture), ); - } else if (profilePicture == "") { - utils.showToast('Upload edit profile picture!'); + print(imageFile.toString()); + } + + + updata = FormData.fromMap({ + // "email_address": "priyanka14@yopmail.com", + "full_name": fullNameController.text, + "profile_image": + editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null, + // profilePicture.isNotEmpty + // ? await convertFileToMultiPart1(profilePicture) + // : null, + // "profile_image": "ghjkk.png", + + "user_name": userNameController.text, + "date_of_birth": dateController.text, + "gender": _selectedgenderType, + // "interest": "selectedSportsIds", + "interest": + // '[1,2,3,4]', + abilitiesIds, + "about": aboutController.text, + "position": positionController.text, + "training_scores": trainingScoresController.text, + "height": heightController.text, + "weight": weightController.text, + "batting_average": battingAvgController.text, + "address_line1": battingAvgController.text, + }); + log(updata.toString()); + print(imageFile.toString()); + + final data = await EditProfileApi().postEditProfileIndividual(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); } else { - updata = FormData.fromMap({ - "email_address": "priyanka12@yopmail.com", - "full_name": fullNameController.text, - "profile_image": await convertFileToMultiPart1(profilePicture), - // "profile_image": "ghjkk.png", - - "user_name": userNameController.text, - "date_of_birth": dateController.text, - "gender": _selectedgenderType, - // "interest": "selectedSportsIds", - "interest": ["1", "2", "3"].toList(), - "about": aboutController.text, - "position": positionController.text, - "training_scores": trainingScoresController.text, - "height": heightController.text, - "weight": weightController.text, - "batting_average": battingAvgController.text, - "address_line1": battingAvgController.text, - }); - - final data = await EditProfileApi().postEditProfileIndividual(updata); - if (data.status == ResponseStatus.SUCCESS) { - // await global.setname(); - Get.snackbar( - "Success!", - 'success!', - duration: Duration(seconds: 2), - colorText: Colors.white, - backgroundColor: Colors.green, - margin: EdgeInsets.all(8), - snackStyle: SnackStyle.FLOATING, - snackPosition: SnackPosition.BOTTOM, - ); - Get.back(); - - // Get.toNamed(RouteName.individualgroupstep3); - Get.back(); - } else { - // btnController.reset(); - Get.snackbar( - "Error!", - data.data['message'], - duration: Duration(seconds: 2), - colorText: Colors.white, - backgroundColor: Colors.red, - margin: EdgeInsets.all(8), - snackStyle: SnackStyle.FLOATING, - snackPosition: SnackPosition.BOTTOM, - ); - // _controller.isTextFieldEnabled.value = true; - } + Get.back(); + // btnController.reset(); + Get.snackbar( + "Error!", + data.data['message'], + duration: const Duration(seconds: 2), + colorText: Colors.white, + backgroundColor: Colors.red, + margin: const EdgeInsets.all(8), + snackStyle: SnackStyle.FLOATING, + snackPosition: SnackPosition.BOTTOM, + ); + // _controller.isTextFieldEnabled.value = true; } } + final UserIndiProfileImageController editProfileImage = + Get.put(UserIndiProfileImageController()); + @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "", - ), - body: FutureBuilder( - future: myfuture, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - color: Colors.blue, - ), - ); - } + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18.spMin), - ), - ); - } + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - print("Data fetched-->"); - return Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - Stack( - children: [ - profilePicture != "" && isImageAdded - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(50.r), - child: Image.file( - File(profilePicture), - // filePath[0]!, - fit: BoxFit.cover, - width: double.infinity, + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + print("Data fetched-->"); + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + Stack( + children: [ + Obx( + () => editProfileImage + .usserprofilePicPath.value != + '' + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: editProfileImage + .usserprofilePicPath + .value != + '' + ? Image( + // File(profilePicture), + image: FileImage( + File( + editProfileImage + .usserprofilePicPath + .value, + ), + ), + fit: BoxFit.cover, + width: double.infinity, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace? + stackTrace) { + return CircleAvatar( + backgroundImage: + const AssetImage( + "assets/images/png/cimg3.png"), + radius: 50.r, + ); + }, + ) + : Image.asset( + 'assets/images/png/cimg3.png')), + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(60.r), + child: getEditProfileIndi!.data! + .profilePhoto != + null + ? ClipOval( + child: + SizedBox.fromSize( + size: Size.fromRadius( + 25.r), + child: CircleAvatar( + backgroundImage: + NetworkImage( + getEditProfileIndi! + .data! + .profilePhoto!), + radius: 25.r, + ), + ), + ) + : Image.asset( + "assets/images/blank-profile-picture-973460_1280.png")), + ), + ), + Positioned( + bottom: 0, + right: 0, + child: InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + true, + (result) { + // var filenameresult = + // extractFileName1(result); + editProfileImage + .usserprofilePicPath + .value = result; + + var filenameresult = + extractFileName1(result); + print( + "File name is $filenameresult"); + + profilePicture = result; + isImageAdded = true; + setState(() {}); + }, + ); + }, + child: Container( + height: 35.h, + width: 35.w, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFD90B2E)), + child: Center( + child: Image.asset( + "assets/images/png/cameraicon2.png", + height: 19.h, + width: 19.w, + ), ), ), + )) + ], + ), + sizedBoxHeight(15.h), + text16400white("Edit profile picture"), + sizedBoxHeight(20.h), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white("Full name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: fullNameController, + leadingIcon: Container( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "Edward Hackett", + ), + sizedBoxHeight(20.h), + text16400white("User name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: userNameController, + leadingIcon: Container( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "edward_01", + ), + sizedBoxHeight(20.h), + text16400white("Date of birth"), + sizedBoxHeight(16.h), + GestureDetector( + onTap: () => + datePicker(context, dateController), + child: AbsorbPointer( + child: CustomTextFormField( + leadingIcon: Container( + width: 18.0, + height: 17.0, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", + width: 18.0, + height: 17.0, + ), + ), + ), + hintText: "12-04-2024", + textEditingController: dateController, + ), + ), + ), + + sizedBoxHeight(20.h), + text16400white("Gender"), + sizedBoxHeight(16.h), + CustomDropDownRadio( + initialSelectedValue: _selectedgenderType, + header: _selectedgenderType ?? "Male", + title: "", + showOtherOption: true, + listData: const [ + "Male", + "Female", + "Prefer not to say" + ], + onItemSelected: _onItemSelected, + leadingImage: Image.asset( + "assets/images/png/Vector ws.png", + width: 18.w, + height: 17.h, + ), + ), + sizedBoxHeight(25.h), + Row( + children: [ + text16400white("Location"), + sizedBoxWidth(6.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, ) - : CircleAvatar( - backgroundImage: AssetImage( - "assets/images/png/cimg3.png", + ], + ), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: locationController, + leadingIcon: Container( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + width: 18.w, + height: 17.h, ), - radius: 50.r, ), - Positioned( - bottom: 0, - right: 0, - child: InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - true, - (result) { - var filenameresult = - extractFileName1(result); + ), + hintText: + "Elm street london, United Kingdom", + ), + sizedBoxHeight(20.h), + Row( + children: [ + text16400white("Interests"), + sizedBoxWidth(6.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], + ), + sizedBoxHeight(16.h), - profilePicture = result; - isImageAdded = true; - setState(() {}); - }, + //Obx(() { + //return + CustomDropDownChexkBox( + header: 'Select interest', + title: "", + listData: listofInterests, + onItemSelected: getCatIdFromName, + leadingImage: Image.asset( + "assets/images/png/Vector (4).png", + width: 18.w, + height: 17.h, + ), + // showOtherOption: true, + initiallySelected: listofUserInterests, + ), + // }), + + sizedBoxHeight(20.h), + text16400white("About"), + sizedBoxHeight(16.h), + CustomTextFormField2( + textEditingController: aboutController, + hintText: + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", + maxlines: 3, + ), + // sizedBoxHeight(20.h), + + text16400white("Position"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: positionController, + hintText: "Lorem Ipsum", + ), + sizedBoxHeight(20.h), + text16400white("Training Scores"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: + trainingScoresController, + hintText: "50", + ), + sizedBoxHeight(20.h), + text16400white("Height"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: heightController, + hintText: "6 feet", + ), + sizedBoxHeight(20.h), + text16400white("Weight"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: weightController, + hintText: "70kg", + ), + sizedBoxHeight(20.h), + text16400white("Batting Average"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: battingAvgController, + hintText: "372", + ), + sizedBoxHeight(20.h), + sizedBoxHeight(60.h), + CommonBtn( + text: "Save", + onTap: () { + if (fullNameController.text.isBlank! || + userNameController.text.isBlank! || + dateController.text.isBlank! || + locationController.text.isBlank! || + aboutController.text.isBlank! || + positionController.text.isBlank! || + trainingScoresController + .text.isBlank! || + heightController.text.isBlank! || + weightController.text.isBlank! || + battingAvgController.text.isBlank!) { + Get.snackbar( + 'Error', + 'Please fill missing details', + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, ); - }, - child: Container( - height: 35.h, - width: 35.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFD90B2E)), - child: Center( - child: Image.asset( - "assets/images/png/cameraicon2.png", - height: 19.h, - width: 19.w, - ), - ), - ), - )) - ], - ), - sizedBoxHeight(15.h), - text16400white("Edit profile picture"), - sizedBoxHeight(20.h), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16400white("Full name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: fullNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), + } + // else if (profilePicture == "") { + // utils.showToast( + // 'Upload edit profile picture!'); + // } + else { + print(selectedinterestid.toString()); + saveEditProfileInd(); + } + }, ), - hintText: "Edward Hackett", - ), - sizedBoxHeight(20.h), - text16400white("User name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: userNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "edward_01", - ), - sizedBoxHeight(20.h), - text16400white("Date of birth"), - sizedBoxHeight(16.h), - GestureDetector( - onTap: () => - datePicker(context, dateController), - child: AbsorbPointer( - child: CustomTextFormField( - leadingIcon: Container( - width: 18.0, - height: 17.0, - child: Center( - child: Image.asset( - "assets/images/png/calender.png", - width: 18.0, - height: 17.0, - ), - ), - ), - hintText: "12-04-2024", - textEditingController: dateController, - ), - ), - ), + sizedBoxHeight(60.h), + ], + ) + ]))) + ]); + } + return Container(); + })), + ); - sizedBoxHeight(20.h), - text16400white("Gender"), - sizedBoxHeight(16.h), - CustomDropDownRadio( - header: _selectedgenderType ?? "Male", - title: "", - showOtherOption: true, - listData: [ - "Male", - "Female", - "Prefer not to say" - ], - onItemSelected: _onItemSelected, - leadingImage: Image.asset( - "assets/images/png/Vector ws.png", - width: 18.w, - height: 17.h, - ), - ), - sizedBoxHeight(25.h), - Row( - children: [ - text16400white("Location"), - sizedBoxWidth(6.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: locationController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Group 58645.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "Elm street london, United Kingdom", - ), - sizedBoxHeight(20.h), - Row( - children: [ - text16400white("Interests"), - sizedBoxWidth(6.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(16.h), - CustomDropDownChexkBox( - header: _selectedsportType ?? - "Rowing, Rugby, Swimming", - title: "", - listData: [ - "Rowing", - "Cycling", - "Running", - "Swimming", - "Triathlon", - "Hiking", - "Football", - "Rugby" - ], - onItemSelected: _onSportSelected, - leadingImage: Image.asset( - "assets/images/png/Vector (4).png", - width: 18.w, - height: 17.h, - ), - showOtherOption: true, - initiallySelected: _selectedSports, - ), - // CustomDropDownRadio( - // showOtherOption: true, - // header: _selectedsportType ?? - // "Rowing, Rugby, Swimming", - // title: "", - // listData: [ - // "Rowing", - // "Cycling", - // "Running", - // "Swimming", - // "Triathlon", - // "Hiking", - // "Football", - // "Rugby" - // ], - // onItemSelected: _onSportSelected, - // leadingImage: Image.asset( - // "assets/images/png/Vector (4).png", - // width: 18.w, - // height: 17.h, - // ), - // ), + // FutureBuilder( + // future: myfuture, + // builder: (ctx, snapshot) { + // if (snapshot.connectionState == ConnectionState.waiting) { + // return const Center( + // child: CircularProgressIndicator( + // color: Colors.blue, + // ), + // ); + // } - sizedBoxHeight(20.h), - text16400white("About"), - sizedBoxHeight(16.h), - CustomTextFormField2( - textEditingController: aboutController, - hintText: - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", - maxlines: 3, - ), - // sizedBoxHeight(20.h), + // if (snapshot.hasError) { + // return Center( + // child: Text( + // '${snapshot.error} occurred', + // style: TextStyle(fontSize: 18.spMin), + // ), + // ); + // } - text16400white("Position"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: positionController, - hintText: "Lorem Ipsum", - ), - sizedBoxHeight(20.h), - text16400white("Training Scores"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: - trainingScoresController, - hintText: "50", - ), - sizedBoxHeight(20.h), - text16400white("Height"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: heightController, - hintText: "6 feet", - ), - sizedBoxHeight(20.h), - text16400white("Weight"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: weightController, - hintText: "70kg", - ), - sizedBoxHeight(20.h), - text16400white("Batting Average"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: battingAvgController, - hintText: "372", - ), - sizedBoxHeight(20.h), - sizedBoxHeight(60.h), - CommonBtn( - text: "Save", - onTap: () { - saveEditProfileInd(); - }, - ), - sizedBoxHeight(60.h), - ], - ) - ]))) - ]); - } - return Container(); - })); + // if (snapshot.connectionState == ConnectionState.done && + // snapshot.hasData) { + // print("Data fetched-->"); + // return Stack(children: [ + // Container( + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage( + // "assets/images/png/Ellipse 1496.png"), + // fit: BoxFit.fill)), + // ), + // SingleChildScrollView( + // child: Padding( + // padding: const EdgeInsets.symmetric(horizontal: 16), + // child: Column(children: [ + // sizedBoxHeight(25.h), + // Stack( + // children: [ + // profilePicture != "" && isImageAdded + // ? ClipOval( + // child: SizedBox.fromSize( + // size: Size.fromRadius(50.r), + // child: Image.file( + // File(profilePicture), + // fit: BoxFit.cover, + // width: double.infinity, + // errorBuilder: (BuildContext context, + // Object exception, + // StackTrace? stackTrace) { + // return CircleAvatar( + // backgroundImage: const AssetImage( + // "assets/images/png/cimg3.png"), + // radius: 50.r, + // ); + // }, + // ), + // ), + // ) + // : getEditProfileIndi?.data?.profilePhoto != + // null && + // getEditProfileIndi! + // .data!.profilePhoto!.isNotEmpty + // ? Container( + // width: 100.w, + // height: 100.h, + // decoration: ShapeDecoration( + // image: DecorationImage( + // image: NetworkImage( + // getEditProfileIndi! + // .data!.profilePhoto!, + // ), + // fit: BoxFit.cover, + // // onError: (error, stackTrace) { + // // // Fallback to default image in case of error + // // return const AssetImage("assets/images/png/cimg3.png"); + // // }, + // ), + // shape: const OvalBorder(), + // ), + // ) + // : CircleAvatar( + // backgroundImage: const AssetImage( + // "assets/images/png/cimg3.png"), + // radius: 50.r, + // ), + // Positioned( + // bottom: 0, + // right: 0, + // child: InkWell( + // onTap: () { + // ImageUploadBottomSheet().showModal( + // context, + // true, + // (result) { + // var filenameresult = + // extractFileName1(result); + + // profilePicture = result; + // isImageAdded = true; + // setState(() {}); + // }, + // ); + // }, + // child: Container( + // height: 35.h, + // width: 35.w, + // decoration: const BoxDecoration( + // shape: BoxShape.circle, + // color: Color(0xFFD90B2E)), + // child: Center( + // child: Image.asset( + // "assets/images/png/cameraicon2.png", + // height: 19.h, + // width: 19.w, + // ), + // ), + // ), + // )) + // ], + // ), + // sizedBoxHeight(15.h), + // text16400white("Edit profile picture"), + // sizedBoxHeight(20.h), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // text16400white("Full name"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: fullNameController, + // leadingIcon: Container( + // width: 18.w, + // height: 17.h, + // child: Center( + // child: Image.asset( + // "assets/images/png/Frame 24.png", + // width: 18.w, + // height: 17.h, + // ), + // ), + // ), + // hintText: "Edward Hackett", + // ), + // sizedBoxHeight(20.h), + // text16400white("User name"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: userNameController, + // leadingIcon: Container( + // width: 18.w, + // height: 17.h, + // child: Center( + // child: Image.asset( + // "assets/images/png/Frame 24.png", + // width: 18.w, + // height: 17.h, + // ), + // ), + // ), + // hintText: "edward_01", + // ), + // sizedBoxHeight(20.h), + // text16400white("Date of birth"), + // sizedBoxHeight(16.h), + // GestureDetector( + // onTap: () => + // datePicker(context, dateController), + // child: AbsorbPointer( + // child: CustomTextFormField( + // leadingIcon: Container( + // width: 18.0, + // height: 17.0, + // child: Center( + // child: Image.asset( + // "assets/images/png/calender.png", + // width: 18.0, + // height: 17.0, + // ), + // ), + // ), + // hintText: "12-04-2024", + // textEditingController: dateController, + // ), + // ), + // ), + + // sizedBoxHeight(20.h), + // text16400white("Gender"), + // sizedBoxHeight(16.h), + // CustomDropDownRadio( + // initialSelectedValue: _selectedgenderType, + // header: _selectedgenderType ?? "Male", + // title: "", + // showOtherOption: true, + // listData: [ + // "Male", + // "Female", + // "Prefer not to say" + // ], + // onItemSelected: _onItemSelected, + // leadingImage: Image.asset( + // "assets/images/png/Vector ws.png", + // width: 18.w, + // height: 17.h, + // ), + // ), + // sizedBoxHeight(25.h), + // Row( + // children: [ + // text16400white("Location"), + // sizedBoxWidth(6.w), + // Image.asset( + // "assets/images/png/octicon_question-24.png", + // height: 16.h, + // width: 16.w, + // ) + // ], + // ), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: locationController, + // leadingIcon: Container( + // width: 18.w, + // height: 17.h, + // child: Center( + // child: Image.asset( + // "assets/images/png/Group 58645.png", + // width: 18.w, + // height: 17.h, + // ), + // ), + // ), + // hintText: "Elm street london, United Kingdom", + // ), + // sizedBoxHeight(20.h), + // Row( + // children: [ + // text16400white("Interests"), + // sizedBoxWidth(6.w), + // Image.asset( + // "assets/images/png/octicon_question-24.png", + // height: 16.h, + // width: 16.w, + // ) + // ], + // ), + // sizedBoxHeight(16.h), + // // CustomDropDownChexkBox( + // // header: _selectedsportType ?? + // // "Rowing, Rugby, Swimming", + // // title: "", + // // listData: [ + // // "Rowing", + // // "Cycling", + // // "Running", + // // "Swimming", + // // "Triathlon", + // // "Hiking", + // // "Football", + // // "Rugby" + // // ], + // // onItemSelected: _onSportSelected, + // // leadingImage: Image.asset( + // // "assets/images/png/Vector (4).png", + // // width: 18.w, + // // height: 17.h, + // // ), + // // showOtherOption: true, + // // initiallySelected: _selectedSports, + // // ), + // // CustomDropDownRadio( + // // showOtherOption: true, + // // header: _selectedsportType ?? + // // "Rowing, Rugby, Swimming", + // // title: "", + // // listData: [ + // // "Rowing", + // // "Cycling", + // // "Running", + // // "Swimming", + // // "Triathlon", + // // "Hiking", + // // "Football", + // // "Rugby" + // // ], + // // onItemSelected: _onSportSelected, + // // leadingImage: Image.asset( + // // "assets/images/png/Vector (4).png", + // // width: 18.w, + // // height: 17.h, + // // ), + // // ), + + // sizedBoxHeight(20.h), + // text16400white("About"), + // sizedBoxHeight(16.h), + // CustomTextFormField2( + // textEditingController: aboutController, + // hintText: + // "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", + // maxlines: 3, + // ), + // // sizedBoxHeight(20.h), + + // text16400white("Position"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: positionController, + // hintText: "Lorem Ipsum", + // ), + // sizedBoxHeight(20.h), + // text16400white("Training Scores"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: + // trainingScoresController, + // hintText: "50", + // ), + // sizedBoxHeight(20.h), + // text16400white("Height"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: heightController, + // hintText: "6 feet", + // ), + // sizedBoxHeight(20.h), + // text16400white("Weight"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: weightController, + // hintText: "70kg", + // ), + // sizedBoxHeight(20.h), + // text16400white("Batting Average"), + // sizedBoxHeight(16.h), + // CustomTextFormField( + // textEditingController: battingAvgController, + // hintText: "372", + // ), + // sizedBoxHeight(20.h), + // sizedBoxHeight(60.h), + // CommonBtn( + // text: "Save", + // onTap: () { + // saveEditProfileInd(); + // }, + // ), + // sizedBoxHeight(60.h), + // ], + // ) + // ]))) + // ]); + // } + // return Container(); + // })); } } 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 f313a88..fe9ef93 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_reaction_button/flutter_reaction_button.dart'; @@ -7,13 +6,19 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonBottomNavigationBar.dart'; 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/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Global.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:shared_preferences/shared_preferences.dart'; +import 'package:intl/intl.dart'; class ProfileTab extends StatefulWidget { const ProfileTab({super.key}); @@ -22,6 +27,8 @@ class ProfileTab extends StatefulWidget { State createState() => _ProfileTabState(); } +//location + class _ProfileTabState extends State { List cardtile = [ { @@ -92,9 +99,6 @@ class _ProfileTabState extends State { String? interestText; @override void initState() { - // TODO: implement initState - setValues(); - individualfuture = EditProfileApi() .getEditProfileIndividual() .then((value) => {setValues()}); @@ -107,14 +111,7 @@ class _ProfileTabState extends State { setValues() async { if (isOnce) { - SharedPreferences prefs = await SharedPreferences.getInstance(); - accountTypeValue = prefs.getString('accountTypeValue'); - accounTypeLogin = prefs.getString('accountTypefromLogin'); - - if (getEditProfileIndi != null && - getEditProfileIndi!.data != null && - getEditProfileIndi!.data!.interest != null) { - // Join all interest names with a comma separator + if (getEditProfileIndi!.data!.interest != null) { interestText = getEditProfileIndi!.data!.interest!.map((e) => e.name).join(', '); } @@ -128,6 +125,8 @@ class _ProfileTabState extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); 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(); @@ -148,19 +147,58 @@ class _ProfileTabState extends State { } } + int? timelineremoveid; + + int? certificationsremoveid; + + RemoveTimelineUploadata() async { + utils.loader(); + Map updata = { + "timeline_id": timelineremoveid, + }; + final data = await Profilepostmethod().postRemoveTimeline(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + RemoveCertificationUploadata() async { + utils.loader(); + Map updata = { + "certification_id": certificationsremoveid, + }; + final data = await Profilepostmethod().postRemoveCertification(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + @override 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: globalAccountType == '1' ? FutureBuilder( future: individualfuture, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return Center( + return + // ShimmerCommon(); + + const Center( child: CircularProgressIndicator( color: Colors.blue, ), @@ -195,16 +233,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, @@ -244,20 +299,24 @@ class _ProfileTabState extends State { '@${getEditProfileIndi!.data!.userName}' ?? "@edward_01"), sizedBoxWidth(5.w), - Icon( - Icons.circle, - size: 5.sp, - color: Colors.white, - ), - sizedBoxWidth(5.w), - text18w400white("2,124 days") + // Icon( + // Icons.circle, + // size: 5.sp, + // color: Colors.white, + // ), + // sizedBoxWidth(5.w), + // text18w400white("2,124 days") ], ), sizedBoxHeight(15.h), GestureDetector( onTap: () { Get.toNamed( - RouteName.mynetwork); + RouteName.mynetwork, + // arguments: { + // "From": 'MainIndProfile', + // } + ); }, child: Container( height: 34.h, @@ -267,8 +326,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: @@ -302,7 +361,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( @@ -322,12 +382,15 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur( + text14400whiteblur(getEditProfileIndi! + .data!.location ?? "Elm street london, United Kingdom"), ], ), sizedBoxHeight(20.h), Row( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ commonContainer( width: 25.w, @@ -344,7 +407,9 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(interestText ?? ''), + Flexible( + child: text14400whiteblur( + interestText ?? '')), // interestText // text14400whiteblur(getEditProfileIndi! // .data!.interest! @@ -366,10 +431,14 @@ class _ProfileTabState extends State { Row( children: [ text18w700white("Timeline"), - Spacer(), + const Spacer(), InkWell( onTap: () { - Get.toNamed(RouteName.addtimeline); + Get.toNamed(RouteName.addtimeline, + arguments: { + 'id': 0, + 'edit': false, + }); }, child: Image.asset( "assets/images/png/iconamoon_edit-thin.png", @@ -380,91 +449,612 @@ class _ProfileTabState extends State { ], ), sizedBoxHeight(20.h), - SizedBox( - height: 300.h, - child: ListView.builder( - shrinkWrap: true, - itemCount: timeline.length, - itemBuilder: (context, index) { - return commonTimelineCard( - imagePath: timeline[index] - ["imagePath"], - title: timeline[index] - ["title"]); - }, - )), + getEditProfileIndi!.data!.timelines!.isEmpty + ? Center( + child: + text16400white("Add timeline")) + : SizedBox( + height: 200.h, + child: ListView.builder( + shrinkWrap: true, + itemCount: getEditProfileIndi! + .data!.timelines!.length, + itemBuilder: (context, index) { + DateTime startDate = + DateTime.parse( + getEditProfileIndi! + .data! + .timelines![index] + .startDate!); + DateTime endDate = + DateTime.parse( + getEditProfileIndi! + .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 = + getEditProfileIndi!.data! + .timelines![index]; + + // List> + // abilities = + // timeline.abilities! + // .map((ability) => { + // 'id': ability.id, + // 'name': + // ability.name, + // }) + // .toList(); + return + // commonTimelineCard( + // imagePath: getEditProfileIndi + // ?.data + // ?.profileImage ?? + // '', + // title: getEditProfileIndi! + // .data! + // .timelines![index] + // .clubName!, + // role: getEditProfileIndi! + // .data! + // .timelines![index] + // .roleName!, + // teamname: getEditProfileIndi! + // .data! + // .timelines![index] + // .teamName!, + // abilities: abilities, + // id: getEditProfileIndi!.data! + // .timelines![index].id, + // starttoend: startToEnd, + // ); + 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: const BoxDecoration( + color: Colors + .white, + shape: BoxShape + .circle)), + ), + Positioned( + right: 3.w, + child: Container( + width: 1.w, + height: 170.h, + decoration: + const 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: [ + getEditProfileIndi?.data?.profilePhoto == null || getEditProfileIndi!.data!.profilePhoto!.isEmpty + ? CircleAvatar(radius: 10.r, backgroundImage: const AssetImage('assets/images/png/cimg1.png')) + : CircleAvatar(radius: 10.r, backgroundImage: NetworkImage(getEditProfileIndi!.data!.profilePhoto!)), + sizedBoxWidth( + 8.w), + getEditProfileIndi!.data!.timelines![index].clubName == null || getEditProfileIndi!.data!.timelines![index].clubName!.isEmpty + ? text14700white('Regroup') + : text14700white(getEditProfileIndi!.data!.timelines![index].clubName!) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + InkWell( + onTap: + () { + setState(() { + timelineremoveid = getEditProfileIndi!.data!.timelines![index].id ?? 0; + getEditProfileIndi!.data!.timelines!.removeWhere((item) => item.id! == timelineremoveid); + // .removeAt(index); + RemoveTimelineUploadata(); + }); + }, + child: SizedBox( + width: 20.w, + height: 20.h, + child: const Icon( + Icons.delete, + color: Colors.white, + )), + ), + sizedBoxWidth( + 10.w), + InkWell( + onTap: + () { + // setState( + // () { + // timelineremoveid = + // getEditProfileIndi!.data!.timelines![index].id ?? 0; + // getEditProfileIndi!.data!.timelines!.removeWhere((item) => + // item.id! == + // timelineremoveid); + // // .removeAt(index); + // RemoveTimelineUploadata(); + // }); + + Get.toNamed(RouteName.addtimeline, arguments: { + 'id': getEditProfileIndi!.data!.timelines![index].id, + 'edit': true, + }); + }, + child: + Padding( + padding: EdgeInsets.only(top: 4.h), + child: SizedBox( + width: 20.w, + height: 20.h, + child: Image.asset( + "assets/images/png/iconamoon_edit-thin.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ) + ], + ) + ], + ), + sizedBoxHeight( + 10.h), + getEditProfileIndi!.data!.timelines![index].roleName == + null || + getEditProfileIndi! + .data! + .timelines![ + index] + .roleName! + .isEmpty + ? text12700white( + 'regroup') + : text12700white(getEditProfileIndi! + .data! + .timelines![ + index] + .roleName!), + sizedBoxHeight( + 10.h), + getEditProfileIndi!.data!.timelines![index].teamName == + null || + getEditProfileIndi! + .data! + .timelines![ + index] + .teamName! + .isEmpty + ? text12700white( + 'regroup') + : text12700white(getEditProfileIndi! + .data! + .timelines![ + index] + .teamName!), + sizedBoxHeight( + 10.h), + startToEnd + .isEmpty + ? text12400white( + 'No date') + : text12400white( + startToEnd), + sizedBoxHeight( + 10.h), + getEditProfileIndi!.data!.timelines![index].abilities == + null || + getEditProfileIndi! + .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: + // getEditProfileIndi!.data!.timelines![index].abilities!.length, + // itemBuilder: + // (context, index) { + // String abilityName = getEditProfileIndi!.data!.timelines![index].abilities![index].name!; + // // String abilitiesString = abilities.map((ability) => ability['name']).join(', '); + // return Padding( + // padding: EdgeInsets.only(right: 8.w), + // child: text10400whiteblur(abilityName), + // ); + + // // if (index < abilities.length) { + // // // String abilityName = abilities[index]['name']; + // // String abilitiesString = abilities.map((ability) => ability['name']).join(', '); + // // return Padding( + // // padding: EdgeInsets.only(right: 8.w), + // // child: text10400whiteblur(abilitiesString), + // // ); + // // } else { + // // return SizedBox(); + // // } + // }, + // ), + // ), + Container( + height: + 30.h, // Adjust the height as needed + child: + ListView.builder( + shrinkWrap: + true, + scrollDirection: + Axis.horizontal, + itemCount: + getEditProfileIndi!.data!.timelines![index].abilities!.length, + itemBuilder: + (context, innerIndex) { + 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(formattedNames), + ); + }, + ), + ), + ], + ), + ), + // border: 1 + ), + ], + ), + ), + ], + ); + }, + )), + sizedBoxHeight(30.h), ]), ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + text18w700white( + "Certifications/Qualifications"), + const Spacer(), + InkWell( + onTap: () { + Get.toNamed(RouteName.certificate, + arguments: { + 'id': getEditProfileIndi! + .data!.id, + }); + }, + child: text16400white('View more')) + ], + ), + sizedBoxHeight(20.h), + getEditProfileIndi! + .data!.certifications!.isEmpty + ? Center( + child: text16400white( + "No certificates added")) + : SizedBox( + height: 100.h, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + // padding: + // EdgeInsets.only(left: 16.w), + physics: const ScrollPhysics(), + itemCount: getEditProfileIndi! + .data!.certifications!.length, + itemBuilder: (context, index) { + 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: [ + getEditProfileIndi! + .data! + .certifications![ + index] + .certificationImage == + null || + getEditProfileIndi! + .data! + .certifications![ + index] + .certificationImage! + .isEmpty + ? Image.asset( + 'assets/images/png/image 17.png', + width: + 57.w, + height: + 40.h, + ) + : Image + .network( + getEditProfileIndi! + .data! + .certifications![ + index] + .certificationImage!, + width: + 77.w, + height: + 100.h, + ), + sizedBoxWidth( + 20.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + getEditProfileIndi!.data!.certifications![index].certificationName == + null || + getEditProfileIndi! + .data! + .certifications![ + index] + .certificationName! + .isEmpty + ? text12400white( + 'Regroup') + : text12400white(getEditProfileIndi! + .data! + .certifications![ + index] + .certificationName!), + sizedBoxHeight( + 4.h), + getEditProfileIndi!.data!.certifications![index].certificationReason == + null || + getEditProfileIndi! + .data! + .certifications![ + index] + .certificationReason! + .isEmpty + ? text9400white( + 'Regroup') + : text9400white(getEditProfileIndi! + .data! + .certifications![ + index] + .certificationName!), + sizedBoxHeight( + 4.h), + getEditProfileIndi!.data!.certifications![index].certificationDate == + null || + getEditProfileIndi! + .data! + .certifications![index] + .certificationDate! + .isEmpty + ? Text( + 'Regroup', + style: TextStyle( + fontSize: 9.sp, + fontWeight: FontWeight.w400, + color: const Color(0xffFFFFFF).withOpacity(0.70), + fontFamily: 'Helvetica'), + ) + : Text( + 'Issued ${DateFormat('MMM yyyy').format(DateTime.parse(getEditProfileIndi!.data!.certifications![index].certificationDate!))}', + style: TextStyle( + fontSize: 9.sp, + fontWeight: FontWeight.w400, + color: const Color(0xffFFFFFF).withOpacity(0.70), + fontFamily: 'Helvetica'), + ) + ], + ), + const Spacer(), + InkWell( + onTap: () { + setState( + () { + certificationsremoveid = + getEditProfileIndi!.data!.certifications![index].id ?? + 0; + getEditProfileIndi! + .data! + .certifications! + .removeWhere((item) => + item.id! == + certificationsremoveid); + // .removeAt(index); + RemoveCertificationUploadata(); + }); + }, + child: + const Icon( + Icons + .delete, + color: Colors + .white, + )) + ], + ), + )), + sizedBoxWidth(20.w), + ], + ); + }, + )), + sizedBoxHeight(10.h), + InkWell( + onTap: () { + Get.toNamed( + RouteName.addcertificate, + ); + }, + child: Align( + alignment: Alignment.centerRight, + child: text18w400white( + 'Add certificate'))), + sizedBoxHeight(25.h), + ]), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - sizedBoxHeight(30.h), - Row( - children: [ - text16w700white( - "Certifications/Qualifications"), - Spacer(), - InkWell( - onTap: () { - Get.toNamed(RouteName.certificate); - }, - child: text12400white("View more")), - ], - ), - sizedBoxHeight(20.h), - SizedBox( - height: 85.h, + text18w700white("Groups"), + InkWell( + onTap: () { + Get.toNamed(RouteName.group, + arguments: { + 'id': + getEditProfileIndi!.data!.id, + }); + }, + child: text16400white('View more')) + ], + ), + ), + sizedBoxHeight(20.h), + getEditProfileIndi!.data!.myJoinedGroups!.isEmpty + ? Center( + child: + text16400white("No groups available")) + : SizedBox( + height: 190.h, + width: double.infinity, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, - itemCount: certificationData.length, + padding: EdgeInsets.only(left: 16.w), + itemCount: getEditProfileIndi! + .data!.myJoinedGroups!.length, itemBuilder: (context, index) { return Padding( padding: EdgeInsets.only(right: 20.w), - child: certificationCardTile( - imagePath: - certificationData[index] - ["imagePath"], - title: certificationData[index] - ["title"], - subtitle: certificationData[index] - ["subtitle"], - date: certificationData[index] - ["date"]), + child: profilecardtile( + imagePath: getEditProfileIndi! + .data! + .myJoinedGroups![index] + .groupData! + .groupImage ?? + '', + // cardtile[index]["imagePath"], + title: getEditProfileIndi! + .data! + .myJoinedGroups![index] + .groupData! + .title! + + // cardtile[index]["title"] + ), ); }, ), ), - sizedBoxHeight(30.h), - text18w400white("Subgroups"), - sizedBoxHeight(20.h), - ], - ), - ), - SizedBox( - height: 190.h, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - padding: EdgeInsets.only(left: 16.w), - itemCount: cardtile.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 20.w), - child: profilecardtile( - imagePath: cardtile[index]["imagePath"], - title: cardtile[index]["title"]), - ); - }, - ), - ), - sizedBoxHeight(30.h), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: text18w700white("Activity"), - ), normalcardtile( profileImg: 'assets/images/png/Ellipse 48.png', title: 'Jocelyn Dokidis', @@ -490,7 +1080,7 @@ class _ProfileTabState extends State { sizedBoxHeight(20.h), Row( children: [ - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed(RouteName.settings); @@ -521,11 +1111,15 @@ class _ProfileTabState extends State { return Container(); }, ) + + //BusProfile : FutureBuilder( future: businessfuture, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return Center( + return + // ShimmerCommon(); + const Center( child: CircularProgressIndicator( color: Colors.blue, ), @@ -560,16 +1154,33 @@ class _ProfileTabState extends State { Stack( children: [ Container( - height: 484.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/Rectangle 49 (1).png", - fit: BoxFit.cover, - ), - ), + height: 484.h, + width: double.infinity, + child: getEditProfileBus!.data! + .businessProfileImage == + null || + getEditProfileBus!.data! + .businessProfileImage!.isEmpty + ? Image.asset( + "assets/images/png/profileimg.png", + fit: BoxFit.cover, + ) + : Image.network( + getEditProfileBus! + .data!.businessProfileImage!, + 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, @@ -612,7 +1223,11 @@ class _ProfileTabState extends State { GestureDetector( onTap: () { Get.toNamed( - RouteName.followers); + RouteName.followers, + arguments: { + "From": + 'MainBusProfile', + }); }, child: Column( children: [ @@ -639,7 +1254,7 @@ class _ProfileTabState extends State { width: 1.0, ), boxShadow: [ - BoxShadow( + const BoxShadow( color: Color(0x66000000), offset: Offset(0, 4), @@ -652,7 +1267,11 @@ class _ProfileTabState extends State { GestureDetector( onTap: () { Get.toNamed( - RouteName.following); + RouteName.following, + arguments: { + "From": + 'MainBusProfile', + }); }, child: Column( children: [ @@ -697,7 +1316,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), ), @@ -731,7 +1350,7 @@ class _ProfileTabState extends State { sizedBoxHeight(30.h), text18w700white("About"), sizedBoxHeight(10.h), - text14400white( + text14400white(getEditProfileBus!.data!.bio ?? "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), sizedBoxHeight(25.h), Row( @@ -823,7 +1442,9 @@ class _ProfileTabState extends State { // text14400whiteblur(getEditProfileIndi! // .data!.interest! // .join(', ')), - text14400whiteblur("Founded at : 2010"), + text14400whiteblur( + getEditProfileBus!.data!.foundedon ?? + "Founded at : 2010"), ], ), sizedBoxHeight(30.h), @@ -860,7 +1481,7 @@ class _ProfileTabState extends State { sizedBoxHeight(20.h), Row( children: [ - Spacer(), + const Spacer(), InkWell( onTap: () { Get.toNamed(RouteName.settings); @@ -891,57 +1512,19 @@ class _ProfileTabState extends State { return Container(); }, ), - bottomNavigationBar: bottomnavigationbar(mainController), ); } - Widget certificationCardTile({ - required String imagePath, - required String title, - required String subtitle, - required String date, + Widget commonTimelineCard({ + required String? imagePath, + required String? title, + required String? role, + required String? teamname, + required String? starttoend, + required int? id, + required List>? abilities, }) { - return commonGlassUI( - width: 270.w, - height: 70.h, - borderRadius: BorderRadius.circular(10.r), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: 40.h, - width: 57.w, - child: Image.asset( - imagePath, - fit: BoxFit.cover, - ), - ), - sizedBoxWidth(10.w), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - text12400white(title), - sizedBoxHeight(5.h), - text9400white(subtitle), - sizedBoxHeight(5.h), - text9400white(date) - ], - ), - ), - ], - ), - ), - // border: 1 - ); - } - - Widget commonTimelineCard( - {required String imagePath, required String title}) { return Row( children: [ Container( @@ -955,7 +1538,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( @@ -963,7 +1546,7 @@ class _ProfileTabState extends State { child: Container( width: 1.w, height: 170.h, - decoration: BoxDecoration(color: Colors.white), + decoration: const BoxDecoration(color: Colors.white), ), ), ], @@ -975,31 +1558,104 @@ class _ProfileTabState extends State { children: [ commonGlassUI( width: double.infinity, - height: 145.h, + height: 155.h, borderRadius: BorderRadius.circular(10.r), customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), + 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: [ - CircleAvatar( - radius: 10.r, - backgroundImage: AssetImage(imagePath), + Row( + children: [ + imagePath == null || imagePath.isEmpty + ? CircleAvatar( + radius: 10.r, + backgroundImage: const AssetImage( + 'assets/images/png/cimg1.png')) + : CircleAvatar( + radius: 10.r, + backgroundImage: NetworkImage(imagePath)), + sizedBoxWidth(8.w), + title == null || title.isEmpty + ? text14700white('Regroup') + : text14700white(title) + ], ), - sizedBoxWidth(8.w), - text14700white(title) + InkWell( + onTap: () { + setState(() { + timelineremoveid = id; + }); + + // Get.toNamed(RouteName.addtimeline, arguments: { + // 'id': id, + // 'edit': true, + // }); + }, + child: SizedBox( + width: 20.w, + height: 20.h, + child: Image.asset( + "assets/images/png/iconamoon_edit-thin.png", + height: 14.h, + width: 14.w, + ), + ), + ) ], ), sizedBoxHeight(10.h), - text12700white("Team captain"), - sizedBoxHeight(8.h), - text12400white("April 2023 - May 2024"), + role == null || role.isEmpty + ? text12700white('regroup') + : text12700white(role), sizedBoxHeight(10.h), - text10400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry.") + teamname == null || teamname.isEmpty + ? text12700white('regroup') + : text12700white(teamname), + sizedBoxHeight(10.h), + starttoend == null || starttoend.isEmpty + ? text12400white('No date') + : text12400white(starttoend), + sizedBoxHeight(10.h), + abilities == null || abilities.isEmpty + ? text10400whiteblur('No data') + : + // ListView.builder( + // shrinkWrap: true, + // scrollDirection: Axis.horizontal, + // padding: EdgeInsets.only(left: 16.w), + // itemCount: abilities.length, + // itemBuilder: (context, index) { + // return + // text10400whiteblur(abilities.toString()); + + // }, + // ), + + Container( + height: 30.h, // Adjust the height as needed + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + itemCount: abilities.length, + itemBuilder: (context, index) { + if (index < abilities.length) { + String abilityName = + abilities[index]['name']; + return Padding( + padding: EdgeInsets.only(right: 8.w), + child: text10400whiteblur(abilityName), + ); + } else { + return const SizedBox(); + } + }, + ), + ), ], ), ), @@ -1059,7 +1715,7 @@ class _ProfileTabState extends State { sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -1068,12 +1724,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( @@ -1091,7 +1747,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -1101,7 +1757,7 @@ class _ProfileTabState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -1117,7 +1773,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -1127,7 +1783,7 @@ class _ProfileTabState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -1143,7 +1799,7 @@ class _ProfileTabState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -1208,7 +1864,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, @@ -1291,11 +1947,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), @@ -1368,7 +2025,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), @@ -1376,7 +2033,7 @@ class _ProfileTabState extends State { )); } - Widget profilecardtile({required String imagePath, required String title}) { + Widget profilecardtile({required String? imagePath, required String? title}) { return Column( children: [ Container( @@ -1385,10 +2042,26 @@ class _ProfileTabState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.r), ), - child: Image.asset(imagePath), + 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, 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/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart new file mode 100644 index 0000000..fd01570 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:image_cropper/image_cropper.dart'; + +class UserIndiProfileImageController extends GetxController { + RxString usserprofilePicPath = "".obs; + + void getImage(ImageSource imgSource) async { + final ImagePicker picker = ImagePicker(); + print('profilePicPath $usserprofilePicPath'); + final XFile? pickedImg = await picker.pickImage(source: imgSource); + if (pickedImg != null) { + final CroppedFile? croppedImg = await ImageCropper().cropImage( + sourcePath: pickedImg.path, + aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1), + compressFormat: ImageCompressFormat.jpg, + maxHeight: 512, + maxWidth: 512, + compressQuality: 100, + cropStyle: CropStyle.circle, + aspectRatioPresets: [ + CropAspectRatioPreset.square, + ], + uiSettings: [ + AndroidUiSettings( + toolbarTitle: "Crop Image", + toolbarColor: Get.theme.appBarTheme.backgroundColor, + backgroundColor: Colors.black, + activeControlsWidgetColor: Colors.red, + cropFrameColor: Colors.white, + cropGridColor: Colors.white, // Ensure this matches the theme + cropGridColumnCount: 2, // Add to make the grid lines prominent + cropGridRowCount: 2, // Add to make the grid lines prominent + lockAspectRatio: true, // Ensure the aspect ratio is locked + ), + IOSUiSettings( + title: 'Crop Image', + ), + ], + ); + if (croppedImg != null) { + usserprofilePicPath.value = croppedImg.path; + } + } +} +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart new file mode 100644 index 0000000..2913eb4 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:image_cropper/image_cropper.dart'; + +class UserProfileImageController extends GetxController { + RxString usserprofilePicPath = "".obs; + + void getImage(ImageSource imgSource) async { + final ImagePicker picker = ImagePicker(); + print('profilePicPath $usserprofilePicPath'); + final XFile? pickedImg = await picker.pickImage(source: imgSource); + if (pickedImg != null) { + final CroppedFile? croppedImg = await ImageCropper().cropImage( + sourcePath: pickedImg.path, + aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1), + compressFormat: ImageCompressFormat.jpg, + maxHeight: 512, + maxWidth: 512, + compressQuality: 100, + cropStyle: CropStyle.circle, + aspectRatioPresets: [ + CropAspectRatioPreset.square, + ], + uiSettings: [ + AndroidUiSettings( + toolbarTitle: "Crop Image", + toolbarColor: Get.theme.appBarTheme.backgroundColor, + backgroundColor: Colors.black, + activeControlsWidgetColor: Colors.red, + cropFrameColor: Colors.white, + cropGridColor: Colors.white, // Ensure this matches the theme + cropGridColumnCount: 2, // Add to make the grid lines prominent + cropGridRowCount: 2, // Add to make the grid lines prominent + lockAspectRatio: true, // Ensure the aspect ratio is locked + ), + IOSUiSettings( + title: 'Crop Image', + ), + ], + ); + if (croppedImg != null) { + usserprofilePicPath.value = croppedImg.path; + } + } +} +} 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 f31a781..85524f2 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart @@ -1,3 +1,5 @@ + + import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; @@ -7,6 +9,9 @@ import 'package:shared_preferences/shared_preferences.dart'; GetEditProfileIndi? getEditProfileIndi; GetEditProfileBus? getEditProfileBus; +List listofUserInterests = []; + +bool accountvisibility = true; class EditProfileApi { EditProfileApi(); @@ -27,23 +32,33 @@ class EditProfileApi { } Future> getEditProfileIndividual() async { - final response = await NetworkApiServices().getApi( - ApiUrls.geteditprofile, - ); - getEditProfileIndi = GetEditProfileIndi.fromJson(response.data); + final response = await NetworkApiServices().getApi(ApiUrls.geteditprofile); + if (response.status == ResponseStatus.SUCCESS) { if (response.data["status"] == "success") { - print("Success---->"); - return ResponseData( - response.data['message'], ResponseStatus.SUCCESS, - data: response.data); + getEditProfileIndi = GetEditProfileIndi.fromJson(response.data); + accountvisibility = getEditProfileIndi!.data!.accountVisibility == 1; + getUserIntersetFromResponse(); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + + getUserIntersetFromResponse() { + for (var interests in getEditProfileIndi!.data!.interest!) { + String interestName = interests.name ?? "null"; + int index = listofUserInterests.indexOf(interestName); + if (index != -1) { + listofUserInterests[index] = interestName; } else { - return ResponseData( - response.data['message'], ResponseStatus.FAILED); + listofUserInterests.add(interestName); } } - - return response; } Future> postEditProfileBusiness(var data) async { @@ -65,8 +80,9 @@ class EditProfileApi { final response = await NetworkApiServices().getApi( ApiUrls.geteditprofilebusiness, ); - getEditProfileBus = GetEditProfileBus.fromJson(response.data); if (response.status == ResponseStatus.SUCCESS) { + getEditProfileBus = GetEditProfileBus.fromJson(response.data); + if (response.data["status"] == "success") { print("Success---->"); return ResponseData( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart new file mode 100644 index 0000000..fc9968c --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart @@ -0,0 +1,37 @@ + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart'; + +InterestModel? interestlistobj; +List listofInterests = []; + +class InterestListApi { + InterestListApi(); + var data = ""; + Future> getinterestlistApi() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getinterestlist, + ); + + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + interestlistobj = InterestModel.fromJson(responseData); + getIntersetFromResponse(); + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } + + getIntersetFromResponse() { + for (var interests in interestlistobj!.data!) { + listofInterests.add(interests.name ?? "null"); + } + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart index 19fcb62..8117225 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart @@ -5,6 +5,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; @@ -13,6 +15,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'; class Followers extends StatefulWidget { @@ -24,12 +27,32 @@ class Followers extends StatefulWidget { class _FollowersState extends State { StreamController searchcontroller = StreamController(); + StreamController guestsearchcontroller = + StreamController(); + var guestUserid = Get.arguments['UpdataGuestIdfollowers'] ?? ''; + + var fromBusFollower = Get.arguments['From'] ?? ''; + var guestUserBusid = Get.arguments['UpdataGuestBusIdfollowers'] ?? ''; + var fromMainBusProfile = Get.arguments['From'] ?? ''; @override void initState() { // TODO: implement initState var updata = ""; - Profilegetmethod().getFollowers(updata, streamController: searchcontroller); + if (fromMainBusProfile == 'MainBusProfile') { + Profilegetmethod() + .getFollowers(updata, streamController: searchcontroller); + } + + var guestupdata = ""; + + if (fromBusFollower == 'GuestBusFollowers') { + GuestProfileApi().getGuestfollowers(guestUserBusid, guestupdata, + streamController: guestsearchcontroller); + } else { + GuestProfileApi().getGuestfollowers(guestUserid, guestupdata, + streamController: guestsearchcontroller); + } super.initState(); } @@ -81,305 +104,671 @@ class _FollowersState 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: "Followers", ), resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Column(children: [ - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), - ), - ), - texttype: TextInputType.text, - inputFormatters: [ - RemoveEmojiInputFormatter(), - ], - onInput: (value) { - Profilegetmethod().getFollowers(value, - streamController: searchcontroller); - }, - hintText: "Search people", + body: fromMainBusProfile == 'MainBusProfile' + ? Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), - ), - sizedBoxHeight(25.h), - StreamBuilder( - stream: searchcontroller.stream, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - // Display shimmer effect while waiting for data - return Center(child: CircularProgressIndicator()); - } else if (snapshot.hasError) { - // Handle error state - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18), - ), - ); - } else { - // Data has been loaded, show actual UI - return followersobj!.data!.isEmpty - ? _buildNoDataBody(context) - : - // ListView.builder( - // shrinkWrap: true, - // itemCount: followersobj!.data!.length, - // itemBuilder: (context, index) { - // return Column( - // children: [ - // followerWidget( - // imagePath: followersobj?.data?[index] - // .follower?.profilePhoto ?? - // "", - // // followersData[index]["imagePath"], - // title: followersobj?.data?[index].follower - // ?.fullName ?? - // "", - // // followersData[index]["title"], - // subtitle: followersobj?.data?[index] - // .follower?.userName ?? - // "", - // blockonTap: () { - // BlockUploadata(followersobj! - // .data![index].follower!.id); - // } - // // followersData[index]["subtitle"] - // ), - // if (index != followersobj!.data!.length - 1) - // commonDivider(), - // ], - // ); - // }, - // ); - - ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followersobj!.data!.length, - separatorBuilder: - (BuildContext context, int index) { - return commonDivider(); + Column(children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Profilegetmethod().getFollowers(value, + streamController: searchcontroller); }, - itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - followersobj!.data![index].follower! - .profilePhoto == - null || - followersobj! - .data![index] - .follower! - .profilePhoto! - .isEmpty - ? CircleAvatar( - backgroundImage: AssetImage( - 'assets/images/png/Ellipse 43.png'), - radius: 25.r, - ) - : CircleAvatar( - backgroundImage: NetworkImage( - followersobj! - .data![index] - .follower! - .profilePhoto!), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - followersobj!.data![index].follower! - .fullName == - null || - followersobj! - .data![index] - .follower! - .fullName! - .isEmpty == - true - ? text16w400_FCFCFC("Regroup") - : text16w400_FCFCFC( - followersobj!.data![index] - .follower!.fullName!), - sizedBoxHeight(4.h), - followersobj!.data![index].follower! - .userName == - null || - followersobj! - .data![index] - .follower! - .userName! - .isEmpty == - true - ? text12w400_FCFCFC_blur( - "regroup") - : text12w400_FCFCFC_blur( - followersobj!.data![index] - .follower!.userName!) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext - context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async { - setState(() { - removeid = followersobj! - .data![index] - .follower! - .id ?? - 0; - followersobj!.data! - .removeWhere((item) => - item.follower! - .id == - removeid); - RemoveUploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async { - setState(() { - blockid = followersobj! - .data![index] - .follower! - .id ?? - 0; - followersobj!.data! - .removeWhere((item) => - item.follower! - .id == - blockid); - BlockUploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), - ), - )), - ], - ), - ) - ], + hintText: "Search people", + ), + ), + sizedBoxHeight(25.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return const Center( + child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), ); + } else { + // Data has been loaded, show actual UI + return followersobj!.data!.isEmpty + ? _buildNoDataBody(context) + : + // ListView.builder( + // shrinkWrap: true, + // itemCount: followersobj!.data!.length, + // itemBuilder: (context, index) { + // return Column( + // children: [ + // followerWidget( + // imagePath: followersobj?.data?[index] + // .follower?.profilePhoto ?? + // "", + // // followersData[index]["imagePath"], + // title: followersobj?.data?[index].follower + // ?.fullName ?? + // "", + // // followersData[index]["title"], + // subtitle: followersobj?.data?[index] + // .follower?.userName ?? + // "", + // blockonTap: () { + // BlockUploadata(followersobj! + // .data![index].follower!.id); + // } + // // followersData[index]["subtitle"] + // ), + // if (index != followersobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + // }, + // ); + + ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: followersobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var mainFollowersData = + followersobj!.data![index]; + return GestureDetector( + onTap: () { + mainFollowersData.follower! + .principleTypeXid == + 1 + ? Get.toNamed( + RouteName + .profiletabindguest, + arguments: { + "FolloweridIndex": + mainFollowersData + .iamPrincipalXid!, + }) + : Get.toNamed( + RouteName + .profiletabbusguest, + arguments: { + "FolloweridIndex": + mainFollowersData + .iamPrincipalXid!, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, + horizontal: 16.w), + child: Row( + children: [ + mainFollowersData.follower! + .profilePhoto == + null || + mainFollowersData + .follower! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: + const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + mainFollowersData + .follower! + .profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + mainFollowersData + .follower! + .fullName == + null || + mainFollowersData + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC( + "Regroup") + : text16w400_FCFCFC( + mainFollowersData + .follower! + .fullName!), + sizedBoxHeight(4.h), + mainFollowersData + .follower! + .userName == + null || + mainFollowersData + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + mainFollowersData + .follower! + .userName!) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color( + 0xFF222935), + constraints: + BoxConstraints + .tightFor( + width: + 176.w), + offset: + const Offset(0, 20), + color: const Color( + 0xFF222935), + tooltip: "", + itemBuilder: + (BuildContext + context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: + () async { + setState( + () { + removeid = + followersobj!.data![index].follower!.id ?? + 0; + followersobj!.data!.removeWhere((item) => + item.follower!.id == + removeid); + RemoveUploadata(); + }); + }, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Remove user"), + const Spacer(), + Image + .asset( + "assets/images/png/fluent_delete-28-regular.png", + height: + 15.h, + width: + 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: + () {}, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image + .asset( + "assets/images/png/fluent_chat-20-regular.png", + height: + 20.h, + width: + 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: + () async { + setState( + () { + blockid = + followersobj!.data![index].follower!.id ?? + 0; + followersobj!.data!.removeWhere((item) => + item.follower!.id == + blockid); + BlockUploadata(); + }); + }, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Block user"), + const Spacer(), + Image + .asset( + "assets/images/png/blockchat.png", + height: + 25.h, + width: + 25.w, + ) + ], + ), + ), + ), + ], + child: SizedBox( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ) + ], + ), + ); + }, + ); + } + }, + ), + ]) + ]) + ]) + : Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column(children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + if (fromBusFollower == 'GuestBusFollowers') { + GuestProfileApi().getGuestfollowers( + guestUserBusid, value, + streamController: guestsearchcontroller); + } + GuestProfileApi().getGuestfollowers( + guestUserid, value, + streamController: guestsearchcontroller); }, - ); - } - }, - ), - ]) - ])) - ])); + hintText: "Search people", + ), + ), + sizedBoxHeight(25.h), + StreamBuilder( + stream: guestsearchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Expanded( + child: const Center( + child: CircularProgressIndicator()), + ); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return getguestfollowersobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: + getguestfollowersobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var guestFollowerData = + getguestfollowersobj!.data![index]; + return GestureDetector( + onTap: () { + guestFollowerData.follower! + .principleTypeXid == + 1 + ? Get.toNamed( + RouteName + .profiletabindguest, + arguments: { + "FolloweridIndex": + guestFollowerData + .iamPrincipalXid, + }) + : Get.toNamed( + RouteName + .profiletabbusguest, + arguments: { + "FolloweridIndex": + guestFollowerData + .iamPrincipalXid, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, + horizontal: 16.w), + child: Row( + children: [ + guestFollowerData.follower! + .profilePhoto == + null || + guestFollowerData + .follower! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: + const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + guestFollowerData + .follower! + .profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + guestFollowerData + .follower! + .fullName == + null || + guestFollowerData + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC( + "Regroup") + : text16w400_FCFCFC( + guestFollowerData + .follower! + .fullName!), + sizedBoxHeight(4.h), + guestFollowerData + .follower! + .userName == + null || + guestFollowerData + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + guestFollowerData + .follower! + .userName!) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color( + 0xFF222935), + constraints: + BoxConstraints + .tightFor( + width: + 176.w), + offset: + const Offset(0, 20), + color: const Color( + 0xFF222935), + tooltip: "", + itemBuilder: + (BuildContext + context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: + () async { + // setState( + // () { + // removeid = + // getguestfollowersobj!.data![index].follower!.id ?? + // 0; + // getguestfollowersobj!.data!.removeWhere((item) => + // item.follower!.id == + // removeid); + // RemoveUploadata(); + // }); + }, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + ""), + const Spacer(), + Image + .asset( + "assets/images/png/fluent_delete-28-regular.png", + height: + 15.h, + width: + 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: + () {}, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image + .asset( + "assets/images/png/fluent_chat-20-regular.png", + height: + 20.h, + width: + 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: + () async { + // setState( + // () { + // blockid = + // getguestfollowersobj!.data![index].follower!.id ?? + // 0; + // getguestfollowersobj!.data!.removeWhere((item) => + // item.follower!.id == + // blockid); + // BlockUploadata(); + // }); + }, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Block user"), + const Spacer(), + Image + .asset( + "assets/images/png/blockchat.png", + height: + 25.h, + width: + 25.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ) + ], + ), + ); + }, + ); + } + }, + ), + ]) + ]) + ])); } Widget _buildNoDataBody(context) { return Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( "No Data Found", diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart index ea23321..31bc182 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart @@ -5,6 +5,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; @@ -13,6 +16,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'; class Following extends StatefulWidget { @@ -24,12 +28,34 @@ class Following extends StatefulWidget { class _FollowingState extends State { StreamController searchcontroller = StreamController(); + StreamController guestsearchcontroller = + StreamController(); + + var guestUserid = Get.arguments['UpdataGuestIdfollowing'] ?? ''; + + var fromBusFollowing = Get.arguments['From'] ?? ''; + + var guestBusUserid = Get.arguments['UpdataGuestBusIdfollowing'] ?? ''; + + var fromMainBusProfile = Get.arguments['From'] ?? ''; @override void initState() { // TODO: implement initState var updata = ""; - Profilegetmethod().getFollowing(updata, streamController: searchcontroller); + if (fromMainBusProfile == 'MainBusProfile') { + Profilegetmethod() + .getFollowing(updata, streamController: searchcontroller); + } + + var guestupdata = ""; + if (fromBusFollowing == 'GuestBusFollowing') { + GuestProfileApi().getGuestfollowing(guestBusUserid, guestupdata, + streamController: guestsearchcontroller); + } else { + GuestProfileApi().getGuestfollowing(guestUserid, guestupdata, + streamController: guestsearchcontroller); + } super.initState(); } @@ -66,261 +92,562 @@ class _FollowingState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Following", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Column(children: [ - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: const CommonAppbar( + titleTxt: "Following", + ), + body: fromMainBusProfile == 'MainBusProfile' + ? Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: CustomTextFormField( + leadingIcon: SizedBox( height: 23, width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), ), + hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // Onboard().postGroupsearch({"search": value}, + // streamController: searchcontroller); + // searchGroups(value!); + Profilegetmethod().getFollowing(value, + streamController: searchcontroller); + }, ), ), - hintText: "Search people", - texttype: TextInputType.text, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - ], - onInput: (value) { - // Onboard().postGroupsearch({"search": value}, - // streamController: searchcontroller); - // searchGroups(value!); - Profilegetmethod().getFollowing(value, - streamController: searchcontroller); - }, - ), - ), - sizedBoxHeight(25.h), - StreamBuilder( - stream: searchcontroller.stream, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - // Display shimmer effect while waiting for data - return Center(child: CircularProgressIndicator()); - } else if (snapshot.hasError) { - // Handle error state - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18), - ), - ); - } else { - // Data has been loaded, show actual UI - return followingobj!.data!.isEmpty - ? _buildNoDataBody(context) - : ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followingobj!.data!.length, - separatorBuilder: - (BuildContext context, int index) { - return commonDivider(); - }, - itemBuilder: (context, index) { - return - // Column( - // children: [ - // Followinglist( - // imagePath: followingobj?.data?[index] - // .following?.profilePhoto ?? - // '', - // title: followingobj! - // .data?[index].following?.fullName ?? - // '', - // subtitle: followingobj! - // .data?[index].following?.userName ?? - // '', - // unfollowontap: (id) => Uploadata(id), - // unfollowindex: followingobj! - // .data![index].following!.id!, - // ), - // if (index != followingobj!.data!.length - 1) - // commonDivider(), - // ], - // ); - Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 16.h, horizontal: 16.w), - child: Row( + sizedBoxHeight(25.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followingobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: followingobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var mainFollowing = + followingobj!.data![index]; + return + // Column( + // children: [ + // Followinglist( + // imagePath: followingobj?.data?[index] + // .following?.profilePhoto ?? + // '', + // title: followingobj! + // .data?[index].following?.fullName ?? + // '', + // subtitle: followingobj! + // .data?[index].following?.userName ?? + // '', + // unfollowontap: (id) => Uploadata(id), + // unfollowindex: followingobj! + // .data![index].following!.id!, + // ), + // if (index != followingobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + GestureDetector( + onTap: () { + mainFollowing.following! + .principleTypeXid == + 1 + ? Get.toNamed( + RouteName.profiletabindguest, + arguments: { + "FollowingidIndex": mainFollowing + .followingIamPrincipalXid!, + }) + : Get.toNamed( + RouteName.profiletabbusguest, + arguments: { + "FollowingidIndex": mainFollowing + .followingIamPrincipalXid!, + }); + }, + child: Column( children: [ - followingobj!.data![index].following! - .profilePhoto == - null || - followingobj! - .data![index] - .following! - .profilePhoto! - .isEmpty - ? CircleAvatar( - backgroundImage: AssetImage( - 'assets/images/png/Ellipse 43.png'), - radius: 25.r, - ) - : CircleAvatar( - backgroundImage: NetworkImage( - followingobj! - .data![index] - .following! - .profilePhoto!), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - followingobj! - .data![index] - .following! - .fullName == - null || - followingobj! - .data![index] - .following! - .fullName! - .isEmpty - ? text16w400_FCFCFC("Regroup") - : text16w400_FCFCFC( - followingobj!.data![index] - .following!.fullName!), - sizedBoxHeight(4.h), - followingobj! - .data![index] - .following! - .userName == - null || - followingobj! - .data![index] - .following! - .userName! - .isEmpty - ? text12w400_FCFCFC_blur( - "regroup") - : text12w400_FCFCFC_blur( - followingobj!.data![index] - .following!.userName!) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext - context) => - [ - PopupMenuItem( - onTap: () async { - setState(() { - unfollowid = - followingobj! - .data![ - index] - .following! - .id ?? - 0; - // followingobj!.data!.removeAt(index); - followingobj!.data! - .removeWhere((item) => - item.following! - .id == - unfollowid); - Uploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Unfollow user"), - Spacer(), - Image.asset( - "assets/images/png/Black1323e.png", - height: 20.h, - width: 20.w, - ) - ], - ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + mainFollowing.following! + .profilePhoto == + null || + mainFollowing.following! + .profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: + const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: + NetworkImage( + mainFollowing + .following! + .profilePhoto!), + radius: 25.r, ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-22.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + mainFollowing.following! + .fullName == + null || + mainFollowing + .following! + .fullName! + .isEmpty + ? text16w400_FCFCFC( + "Regroup") + : text16w400_FCFCFC( + mainFollowing + .following! + .fullName!), + sizedBoxHeight(4.h), + mainFollowing.following! + .userName == + null || + mainFollowing + .following! + .userName! + .isEmpty + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + mainFollowing + .following! + .userName!) ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), ), - )), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: const Offset(0, 20), + color: + const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () async { + setState(() { + unfollowid = + mainFollowing + .following! + .id ?? + 0; + // followingobj!.data!.removeAt(index); + followingobj! + .data! + .removeWhere((item) => + item.following! + .id == + unfollowid); + Uploadata(); + }); + }, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Unfollow user"), + const Spacer(), + Image.asset( + "assets/images/png/Black1323e.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-22.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ), ], ), - ), - ], + ); + }, ); - }, - ); - } - }, - ), + } + }, + ), + ]) + ])) ]) - ])) - ])); + : Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // GuestProfileApi().getGuestfollowing(guestUserid, value, + // streamController: guestsearchcontroller); + if (fromBusFollowing == 'GuestBusFollowing') { + GuestProfileApi().getGuestfollowing( + guestBusUserid, value, + streamController: guestsearchcontroller); + } else { + GuestProfileApi().getGuestfollowing( + guestUserid, value, + streamController: guestsearchcontroller); + } + }, + ), + ), + sizedBoxHeight(25.h), + StreamBuilder( + stream: guestsearchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return const Center( + child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return getguestfollowingobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: + getguestfollowingobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var guestFollowing = + getguestfollowingobj!.data![index]; + return GestureDetector( + onTap: () { + guestFollowing.following! + .principleTypeXid == + 1 + ? Get.toNamed( + RouteName + .profiletabindguest, + arguments: { + "FollowingidIndex": + guestFollowing + .followingIamPrincipalXid!, + }) + : Get.toNamed( + RouteName + .profiletabbusguest, + arguments: { + "FollowingidIndex": + guestFollowing + .followingIamPrincipalXid!, + }, + ); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, + horizontal: 16.w), + child: Row( + children: [ + guestFollowing.following! + .profilePhoto == + null || + guestFollowing + .following! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: + const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: + NetworkImage( + guestFollowing + .following! + .profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + guestFollowing.following! + .fullName == + null || + guestFollowing + .following! + .fullName! + .isEmpty + ? text16w400_FCFCFC( + "Regroup") + : text16w400_FCFCFC( + guestFollowing + .following! + .fullName!), + sizedBoxHeight(4.h), + guestFollowing.following! + .userName == + null || + guestFollowing + .following! + .userName! + .isEmpty + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + guestFollowing + .following! + .userName!) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color( + 0xFF222935), + constraints: + BoxConstraints + .tightFor( + width: + 176.w), + offset: + const Offset(0, 20), + color: const Color( + 0xFF222935), + tooltip: "", + itemBuilder: + (BuildContext + context) => + [ + PopupMenuItem( + onTap: + () async { + // setState( + // () { + // unfollowid = + // getguestfollowingobj!.data![index].following!.id ?? + // 0; + // // followingobj!.data!.removeAt(index); + // getguestfollowingobj!.data!.removeWhere((item) => + // item.following!.id == + // unfollowid); + // Uploadata(); + // }); + }, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + ""), + const Spacer(), + Image + .asset( + "assets/images/png/Black1323e.png", + height: + 20.h, + width: + 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: + () {}, + child: + Padding( + padding: EdgeInsets.symmetric( + horizontal: + 12.w), + child: + Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image + .asset( + "assets/images/png/fluent_chat-20-22.png", + height: + 20.h, + width: + 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ), + ], + ), + ); + }, + ); + } + }, + ), + ]) + ])) + ], + ), + ); } Widget _buildNoDataBody(context) { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart deleted file mode 100644 index efda704..0000000 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart +++ /dev/null @@ -1,813 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.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/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class profiletabBusGest extends StatefulWidget { - const profiletabBusGest({super.key}); - - @override - State createState() => _profiletabBusGestState(); -} - -class _profiletabBusGestState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - // accountTypeValue == '1' || - body: - // FutureBuilder( - // future: businessfuture, - // builder: (ctx, snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // return Center( - // child: CircularProgressIndicator( - // color: Colors.blue, - // ), - // ); - // } - - // if (snapshot.hasError) { - // return Center( - // child: Text( - // '${snapshot.error} occurred', - // style: TextStyle(fontSize: 18.spMin), - // ), - // ); - // } - - // if (snapshot.connectionState == ConnectionState.done && - // snapshot.hasData) { - // print("Data fetched-->"); - // return - - Stack(clipBehavior: Clip.none, children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SafeArea( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - height: 484.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/Rectangle 49 (1).png", - fit: BoxFit.cover, - ), - ), - Positioned.fill( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color.fromRGBO(34, 41, 53, 0.1), - Color.fromRGBO(34, 41, 53, 0.79), - ], - stops: [ - 0.5788, - 0.8, - ], - ), - ), - ), - ), - Positioned( - bottom: 0, - right: 0, - left: 0, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - text20700white( - "Victory gear sports emporium"), - sizedBoxHeight(5.h), - text18w400white("@Victorygames_10"), - sizedBoxHeight(15.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.followers); - }, - child: Column( - children: [ - text16400white("254"), - sizedBoxHeight(6.h), - text12400whiteblur("Followers") - ], - ), - ), - sizedBoxWidth(20.w), - Container( - height: 58.h, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.white, - width: 1.0, - ), - boxShadow: [ - BoxShadow( - color: Color(0x66000000), - offset: Offset(0, 4), - blurRadius: 4.0, - ), - ], - ), - ), - sizedBoxWidth(20.w), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.following); - }, - child: Column( - children: [ - text16400white("344"), - sizedBoxHeight(6.h), - text12400whiteblur("Following") - ], - ), - ), - ], - ), - sizedBoxHeight(20.h), - ], - ), - ], - ), - ), - ), - ], - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.buseditprofile); - }, - child: Container( - height: 40.h, - width: 170.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - borderRadius: BorderRadius.circular(30.r), - ), - child: - Center(child: text16w400_FCFCFC("Follow")), - ), - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.shareProfile); - }, - child: commonGlassUI( - width: 170.w, - height: 40.h, - - opacity1: 0.05, - opacity2: 0.07, - borderRadius: BorderRadius.circular(30.r), - mainOpacity: 1, - customWidget: Center( - child: text16w400_FCFCFC("Message"), - ), - // border: 1, - ), - ) - ], - ), - sizedBoxHeight(30.h), - text18w700white("About"), - sizedBoxHeight(10.h), - text14400white( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), - sizedBoxHeight(25.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - text14400whiteblur("James Bothman"), - ], - ), - sizedBoxHeight(20.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/Vector2a.png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - text14400whiteblur("www.exampledummywebsite.com"), - ], - ), - sizedBoxHeight(20.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/Group 58645.png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - text14400whiteblur( - "Elm street london, United Kingdom"), - ], - ), - sizedBoxHeight(20.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/calender.png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - // text14400whiteblur(getEditProfileIndi! - // .data!.interest! - // .join(', ')), - text14400whiteblur("Founded at : 2010"), - ], - ), - sizedBoxHeight(30.h), - ], - ), - ), - sizedBoxHeight(30.h), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: text18w700white("Posts"), - ), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 48.png', - title: 'Jocelyn Dokidis', - mainImg: 'assets/images/png/Rectangle 46.png', - containerTitle: [ - 'Race', - 'Swimming', - 'Events', - 'Marathon', - 'Events' - ]), - sizedBoxHeight(120.h), - ], - ), - ), - ), - Positioned.fill( - top: 40.h, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - children: [ - sizedBoxHeight(20.h), - Row( - children: [ - Spacer(), - commonContainer( - width: 40.w, - height: 40.h, - borderwidth: 0.5, - boxShape: BoxShape.circle, - opacity1: 0.5, - opacity2: 0.6, - customWidget: PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () { - Get.toNamed(RouteName.shareProfile); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share profile', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 17.h, - width: 17.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Block user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/blocked.png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - ], - child: Center( - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - height: 20.h, - width: 20.w, - )), - ), - ), - ], - ), - ], - ), - ), - ), - ])); - } -} - -Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 50), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Container( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - // Get.toNamed(RouteName.cyclescreen); - }, - child: containertile(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - opacity1: 0.2, - opacity2: 0.2, - borderwidth: 0.43, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - opacity1: 0.2, - opacity2: 0.2, - borderwidth: 0.43, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - 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), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ) - ]), - ), - ], - ); -} - -Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); -} - -Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); -} - -Widget containertile({required String text}) { - return commonContainer( - width: 100.w, - height: 30.h, - borderRadius: BorderRadius.circular(30.r), - borderColor: Color(0xFFD90B2E), - borderwidth: 0.9, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); -} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart deleted file mode 100644 index 77a0c58..0000000 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart +++ /dev/null @@ -1,1138 +0,0 @@ -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'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class ProfileTabIndGuest extends StatefulWidget { - const ProfileTabIndGuest({super.key}); - - @override - State createState() => _ProfileTabIndGuestState(); -} - -class _ProfileTabIndGuestState extends State { - List cardtile = [ - { - "imagePath": "assets/images/png/Rectangle 29ss.png", - "title": "Cardio crusaders circle" - }, - { - "imagePath": "assets/images/png/Rectangle 31ee.png", - "title": "Strength squad syndicate" - }, - { - "imagePath": "assets/images/png/Rectangle 30aa.png", - "title": "Flexibility faction force" - }, - { - "imagePath": "assets/images/png/Rectangle 29ss.png", - "title": "Cardio crusaders circle" - }, - ]; - - List timeline = [ - { - "imagePath": "assets/images/png/cimg1.png", - "title": "Cardio crusaders circle" - }, - { - "imagePath": "assets/images/png/cimg1.png", - "title": "Cardio crusaders circle" - }, - { - "imagePath": "assets/images/png/cimg1.png", - "title": "Cardio crusaders circle" - }, - { - "imagePath": "assets/images/png/cimg1.png", - "title": "Cardio crusaders circle" - }, - ]; - - List certificationData = [ - { - "imagePath": "assets/images/png/image 17.png", - "title": "Professional sports management", - "subtitle": "Athlete 365 ", - "date": "Issued Feb 2024" - }, - { - "imagePath": "assets/images/png/image 18.png", - "title": "Professional sports management", - "subtitle": "Athlete 365 ", - "date": "Issued Feb 2024" - }, - { - "imagePath": "assets/images/png/image 19.png", - "title": "Professional sports management", - "subtitle": "Athlete 365 ", - "date": "Issued Feb 2024" - }, - ]; - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - // accountTypeValue == '1' || - body: - // accounTypeLogin == '1' || accountTypeValue == '1' - // ? FutureBuilder( - // future: individualfuture, - // builder: (ctx, snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // return Center( - // child: CircularProgressIndicator( - // color: Colors.blue, - // ), - // ); - // } - - // if (snapshot.hasError) { - // return Center( - // child: Text( - // '${snapshot.error} occurred', - // style: TextStyle(fontSize: 18.spMin), - // ), - // ); - // } - - // if (snapshot.connectionState == ConnectionState.done && - // snapshot.hasData) { - // print("Data fetched-->"); - // return - Stack(clipBehavior: Clip.none, children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SafeArea( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - height: 484.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/profileimg.png", - fit: BoxFit.cover, - ), - ), - Positioned.fill( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color.fromRGBO(34, 41, 53, 0.1), - Color.fromRGBO(34, 41, 53, 0.79), - ], - stops: [ - 0.5788, - 0.8, - ], - ), - ), - ), - ), - Positioned( - bottom: 0, - right: 0, - left: 0, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - text20700white("Edward Hackett"), - sizedBoxHeight(5.h), - text18w400white("@edward_01"), - sizedBoxHeight(15.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.followers); - }, - child: Column( - children: [ - text16400white("254"), - sizedBoxHeight(6.h), - text12400whiteblur("Followers") - ], - ), - ), - sizedBoxWidth(20.w), - Container( - height: 58.h, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.white, - width: 1.0, - ), - boxShadow: [ - BoxShadow( - color: Color(0x66000000), - offset: Offset(0, 4), - blurRadius: 4.0, - ), - ], - ), - ), - sizedBoxWidth(20.w), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.following); - }, - child: Column( - children: [ - text16400white("254"), - sizedBoxHeight(6.h), - text12400whiteblur("Following") - ], - ), - ), - sizedBoxWidth(20.w), - Container( - height: 58.h, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.white, - width: 1.0, - ), - boxShadow: [ - BoxShadow( - color: Color(0x66000000), - offset: Offset(0, 4), - blurRadius: 4.0, - ), - ], - ), - ), - sizedBoxWidth(20.w), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.clubs); - }, - child: Column( - children: [ - text16400white("10"), - sizedBoxHeight(6.h), - text12400whiteblur("Clubs") - ], - ), - ), - ], - ), - sizedBoxHeight(20.h), - ], - ), - ], - ), - ), - ), - ], - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.editProfile); - }, - child: Container( - height: 40.h, - width: 170.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - borderRadius: BorderRadius.circular(30.r), - ), - child: Center(child: text16w400_FCFCFC("Follow")), - ), - ), - GestureDetector( - onTap: () { - // Get.toNamed(RouteName.shareProfile); - }, - child: commonGlassUI( - width: 170.w, - height: 40.h, - - opacity1: 0.05, - opacity2: 0.07, - borderRadius: BorderRadius.circular(30.r), - mainOpacity: 1, - customWidget: Center( - child: text16w400_FCFCFC("Message"), - ), - // border: 1, - ), - ) - ], - ), - sizedBoxHeight(30.h), - text18w700white("About"), - sizedBoxHeight(10.h), - text14400white( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), - sizedBoxHeight(25.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/Group 58645.png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - text14400whiteblur( - "Elm street london, United Kingdom"), - ], - ), - sizedBoxHeight(20.h), - Row( - children: [ - commonContainer( - width: 25.w, - height: 25.h, - opacity1: 0.26, - opacity2: 0.26, - borderwidth: 0.5, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - "assets/images/png/Vector (4).png", - height: 12.h, - width: 12.w, - )), - ), - sizedBoxWidth(12.w), - text14400whiteblur('Rowing, Football, Swimming'), - // interestText - // text14400whiteblur(getEditProfileIndi! - // .data!.interest! - // .join(', ')), - // text14400whiteblur( - // "Rowing, Football, Swimming"), - ], - ), - sizedBoxHeight(25.h), - // commonGlassUI( - // width: double.infinity, - // height: 135.h, - // borderRadius: BorderRadius.circular(10), - // customWidget: Padding( - // padding: EdgeInsets.symmetric( - // vertical: 12.h, horizontal: 16.w), - // child: Column( - // children: [ - // Row( - // children: [ - // text16w700white("Badges"), - // Spacer(), - // GestureDetector( - // onTap: () { - // Get.toNamed(RouteName.badges); - // }, - // child: text12400white("View more")) - // ], - // ), - // sizedBoxHeight(8.h), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // ], - // ), - // ], - // ), - // ), - // // border: 1 - // ), - ], - ), - ), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - text18w700white("Timeline"), - Spacer(), - 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), - SizedBox( - height: 300.h, - child: ListView.builder( - shrinkWrap: true, - itemCount: timeline.length, - itemBuilder: (context, index) { - return commonTimelineCard( - imagePath: timeline[index]["imagePath"], - title: timeline[index]["title"]); - }, - )), - sizedBoxHeight(30.h), - Row( - children: [ - text16w700white("Certifications/Qualifications"), - Spacer(), - InkWell( - onTap: () { - Get.toNamed(RouteName.certificate); - }, - child: text12400white("View more")), - ], - ), - sizedBoxHeight(20.h), - SizedBox( - height: 85.h, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemCount: certificationData.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 20.w), - child: certificationCardTile( - imagePath: certificationData[index] - ["imagePath"], - title: certificationData[index]["title"], - subtitle: certificationData[index] - ["subtitle"], - date: certificationData[index]["date"]), - ); - }, - ), - ), - sizedBoxHeight(30.h), - text18w400white("Subgroups"), - ]), - ), - sizedBoxHeight(20.h), - SizedBox( - height: 190.h, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - padding: EdgeInsets.only(left: 16.w), - itemCount: cardtile.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 20.w), - child: profilecardtile( - imagePath: cardtile[index]["imagePath"], - title: cardtile[index]["title"]), - ); - }, - ), - ), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: text18w700white("Activity"), - ), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 48.png', - title: 'Jocelyn Dokidis', - mainImg: 'assets/images/png/Rectangle 46.png', - containerTitle: [ - 'Race', - 'Swimming', - 'Events', - 'Marathon', - 'Events' - ]), - sizedBoxHeight(120.h), - ], - ), - ), - ), - Positioned.fill( - top: 40.h, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - children: [ - sizedBoxHeight(20.h), - Row( - children: [ - Spacer(), - commonContainer( - width: 40.w, - height: 40.h, - borderwidth: 0.5, - boxShape: BoxShape.circle, - opacity1: 0.5, - opacity2: 0.6, - customWidget: - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () { - Get.toNamed(RouteName.shareProfile); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share profile', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 17.h, - width: 17.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Block user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/blocked.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Center( - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - height: 20.h, - width: 20.w, - )), - ), - - ), - ], - ), - ], - ), - ), - ), - ]), - ); - } -} - -Widget commonTimelineCard({required String imagePath, required String title}) { - 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: 145.h, - borderRadius: BorderRadius.circular(10.r), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - CircleAvatar( - radius: 10.r, - backgroundImage: AssetImage(imagePath), - ), - sizedBoxWidth(8.w), - text14700white(title) - ], - ), - sizedBoxHeight(10.h), - text12700white("Team captain"), - sizedBoxHeight(8.h), - text12400white("April 2023 - May 2024"), - sizedBoxHeight(10.h), - text10400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry.") - ], - ), - ), - // border: 1 - ), - ], - ), - ), - ], - ); -} - -Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 50), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Container( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - // Get.toNamed(RouteName.cyclescreen); - }, - child: containertile(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - opacity1: 0.2, - opacity2: 0.2, - borderwidth: 0.43, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - opacity1: 0.2, - opacity2: 0.2, - borderwidth: 0.43, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - 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), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ) - ]), - ), - ], - ); -} - -Widget certificationCardTile({ - required String imagePath, - required String title, - required String subtitle, - required String date, -}) { - return commonGlassUI( - width: 270.w, - height: 70.h, - borderRadius: BorderRadius.circular(10.r), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: 40.h, - width: 57.w, - child: Image.asset( - imagePath, - fit: BoxFit.cover, - ), - ), - sizedBoxWidth(10.w), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - text12400white(title), - sizedBoxHeight(5.h), - text9400white(subtitle), - sizedBoxHeight(5.h), - text9400white(date) - ], - ), - ), - ], - ), - ), - // border: 1 - ); -} - -Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); -} - -Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); -} - -Widget containertile({required String text}) { - return commonContainer( - width: 100.w, - height: 30.h, - borderRadius: BorderRadius.circular(30.r), - borderColor: Color(0xFFD90B2E), - borderwidth: 0.9, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); -} - -Widget profilecardtile({required String imagePath, required String title}) { - return Column( - children: [ - 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)), - ], - ); -} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart new file mode 100644 index 0000000..84e829d --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart @@ -0,0 +1,91 @@ +class GetGuestFollowers { + String? status; + int? statusCode; + String? message; + List? data; + + GetGuestFollowers({this.status, this.statusCode, this.message, this.data}); + + GetGuestFollowers.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? followingIamPrincipalXid; + int? iamPrincipalXid; + Follower? follower; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + follower = json['follower'] != null + ? new Follower.fromJson(json['follower']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.follower != null) { + data['follower'] = this.follower!.toJson(); + } + return data; + } +} + +class Follower { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + int? principleTypeXid; + + Follower( + {this.id, + this.userName, + this.fullName, + this.profilePhoto, + this.principleTypeXid}); + + Follower.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + principleTypeXid = json['principal_type_xid']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + data['principal_type_xid'] = this.principleTypeXid; + + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart new file mode 100644 index 0000000..e6eb03c --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart @@ -0,0 +1,86 @@ +class GetGuestFollowing { + String? status; + int? statusCode; + String? message; + List? data; + + GetGuestFollowing({this.status, this.statusCode, this.message, this.data}); + + GetGuestFollowing.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? followingIamPrincipalXid; + int? iamPrincipalXid; + Following? following; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + following = json['following'] != null + ? new Following.fromJson(json['following']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.following != null) { + data['following'] = this.following!.toJson(); + } + return data; + } +} + +class Following { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + int? principleTypeXid; + + + Following({this.id, this.userName, this.fullName, this.profilePhoto, this.principleTypeXid}); + + Following.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + principleTypeXid = json['principal_type_xid']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + data['principal_type_xid'] = this.principleTypeXid; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart new file mode 100644 index 0000000..99e8b83 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart @@ -0,0 +1,412 @@ +class GuestGetProfileDataBus { + String? status; + int? statusCode; + String? message; + Data? data; + + GuestGetProfileDataBus( + {this.status, this.statusCode, this.message, this.data}); + + GuestGetProfileDataBus.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + 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!.toJson(); + } + return data; + } +} + +class Data { + int? id; + int? iamPrincipalXid; + int? businessTypeXid; + String? businessOwnerName; + String? businessName; + String? businessUsername; + String? businessLocation; + String? businessContactNumber; + String? businessEmail; + String? businessHandle; + String? websiteLink; + String? googleReviewLink; + String? businessLogo; + String? tags; + String? bannerImage; + String? businessProfileImage; + String? bio; + Follows? follows; + int? isIamFollowingToGuestUser; + BusinessType? businessType; + IamPrincipalData? iamPrincipalData; + + Data( + {this.id, + this.iamPrincipalXid, + this.businessTypeXid, + this.businessOwnerName, + this.businessName, + this.businessUsername, + this.businessLocation, + this.businessContactNumber, + this.businessEmail, + this.businessHandle, + this.websiteLink, + this.googleReviewLink, + this.businessLogo, + this.tags, + this.bannerImage, + this.businessProfileImage, + this.bio, + this.follows, + this.isIamFollowingToGuestUser, + this.businessType, + this.iamPrincipalData}); + + Data.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + businessTypeXid = json['business_type_xid']; + businessOwnerName = json['business_owner_name']; + businessName = json['business_name']; + businessUsername = json['business_username']; + businessLocation = json['business_location']; + businessContactNumber = json['business_contact_number']; + businessEmail = json['business_email']; + businessHandle = json['business_handle']; + websiteLink = json['website_link']; + googleReviewLink = json['google_review_link']; + businessLogo = json['business_logo']; + tags = json['tags']; + bannerImage = json['banner_image']; + businessProfileImage = json['business_profile_image']; + bio = json['bio']; + follows = + json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + isIamFollowingToGuestUser = json['is_iam_following_to_guest_user']; + businessType = json['business_type'] != null + ? new BusinessType.fromJson(json['business_type']) + : null; + iamPrincipalData = json['iam_principal_data'] != null + ? new IamPrincipalData.fromJson(json['iam_principal_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['iam_principal_xid'] = this.iamPrincipalXid; + data['business_type_xid'] = this.businessTypeXid; + data['business_owner_name'] = this.businessOwnerName; + data['business_name'] = this.businessName; + data['business_username'] = this.businessUsername; + data['business_location'] = this.businessLocation; + data['business_contact_number'] = this.businessContactNumber; + data['business_email'] = this.businessEmail; + data['business_handle'] = this.businessHandle; + data['website_link'] = this.websiteLink; + data['google_review_link'] = this.googleReviewLink; + data['business_logo'] = this.businessLogo; + data['tags'] = this.tags; + data['banner_image'] = this.bannerImage; + data['business_profile_image'] = this.businessProfileImage; + data['bio'] = this.bio; + if (this.follows != null) { + data['follows'] = this.follows!.toJson(); + } + data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; + if (this.businessType != null) { + data['business_type'] = this.businessType!.toJson(); + } + if (this.iamPrincipalData != null) { + data['iam_principal_data'] = this.iamPrincipalData!.toJson(); + } + return data; + } +} + +class Follows { + int? following; + int? followers; + + Follows({this.following, this.followers}); + + Follows.fromJson(Map json) { + following = json['following']; + followers = json['followers']; + } + + Map toJson() { + final Map data = new Map(); + data['following'] = this.following; + data['followers'] = this.followers; + return data; + } +} + +class BusinessType { + int? id; + String? name; + String? image; + String? description; + int? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + BusinessType( + {this.id, + this.name, + this.image, + this.description, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + BusinessType.fromJson(Map json) { + id = json['id']; + name = json['name']; + image = json['image']; + description = json['description']; + isActive = json['is_active']; + createdBy = json['created_by']; + modifiedBy = json['modified_by']; + deletedAt = json['deleted_at']; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['image'] = this.image; + data['description'] = this.description; + data['is_active'] = this.isActive; + data['created_by'] = this.createdBy; + data['modified_by'] = this.modifiedBy; + data['deleted_at'] = this.deletedAt; + data['created_at'] = this.createdAt; + data['updated_at'] = this.updatedAt; + return data; + } +} + +class IamPrincipalData { + int? id; + int? principalTypeXid; + int? principalSourceXid; + String? oneSignalPlayerId; + String? googleId; + String? appleId; + String? facebookId; + String? microsoftId; + String? userName; + String? pin; + String? fullName; + String? gender; + String? dateOfBirth; + String? phoneNumber; + String? otherPhoneNumber; + String? emailAddress; + String? addressLine1; + String? addressLine2; + String? cityXid; + String? stateXid; + String? countryXid; + String? postCode; + String? lastLoginDatetime; + String? profilePhoto; + String? referralCode; + String? description; + String? about; + String? position; + String? trainingScores; + String? height; + String? weight; + String? battingAverage; + int? isProfileUpdated; + String? isActive; + int? groupNotification; + int? communityNotification; + int? followerNotification; + int? newFollowerNotification; + int? directMessageNotification; + int? isAccountVisibility; + int? isDeleted; + String? reason; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + String? profileImage; + + IamPrincipalData( + {this.id, + this.principalTypeXid, + this.principalSourceXid, + this.oneSignalPlayerId, + this.googleId, + this.appleId, + this.facebookId, + this.microsoftId, + this.userName, + this.pin, + this.fullName, + this.gender, + this.dateOfBirth, + this.phoneNumber, + this.otherPhoneNumber, + this.emailAddress, + this.addressLine1, + this.addressLine2, + this.cityXid, + this.stateXid, + this.countryXid, + this.postCode, + this.lastLoginDatetime, + this.profilePhoto, + this.referralCode, + this.description, + this.about, + this.position, + this.trainingScores, + this.height, + this.weight, + this.battingAverage, + this.isProfileUpdated, + this.isActive, + this.groupNotification, + this.communityNotification, + this.followerNotification, + this.newFollowerNotification, + this.directMessageNotification, + this.isAccountVisibility, + this.isDeleted, + this.reason, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt, + this.profileImage}); + + IamPrincipalData.fromJson(Map json) { + id = json['id']; + principalTypeXid = json['principal_type_xid']; + principalSourceXid = json['principal_source_xid']; + oneSignalPlayerId = json['one_signal_player_id']; + googleId = json['google_id']; + appleId = json['apple_id']; + facebookId = json['facebook_id']; + microsoftId = json['microsoft_id']; + userName = json['user_name']; + pin = json['pin']; + fullName = json['full_name']; + gender = json['gender']; + dateOfBirth = json['date_of_birth']; + phoneNumber = json['phone_number']; + otherPhoneNumber = json['other_phone_number']; + emailAddress = json['email_address']; + addressLine1 = json['address_line1']; + addressLine2 = json['address_line2']; + cityXid = json['city_xid']; + stateXid = json['state_xid']; + countryXid = json['country_xid']; + postCode = json['post_code']; + lastLoginDatetime = json['last_login_datetime']; + profilePhoto = json['profile_photo']; + referralCode = json['referral_code']; + description = json['description']; + about = json['about']; + position = json['position']; + trainingScores = json['training_scores']; + height = json['height']; + weight = json['weight']; + battingAverage = json['batting_average']; + isProfileUpdated = json['is_profile_updated']; + isActive = json['is_active']; + groupNotification = json['group_notification']; + communityNotification = json['community_notification']; + followerNotification = json['follower_notification']; + newFollowerNotification = json['new_follower_notification']; + directMessageNotification = json['direct_message_notification']; + isAccountVisibility = json['is_account_visibility']; + isDeleted = json['is_deleted']; + reason = json['reason']; + createdBy = json['created_by']; + modifiedBy = json['modified_by']; + deletedAt = json['deleted_at']; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + profileImage = json['profile_image']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['principal_type_xid'] = this.principalTypeXid; + data['principal_source_xid'] = this.principalSourceXid; + data['one_signal_player_id'] = this.oneSignalPlayerId; + data['google_id'] = this.googleId; + data['apple_id'] = this.appleId; + data['facebook_id'] = this.facebookId; + data['microsoft_id'] = this.microsoftId; + data['user_name'] = this.userName; + data['pin'] = this.pin; + data['full_name'] = this.fullName; + data['gender'] = this.gender; + data['date_of_birth'] = this.dateOfBirth; + data['phone_number'] = this.phoneNumber; + data['other_phone_number'] = this.otherPhoneNumber; + data['email_address'] = this.emailAddress; + data['address_line1'] = this.addressLine1; + data['address_line2'] = this.addressLine2; + data['city_xid'] = this.cityXid; + data['state_xid'] = this.stateXid; + data['country_xid'] = this.countryXid; + data['post_code'] = this.postCode; + data['last_login_datetime'] = this.lastLoginDatetime; + data['profile_photo'] = this.profilePhoto; + data['referral_code'] = this.referralCode; + data['description'] = this.description; + data['about'] = this.about; + data['position'] = this.position; + data['training_scores'] = this.trainingScores; + data['height'] = this.height; + data['weight'] = this.weight; + data['batting_average'] = this.battingAverage; + data['is_profile_updated'] = this.isProfileUpdated; + data['is_active'] = this.isActive; + data['group_notification'] = this.groupNotification; + data['community_notification'] = this.communityNotification; + data['follower_notification'] = this.followerNotification; + data['new_follower_notification'] = this.newFollowerNotification; + data['direct_message_notification'] = this.directMessageNotification; + data['is_account_visibility'] = this.isAccountVisibility; + data['is_deleted'] = this.isDeleted; + data['reason'] = this.reason; + data['created_by'] = this.createdBy; + data['modified_by'] = this.modifiedBy; + data['deleted_at'] = this.deletedAt; + data['created_at'] = this.createdAt; + data['updated_at'] = this.updatedAt; + data['profile_image'] = this.profileImage; + return data; + } +} 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 new file mode 100644 index 0000000..9e8fe7d --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart @@ -0,0 +1,422 @@ +class GuestGetProfileDataIndi { + String? status; + int? statusCode; + String? message; + Data? data; + + GuestGetProfileDataIndi( + {this.status, this.statusCode, this.message, this.data}); + + GuestGetProfileDataIndi.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + 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!.toJson(); + } + return data; + } +} + +class Data { + int? id; + String? userName; + String? fullName; + String? gender; + String? profilePhoto; + String? dateOfBirth; + List? interest; + String? about; + String? position; + String? trainingScores; + String? height; + String? weight; + String? battingAverage; + Follows? follows; + List? timelines; + int? accountVisibility; + List? myJoinedGroups; + // List? myJoinedSubgroups; + List? certifications; + int? daysBeforeJoined; + int? isIamFollowingToGuestUser; + + Data( + {this.id, + this.userName, + this.fullName, + this.gender, + this.profilePhoto, + this.dateOfBirth, + this.interest, + this.about, + this.position, + this.trainingScores, + this.height, + this.weight, + this.battingAverage, + this.follows, + this.timelines, + this.accountVisibility, + this.myJoinedGroups, + // this.myJoinedSubgroups, + this.certifications, + this.daysBeforeJoined, + this.isIamFollowingToGuestUser, + }); + + Data.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + gender = json['gender']; + profilePhoto = json['profile_photo']; + dateOfBirth = json['date_of_birth']; + if (json['interest'] != null) { + interest = []; + json['interest'].forEach((v) { + interest!.add(new Interest.fromJson(v)); + }); + } + about = json['about']; + position = json['position']; + trainingScores = json['training_scores']; + height = json['height']; + weight = json['weight']; + battingAverage = json['batting_average']; + follows = + json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + if (json['timelines'] != null) { + timelines = []; + json['timelines'].forEach((v) { + timelines!.add(new Timelines.fromJson(v)); + }); + } + accountVisibility = json['account_visibility']; + if (json['my_joined_groups'] != null) { + myJoinedGroups = []; + json['my_joined_groups'].forEach((v) { + myJoinedGroups!.add(new MyJoinedGroups.fromJson(v)); + }); + } + // if (json['my_joined_subgroups'] != null) { + // myJoinedSubgroups = []; + // json['my_joined_subgroups'].forEach((v) { + // myJoinedSubgroups!.add(new MyJoinedSubgroups.fromJson(v)); + // }); + // } + if (json['certifications'] != null) { + certifications = []; + json['certifications'].forEach((v) { + certifications!.add(new Certifications.fromJson(v)); + }); + } + daysBeforeJoined = json['days_before_joined']; + isIamFollowingToGuestUser = json['is_iam_following_to_guest_user']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['gender'] = this.gender; + data['profile_photo'] = this.profilePhoto; + data['date_of_birth'] = this.dateOfBirth; + if (this.interest != null) { + data['interest'] = this.interest!.map((v) => v.toJson()).toList(); + } + data['about'] = this.about; + data['position'] = this.position; + data['training_scores'] = this.trainingScores; + data['height'] = this.height; + data['weight'] = this.weight; + data['batting_average'] = this.battingAverage; + if (this.follows != null) { + data['follows'] = this.follows!.toJson(); + } + if (this.timelines != null) { + data['timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + } + data['account_visibility'] = this.accountVisibility; + if (this.myJoinedGroups != null) { + data['my_joined_groups'] = + this.myJoinedGroups!.map((v) => v.toJson()).toList(); + } + // if (this.myJoinedSubgroups != null) { + // data['my_joined_subgroups'] = + // this.myJoinedSubgroups!.map((v) => v.toJson()).toList(); + // } + if (this.certifications != null) { + data['certifications'] = + this.certifications!.map((v) => v.toJson()).toList(); + } + data['days_before_joined'] = this.daysBeforeJoined; + data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; + return data; + } +} +class Interest { + int? id; + String? name; + + Interest({this.id, this.name}); + + Interest.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class Follows { + int? following; + int? followers; + + Follows({this.following, this.followers}); + + Follows.fromJson(Map json) { + following = json['following']; + followers = json['followers']; + } + + Map toJson() { + final Map data = new Map(); + data['following'] = this.following; + data['followers'] = this.followers; + return data; + } +} + +class Timelines { + int? id; + String? clubName; + String? roleName; + String? teamName; + String? startDate; + String? endDate; + String? abilitiesXids; + List? abilities; + + Timelines( + {this.id, + this.clubName, + this.roleName, + this.teamName, + this.startDate, + this.endDate, + this.abilitiesXids, + this.abilities}); + + Timelines.fromJson(Map json) { + id = json['id']; + clubName = json['club_name']; + roleName = json['role_name']; + teamName = json['team_name']; + startDate = json['start_date']; + endDate = json['end_date']; + abilitiesXids = json['abilities_xids']; + if (json['abilities'] != null) { + abilities = []; + json['abilities'].forEach((v) { + abilities!.add(new Abilities.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['club_name'] = this.clubName; + data['role_name'] = this.roleName; + data['team_name'] = this.teamName; + data['start_date'] = this.startDate; + data['end_date'] = this.endDate; + data['abilities_xids'] = this.abilitiesXids; + if (this.abilities != null) { + data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Abilities { + int? id; + String? name; + + Abilities({this.id, this.name}); + + Abilities.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class MyJoinedGroups { + int? id; + int? iamPrincipalXid; + int? manageGroupXid; + GroupData? groupData; + + MyJoinedGroups( + {this.id, this.iamPrincipalXid, this.manageGroupXid, this.groupData}); + + MyJoinedGroups.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageGroupXid = json['manage_group_xid']; + 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.groupData != null) { + data['group_data'] = this.groupData!.toJson(); + } + 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; + } +} + +class MyJoinedSubgroups { + int? id; + int? iamPrincipalXid; + int? manageGroupXid; + int? manageSubGroupXid; + SubGroupData? subGroupData; + + MyJoinedSubgroups( + {this.id, + this.iamPrincipalXid, + this.manageGroupXid, + this.manageSubGroupXid, + this.subGroupData}); + + MyJoinedSubgroups.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageGroupXid = json['manage_group_xid']; + manageSubGroupXid = json['manage_sub_group_xid']; + subGroupData = json['sub_group_data'] != null + ? new SubGroupData.fromJson(json['sub_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; + data['manage_sub_group_xid'] = this.manageSubGroupXid; + if (this.subGroupData != null) { + data['sub_group_data'] = this.subGroupData!.toJson(); + } + return data; + } +} + +class SubGroupData { + int? id; + String? title; + String? subGroupImage; + + SubGroupData({this.id, this.title, this.subGroupImage}); + + SubGroupData.fromJson(Map json) { + id = json['id']; + title = json['title']; + subGroupImage = json['sub_group_image']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['sub_group_image'] = this.subGroupImage; + return data; + } +} + +class Certifications { + int? id; + String? certificationName; + String? certificationImage; + String? certificationReason; + String? certificationDate; + int? iamPrincipalXid; + + Certifications( + {this.id, + this.certificationName, + this.certificationImage, + this.certificationReason, + this.certificationDate, + this.iamPrincipalXid}); + + Certifications.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/Guest User/View/Business/ProfileTabBusGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart new file mode 100644 index 0000000..ece5e3a --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart @@ -0,0 +1,998 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_reaction_button/flutter_reaction_button.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/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/ShimmerCommon.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'; + +class profiletabBusGest extends StatefulWidget { + const profiletabBusGest({super.key}); + + @override + State createState() => _profiletabBusGestState(); +} + +class _profiletabBusGestState extends State { + late Future guestBusfuture; + var updata; + + @override + void initState() { + // TODO: implement initState + updata = Get.arguments?['FolloweridIndex'] ?? + Get.arguments?['FollowingidIndex'] ?? + "64"; + + guestBusfuture = GuestProfileApi().getGuestProfileBus(updata); + + super.initState(); + } + + int? followunfollowid; + int? blockid; + + FollowUnfollowUploadata() async { + utils.loader(); + Map newupdata = { + "following_iam_principal_xid": followunfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(newupdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + updata = Get.arguments?['FolloweridIndex'] ?? + Get.arguments?['FollowingidIndex'] ?? + "64"; + + guestBusfuture = GuestProfileApi().getGuestProfileBus(updata); + // return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + BlockUploadata() async { + utils.loader(); + Map updata = { + "blocked_iam_principal_xid": blockid, + }; + final data = await Profilepostmethod().postBlockuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + // accountTypeValue == '1' || + body: FutureBuilder( + future: guestBusfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return + // ShimmerCommon(); + + Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + print("Data fetched-->"); + return Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SafeArea( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + guestGetProfileBus!.data!.businessProfileImage != + null + ? Container( + width: double.infinity, + height: 484.h, + decoration: ShapeDecoration( + image: DecorationImage( + image: Image( + image: NetworkImage( + guestGetProfileBus!.data! + .businessProfileImage ?? + ''), + ).image, + fit: BoxFit.cover, + ), + shape: LinearBorder(), + ), + ) + : Container( + height: 484.h, + width: double.infinity, + child: Image.asset( + "assets/images/png/Rectangle 49 (1).png", + fit: BoxFit.cover, + ), + ), + Positioned.fill( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(34, 41, 53, 0.1), + Color.fromRGBO(34, 41, 53, 0.79), + ], + stops: [ + 0.5788, + 0.8, + ], + ), + ), + ), + ), + Positioned( + bottom: 0, + right: 0, + left: 0, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + children: [ + text20700white(guestGetProfileBus! + .data!.businessOwnerName ?? + "Victory gear sports emporium"), + sizedBoxHeight(5.h), + text18w400white(guestGetProfileBus! + .data!.businessName ?? + "@Victorygames_10"), + sizedBoxHeight(15.h), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.followers, + arguments: { + 'From': + "GuestBusFollowers", + 'UpdataGuestBusIdfollowers': + updata + }); + }, + child: Column( + children: [ + text16400white( + guestGetProfileBus! + .data! + .follows! + .followers + .toString() ?? + "254"), + sizedBoxHeight(6.h), + text12400whiteblur( + "Followers") + ], + ), + ), + sizedBoxWidth(20.w), + Container( + height: 58.h, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.white, + width: 1.0, + ), + boxShadow: [ + BoxShadow( + color: Color(0x66000000), + offset: Offset(0, 4), + blurRadius: 4.0, + ), + ], + ), + ), + sizedBoxWidth(20.w), + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.following, + arguments: { + 'From': + "GuestBusFollowing", + 'UpdataGuestBusIdfollowing': + updata, + }); + }, + child: + // guestGetProfileBus.data. + + Column( + children: [ + text16400white( + guestGetProfileBus! + .data! + .follows! + .following + .toString() ?? + "344"), + sizedBoxHeight(6.h), + text12400whiteblur( + "Following") + ], + ), + ), + ], + ), + sizedBoxHeight(20.h), + ], + ), + ], + ), + ), + ), + ], + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + // Get.toNamed(RouteName.buseditprofile); + followunfollowid = + guestGetProfileBus!.data!.id; + FollowUnfollowUploadata(); + print(followunfollowid); + }, + child: guestGetProfileBus!.data! + .isIamFollowingToGuestUser == + 0 + ? Container( + height: 40.h, + width: 170.w, + decoration: BoxDecoration( + color: Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r), + ), + child: Center( + child: text16w400_FCFCFC( + "Follow")), + ) + : Container( + height: 40.h, + width: 170.w, + decoration: BoxDecoration( + color: Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r), + ), + child: Center( + child: text16w400_FCFCFC( + "Unfollow")), + ), + ), + GestureDetector( + onTap: () { + // Get.toNamed(RouteName.shareProfile); + }, + child: commonGlassUI( + width: 170.w, + height: 40.h, + + opacity1: 0.05, + opacity2: 0.07, + borderRadius: + BorderRadius.circular(30.r), + mainOpacity: 1, + customWidget: Center( + child: text16w400_FCFCFC("Message"), + ), + // border: 1, + ), + ) + ], + ), + sizedBoxHeight(30.h), + text18w700white("About"), + sizedBoxHeight(10.h), + text14400white( + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), + sizedBoxHeight(25.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + text14400whiteblur(guestGetProfileBus! + .data!.businessOwnerName ?? + "James Bothman"), + ], + ), + sizedBoxHeight(20.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/Vector2a.png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + text14400whiteblur( + guestGetProfileBus!.data!.websiteLink ?? + "www.exampledummywebsite.com"), + ], + ), + sizedBoxHeight(20.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + text14400whiteblur(guestGetProfileBus! + .data!.businessLocation ?? + "Elm street london, United Kingdom"), + ], + ), + sizedBoxHeight(20.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/calender.png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + // text14400whiteblur(getEditProfileIndi! + // .data!.interest! + // .join(', ')), + guestGetProfileBus!.data!.businessType! + .createdAt != + null + ? text14400whiteblur( + ' Founded at : ${guestGetProfileBus!.data!.businessType!.createdAt}') + : text14400whiteblur( + "Founded at : 2010") + ], + ), + sizedBoxHeight(30.h), + ], + ), + ), + sizedBoxHeight(30.h), + Padding( + padding: EdgeInsets.only(left: 16.w), + child: text18w700white("Posts"), + ), + normalcardtile( + profileImg: 'assets/images/png/Ellipse 48.png', + title: 'Jocelyn Dokidis', + mainImg: 'assets/images/png/Rectangle 46.png', + containerTitle: [ + 'Race', + 'Swimming', + 'Events', + 'Marathon', + 'Events' + ]), + sizedBoxHeight(120.h), + ], + ), + ), + ), + Positioned.fill( + top: 40.h, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + sizedBoxHeight(20.h), + Row( + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: Center( + child: Image.asset( + 'assets/images/png/ph_arrow-up-thin.png', + height: 25.h, + width: 25.w, + ), + )), + ), + Spacer(), + commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () { + Get.toNamed(RouteName.shareProfile); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share profile', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 17.h, + width: 17.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + setState(() { + blockid = + guestGetProfileBus!.data!.id ?? 0; + + BlockUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Block user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/blocked.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Center( + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + height: 20.h, + width: 20.w, + )), + ), + ), + ], + ), + ], + ), + ), + ), + ]); + } + return Container(); + })); + } +} + +Widget normalcardtile({ + required String profileImg, + required String title, + required String mainImg, + required List containerTitle, +}) { + var mainImage = 'assets/images/png/uiw_like-o.png'.obs; + void updateImage(String reaction) { + if (reaction == 'like') { + mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; + } else if (reaction == 'heart') { + mainImage.value = 'assets/images/png/heart 2.png'; + } else if (reaction == 'party') { + mainImage.value = 'assets/images/png/party-popper 2.png'; + } + } + + return Column( + children: [ + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircleAvatar( + foregroundImage: AssetImage(profileImg), + radius: 25.r, + ), + sizedBoxWidth(12.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16w400_FCFCFC(title), + sizedBoxHeight(5.h), + Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + height: 14.w, + width: 14.w, + ), + sizedBoxWidth(7.w), + text12w400_FCFCFC('Active alliance network'), + sizedBoxWidth(7.w), + Icon( + Icons.circle, + color: Color(0xFFFCFCFC), + size: 4.sp, + ), + sizedBoxWidth(6.w), + text12w400_FCFCFC('1 Hour ago'), + ], + ) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: BoxConstraints.tightFor(width: 176.w), + offset: Offset(0, 50), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report Post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Pin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + width: 16.w, + height: 18.h, + ), + ), + sizedBoxWidth(5.w) + ], + ), + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.postdetailsScreen); + }, + child: Container( + height: 163.h, + width: double.infinity, + child: Image.asset( + mainImg, + fit: BoxFit.cover, + ), + )), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column(children: [ + SizedBox( + height: 30.h, + child: ListView.builder( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + itemCount: containerTitle.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(right: 12.w), + child: GestureDetector( + onTap: () { + // Get.toNamed(RouteName.cyclescreen); + }, + child: containertile(text: containerTitle[index])), + ); + }, + ), + ), + sizedBoxHeight(20.h), + text16w400_FCFCFC( + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), + Row(children: [ + stackReaction(number: '20', containerImages: [ + 'assets/images/png/f7_hand-thumbsup.png', + 'assets/images/png/heart 2.png', + 'assets/images/png/party-popper 2.png' + ]), + Spacer(), + commonContainer( + width: 30.w, + height: 30.h, + opacity1: 0.2, + opacity2: 0.2, + borderwidth: 0.43, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 13.h, + width: 13.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC('20'), + sizedBoxWidth(20.w), + commonContainer( + width: 30.w, + height: 30.h, + opacity1: 0.2, + opacity2: 0.2, + borderwidth: 0.43, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Vector (1).png', + height: 12.h, + width: 12.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC('10'), + ]), + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Obx(() { + return ReactionButton( + onReactionChanged: (reaction) { + updateImage(reaction?.value ?? 'like'); + debugPrint('Selected value: ${reaction?.value}'); + }, + reactions: ?>[ + Reaction( + value: 'like', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + Reaction( + value: 'heart', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/heart 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/heart 2.png'), + ), + Reaction( + value: 'party', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/party-popper 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/party-popper 2.png'), + ), + ], + selectedReaction: Reaction( + value: 'like', + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + boxColor: Colors.white, + boxElevation: 9, + 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), + // toggle: false, + + child: _buildReactionsIcon(mainImage.value), + ); + }) + ], + ), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.postdetailsScreen); + }, + child: Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Comment') + ], + ), + ), + Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004089.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Save') + ], + ) + ], + ) + ]), + ), + ], + ); +} + +Widget _buildReactionsPreviewIcon(String assetPath) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + assetPath, + height: 40.h, + width: 40.w, + ), + ); +} + +Widget _buildReactionsIcon(String assetPath) { + return Column( + children: [ + Image.asset( + assetPath, + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Like') + ], + ); +} + +Widget containertile({required String text}) { + return commonContainer( + width: 100.w, + height: 30.h, + borderRadius: BorderRadius.circular(30.r), + borderColor: Color(0xFFD90B2E), + borderwidth: 0.9, + customWidget: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Center(child: text14w400_FCFCFC(text)), + )); +} 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 new file mode 100644 index 0000000..c10ca6a --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart @@ -0,0 +1,1797 @@ +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'; +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}); + + @override + State createState() => _ProfileTabIndGuestState(); +} + +class _ProfileTabIndGuestState extends State { + List cardtile = [ + { + "imagePath": "assets/images/png/Rectangle 29ss.png", + "title": "Cardio crusaders circle" + }, + { + "imagePath": "assets/images/png/Rectangle 31ee.png", + "title": "Strength squad syndicate" + }, + { + "imagePath": "assets/images/png/Rectangle 30aa.png", + "title": "Flexibility faction force" + }, + { + "imagePath": "assets/images/png/Rectangle 29ss.png", + "title": "Cardio crusaders circle" + }, + ]; + + List timeline = [ + { + "imagePath": "assets/images/png/cimg1.png", + "title": "Cardio crusaders circle" + }, + { + "imagePath": "assets/images/png/cimg1.png", + "title": "Cardio crusaders circle" + }, + { + "imagePath": "assets/images/png/cimg1.png", + "title": "Cardio crusaders circle" + }, + { + "imagePath": "assets/images/png/cimg1.png", + "title": "Cardio crusaders circle" + }, + ]; + + List certificationData = [ + { + "imagePath": "assets/images/png/image 17.png", + "title": "Professional sports management", + "subtitle": "Athlete 365 ", + "date": "Issued Feb 2024" + }, + { + "imagePath": "assets/images/png/image 18.png", + "title": "Professional sports management", + "subtitle": "Athlete 365 ", + "date": "Issued Feb 2024" + }, + { + "imagePath": "assets/images/png/image 19.png", + "title": "Professional sports management", + "subtitle": "Athlete 365 ", + "date": "Issued Feb 2024" + }, + ]; + + late Future guestIndfuture; + var updata; + + @override + void initState() { + // updata = Get.arguments != null + // ? Get.arguments['FolloweridIndex'] + // : Get.arguments != null + // ? Get.arguments['FollowingidIndex'] + // : "56"; + updata = Get.arguments?['FolloweridIndex'] ?? + Get.arguments?['FollowingidIndex'] ?? + "56"; + + guestIndfuture = GuestProfileApi().getGuestProfileInd(updata); + + super.initState(); + } + + int? followunfollowid; + int? blockid; + + + FollowUnfollowUploadata() async { + utils.loader(); + Map newupdata = { + "following_iam_principal_xid": followunfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(newupdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + updata = Get.arguments?['FolloweridIndex'] ?? + Get.arguments?['FollowingidIndex'] ?? + "56"; + + GuestProfileApi().getGuestProfileInd(updata).then((value) { + setState(() {}); + }); + // return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + + BlockUploadata() async { + utils.loader(); + Map updata = { + "blocked_iam_principal_xid": blockid, + }; + final data = await Profilepostmethod().postBlockuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + // accountTypeValue == '1' || + body: FutureBuilder( + future: guestIndfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + print("Data fetched-->"); + return + // guestGetProfileInd!.data!.isBlank! + // ? + // _buildNoDataBody(context) + // : + + Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SafeArea( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + guestGetProfileInd!.data!.profilePhoto!.isNotEmpty + ? Container( + width: double.infinity, + height: 484.h, + decoration: ShapeDecoration( + image: DecorationImage( + image: Image( + image: NetworkImage( + guestGetProfileInd! + .data!.profilePhoto!), + ).image, + fit: BoxFit.cover, + ), + shape: LinearBorder(), + ), + ) + : Container( + height: 484.h, + width: double.infinity, + child: Image.asset( + "assets/images/png/profileimg.png", + fit: BoxFit.cover, + ), + ), + Positioned.fill( + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(34, 41, 53, 0.1), + Color.fromRGBO(34, 41, 53, 0.79), + ], + stops: [ + 0.5788, + 0.8, + ], + ), + ), + ), + ), + Positioned( + bottom: 0, + right: 0, + left: 0, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + children: [ + text20700white(guestGetProfileInd! + .data!.fullName ?? + "Edward Hackett"), + sizedBoxHeight(5.h), + text18w400white(guestGetProfileInd! + .data!.userName ?? + "@edward_01"), + sizedBoxHeight(15.h), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.followers, + arguments: { + 'UpdataGuestIdfollowers': + updata, + }); + }, + child: Column( + children: [ + text16400white( + guestGetProfileInd! + .data! + .follows! + .followers + .toString()), + sizedBoxHeight(6.h), + text12400whiteblur( + "Followers") + ], + ), + ), + sizedBoxWidth(20.w), + Container( + height: 58.h, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.white, + width: 1.0, + ), + boxShadow: const [ + BoxShadow( + color: Color(0x66000000), + offset: Offset(0, 4), + blurRadius: 4.0, + ), + ], + ), + ), + sizedBoxWidth(20.w), + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.following, + arguments: { + 'UpdataGuestIdfollowing': + updata, + }); + }, + child: Column( + children: [ + text16400white( + guestGetProfileInd! + .data! + .follows! + .following + .toString()), + sizedBoxHeight(6.h), + text12400whiteblur( + "Following") + ], + ), + ), + // sizedBoxWidth(20.w), + // Container( + // height: 58.h, + // decoration: BoxDecoration( + // color: Colors.white, + // border: Border.all( + // color: Colors.white, + // width: 1.0, + // ), + // boxShadow: const [ + // BoxShadow( + // color: Color(0x66000000), + // offset: Offset(0, 4), + // blurRadius: 4.0, + // ), + // ], + // ), + // ), + // sizedBoxWidth(20.w), + // GestureDetector( + // onTap: () { + // Get.toNamed(RouteName.clubs); + // }, + // child: Column( + // children: [ + // text16400white("10"), + // sizedBoxHeight(6.h), + // text12400whiteblur("Clubs") + // ], + // ), + // ), + ], + ), + sizedBoxHeight(20.h), + ], + ), + ], + ), + ), + ), + ], + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + // Get.toNamed(RouteName.editProfile); + followunfollowid = + guestGetProfileInd!.data!.id; + FollowUnfollowUploadata(); + print(followunfollowid); + // _handleFollowButton(followunfollowid); + }, + 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: () { + // Get.toNamed(RouteName.shareProfile); + }, + child: commonGlassUI( + width: 170.w, + height: 40.h, + + opacity1: 0.05, + opacity2: 0.07, + borderRadius: + BorderRadius.circular(30.r), + mainOpacity: 1, + customWidget: Center( + child: text16w400_FCFCFC("Message"), + ), + // border: 1, + ), + ) + ], + ), + sizedBoxHeight(30.h), + text18w700white("About"), + sizedBoxHeight(10.h), + guestGetProfileInd!.data!.about == null || + guestGetProfileInd!.data!.about!.isEmpty + ? text14400white("No about added") + : text14400white( + guestGetProfileInd!.data!.about!), + sizedBoxHeight(25.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + text14400whiteblur( + "Elm street london, United Kingdom"), + ], + ), + sizedBoxHeight(20.h), + Row( + children: [ + commonContainer( + width: 25.w, + height: 25.h, + opacity1: 0.26, + opacity2: 0.26, + borderwidth: 0.5, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + "assets/images/png/Vector (4).png", + height: 12.h, + width: 12.w, + )), + ), + sizedBoxWidth(12.w), + text14400whiteblur( + 'Rowing, Football, Swimming'), + // interestText + // text14400whiteblur(guestGetProfileInd! + // .data!.interest! + // .join(', ')), + // text14400whiteblur( + // "Rowing, Football, Swimming"), + ], + ), + sizedBoxHeight(25.h), + // commonGlassUI( + // width: double.infinity, + // height: 135.h, + // borderRadius: BorderRadius.circular(10), + // customWidget: Padding( + // padding: EdgeInsets.symmetric( + // vertical: 12.h, horizontal: 16.w), + // child: Column( + // children: [ + // Row( + // children: [ + // text16w700white("Badges"), + // Spacer(), + // GestureDetector( + // onTap: () { + // Get.toNamed(RouteName.badges); + // }, + // child: text12400white("View more")) + // ], + // ), + // sizedBoxHeight(8.h), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // ], + // ), + // ], + // ), + // ), + // // border: 1 + // ), + ], + ), + ), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + 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, + // ), + // ) + ], + ), + sizedBoxHeight(20.h), + guestGetProfileInd!.data!.timelines!.isEmpty + ? Padding( + padding: EdgeInsets.symmetric( + vertical: 30.h), + child: Center( + child: text18w700white( + "No Timeline Found")), + ) + : SizedBox( + height: 200.h, + child: ListView.builder( + shrinkWrap: true, + itemCount: guestGetProfileInd! + .data!.timelines!.length, + itemBuilder: (context, index) { + 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: [ + text16w700white( + "Certifications/Qualifications"), + const Spacer(), + InkWell( + onTap: () { + Get.toNamed(RouteName.certificate, + arguments: { + 'id': guestGetProfileInd! + .data!.id, + }); + }, + child: text12400white("View more")), + ], + ), + sizedBoxHeight(20.h), + guestGetProfileInd! + .data!.certifications!.isEmpty + ? Padding( + padding: EdgeInsets.symmetric( + vertical: 30.h), + child: Center( + child: text18w700white( + "No Certifications Found")), + ) + : SizedBox( + height: 100.h, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + // padding: + // EdgeInsets.only(left: 16.w), + physics: ScrollPhysics(), + itemCount: guestGetProfileInd! + .data!.certifications!.length, + itemBuilder: (context, index) { + 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), + 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), + guestGetProfileInd!.data!.myJoinedGroups!.isEmpty + ? Padding( + padding: EdgeInsets.symmetric(vertical: 30.h), + child: Center( + child: + text18w700white("No groups Found")), + ) + : SizedBox( + height: 190.h, + width: double.infinity, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + padding: EdgeInsets.only(left: 16.w), + itemCount: guestGetProfileInd! + .data!.myJoinedGroups!.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(right: 20.w), + child: profilecardtile( + imagePath: guestGetProfileInd! + .data! + .myJoinedGroups![index] + .groupData! + .groupImage ?? + '', + // cardtile[index]["imagePath"], + title: guestGetProfileInd! + .data! + .myJoinedGroups![index] + .groupData! + .title! + + // cardtile[index]["title"] + ), + ); + }, + ), + ), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.only(left: 16.w), + child: text18w700white("Activity"), + ), + normalcardtile( + profileImg: 'assets/images/png/Ellipse 48.png', + title: 'Jocelyn Dokidis', + mainImg: 'assets/images/png/Rectangle 46.png', + containerTitle: [ + 'Race', + 'Swimming', + 'Events', + 'Marathon', + 'Events' + ]), + sizedBoxHeight(120.h), + ], + ), + ), + ), + Positioned.fill( + top: 40.h, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + sizedBoxHeight(20.h), + Row( + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: Center( + child: Image.asset( + 'assets/images/png/ph_arrow-up-thin.png', + height: 25.h, + width: 25.w, + ), + )), + ), + const Spacer(), + commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () { + Get.toNamed(RouteName.shareProfile); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share profile', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 17.h, + width: 17.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: ()async { + setState(() { + blockid = guestGetProfileInd!.data!.id ?? 0; + + BlockUploadata(); + + }); + + + + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Block user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/blocked.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Center( + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + height: 20.h, + width: 20.w, + )), + ), + ), + ], + ), + ], + ), + ), + ), + ]); + } + return Container(); + })); + } + + 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 commonTimelineCard( + {required String imagePath, + required String title, + required String teamName, + required String startendDate, + required String abilities}) { + 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: const BoxDecoration( + color: Colors.white, shape: BoxShape.circle)), + ), + Positioned( + right: 3.w, + child: Container( + width: 1.w, + height: 170.h, + decoration: const BoxDecoration(color: Colors.white), + ), + ), + ], + ), + ), + sizedBoxWidth(20.w), + Expanded( + child: Column( + children: [ + commonGlassUI( + width: double.infinity, + height: 145.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + CircleAvatar( + radius: 10.r, + backgroundImage: AssetImage(imagePath), + ), + sizedBoxWidth(8.w), + text14700white(title) + ], + ), + sizedBoxHeight(10.h), + text12700white(teamName), + sizedBoxHeight(8.h), + text12400white(startendDate), + sizedBoxHeight(10.h), + text10400whiteblur(abilities) + ], + ), + ), + // border: 1 + ), + ], + ), + ), + ], + ); + } + + Widget normalcardtile({ + required String profileImg, + required String title, + required String mainImg, + required List containerTitle, + }) { + var mainImage = 'assets/images/png/uiw_like-o.png'.obs; + void updateImage(String reaction) { + if (reaction == 'like') { + mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; + } else if (reaction == 'heart') { + mainImage.value = 'assets/images/png/heart 2.png'; + } else if (reaction == 'party') { + mainImage.value = 'assets/images/png/party-popper 2.png'; + } + } + + return Column( + children: [ + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircleAvatar( + foregroundImage: AssetImage(profileImg), + radius: 25.r, + ), + sizedBoxWidth(12.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16w400_FCFCFC(title), + sizedBoxHeight(5.h), + Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + height: 14.w, + width: 14.w, + ), + sizedBoxWidth(7.w), + text12w400_FCFCFC('Active alliance network'), + sizedBoxWidth(7.w), + Icon( + Icons.circle, + color: const Color(0xFFFCFCFC), + size: 4.sp, + ), + sizedBoxWidth(6.w), + text12w400_FCFCFC('1 Hour ago'), + ], + ) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: BoxConstraints.tightFor(width: 176.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report Post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Pin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + width: 16.w, + height: 18.h, + ), + ), + sizedBoxWidth(5.w) + ], + ), + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.postdetailsScreen); + }, + child: Container( + height: 163.h, + width: double.infinity, + child: Image.asset( + mainImg, + fit: BoxFit.cover, + ), + )), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column(children: [ + SizedBox( + height: 30.h, + child: ListView.builder( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + itemCount: containerTitle.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(right: 12.w), + child: GestureDetector( + onTap: () { + // Get.toNamed(RouteName.cyclescreen); + }, + child: containertile(text: containerTitle[index])), + ); + }, + ), + ), + sizedBoxHeight(20.h), + text16w400_FCFCFC( + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), + Row(children: [ + stackReaction(number: '20', containerImages: [ + 'assets/images/png/f7_hand-thumbsup.png', + 'assets/images/png/heart 2.png', + 'assets/images/png/party-popper 2.png' + ]), + const Spacer(), + commonContainer( + width: 30.w, + height: 30.h, + opacity1: 0.2, + opacity2: 0.2, + borderwidth: 0.43, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 13.h, + width: 13.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC('20'), + sizedBoxWidth(20.w), + commonContainer( + width: 30.w, + height: 30.h, + opacity1: 0.2, + opacity2: 0.2, + borderwidth: 0.43, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Vector (1).png', + height: 12.h, + width: 12.w, + ), + ), + ), + sizedBoxWidth(12.w), + text14w400_FCFCFC('10'), + ]), + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Obx(() { + return ReactionButton( + onReactionChanged: (reaction) { + updateImage(reaction?.value ?? 'like'); + debugPrint('Selected value: ${reaction?.value}'); + }, + reactions: ?>[ + Reaction( + value: 'like', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + Reaction( + value: 'heart', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/heart 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/heart 2.png'), + ), + Reaction( + value: 'party', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/party-popper 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/party-popper 2.png'), + ), + ], + selectedReaction: Reaction( + value: 'like', + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + boxColor: Colors.white, + boxElevation: 9, + boxRadius: 30, + itemsSpacing: 8, + itemScale: 0.4, + 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), + ); + }) + ], + ), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.postdetailsScreen); + }, + child: Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Comment') + ], + ), + ), + Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004089.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Save') + ], + ) + ], + ) + ]), + ), + ], + ); + } + + Widget certificationCardTile({ + required String imagePath, + required String title, + required String subtitle, + required String date, + }) { + return commonGlassUI( + width: 270.w, + height: 70.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + guestGetProfileInd!.data!.certifications != null + ? Container( + width: 57.w, + height: 40.h, + decoration: ShapeDecoration( + image: DecorationImage( + image: Image( + image: NetworkImage(imagePath), + ).image, + fit: BoxFit.cover, + ), + shape: LinearBorder(), + ), + ) + : Container( + height: 40.h, + width: 57.w, + child: Image.asset( + imagePath, + fit: BoxFit.cover, + ), + ), + sizedBoxWidth(10.w), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + text12400white(title), + sizedBoxHeight(5.h), + text9400white(subtitle), + sizedBoxHeight(5.h), + text9400white(date) + ], + ), + ), + ], + ), + ), + // border: 1 + ); + } + + Widget _buildReactionsPreviewIcon(String assetPath) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + assetPath, + height: 40.h, + width: 40.w, + ), + ); + } + + Widget _buildReactionsIcon(String assetPath) { + return Column( + children: [ + Image.asset( + assetPath, + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Like') + ], + ); + } + + Widget containertile({required String text}) { + return commonContainer( + width: 100.w, + height: 30.h, + borderRadius: BorderRadius.circular(30.r), + borderColor: const Color(0xFFD90B2E), + borderwidth: 0.9, + customWidget: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Center(child: text14w400_FCFCFC(text)), + )); + } + + Widget profilecardtile({required String? imagePath, required String? title}) { + 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, + 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, + child: title == null || title.isEmpty + ? text12w700_FCFCFC('Reegroup') + : text12w700_FCFCFC(title)), + ], + ); + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart new file mode 100644 index 0000000..824147b --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart @@ -0,0 +1,73 @@ + import 'dart:async'; +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/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataBus.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataIndi.dart'; + + +GuestGetProfileDataIndi? guestGetProfileInd; +GuestGetProfileDataBus? guestGetProfileBus; + +GetGuestFollowers? getguestfollowersobj; +GetGuestFollowing? getguestfollowingobj; + + +class GuestProfileApi { + GuestProfileApi(); + + +Future> getGuestProfileInd(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestProfileInd}?guest_user_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + guestGetProfileInd = GuestGetProfileDataIndi.fromJson(response.data); + log(guestGetProfileInd!.data.toString()); + } + return response; + } + + Future> getGuestProfileBus(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestProfileBus}?guest_user_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + guestGetProfileBus = GuestGetProfileDataBus.fromJson(response.data); + log(guestGetProfileBus!.data.toString()); + } + return response; + } + + Future> getGuestfollowers(gestUserid ,guestupdata , {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestfollowers}?guest_user_id=$gestUserid&search=$guestupdata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + getguestfollowersobj = GetGuestFollowers.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(getguestfollowersobj!); + log(guestGetProfileInd!.data.toString()); + } + return response; + } + + Future> getGuestfollowing(gestUserid ,guestupdata , {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestfollowing}?guest_user_id=$gestUserid&search=$guestupdata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + getguestfollowingobj = GetGuestFollowing.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(getguestfollowingobj!); + log(guestGetProfileInd!.data.toString()); + } + return response; + } +} \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart new file mode 100644 index 0000000..0714af3 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart @@ -0,0 +1,89 @@ +class GetAccountSessionsModel { + String? status; + int? statusCode; + String? message; + List? data; + + GetAccountSessionsModel( + {this.status, this.statusCode, this.message, this.data}); + + GetAccountSessionsModel.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? deviceName; + String? ipAddress; + String? country; + String? state; + String? city; + String? zip; + String? isp; + String? lat; + String? lon; + String? timezone; + + Data( + {this.id, + this.deviceName, + this.ipAddress, + this.country, + this.state, + this.city, + this.zip, + this.isp, + this.lat, + this.lon, + this.timezone}); + + Data.fromJson(Map json) { + id = json['id']; + deviceName = json['device_name']; + ipAddress = json['ip_address']; + country = json['country']; + state = json['state']; + city = json['city']; + zip = json['zip']; + isp = json['isp']; + lat = json['lat']; + lon = json['lon']; + timezone = json['timezone']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['device_name'] = this.deviceName; + data['ip_address'] = this.ipAddress; + data['country'] = this.country; + data['state'] = this.state; + data['city'] = this.city; + data['zip'] = this.zip; + data['isp'] = this.isp; + data['lat'] = this.lat; + data['lon'] = this.lon; + data['timezone'] = this.timezone; + return data; + } +} 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/Model/editTimelineModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart new file mode 100644 index 0000000..67cfe5e --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart @@ -0,0 +1,116 @@ +class GetEditTimelineModel { + String? status; + int? statusCode; + String? message; + Data? data; + + GetEditTimelineModel({this.status, this.statusCode, this.message, this.data}); + + GetEditTimelineModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + 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!.toJson(); + } + return data; + } +} + +class Data { + List? abilities; + TimelineData? timelineData; + + Data({this.abilities, this.timelineData}); + + Data.fromJson(Map json) { + if (json['abilities'] != null) { + abilities = []; + json['abilities'].forEach((v) { + abilities!.add(new Abilities.fromJson(v)); + }); + } + timelineData = json['timeline_data'] != null + ? new TimelineData.fromJson(json['timeline_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + if (this.abilities != null) { + data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + } + if (this.timelineData != null) { + data['timeline_data'] = this.timelineData!.toJson(); + } + return data; + } +} + +class Abilities { + int? id; + String? name; + + Abilities({this.id, this.name}); + + Abilities.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class TimelineData { + int? id; + String? clubName; + String? roleName; + String? teamName; + String? startDate; + String? endDate; + String? abilitiesXids; + + TimelineData( + {this.id, + this.clubName, + this.roleName, + this.teamName, + this.startDate, + this.endDate, + this.abilitiesXids}); + + TimelineData.fromJson(Map json) { + id = json['id']; + clubName = json['club_name']; + roleName = json['role_name']; + teamName = json['team_name']; + startDate = json['start_date']; + endDate = json['end_date']; + abilitiesXids = json['abilities_xids']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['club_name'] = this.clubName; + data['role_name'] = this.roleName; + data['team_name'] = this.teamName; + data['start_date'] = this.startDate; + data['end_date'] = this.endDate; + data['abilities_xids'] = this.abilitiesXids; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart index 1c0e3d7..c8fcb02 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart @@ -61,14 +61,18 @@ class Follower { String? userName; String? fullName; String? profilePhoto; + int? principleTypeXid; - Follower({this.id, this.userName, this.fullName, this.profilePhoto}); + + Follower({this.id, this.userName, this.fullName, this.profilePhoto, this.principleTypeXid}); Follower.fromJson(Map json) { id = json['id']; userName = json['user_name']; fullName = json['full_name']; profilePhoto = json['profile_photo']; + principleTypeXid = json['principal_type_xid']; + } Map toJson() { @@ -77,6 +81,8 @@ class Follower { data['user_name'] = this.userName; data['full_name'] = this.fullName; data['profile_photo'] = this.profilePhoto; + data['principal_type_xid'] = this.principleTypeXid; + return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart index 323b892..869a84e 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart @@ -61,14 +61,21 @@ class Following { String? userName; String? fullName; String? profilePhoto; + int? principleTypeXid; - Following({this.id, this.userName, this.fullName, this.profilePhoto}); + Following( + {this.id, + this.userName, + this.fullName, + this.profilePhoto, + this.principleTypeXid}); Following.fromJson(Map json) { id = json['id']; userName = json['user_name']; fullName = json['full_name']; profilePhoto = json['profile_photo']; + principleTypeXid = json['principal_type_xid']; } Map toJson() { @@ -77,6 +84,8 @@ class Following { data['user_name'] = this.userName; data['full_name'] = this.fullName; data['profile_photo'] = this.profilePhoto; + data['principal_type_xid'] = this.principleTypeXid; + return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart new file mode 100644 index 0000000..18b3f0f --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart @@ -0,0 +1,51 @@ +class TimelineAbilityListModel { + String? status; + int? statusCode; + String? message; + List? data; + + TimelineAbilityListModel( + {this.status, this.statusCode, this.message, this.data}); + + TimelineAbilityListModel.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? name; + + Data({this.id, this.name}); + + Data.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + 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 ecbf9f0..dab35fc 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart @@ -1,12 +1,24 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; 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/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; 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'; class MyNetwork extends StatefulWidget { const MyNetwork({super.key}); @@ -16,87 +28,162 @@ class MyNetwork extends StatefulWidget { } class _MyNetworkState extends State { + // var fromMainIndProfile = Get.arguments['From'] ?? ''; +// MainIndProfile @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "My networks", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "My networks", ), - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(16.h), - Expanded( - child: DefaultTabController( - length: 2, - // initialIndex: selectedIndex.value, - child: Column(children: [ - CommonTabBar(tabs: const [ - Tab( - text: 'Followers', + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(16.h), + Expanded( + child: DefaultTabController( + length: 2, + // initialIndex: selectedIndex.value, + child: Column(children: [ + CommonTabBar(tabs: const [ + Tab( + text: 'Followers', + ), + Tab( + text: 'Following', + ), + ]), + const Expanded( + child: TabBarView( + children: [ + FollowersTab(), + FollowingTab(), + ], + ), ), - Tab( - text: 'Following', - ), - ]), - Expanded( - child: TabBarView( - children: [ - followersTab(), - followingTab(), - ], - ), - ), - ])), - ) - ]) - ])); + ])), + ) + ]) + ])), + ); + } +} + +class FollowersTab extends StatefulWidget { + const FollowersTab({super.key}); + + @override + State createState() => _FollowersTabState(); +} + +class _FollowersTabState extends State { + StreamController searchcontroller = StreamController(); + + @override + void initState() { + var updata = ""; + + Profilegetmethod().getFollowers(updata, streamController: searchcontroller); + + // TODO: implement initState + super.initState(); } - Widget followersTab() { - List followersData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 37.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - ]; + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } - return Column( + int? blockid; + int? removeid; + + RemoveUploadata() async { + utils.loader(); + Map updata = { + "iam_principal_xid": removeid, + }; + final data = await Profilepostmethod().postRemoveuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + BlockUploadata() async { + utils.loader(); + Map updata = { + "blocked_iam_principal_xid": blockid, + }; + final data = await Profilepostmethod().postBlockuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + List followersData = [ + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 43.png", + "title": "Fit fusion squad", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 37.png", + "title": "Power pulse posse", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + ]; + + @override + Widget build(BuildContext context) { + return + // ListView( + // scrollDirection: Axis.vertical, + // physics: const ScrollPhysics(), + // children: [ + Column( children: [ sizedBoxHeight(25.h), Padding( @@ -113,297 +200,601 @@ class _MyNetworkState extends State { ), ), ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Profilegetmethod() + .getFollowers(value, streamController: searchcontroller); + }, hintText: "Search people", ), ), - ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followersData.length, - separatorBuilder: (BuildContext context, int index) { - return commonDivider(); - }, - itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: - EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - CircleAvatar( - backgroundImage: - AssetImage(followersData[index]["imagePath"]), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(followersData[index]["title"]), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur( - followersData[index]["subtitle"]) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( + sizedBoxHeight(20.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Expanded( + child: Center(child: CircularProgressIndicator())); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followersobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: followersobj!.data!.length, + separatorBuilder: (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + followersobj!.data![index].follower! + .principleTypeXid == + 1 + ? Get.toNamed(RouteName.profiletabindguest, + arguments: { + "FolloweridIndex": followersobj! + .data![index].iamPrincipalXid!, + }) + : Get.toNamed(RouteName.profiletabbusguest, + arguments: { + "FolloweridIndex": followersobj! + .data![index].iamPrincipalXid!, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followersobj!.data![index].follower! + .profilePhoto == + null || + followersobj!.data![index].follower! + .profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + followersobj!.data![index] + .follower!.profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - text14400white("Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, - ) + followersobj!.data![index].follower! + .fullName == + null || + followersobj! + .data![index] + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC(followersobj! + .data![index] + .follower! + .fullName!), + sizedBoxHeight(4.h), + followersobj!.data![index].follower! + .userName == + null || + followersobj! + .data![index] + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur("regroup") + : text12w400_FCFCFC_blur( + followersobj!.data![index] + .follower!.userName!) ], ), - ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: BoxConstraints.tightFor( + width: 176.w), + offset: const Offset(0, 20), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: () async { + setState(() { + removeid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower!.id == + removeid); + RemoveUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Remove user"), + const Spacer(), + Image.asset( + "assets/images/png/fluent_delete-28-regular.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-regular.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + setState(() { + blockid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower!.id == + blockid); + BlockUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Block user"), + const Spacer(), + Image.asset( + "assets/images/png/blockchat.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), - ), - )), - ], - ), - ) - ], - ); + ) + ], + ), + ); + }, + ); + } }, ), ], ); } - Widget followingTab() { - List followingData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 37.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - ]; - + Widget _buildNoDataBody(context) { return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - sizedBoxHeight(25.h), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ); + } + + +} + +class FollowingTab extends StatefulWidget { + const FollowingTab({super.key}); + + @override + State createState() => _FollowingTabState(); +} + +class _FollowingTabState extends State { + StreamController searchcontroller = StreamController(); + + List followingData = [ + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 43.png", + "title": "Fit fusion squad", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 37.png", + "title": "Power pulse posse", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + ]; + + @override + void initState() { + // TODO: implement initState + + var updata = ""; + Profilegetmethod().getFollowing(updata, streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + Uploadata() async { + utils.loader(); + Map updata = { + "following_iam_principal_xid": unfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("unfollow done"); + // setState(() { + // // Assuming followingobj is a list of items, remove the item with matching user ID + // followingobj!.data!.removeWhere((item) => item.following!.id == userid); + // }); + return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + int? unfollowid; + + @override + Widget build(BuildContext context) { + return + // ListView( + // physics: const ScrollPhysics(), + // scrollDirection: Axis.vertical, + // children: [ + Column(children: [ + sizedBoxHeight(25.h), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, ), ), - hintText: "Search people", ), - ), - ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followingData.length, - separatorBuilder: (BuildContext context, int index) { - return commonDivider(); + hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // Onboard().postGroupsearch({"search": value}, + // streamController: searchcontroller); + // searchGroups(value!); + Profilegetmethod() + .getFollowing(value, streamController: searchcontroller); + return null; }, - itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: - EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - CircleAvatar( - backgroundImage: - AssetImage(followingData[index]["imagePath"]), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(followingData[index]["title"]), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur( - followingData[index]["subtitle"]) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, + ), + ), + sizedBoxHeight(20.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Expanded(child: Center(child: CircularProgressIndicator())); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followingobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: followingobj!.data!.length, + separatorBuilder: (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return + // Column( + // children: [ + // Followinglist( + // imagePath: followingobj?.data?[index] + // .following?.profilePhoto ?? + // '', + // title: followingobj! + // .data?[index].following?.fullName ?? + // '', + // subtitle: followingobj! + // .data?[index].following?.userName ?? + // '', + // unfollowontap: (id) => Uploadata(id), + // unfollowindex: followingobj! + // .data![index].following!.id!, + // ), + // if (index != followingobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + GestureDetector( + onTap: () { + followingobj!.data![index].following! + .principleTypeXid == + 1 + ? Get.toNamed(RouteName.profiletabindguest, + arguments: { + "FollowingidIndex": followingobj! + .data![index] + .followingIamPrincipalXid!, + }) + : Get.toNamed(RouteName.profiletabbusguest, + arguments: { + "FollowingidIndex": followingobj! + .data![index] + .followingIamPrincipalXid!, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followingobj!.data![index].following! + .profilePhoto == + null || + followingobj!.data![index].following! + .profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, ) - ], - ), + : CircleAvatar( + backgroundImage: NetworkImage( + followingobj!.data![index] + .following!.profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + followingobj!.data![index].following! + .fullName == + null || + followingobj!.data![index] + .following!.fullName!.isEmpty + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC(followingobj! + .data![index] + .following! + .fullName!), + sizedBoxHeight(4.h), + followingobj!.data![index].following! + .userName == + null || + followingobj!.data![index] + .following!.userName!.isEmpty + ? text12w400_FCFCFC_blur("regroup") + : text12w400_FCFCFC_blur(followingobj! + .data![index] + .following! + .userName!) + ], ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, + const Spacer(), + PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 176.w), + offset: const Offset(0, 20), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () async { + setState(() { + unfollowid = followingobj! + .data![index] + .following! + .id ?? + 0; + // followingobj!.data!.removeAt(index); + followingobj!.data! + .removeWhere((item) => + item.following!.id == + unfollowid); + Uploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Unfollow user"), + const Spacer(), + Image.asset( + "assets/images/png/Black1323e.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + const Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-22.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], ), ), - )), - ], - ), - ) - ], - ); - }, - ), + ], + ), + ); + }, + ); + } + }, + ), + ]); + } + + Widget _buildNoDataBody(context) { + return 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/AccountSessions.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart index 73c2ed1..347e96b 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.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/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -30,7 +30,65 @@ class _AccountSessionState extends State { appBar: CommonAppbar( titleTxt: "Account sessions", ), - body: Stack(children: [ + body: + FutureBuilder( + future: Profilegetmethod().getAccountSessions(), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return accountsessionobj!.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( @@ -45,17 +103,30 @@ class _AccountSessionState extends State { sizedBoxHeight(16.h), ListView.builder( shrinkWrap: true, - itemCount: sessionData.length, + physics: ScrollPhysics(), + itemCount: accountsessionobj!.data!.length, itemBuilder: (context, index) { - return sessionCard(title: sessionData[index]); + final city = accountsessionobj!.data![index].city; + final state = accountsessionobj!.data![index].state; + final country = accountsessionobj!.data![index].country; + + // Combine city, state, and country + final locationTitle = '$city, $state, $country'; + return sessionCard( + title: locationTitle, + devicename: accountsessionobj!.data![index].deviceName!, + ipaddress: accountsessionobj!.data![index].ipAddress! + + ); }, ) ]), ) - ])); - } + ]); + + } - Widget sessionCard({required String title}) { + Widget sessionCard({required String title, required String devicename, required String ipaddress}) { return Padding( padding: const EdgeInsets.symmetric(vertical: 15), child: commonGlassContainer( @@ -89,7 +160,7 @@ class _AccountSessionState extends State { sizedBoxHeight(16.h), Row( children: [ - text14400whiteblur("Apple iPhone 15"), + text14400whiteblur(devicename), sizedBoxWidth(6.w), Icon( Icons.circle, @@ -97,7 +168,7 @@ class _AccountSessionState extends State { color: Colors.white, ), sizedBoxWidth(6.w), - text144005DFD63("192.158.1.38") + text144005DFD63(ipaddress.toString()) ], ) ], diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart index a37e0aa..815dab9 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart @@ -3,11 +3,16 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.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/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/blureffect.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:shared_preferences/shared_preferences.dart'; class AccountSettings extends StatefulWidget { const AccountSettings({super.key}); @@ -17,7 +22,66 @@ class AccountSettings extends StatefulWidget { } class _AccountSettingsState extends State { - bool swichvalue = false; + // 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(); + + int? accountype ; + if (accountvisibility == false) { + accountype = 0; + } + else if (accountvisibility == true) { + accountype = 1; + } + Map updata = { + "is_account_visibility": accountype, + }; + + final data = await Profilepostmethod().postAccountvisibility(updata); + + if (data.status == ResponseStatus.SUCCESS) { + String? accountype; + +accountype = prefs.getString('accountTypefromLogin'); + +if (accountype == "1") { + EditProfileApi() + .getEditProfileIndividual(); +} +else if (accountype == "2") { + EditProfileApi() + .getEditProfileBusiness(); +} + + + + return utils.showToast(data.message); + } else { + return utils.showToast(data.message); + } + } @override Widget build(BuildContext context) { return Scaffold( @@ -47,32 +111,43 @@ class _AccountSettingsState extends State { 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, + accounTypeLogin == '1' + ? + + 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; + }); + })) + ]), ), - sizedBoxWidth(12.w), - text16w400_FCFCFC("Account visibility"), - Spacer(), - Transform.scale( - scale: 0.9, - child: CupertinoSwitch( - value: swichvalue, - trackColor: Colors.white.withOpacity(0.4), - activeColor: Color(0xFF34C759), - onChanged: (bool? value) { - setState(() { - swichvalue = value ?? false; - }); - })) - ]), - ), commonDivider(), + ], + ) + : SizedBox(), GestureDetector( onTap: () { Get.toNamed(RouteName.changepassword); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart index 616ef33..1e0dc27 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart @@ -190,9 +190,9 @@ class _ContactUsState extends State { onPressed: () { // final isValid = // _formkey.currentState?.validate(); - if (fullname.text.isBlank! && - email.text.isBlank! && - querycontroller.text.isBlank! && + if (fullname.text.isBlank! || + email.text.isBlank! || + querycontroller.text.isBlank! || _selectedreasontocontact.isEmpty) { utils.showToast("Please fill all fields"); } else { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart index 513816c..7d453cf 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart @@ -1,11 +1,20 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/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:shared_preferences/shared_preferences.dart'; class DeleteAccount extends StatefulWidget { const DeleteAccount({super.key}); @@ -15,54 +24,118 @@ class DeleteAccount extends StatefulWidget { } class _DeleteAccountState extends State { + TextEditingController leavingcontroller = TextEditingController(); + + Uploadata() async { + utils.loader(); + Map updata = { + "reason": leavingcontroller.text, + }; + final data = await Profilepostmethod().postDeleteaccount(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("delete done"); + SharedPreferences prefs = await SharedPreferences.getInstance(); + await prefs.remove('access-token'); + await prefs.remove('fullname'); + await prefs.remove('username'); + await prefs.remove('email'); + await prefs.remove('phone'); + await prefs.remove('accountTypefromLogin'); + await prefs.remove('principal_xid'); + await prefs.remove('accountTypeValue'); + + await prefs.clear(); + + Get.offNamed(RouteName.loginScreen); + + return utils.showToast(data.message); + } else { + Get.back(); + print("delete not done"); + return utils.showToast(data.message); + } + } + @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + // resizeToAvoidBottomInset: false, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "", ), - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - text20400white("Sad to see you go"), - sizedBoxHeight(16.h), - Image.asset( - "assets/images/png/Frame 1.png", - height: 119.h, - width: 119.w, - ), - sizedBoxHeight(20.h), - SizedBox( - width: 311.w, - child: text16400white( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type ", - textAlign: TextAlign.center), - ), - sizedBoxHeight(30.h), - text18w400white("Tell us why you are leaving ?"), - sizedBoxHeight(10.h), - CustomTextFormField2( - maxlines: 3, - ), - sizedBoxHeight(20.h), - CommonBtn(text: "I don’t want to delete"), - sizedBoxHeight(18.h), - text16400white("Yes I am ready to delete my account"), - ]), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), - ) - ])); + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + text20400white("Sad to see you go"), + sizedBoxHeight(16.h), + Image.asset( + "assets/images/png/Frame 1.png", + height: 119.h, + width: 119.w, + ), + sizedBoxHeight(20.h), + SizedBox( + width: 311.w, + child: text16400white( + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type ", + textAlign: TextAlign.center), + ), + sizedBoxHeight(30.h), + text18w400white("Tell us why you are leaving ?"), + sizedBoxHeight(10.h), + CustomTextFormField2( + maxlines: 3, + hintText: "Enter why are you leaving", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + textEditingController: leavingcontroller, + ), + sizedBoxHeight(20.h), + CommonBtn( + text: "I don’t want to delete", + onTap: () { + Get.toNamed(RouteName.mainscreen); + }, + ), + sizedBoxHeight(18.h), + GestureDetector( + onTap: () { + if (leavingcontroller.text.isBlank!) { + utils.showToast('Please tell us why are you leaving'); + } else { + Uploadata(); + } + }, + child: text16400white( + "Yes I am ready to delete my account")), + ]), + ), + ) + ])), + ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart index abcdaeb..2b12ccf 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/Model/FetchNotification.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart index 1158609..3bc37e2 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart @@ -10,14 +10,14 @@ class FetchNotification { status = json['status']; statusCode = json['status_code']; message = json['message']; - data = json['data'] != null ? new Data.fromJson(json['data']) : null; + data = json['data'] != null ? Data.fromJson(json['data']) : null; } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -48,12 +48,12 @@ class Data { } Map toJson() { - final Map data = new Map(); - data['group_notification'] = this.groupNotification; - data['community_notification'] = this.communityNotification; - data['follower_notification'] = this.followerNotification; - data['new_follower_notification'] = this.newFollowerNotification; - data['direct_message_notification'] = this.directMessageNotification; + final Map data = {}; + data['group_notification'] = groupNotification; + data['community_notification'] = communityNotification; + data['follower_notification'] = followerNotification; + data['new_follower_notification'] = newFollowerNotification; + data['direct_message_notification'] = directMessageNotification; return data; } } \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart index caa0c8d..2cc16c7 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart @@ -5,9 +5,12 @@ import 'package:get/get.dart'; import 'package:glassmorphism/glassmorphism.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/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/blureffect.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:shared_preferences/shared_preferences.dart'; @@ -20,6 +23,54 @@ 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(); + final data = await Profilepostmethod().postLogoutaccount(); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("delete done"); + SharedPreferences prefs = await SharedPreferences.getInstance(); + await prefs.remove('access-token'); + await prefs.remove('fullname'); + await prefs.remove('username'); + await prefs.remove('email'); + await prefs.remove('phone'); + await prefs.remove('accountTypefromLogin'); + await prefs.remove('principal_xid'); + await prefs.remove('accountTypeValue'); + + await prefs.clear(); + + Get.offNamed(RouteName.loginScreen); + + return utils.showToast(data.message); + } else { + Get.back(); + print("delete not done"); + return utils.showToast(data.message); + } + } + @override Widget build(BuildContext context) { return Scaffold( @@ -58,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); @@ -99,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(); @@ -160,10 +233,11 @@ class _SettingsState extends State { children: [ GestureDetector( onTap: () async { - SharedPreferences prefs = - await SharedPreferences.getInstance(); - await prefs.clear(); - Get.offAllNamed(RouteName.loginScreen); + // SharedPreferences prefs = + // await SharedPreferences.getInstance(); + // await prefs.clear(); + // Get.offAllNamed(RouteName.loginScreen); + Uploadata(); }, child: commonGlassContainer( width: 130.w, diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart index 01a0d99..96c8a2d 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart @@ -21,7 +21,7 @@ class _TermsConditionState extends State { backgroundColor: Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Terms & Condition", ), body: FutureBuilder( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart index 89623a6..edfb5b6 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart @@ -1,3 +1,6 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -5,11 +8,13 @@ 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/Settings/Model/FetchBlockUser.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; import 'package:shared_preferences/shared_preferences.dart'; class BlockedUsers extends StatefulWidget { @@ -57,13 +62,16 @@ class _BlockedUsersState extends State { "subtitle": "Lorem ipsum dummy text", }, ]; - late Future myfuture; + + // late Future myfuture; double? blockedXid; + StreamController searchcontroller = StreamController(); + unblockDone(int index) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setInt('blockedprincipalxid', - fetchblockuser!.data![index].blockedIamPrincipalXid!); + fetchblockuserobj!.data![index].blockedIamPrincipalXid!); blockedXid = prefs.getInt('blockedprincipalxid')!.toDouble(); Map updata = { "blocked_iam_principal_xid": blockedXid.toString(), @@ -83,7 +91,7 @@ class _BlockedUsersState extends State { // utils.showToast('Unblock user successfully'); setState(() { - fetchblockuser!.data!.removeAt(index); + fetchblockuserobj!.data!.removeAt(index); }); print('success'); } else { @@ -104,11 +112,19 @@ class _BlockedUsersState extends State { @override void initState() { - myfuture = BlockUserAPI().fetchBlockUser(); + var updata = ""; + // myfuture = BlockUserAPI().fetchBlockUser(); + BlockUserAPI().getBlockedusers(updata, streamController: searchcontroller); // TODO: implement initState super.initState(); } + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -119,96 +135,301 @@ class _BlockedUsersState extends State { appBar: CommonAppbar( titleTxt: "Blocked users", ), - body: FutureBuilder( - future: myfuture, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Center( - child: CircularProgressIndicator( - color: Colors.blue, + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(25.h), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), ), - ); - } + hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // Onboard().postGroupsearch({"search": value}, + // streamController: searchcontroller); + // searchGroups(value!); + BlockUserAPI().getBlockedusers(value, + streamController: searchcontroller); + }, + ), + ), + sizedBoxHeight(25.h), - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18.spMin), - ), - ); - } - - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - print("Data fetched-->"); - return Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(25.h), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), - ), - ), - hintText: "Search people", - ), - ), - sizedBoxHeight(25.h), - Expanded( - child: ListView.builder( + // Expanded( + // child: ListView.builder( + // shrinkWrap: true, + // itemCount: fetchblockuser!.data!.length, + // itemBuilder: (context, index) { + // return Column( + // children: [ + // blockedUser( + // imagePath: fetchblockuser!.data![index] + // .blockedProfile!.profilePhoto ?? + // '', + // title: fetchblockuser!.data![index] + // .blockedProfile!.fullName ?? + // '', + // subtitle: fetchblockuser!.data![index] + // .blockedProfile!.userName ?? + // '', + // index: index), + // // blockedUser( + // // imagePath: blockedUserData[index] + // // ["imagePath"], + // // title: blockedUserData[index]["title"], + // // subtitle: blockedUserData[index] + // // ["subtitle"]), + // if (index != fetchblockuser!.data!.length - 1) + // commonDivider(), + // ], + // ); + // }, + // ), + // ), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return fetchblockuserobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: ScrollPhysics(), shrinkWrap: true, - itemCount: fetchblockuser!.data!.length, + itemCount: fetchblockuserobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, itemBuilder: (context, index) { return Column( children: [ blockedUser( - imagePath: fetchblockuser!.data![index] + imagePath: fetchblockuserobj!.data![index] .blockedProfile!.profilePhoto ?? '', - title: fetchblockuser!.data![index] + title: fetchblockuserobj!.data![index] .blockedProfile!.fullName ?? '', - subtitle: fetchblockuser!.data![index] + subtitle: fetchblockuserobj!.data![index] .blockedProfile!.userName ?? '', index: index), - // blockedUser( - // imagePath: blockedUserData[index] - // ["imagePath"], - // title: blockedUserData[index]["title"], - // subtitle: blockedUserData[index] - // ["subtitle"]), - if (index != fetchblockuser!.data!.length - 1) - commonDivider(), ], ); + + // Column( + // children: [ + // Padding( + // padding: EdgeInsets.symmetric( + // vertical: 16.h, horizontal: 16.w), + // child: Row( + // children: [ + // followingobj!.data![index].following! + // .profilePhoto == + // null || + // followingobj! + // .data![index] + // .following! + // .profilePhoto! + // .isEmpty + // ? CircleAvatar( + // backgroundImage: AssetImage( + // 'assets/images/png/Ellipse 43.png'), + // radius: 25.r, + // ) + // : CircleAvatar( + // backgroundImage: NetworkImage( + // followingobj! + // .data![index] + // .following! + // .profilePhoto!), + // radius: 25.r, + // ), + // sizedBoxWidth(10.w), + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // followingobj! + // .data![index] + // .following! + // .fullName == + // null || + // followingobj! + // .data![index] + // .following! + // .fullName! + // .isEmpty + // ? text16w400_FCFCFC("Regroup") + // : text16w400_FCFCFC( + // followingobj!.data![index] + // .following!.fullName!), + // sizedBoxHeight(4.h), + // followingobj! + // .data![index] + // .following! + // .userName == + // null || + // followingobj! + // .data![index] + // .following! + // .userName! + // .isEmpty + // ? text12w400_FCFCFC_blur( + // "regroup") + // : text12w400_FCFCFC_blur( + // followingobj!.data![index] + // .following!.userName!) + // ], + // ), + // Spacer(), + // PopupMenuButton( + // surfaceTintColor: Color(0xFF222935), + // constraints: + // BoxConstraints.tightFor( + // width: 176.w), + // offset: Offset(0, 20), + // color: Color(0xFF222935), + // tooltip: "", + // itemBuilder: (BuildContext + // context) => + // [ + // PopupMenuItem( + // onTap: () async { + // setState(() { + // unfollowid = + // followingobj! + // .data![ + // index] + // .following! + // .id ?? + // 0; + // // followingobj!.data!.removeAt(index); + // followingobj!.data! + // .removeWhere((item) => + // item.following! + // .id == + // unfollowid); + // Uploadata(); + // }); + // }, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Unfollow user"), + // Spacer(), + // Image.asset( + // "assets/images/png/Black1323e.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Message user"), + // Spacer(), + // Image.asset( + // "assets/images/png/fluent_chat-20-22.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // ], + // child: Container( + // height: 20, + // width: 20, + // child: Center( + // child: Image.asset( + // "assets/images/png/Group 1000004071.png", + // height: 22.h, + // width: 4.w, + // ), + // ), + // )), + // ], + // ), + // ), + // ], + // ); }, - ), - ), - sizedBoxHeight(20.h) - ]) - ]); - } - return Container(); - })); + ); + } + }, + ), + sizedBoxHeight(20.h) + ]), + ) + ])); + } + + 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), + ) + ], + ), + ); } dialogwidget({required int index}) { @@ -273,28 +494,39 @@ class _BlockedUsersState extends State { } Widget blockedUser({ - required String imagePath, - required String title, - required String subtitle, + required String? imagePath, + required String? title, + required String? subtitle, required int index, }) { return Padding( padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), child: Row( children: [ - CircleAvatar( - backgroundImage: NetworkImage(imagePath), + imagePath == null || imagePath.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage("assets/images/png/cimg3.png"), - // AssetImage(imagePath), - radius: 25.r, - ), + // AssetImage(imagePath), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage(imagePath), + + // AssetImage(imagePath), + radius: 25.r, + ), sizedBoxWidth(10.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - text16w400_FCFCFC(title), + title == null || title.isEmpty + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC(title), sizedBoxHeight(4.h), - text12w400_FCFCFC_blur(subtitle), + subtitle == null || subtitle.isEmpty + ? text12w400_FCFCFC_blur('regroup') + : text12w400_FCFCFC_blur(subtitle), ], ), Spacer(), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart index 7d8640d..10b0369 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart @@ -1,32 +1,34 @@ +import 'dart:async'; + 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/Settings/Model/FetchBlockUser.dart'; -FetchBlockedUser? fetchblockuser; +FetchBlockedUser? fetchblockuserobj; class BlockUserAPI { BlockUserAPI(); - Future> fetchBlockUser() async { - final response = await NetworkApiServices().getApi( - ApiUrls.getblockuser, - ); - fetchblockuser = FetchBlockedUser.fromJson(response.data); - if (response.status == ResponseStatus.SUCCESS) { - if (response.data["status"] == "success") { - print("Success---->"); - return ResponseData( - response.data['message'], ResponseStatus.SUCCESS, - data: response.data); - } else { - return ResponseData( - response.data['message'], ResponseStatus.FAILED); - } - } + // Future> fetchBlockUser() async { + // final response = await NetworkApiServices().getApi( + // ApiUrls.getblockuser, + // ); + // fetchblockuser = FetchBlockedUser.fromJson(response.data); + // if (response.status == ResponseStatus.SUCCESS) { + // if (response.data["status"] == "success") { + // print("Success---->"); + // return ResponseData( + // response.data['message'], ResponseStatus.SUCCESS, + // data: response.data); + // } else { + // return ResponseData( + // response.data['message'], ResponseStatus.FAILED); + // } + // } - return response; - } + // return response; + // } Future> postBlockApi(var data) async { final response = await NetworkApiServices().postApi( @@ -50,4 +52,19 @@ class BlockUserAPI { return response; } + Future> getBlockedusers(updata, + {required StreamController streamController}) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getblockuser}?search=$updata", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + fetchblockuserobj = FetchBlockedUser.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(fetchblockuserobj!); + } + return response; + } + } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart index f9ca64d..ca67740 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart @@ -1,16 +1,29 @@ +import 'dart:developer'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:regroup/Common/CommonButton.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'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/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'; +import 'package:shared_preferences/shared_preferences.dart'; class AddTimeline extends StatefulWidget { const AddTimeline({super.key}); @@ -22,167 +35,1094 @@ class AddTimeline extends StatefulWidget { class _AddTimelineState extends State { TextEditingController dateController = TextEditingController(); TextEditingController dateController2 = TextEditingController(); + TextEditingController clubNameController = TextEditingController(); + TextEditingController rollnameController = TextEditingController(); + TextEditingController teamnameController = TextEditingController(); - final List _dropdownProductItems = [ - 'Individual', - 'Business', - ]; - - String _selectedAccountType = ''; - - void _onItemSelected(String value) { - setState(() { - _selectedAccountType = value; - }); - } + int id = Get.arguments["id"]; + bool edited = Get.arguments["edit"]; RxBool isChecked = false.obs; + + timelineabilist.TimelineAbilityListModel? abilityModel; + List timeline = []; + List _abilitydrop = []; + + Future fetchABilitylist() async { + TimelineAbilityListApi abilityLsitAPI = TimelineAbilityListApi(); + ResponseData response = await abilityLsitAPI.getAbilitylistApi(); + + if (response.status == ResponseStatus.SUCCESS) { + abilityModel = + timelineabilist.TimelineAbilityListModel.fromJson(response.data!); + setState(() { + timeline = abilityModel!.data ?? []; // Store the fetched cities + _abilitydrop = + timeline.map((platform) => platform.name.toString()).toList(); + }); + log(timeline.toString()); + } else { + print('Failed to fetch abilities'); + } + } + + List selectedabilityid = []; + + void getCatIdFromName(List selectedAbilities) { + selectedabilityid.clear(); // Clear existing selections + for (var name in selectedAbilities) { + for (var i = 0; i < timeline.length; i++) { + if (name == timeline[i].name) { + selectedabilityid.add(timeline[i].id!); + break; // Assuming each name is unique, we break after finding a match + } + } + } + } + + // late Future myfuture; + FutureGroup futureGroup = FutureGroup(); + RxBool isloading = true.obs; + List seelctedNameList = []; + @override + void initState() { + // TODO: implement initState + + if (edited == true) { + // futureGroup.add( + Profilegetmethod().getEditTimeline(id).then((value) { + clubNameController.text = + edittimelineobj!.data!.timelineData!.clubName ?? ""; + rollnameController.text = + edittimelineobj!.data!.timelineData!.roleName ?? ""; + teamnameController.text = + edittimelineobj!.data!.timelineData!.teamName ?? ""; + ""; + dateController.text = + edittimelineobj!.data!.timelineData!.startDate ?? ""; + dateController2.text = + edittimelineobj!.data!.timelineData!.endDate ?? ""; + + log(_abilityMap.length.toString()); + // futureGroup.add( + fetchABilitylist().then((value) { + String abilitiesXids = + edittimelineobj!.data!.timelineData!.abilitiesXids ?? ""; + abilitiesIds = abilitiesXids + .split(',') + .map((e) => int.tryParse(e.trim()) ?? 0) // Trim spaces around IDs + .toList(); + selectedabilityid = abilitiesIds; + + print(selectedabilityid.toList()); + + for (int i = 0; i < _abilitydrop.length; i++) { + _abilityMap.add({ + "id": i + 1, + "name": _abilitydrop[i], + }); + } + getSelectedNames(selectedabilityid).then((value) { + seelctedNameList = value; + isloading = false.obs; + }); + }); + // ); + }); + } else { + fetchABilitylist().then((value) { + isloading = false.obs; + }); + } + + super.initState(); + } + + List abilitiesIds = []; + + UploadData() async { + // SharedPreferences prefs = await SharedPreferences.getInstance(); + utils.loader(); + String abilitiesIds = selectedabilityid.join(','); + print(abilitiesIds); + Map updata = { + "club_name": clubNameController.text, + "role_name": rollnameController.text, + "team_name": teamnameController.text, + "start_date": dateController.text, + "end_date": dateController2.text, + "abilities_xids": abilitiesIds, + }; + final data = await Profilepostmethod().postTimeline(updata); + if (data.status == ResponseStatus.SUCCESS) { + 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 { + Get.back(); + print("timeline not done"); + return utils.showToast(data.message); + } + } + + EdituploadData() async { + utils.loader(); + String abilitiesIds = selectedabilityid.join(','); + print(abilitiesIds); + Map updata = { + "club_name": clubNameController.text, + "role_name": rollnameController.text, + "team_name": teamnameController.text, + "start_date": dateController.text, + "end_date": dateController2.text, + "abilities_xids": abilitiesIds, + "timeline_id": id, + }; + final data = await Profilepostmethod().postEditTimeline(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("timeline done"); + // 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"); + return utils.showToast(data.message); + } + } + +// List> _abilityMap = []; + List> _abilityMap = []; + List listData = []; + +// Function to get names from selected IDs + Future> getSelectedNames(List selectedIds) async { + List selectedNames = []; + for (int id in selectedIds) { + for (Map ability in _abilityMap) { + if (ability["id"] == id) { + selectedNames.add(ability["name"]); + break; + } + } + _abilitydrop = + _abilityMap.map((ability) => ability["name"] as String).toList(); + } + + return selectedNames; + } + @override Widget build(BuildContext context) { - return Scaffold( - resizeToAvoidBottomInset: false, - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Add timeline", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // resizeToAvoidBottomInset: false, + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Add timeline", ), - SingleChildScrollView( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(20.h), - text16400white("Club name"), - sizedBoxHeight(15.h), - CustomTextFormField(), - sizedBoxHeight(25.h), - text16400white("Role in the club"), - sizedBoxHeight(15.h), - CustomTextFormField(), - sizedBoxHeight(25.h), - text16400white("Team name"), - sizedBoxHeight(15.h), - CustomTextFormField(), - 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( - 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( + body: Obx(() + // { + => + isloading.value + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, 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!; - }), - ), - ), - ); - }), - sizedBoxWidth(8.w), - text10400white("Present") + CircularProgressIndicator(), ], - ), - ], - ), - ) - ], - ), - text16400white("Ability"), - sizedBoxHeight(15.h), - CustomDropDownWidgetSignup( - header: 'Select ability', - title: '', - listData: _dropdownProductItems, - onItemSelected: _onItemSelected, - // leadingImage: - // Image.asset( - // 'assets/images/png/user.png', - // ), - ), - sizedBoxHeight(80.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: CommonBtn(text: "Add timeline"), - ), - ]), - )) - ])); + )) + : 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: [ + 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, + ), + ), + ), + ), + ), + ) + ], + ), + ), + 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: [ + 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, + ), + ), + ), + ), + ), + ) + ], + ), + ), + 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(); + } + }, + ), + ), + ]), + ) + ]) + ]) + + // } + )), + ); + } +} + +class CustomDropDownCheckBoxTimeline extends StatefulWidget { + const CustomDropDownCheckBoxTimeline({ + Key? key, + required this.header, + required this.title, + required this.listData, + required this.onItemSelected, + this.leadingImage, + this.showOtherOption = false, + required this.initiallySelected, + }) : super(key: key); + + final String header; + final String title; + final List listData; + final Function(List) onItemSelected; + final Widget? leadingImage; + final bool showOtherOption; + final List initiallySelected; + + @override + State createState() => + _CustomDropDownCheckBoxTimelineState(); +} + +class _CustomDropDownCheckBoxTimelineState + extends State { + RxBool onDropTap = false.obs; + RxList selectedValues = [].obs; + final TextEditingController _textController = TextEditingController(); + + @override + void initState() { + super.initState(); + selectedValues + .addAll(widget.initiallySelected); // Initialize selectedValues + } + + // List> _buildDropdownMenuItems() { + // List> items = + // widget.listData.asMap().entries.map((entry) { + // int index = entry.key; + // String item = entry.value; + // return DropdownMenuItem( + // value: item, + // child: InkWell( + // onTap: () { + // setState(() { + // if (selectedValues.contains(item)) { + // selectedValues.remove(item); + // } else { + // selectedValues.add(item); + // } + // _textController.clear(); + // widget.onItemSelected( + // selectedValues.toList()); // Convert RxList to List + // }); + // }, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Obx(() { + // return Checkbox( + // value: selectedValues.contains(item), + // activeColor: Colors.white, + // checkColor: const Color(0xFFD90B2E), + // onChanged: (bool? value) { + // setState(() { + // if (value == true) { + // selectedValues.add(item); + // } else { + // selectedValues.remove(item); + // } + // _textController.clear(); + // widget.onItemSelected(selectedValues.toList()); + // }); + // }, + // ); + // }), + // const SizedBox(width: 8), + // Text( + // item, + // style: const TextStyle( + // color: Colors.white, + // fontSize: 16, + // fontFamily: 'Helvetica', + // fontWeight: FontWeight.w500, + // ), + // overflow: TextOverflow.ellipsis, + // ), + // ], + // ), + // if (index != widget.listData.length - 1) + // const Divider(thickness: 1, color: Color(0xFF434A53)), + // ], + // ), + // ), + // ); + // }).toList(); + + // if (widget.showOtherOption) { + // items.add( + // DropdownMenuItem( + // value: _textController.text, + // child: Column( + // children: [ + // const Divider(thickness: 1, color: Color(0xFF434A53)), + // Row( + // children: [ + // Obx(() { + // return Checkbox( + // value: selectedValues.contains(_textController.text), + // activeColor: Colors.white, + // onChanged: (bool? value) { + // setState(() { + // if (value == true && + // _textController.text.trim().isNotEmpty) { + // selectedValues.add(_textController.text); + // } else { + // selectedValues.remove(_textController.text); + // } + // widget.onItemSelected(selectedValues.toList()); + // }); + // }, + // ); + // }), + // const SizedBox(width: 8), + // const Text( + // "Other: ", + // style: TextStyle( + // color: Colors.white, + // fontSize: 16, + // fontFamily: 'Helvetica', + // fontWeight: FontWeight.w500, + // ), + // overflow: TextOverflow.ellipsis, + // ), + // Expanded( + // child: TextField( + // controller: _textController, + // style: const TextStyle( + // color: Colors.white, + // fontSize: 16, + // fontFamily: 'Helvetica', + // fontWeight: FontWeight.w500, + // ), + // decoration: const InputDecoration( + // hintText: '', + // hintStyle: TextStyle(color: Colors.white70), + // border: UnderlineInputBorder(), + // ), + // ), + // ), + // TextButton( + // onPressed: () { + // setState(() { + // if (_textController.text.trim().isNotEmpty) { + // selectedValues.add(_textController.text); + // widget.onItemSelected(selectedValues.toList()); + // } + // }); + // }, + // child: const Text( + // 'OK', + // style: TextStyle( + // color: Colors.white, + // fontSize: 16, + // fontFamily: 'Helvetica', + // fontWeight: FontWeight.w500, + // ), + // ), + // ), + // ], + // ), + // SizedBox(height: 10), + // ], + // ), + // ), + // ); + // } + // return items; + // } + + List> _buildDropdownMenuItems() { + return widget.listData.asMap().entries.map((entry) { + int index = entry.key; + String item = entry.value; + return DropdownMenuItem( + value: item, + child: InkWell( + onTap: () { + setState(() { + if (selectedValues.contains(item)) { + selectedValues.remove(item); + } else { + selectedValues.add(item); + } + _textController.clear(); + widget.onItemSelected(selectedValues.toList()); + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Obx(() { + return Checkbox( + value: selectedValues.contains(item), + activeColor: Colors.white, + checkColor: const Color(0xFFD90B2E), + onChanged: (bool? value) { + setState(() { + if (value == true) { + selectedValues.add(item); + } else { + selectedValues.remove(item); + } + _textController.clear(); + widget.onItemSelected(selectedValues.toList()); + }); + }, + ); + }), + const SizedBox(width: 8), + Expanded( + child: Text( + item, + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w500, + ), + maxLines: 1, // Adjust as needed + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + if (index != widget.listData.length - 1) + const Divider(thickness: 1, color: Color(0xFF434A53)), + ], + ), + ), + ); + }).toList(); + } + + @override + Widget build(BuildContext context) { + return Obx( + () => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () { + onDropTap.value = !onDropTap.value; + }, + child: Container( + width: double.infinity, + height: 50, + padding: EdgeInsets.only( + right: 22, + left: 12, + ), + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: onDropTap.value + ? const BorderRadius.vertical( + top: Radius.circular(30), + ) + : const BorderRadius.all(Radius.circular(30)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + border: Border.all(color: const Color(0xFF434A53)), + ), + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + widget.leadingImage == null + ? SizedBox() + : widget.leadingImage!, + const SizedBox(width: 12), + Expanded( + child: Text( + selectedValues.isEmpty + ? widget.header + : selectedValues.join(', '), + style: TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + overflow: TextOverflow.ellipsis, + ), + ), + const Spacer(), + onDropTap.value + ? Image.asset('assets/images/png/arrowup.png') + : Image.asset('assets/images/png/arrowdown.png'), + ], + ), + ), + ), + ), + if (onDropTap.value) + Scrollbar( + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: const BorderRadius.vertical( + bottom: Radius.circular(30), + ), + border: Border.all(color: const Color(0xFF434A53)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + ), + child: Column( + children: _buildDropdownMenuItems(), + ), + ), + ), + ], + ), + ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart b/lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart new file mode 100644 index 0000000..37223ee --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart @@ -0,0 +1,32 @@ + + + +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/timelineabilityModel.dart'; + +class TimelineAbilityListApi { + TimelineAbilityListApi(); + var data = ""; + Future> getAbilitylistApi() async { + final response = await NetworkApiServices().getApi( + ApiUrls.gettimelineabilitylist, + + ); + + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + print("success"); + TimelineAbilityListModel timelineabilitylistobj = + TimelineAbilityListModel.fromJson(responseData); + } else { + // return ResponseData( + // responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} 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 254111f..15eb216 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart @@ -4,19 +4,29 @@ 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/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'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart'; +// import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'; FaqModel? faqobj; PrivacypolicyModel? privacyobj; TermsConditionsModel? termsobj; FollowersModel? followersobj; FollowingModel? followingobj; +GetEditTimelineModel? edittimelineobj; +GetAccountSessionsModel? accountsessionobj; +CertificateuserModel? certificateobj; + + class Profilegetmethod { + // Profilegetmethod(); Future> getFaqs() async { final response = await NetworkApiServices().getApi( ApiUrls.getfaqs, @@ -78,4 +88,40 @@ class Profilegetmethod { } return response; } + + Future> getEditTimeline(int data) async { + final response = await NetworkApiServices().getApi(ApiUrls.getedittimeline + "/?timeline_id=${data}"); + + if (response.status == ResponseStatus.SUCCESS) { + edittimelineobj = GetEditTimelineModel.fromJson(response.data); + log(edittimelineobj!.data.toString()); + } + return response; + } + + Future> getAccountSessions() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getaccountsessions, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + accountsessionobj = GetAccountSessionsModel.fromJson(response.data); + log(accountsessionobj!.data.toString()); + } + 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 064b81d..0fc9289 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart @@ -1,9 +1,20 @@ +import 'dart:convert'; +import 'dart:developer'; + +import 'package:dio/dio.dart'; 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 ' + + base64.encode( + utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&')); Future> postContactus(updata) async { print("updata is $updata"); @@ -27,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, @@ -38,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, @@ -49,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, @@ -60,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, @@ -71,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, @@ -81,4 +92,183 @@ class Profilepostmethod { print("response message is ${response.message}"); return response; } + + Future> postTimeline(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.posttimeline, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postAccountvisibility(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postaccountvisibility, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postDeleteaccount(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postdeleteaccount, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postLogoutaccount() async { + Response response; + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('access-token'); + + try { + response = await dio.post( + ApiUrls.postlogoutaccount, + options: Options( + headers: {'authorization': basicAuth, 'access-token': token}, + ), + ); + log(response.toString()); + } on Exception catch (e) { + if (e is DioException) { + log(e.response.toString()); + if (e.response == null) { + return ResponseData( + 'Oops something Went Wrong, Please try again!', + ResponseStatus.FAILED, + ); + } + if (e.response!.statusCode == 401) { + prefs.remove('token'); + prefs.remove('refreshToken'); + // Get.toNamed(RouteName.login); + return ResponseData( + 'Oops something Went Wrong, Please try again!', + ResponseStatus.FAILED, + ); + } + if (e.response!.statusCode == 403) { + if (e.response!.data['message'] is List) { + return ResponseData( + e.response!.data['message'][0]!, ResponseStatus.FAILED, + data: e.response!.data); + } else { + return ResponseData( + e.response!.data['message'], ResponseStatus.FAILED, + data: e.response!.data); + } + } + } + return ResponseData( + 'Oops something Went Wrong', + ResponseStatus.FAILED, + ); + } + + if (response.statusCode == 200 || response.statusCode == 201) { + return ResponseData("success", ResponseStatus.SUCCESS, + data: response.data); + } else if (response.statusCode == 203) { + print(response.data); + return ResponseData("success", ResponseStatus.PRIVATE, + data: response.data); + } else { + try { + return ResponseData( + response.data['message'].toString(), ResponseStatus.FAILED); + } catch (_) { + return ResponseData( + response.statusMessage!, ResponseStatus.FAILED); + } + } + } + + Future> postEditTimeline(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postedittimeline, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postRemoveTimeline(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postremovetimeline, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postRemoveCertification(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postremovecertification, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postCertification(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postcertification, + ); + print("response is ${response.data}"); + 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/Notification/View/notification.dart b/lib/Feed Module/Notification/View/notification.dart index fa8fb0d..619f56b 100644 --- a/lib/Feed Module/Notification/View/notification.dart +++ b/lib/Feed Module/Notification/View/notification.dart @@ -51,18 +51,18 @@ class _NotificationPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), - appBar: CommonAppbar( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + appBar: const CommonAppbar( titleTxt: 'Notifications', ), body: Stack( children: [ // const CommonBlurLeftRed(), - Positioned(top: 10, left: -30, child: CommonBlurLeftSecond()), + const Positioned(top: 10, left: -30, child: CommonBlurLeftSecond()), // const CommonBlurRightRed(), // const CommonBlurLeft(), - Positioned(top: 150, right: -30, child: CommonBlurRightSecond()), - Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()), + const Positioned(top: 150, right: -30, child: CommonBlurRightSecond()), + const Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()), GlassmorphicContainer( width: MediaQuery.of(context).size.width, height: @@ -76,10 +76,10 @@ class _NotificationPageState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), @@ -93,9 +93,9 @@ class _NotificationPageState extends State { colors: [ // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), ], ), child: Column( @@ -104,7 +104,7 @@ class _NotificationPageState extends State { separatorBuilder: (context, index) { return Divider( thickness: 0.6.h, - color: Color(0xffFFFFFF).withOpacity(0.72), + color: const Color(0xffFFFFFF).withOpacity(0.72), ); }, itemCount: notificationcontents.length, @@ -135,7 +135,7 @@ class Notificationlist extends StatefulWidget { final bool followrequest; // const Notificationlist({super.key}); - Notificationlist({ + const Notificationlist({ Key? key, required this.imageurl, required this.msgrequest, @@ -207,7 +207,7 @@ class _NotificationlistState extends State { text12400white('3 mins ago'), ], ), - Spacer(), + const Spacer(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -240,7 +240,7 @@ class _NotificationlistState extends State { ], ), // sizedBoxWidth(25.w), - Spacer(), + const Spacer(), Expanded( child: Image.asset( 'assets/images/png/notifcation.png', 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/Global.dart b/lib/Global.dart index 563c15c..ca8119d 100644 --- a/lib/Global.dart +++ b/lib/Global.dart @@ -1,5 +1,4 @@ import 'dart:async'; - import 'package:get/get.dart'; String? myusername; @@ -14,3 +13,5 @@ bool OnBoard = false; RxInt notification = 0.obs; late Timer timerhomeglobal; bool isTimerInitialize = false; +String? globalAccountType; + diff --git a/lib/Login/View/loginscreen.dart b/lib/Login/View/loginscreen.dart index 72314d1..9ebeb6a 100644 --- a/lib/Login/View/loginscreen.dart +++ b/lib/Login/View/loginscreen.dart @@ -72,7 +72,23 @@ class _LoginScreenState extends State { snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); - Get.toNamed(RouteName.mainscreen); + // Get.toNamed(RouteName.mainscreen,arguments: 0); + await Getuserdetails().Getuser().then((value) { + if (getuserobj?.data?.userData?.isProfileUpdated == 0) { + String? accountype = + getuserobj?.data?.userData?.principalTypeXid.toString(); + + if (accountype == "1") { + Get.toNamed(RouteName.tellusindividualscreen, + arguments: {'pageroute': "mainscreen"}); + } else if (accountype == "2") { + Get.toNamed(RouteName.tellusbusinessscreen, + arguments: {'pageroute': "mainscreen"}); + } + } else { + Get.toNamed(RouteName.mainscreen,arguments: 0); + } + }); logger.d("go to login"); } } else { @@ -196,311 +212,387 @@ class _LoginScreenState extends State { } } + Future _onBackButtonPressed( + BuildContext context, + TextEditingController emailController, + TextEditingController passwordController) async { + bool? exitApp = await showDialog( + barrierDismissible: false, + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: Color(0xff222935), + title: Text( + 'Exit App', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), + content: Text( + 'Do you really want to close the app?', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(false); + }, + child: const Text( + 'No', + style: TextStyle( + color: Colors.white, + ), + ), + ), + TextButton( + onPressed: () { + emailController.clear(); + passwordController.clear(); + + // Reset form state to remove error borders + + SystemNavigator.pop(); + Navigator.pop(context); + }, + child: const Text( + 'Yes', + style: TextStyle( + color: Color(0xFFD90B2E), + ), + ), + ) + ], + ); + }); + return exitApp ?? false; + } + @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - resizeToAvoidBottomInset: - false, // Prevent resizing when the keyboard opens - backgroundColor: const Color.fromARGB(255, 18, 32, 47), - body: Stack( - clipBehavior: Clip.none, - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Choice screen.png"), - fit: BoxFit.cover)), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 150.h, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Align( - alignment: Alignment.center, - child: Container( - width: 107.w, - height: 70.h, - child: SvgPicture.asset( - "assets/images/svg/onboarding2.svg", - fit: BoxFit.cover, + return WillPopScope( + onWillPop: () async { + _onBackButtonPressed(context, _emailController, _passwordController); + + return true; + }, + child: GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + resizeToAvoidBottomInset: + false, // Prevent resizing when the keyboard opens + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack( + clipBehavior: Clip.none, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Choice screen.png"), + fit: BoxFit.cover)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 150.h, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Align( + alignment: Alignment.center, + child: Container( + width: 107.w, + height: 70.h, + child: SvgPicture.asset( + "assets/images/svg/onboarding2.svg", + fit: BoxFit.cover, + ), ), ), ), - ), - sizedBoxHeight(20.h), - Align( - alignment: Alignment.center, - child: text22400FCFCFC("Find your community")), - sizedBoxHeight(40.h), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16400white('Email address'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: _emailController, - hintText: "Enter your email address", - leadingIcon: - // const Icon(Icons.mail_outline), - SizedBox( - width: 22.w, - height: 17.h, - child: Image.asset( - 'assets/images/png/mail.png', + sizedBoxHeight(20.h), + Align( + alignment: Alignment.center, + child: text22400FCFCFC("Find your community")), + sizedBoxHeight(40.h), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white('Email address'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: _emailController, + hintText: "Enter your email address", + leadingIcon: + // const Icon(Icons.mail_outline), + SizedBox( + width: 22.w, + height: 17.h, + child: Image.asset( + 'assets/images/png/mail.png', + width: 22.w, + height: 17.h, + ), + ), + // validationMessage: errormsg.value, + validator: (value) { + if (value!.isEmpty) { + return 'Enter your e-mail address'; + } + if (!RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(value)) { + return 'Enter a valid e-mail address'; + } + return null; + }, + // onInput: (p0) { + // if (p0!.isEmpty) { + // errormsg.value = 'Enter your e-mail address'; + // } + // if (!RegExp( + // r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + // .hasMatch(p0!)) { + // errormsg.value = 'Enter a valid e-mail address'; + // } + // return null; + // }, + // validatorText: "Email Id", + + inputFormatters: [ + LengthLimitingTextInputFormatter(30), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + text16400white('Password'), + sizedBoxHeight(10.h), + CustomTextFormField( + isInputPassword: true, + textEditingController: _passwordController, + hintText: 'Enter your password', + leadingIcon: Image.asset( + 'assets/images/png/lock.png', width: 22.w, height: 17.h, ), - ), - // validationMessage: errormsg.value, - validator: (value) { - if (value!.isEmpty) { - return 'Enter your e-mail address'; - } - if (!RegExp( - r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - .hasMatch(value)) { - return 'Enter a valid e-mail address'; - } - return null; - }, - // onInput: (p0) { - // if (p0!.isEmpty) { - // errormsg.value = 'Enter your e-mail address'; - // } - // if (!RegExp( - // r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - // .hasMatch(p0!)) { - // errormsg.value = 'Enter a valid e-mail address'; - // } - // return null; - // }, - // validatorText: "Email Id", - - inputFormatters: [ - LengthLimitingTextInputFormatter(30), - RemoveEmojiInputFormatter() - ], - ), - sizedBoxHeight(10.h), - text16400white('Password'), - sizedBoxHeight(10.h), - CustomTextFormField( - isInputPassword: true, - textEditingController: _passwordController, - hintText: 'Enter your password', - leadingIcon: Image.asset( - 'assets/images/png/lock.png', - width: 22.w, - height: 17.h, - ), - // validationMessage: errormsgpass.value, - validator: (value) { - if (value!.isEmpty) { - return 'Please enter your password'; - } - if (!RegExp( - r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$') - .hasMatch(value)) { - return 'Enter a valid password'; - } - - return null; - }, - // onInput: (p0) { - // if (p0 == null || p0.isEmpty) { - // errormsgpass.value = - // 'Please enter your password'; - // } - // return null; - // }, - inputFormatters: [ - LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter() - ], - ), - sizedBoxHeight(10.h), - Align( - alignment: Alignment.centerRight, - child: Padding( - padding: EdgeInsets.only(right: 6.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.forgotpass); - }, - child: text14400white('Forgot password ?')), - )), - sizedBoxHeight(40.h), - CustomButton( - text: "Login", - onPressed: () { - _logincheck(); - }), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.signupscreen); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text14400white('Don’t have account ? '), - sizedBoxWidth(5.w), - text14700white('Sign up') + // validationMessage: errormsgpass.value, + validator: (value) { + if (value!.isEmpty) { + return 'Please enter your password'; + } + if (!RegExp( + r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$') + .hasMatch(value)) { + return 'Enter a valid password'; + } + + return null; + }, + // onInput: (p0) { + // if (p0 == null || p0.isEmpty) { + // errormsgpass.value = + // 'Please enter your password'; + // } + // return null; + // }, + inputFormatters: [ + LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter() ], ), - ), - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: 160, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 0.50, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF434A53), - ), - ), - ), - ), - sizedBoxWidth(6.w), - text14400white('Or'), - sizedBoxWidth(6.w), - Container( - width: 160, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 0.50, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF434A53), - ), - ), - ), - ), - ], - ), - sizedBoxHeight(20.h), - Center( - child: SizedBox( - width: 220.w, + sizedBoxHeight(10.h), + Align( + alignment: Alignment.centerRight, + child: Padding( + padding: EdgeInsets.only(right: 6.w), + child: GestureDetector( + onTap: () { + Get.toNamed(RouteName.forgotpass); + }, + child: + text14400white('Forgot password ?')), + )), + sizedBoxHeight(40.h), + CustomButton( + text: "Login", + onPressed: () { + _logincheck(); + }), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.signupscreen); + }, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (Platform.isIOS) - GestureDetector( - onTap: () { - _loginWithApple(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login2.png'))), - ), - ), - // const Spacer(), - if (Platform.isAndroid) - GestureDetector( - onTap: () { - _loginWithGoogle(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login3.png'))), - ), - ), - // const Spacer(), - GestureDetector( - onTap: () async { - _checkIfisLoggedIn(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login4.png'))), - ), - ), + text14400white('Don’t have account ? '), + sizedBoxWidth(5.w), + text14700white('Sign up') ], ), ), - ), - // sizedBoxHeight(100) - ], + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: + BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + sizedBoxWidth(6.w), + text14400white('Or'), + sizedBoxWidth(6.w), + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: + BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + ], + ), + sizedBoxHeight(20.h), + Center( + child: SizedBox( + width: 220.w, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + if (Platform.isIOS) + GestureDetector( + onTap: () { + _loginWithApple(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment( + 0.71, -0.70), + end: + const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login2.png'))), + ), + ), + // const Spacer(), + if (Platform.isAndroid) + GestureDetector( + onTap: () { + _loginWithGoogle(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment( + 0.71, -0.70), + end: + const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login3.png'))), + ), + ), + // const Spacer(), + GestureDetector( + onTap: () async { + _checkIfisLoggedIn(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: + const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login4.png'))), + ), + ), + ], + ), + ), + ), + // sizedBoxHeight(100) + ], + ), ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), ); diff --git a/lib/Login/View/verifygoogleapple.dart b/lib/Login/View/verifygoogleapple.dart index bc134a0..cd8df8d 100644 --- a/lib/Login/View/verifygoogleapple.dart +++ b/lib/Login/View/verifygoogleapple.dart @@ -16,6 +16,7 @@ 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:shared_preferences/shared_preferences.dart'; class Verifygoogleandapple extends StatefulWidget { Verifygoogleandapple({ @@ -51,6 +52,11 @@ class _VerifygoogleandappleState extends State { } } + final Map _accountTypeMap = { + 'Individual': 1, + 'Business': 2, + }; + _createAccountWithOAuth() async { var updata = { "principal_type_xid": getIdFromAccountType(), @@ -59,8 +65,16 @@ class _VerifygoogleandappleState extends State { final resp = await LoginAPI() .storeUserDetailsWhenComingFromGoogleAppleSignin(updata); + SharedPreferences prefs = await SharedPreferences.getInstance(); if (resp.status == ResponseStatus.SUCCESS) { + int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; + + await prefs.setString('accountTypefromLogin', + accountTypeValue.toString()); + await prefs.setString('accountTypeValue', + accountTypeValue.toString()); + if (_selectedAccountType == 'Individual') { Get.toNamed(RouteName.tellusindividualscreen); } else { diff --git a/lib/Login/ViewModel/LoginApi.dart b/lib/Login/ViewModel/LoginApi.dart index dd4e59a..80cf01b 100644 --- a/lib/Login/ViewModel/LoginApi.dart +++ b/lib/Login/ViewModel/LoginApi.dart @@ -35,6 +35,10 @@ class LoginAPI { phonenumber = loginObj.data?.userData?.phoneNumber; await prefs.setString('accountTypefromLogin', loginObj.data?.userData?.principalTypeXid.toString() ?? ""); + globalAccountType = + loginObj.data?.userData?.principalTypeXid.toString(); + await prefs.setString('accountTypeValue', + loginObj.data?.userData?.principalTypeXid.toString() ?? ""); print("token is ${loginObj.data!.accessToken!}"); if (loginObj.data?.userData?.isProfileUpdated == 0) { @@ -101,7 +105,23 @@ class LoginAPI { return ResponseData( "go-to-signin-via-oauth", ResponseStatus.SUCCESS); } else { - Get.toNamed(RouteName.mainscreen); + await Getuserdetails().Getuser().then((value) { + if (getuserobj?.data?.userData?.isProfileUpdated == 0) { + String? accountype = + getuserobj?.data?.userData?.principalTypeXid.toString(); + + if (accountype == "1") { + Get.toNamed(RouteName.tellusindividualscreen, + arguments: {'pageroute': "mainscreen"}); + } else if (accountype == "2") { + Get.toNamed(RouteName.tellusbusinessscreen, + arguments: {'pageroute': "mainscreen"}); + } + } else { + Get.toNamed(RouteName.mainscreen,arguments: 0); + } + }); + // Get.toNamed(RouteName.mainscreen); return ResponseData("go-to-login", ResponseStatus.SUCCESS); } } @@ -122,7 +142,23 @@ class LoginAPI { return ResponseData( "go-to-signin-via-oauth", ResponseStatus.SUCCESS); } else { - Get.toNamed(RouteName.mainscreen); + // Get.toNamed(RouteName.mainscreen); + await Getuserdetails().Getuser().then((value) { + if (getuserobj?.data?.userData?.isProfileUpdated == 0) { + String? accountype = + getuserobj?.data?.userData?.principalTypeXid.toString(); + + if (accountype == "1") { + Get.toNamed(RouteName.tellusindividualscreen, + arguments: {'pageroute': "mainscreen"}); + } else if (accountype == "2") { + Get.toNamed(RouteName.tellusbusinessscreen, + arguments: {'pageroute': "mainscreen"}); + } + } else { + Get.toNamed(RouteName.mainscreen,arguments: 0); + } + }); return ResponseData("go-to-login", ResponseStatus.SUCCESS); } } diff --git a/lib/Utils/Common/AppleOAuthService.dart b/lib/Utils/Common/AppleOAuthService.dart index 3740a71..89fb57d 100644 --- a/lib/Utils/Common/AppleOAuthService.dart +++ b/lib/Utils/Common/AppleOAuthService.dart @@ -1,4 +1,4 @@ -import 'package:get/get.dart'; + import 'package:regroup/Login/ViewModel/LoginApi.dart'; import 'package:regroup/Utils/Common/googleOAuthService.dart'; import 'package:sign_in_with_apple/sign_in_with_apple.dart'; diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index aaea678..9e4648f 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -1,9 +1,6 @@ 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/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; class CustomDropDownWidgetSignup extends StatefulWidget { @@ -74,12 +71,9 @@ class _CustomDropDownWidgetSignupState // 'assets/images/png/user.png', // ), - widget.leadingImage == null - ? - SizedBox() - : - widget.leadingImage! - , + widget.leadingImage == null + ? const SizedBox() + : widget.leadingImage!, SizedBox(width: 16.w), Text( @@ -261,7 +255,7 @@ class _CustomDropDownTag1State extends State { onTap: () { onDropTap.value = !onDropTap.value; }, - child: Container( + child: SizedBox( height: 20.h, width: 20, child: Center( @@ -510,6 +504,7 @@ class CustomDropDownRadio extends StatefulWidget { required this.onItemSelected, required this.leadingImage, this.showOtherOption = false, + this.initialSelectedValue = '', }) : super(key: key); final String header; @@ -518,6 +513,7 @@ class CustomDropDownRadio extends StatefulWidget { final Function(String) onItemSelected; final Widget? leadingImage; final bool showOtherOption; + final String initialSelectedValue; @override State createState() => _CustomDropDownRadioState(); @@ -525,9 +521,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 = @@ -573,7 +574,6 @@ class _CustomDropDownRadioState extends State { ), ], ), - // SizedBox(height: 5.h), if (index != widget.listData.length - 1) const Divider(thickness: 1, color: Color(0xFF434A53)), ], @@ -649,7 +649,7 @@ class _CustomDropDownRadioState extends State { ), ], ), - sizedBoxHeight(10.h), + SizedBox(height: 10.h), ], ), ), @@ -710,7 +710,7 @@ class _CustomDropDownRadioState extends State { fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ), - Spacer(), + const Spacer(), onDropTap.value ? Image.asset('assets/images/png/arrowup.png') : Image.asset('assets/images/png/arrowdown.png'), @@ -721,10 +721,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( @@ -741,8 +739,6 @@ class _CustomDropDownRadioState extends State { ), ), child: Column( - // shrinkWrap: true, - // reverse: true, children: _buildDropdownMenuItems(), ), ), @@ -760,7 +756,7 @@ class CustomDropDownChexkBox extends StatefulWidget { required this.title, required this.listData, required this.onItemSelected, - required this.leadingImage, + this.leadingImage, this.showOtherOption = false, required this.initiallySelected, // Added this line }) : super(key: key); @@ -917,7 +913,7 @@ class _CustomDropDownChexkBoxState extends State { ), ], ), - SizedBox(height: 10), + const SizedBox(height: 10), ], ), ), @@ -940,8 +936,8 @@ class _CustomDropDownChexkBoxState extends State { child: Container( width: double.infinity, // height: 50, - padding: - EdgeInsets.only(right: 22, left: 12, top: 14, bottom: 14), + padding: const EdgeInsets.only( + right: 22, left: 12, top: 15, bottom: 15), decoration: BoxDecoration( color: const Color(0xFFFFFFFF).withOpacity(0.10), borderRadius: onDropTap.value @@ -964,21 +960,25 @@ class _CustomDropDownChexkBoxState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if (widget.leadingImage != null) widget.leadingImage!, + widget.leadingImage == null + ? const SizedBox() + : widget.leadingImage!, const SizedBox(width: 12), Expanded( child: Text( selectedValues.isEmpty ? widget.header : selectedValues.join(', '), - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontFamily: 'Helvetica', - fontWeight: FontWeight.w400), + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + // overflow: TextOverflow.ellipsis, ), ), - const Spacer(), + // const Spacer(), onDropTap.value ? Image.asset('assets/images/png/arrowup.png') : Image.asset('assets/images/png/arrowdown.png'), diff --git a/lib/Utils/Common/CustomTextformfield.dart b/lib/Utils/Common/CustomTextformfield.dart index f932031..470840a 100644 --- a/lib/Utils/Common/CustomTextformfield.dart +++ b/lib/Utils/Common/CustomTextformfield.dart @@ -6,6 +6,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:glassmorphism/glassmorphism.dart'; +import 'package:glassmorphism_ui/glassmorphism_ui.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; @@ -79,32 +80,24 @@ class _CustomTextFormFieldState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - GlassmorphicContainer( + GlassContainer( + height: 50.h, width: double.infinity, - height: 50, - borderRadius: 30, - blur: 6, - alignment: Alignment.bottomCenter, - border: 0.8, - linearGradient: LinearGradient( + gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ const Color(0xFFffffff).withOpacity(widget.opacity1), - const Color(0xFFFFFFFF).withOpacity(widget.opacity2), + const Color(0xFFFFFFFF).withOpacity(widget.opacity1), ], stops: const [ 0.1, 1, ]), - borderGradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xff434A53), - Color(0xFF434A53), - ], - ), + blur: 6, + opacity: 1, + borderRadius: BorderRadius.circular(30.r), + border: Border.all(color: Color(0xff434A53), width: 0.8), child: TextFormField( style: TextStyle( fontSize: 16.sp, color: Colors.white, fontFamily: 'Helvetica'), @@ -254,14 +247,10 @@ class _CustomTextFormField2State extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - GlassmorphicContainer( - width: double.infinity, + GlassContainer( height: 100.h, - borderRadius: 10, - blur: 6, - alignment: Alignment.bottomCenter, - border: 0.8, - linearGradient: LinearGradient( + width: double.infinity, + gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -272,14 +261,10 @@ class _CustomTextFormField2State extends State { 0.1, 1, ]), - borderGradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xff434A53), - Color(0xFF434A53), - ], - ), + blur: 6, + opacity: 1, + borderRadius: BorderRadius.circular(10.r), + border: Border.all(color: const Color(0xff434A53), width: 0.8), child: TextFormField( cursorColor: Colors.red, initialValue: widget.value, @@ -305,7 +290,7 @@ class _CustomTextFormField2State extends State { // ignore: prefer_null_aware_operators prefixIcon: - widget.leadingIcon == null ? null : widget.leadingIcon!, + widget.leadingIcon, suffixIcon: widget.isInputPassword ? GestureDetector( onTap: () => setState(() => obscureText = !obscureText), @@ -332,9 +317,7 @@ class _CustomTextFormField2State extends State { ], ), ) - : widget.suffixIcon == null - ? null - : widget.suffixIcon!, + : widget.suffixIcon, border: InputBorder.none, contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), diff --git a/lib/Utils/Common/ImageUpload.dart b/lib/Utils/Common/ImageUpload.dart index 94fcf99..834624d 100644 --- a/lib/Utils/Common/ImageUpload.dart +++ b/lib/Utils/Common/ImageUpload.dart @@ -15,7 +15,7 @@ class ImageUploadBottomSheet { Function(String) onImagePicked, ) { return showModalBottomSheet( - backgroundColor: Color(0XFF222935), + backgroundColor: const Color(0XFF222935), isScrollControlled: true, context: context, shape: RoundedRectangleBorder( @@ -59,7 +59,7 @@ class ImageUploadBottomSheet { children: [ CircleAvatar( radius: 27.r, - backgroundColor: Color(0xFF858585), + backgroundColor: const Color(0xFF858585), child: Icon( Icons.camera_alt_outlined, size: 30.sp, @@ -91,7 +91,7 @@ class ImageUploadBottomSheet { children: [ CircleAvatar( radius: 27.r, - backgroundColor: Color(0xFF858585), + backgroundColor: const Color(0xFF858585), child: Icon( Icons.image_outlined, size: 30.sp, @@ -122,7 +122,7 @@ class ImageUploadBottomSheet { children: [ CircleAvatar( radius: 27.r, - backgroundColor: Color(0xFF858585), + backgroundColor: const Color(0xFF858585), child: Icon( Icons.file_copy_outlined, size: 30.sp, @@ -161,7 +161,7 @@ class ImageUploadBottomSheet { children: [ CircleAvatar( radius: 27.r, - backgroundColor: Color(0xFF858585), + backgroundColor: const Color(0xFF858585), child: Icon( Icons.camera_alt_outlined, size: 30.sp, @@ -193,7 +193,7 @@ class ImageUploadBottomSheet { children: [ CircleAvatar( radius: 27.r, - backgroundColor: Color(0xFF858585), + backgroundColor: const Color(0xFF858585), child: Icon( Icons.image_outlined, size: 30.sp, diff --git a/lib/Utils/Common/NoInternet.dart b/lib/Utils/Common/NoInternet.dart index 5089ac8..7fdcf0a 100644 --- a/lib/Utils/Common/NoInternet.dart +++ b/lib/Utils/Common/NoInternet.dart @@ -2,7 +2,6 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:lottie/lottie.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -42,10 +41,10 @@ class _NoInternetState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xff222935), + backgroundColor: const Color(0xff222935), body: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), - child: Container( + child: SizedBox( width: double.infinity, height: 900.h, child: Column( @@ -59,7 +58,7 @@ class _NoInternetState extends State { // // fit: BoxFit.cover // ), sizedBoxHeight(40.h), - Text( + const Text( 'No Internet !', style: TextStyle( fontWeight: FontWeight.bold, @@ -67,7 +66,7 @@ class _NoInternetState extends State { color: Colors.white), ), sizedBoxHeight(15.h), - Text( + const Text( 'Please Check Your Internet\nConnection', textAlign: TextAlign.center, style: TextStyle( diff --git a/lib/Utils/Common/ShimmerCommon.dart b/lib/Utils/Common/ShimmerCommon.dart index 40e73bb..8c2ce55 100644 --- a/lib/Utils/Common/ShimmerCommon.dart +++ b/lib/Utils/Common/ShimmerCommon.dart @@ -7,7 +7,7 @@ class ShimmerCommon extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xffFFF3E4), body: _buildShimmerBody()); + backgroundColor: const Color(0xFF222935), body: _buildShimmerBody()); } // Build shimmer effect for the body @@ -28,35 +28,35 @@ class ShimmerCommon extends StatelessWidget { // Build shimmer UI for InsightWidget Widget _buildShimmerInsightWidget() { return Shimmer.fromColors( - baseColor: Colors.grey[300]!, - highlightColor: Colors.grey[100]!, + baseColor: Colors.grey[500]!, + highlightColor: Colors.grey[300]!, child: Container( - padding: EdgeInsets.all(16.0), + padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: double.infinity, height: 20, - color: Colors.grey[300], + color: Colors.grey[500], ), - SizedBox(height: 8), + const SizedBox(height: 8), Container( width: double.infinity, height: 20, - color: Colors.grey[300], + color: Colors.grey[500], ), - SizedBox(height: 8), + const SizedBox(height: 8), Container( width: double.infinity, height: 20, - color: Colors.grey[300], + color: Colors.grey[500], ), - SizedBox(height: 8), + const SizedBox(height: 8), Container( width: double.infinity, height: 20, - color: Colors.grey[300], + color: Colors.grey[500], ), ], ), diff --git a/lib/Utils/Common/blureffect.dart b/lib/Utils/Common/blureffect.dart index 66178da..048256f 100644 --- a/lib/Utils/Common/blureffect.dart +++ b/lib/Utils/Common/blureffect.dart @@ -17,7 +17,7 @@ class CommonBlurLeftRed extends StatelessWidget { width: 200, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0x4CD90B2E).withOpacity(0.5), + color: const Color(0x4CD90B2E).withOpacity(0.5), ), child: Container( height: 200, @@ -44,7 +44,7 @@ class CommonBlurRightRed extends StatelessWidget { width: 200, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0x4CD90B2E).withOpacity(0.5), + color: const Color(0x4CD90B2E).withOpacity(0.5), ), child: Container( height: 200, @@ -71,7 +71,7 @@ class CommonBlurLeft extends StatelessWidget { width: 200, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0xFF009DAB).withOpacity(0.50), + color: const Color(0xFF009DAB).withOpacity(0.50), ), child: Container( height: 200, @@ -98,7 +98,7 @@ class CommonBlurRight extends StatelessWidget { width: 200, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0xFF009DAB).withOpacity(0.50), + color: const Color(0xFF009DAB).withOpacity(0.50), ), child: Container( height: 200, @@ -122,7 +122,7 @@ class CommonBlurLeftSecond extends StatelessWidget { width: 150, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0x4CD90B2E).withOpacity(0.5), + color: const Color(0x4CD90B2E).withOpacity(0.5), ), child: Container( height: 200, @@ -145,7 +145,7 @@ class CommonBlurRightSecond extends StatelessWidget { width: 160, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0x4CD90B2E).withOpacity(0.5), + color: const Color(0x4CD90B2E).withOpacity(0.5), ), child: Container( height: 200, @@ -168,7 +168,7 @@ class CommonBlurLeftBlue extends StatelessWidget { width: 180, decoration: BoxDecoration( shape: BoxShape.circle, - color: Color(0xFF009DAB).withOpacity(0.50), + color: const Color(0xFF009DAB).withOpacity(0.50), ), child: Container( height: 200, diff --git a/lib/Utils/Helper.dart b/lib/Utils/Helper.dart index 289ab7a..7424236 100644 --- a/lib/Utils/Helper.dart +++ b/lib/Utils/Helper.dart @@ -1,6 +1,5 @@ import 'dart:developer'; import 'dart:io'; -import 'dart:typed_data'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; @@ -44,7 +43,7 @@ class Helper { final Dio dio = Dio(); final appDir = await getApplicationDocumentsDirectory(); final String fileName = image.split('/').last; - ; + final File file = File('${appDir.path}/$fileName'); try { log(file.path); @@ -55,13 +54,13 @@ class Helper { await ImageGallerySaver.saveFile(file.path); ScaffoldMessenger.of(context).showSnackBar( - SnackBar( + const SnackBar( content: Text('Image downloaded and saved to gallery successfully'), ), ); } catch (e) { ScaffoldMessenger.of(context).showSnackBar( - SnackBar( + const SnackBar( content: Text('Failed to download or save image'), ), ); diff --git a/lib/Utils/texts.dart b/lib/Utils/texts.dart index 7d77341..e9f3a99 100644 --- a/lib/Utils/texts.dart +++ b/lib/Utils/texts.dart @@ -28,7 +28,7 @@ Widget text22400FCFCFC(String text) { textAlign: TextAlign.center, style: TextStyle( fontSize: 22.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), ); @@ -50,7 +50,7 @@ Widget text20400FCFCFC(String text) { text, style: TextStyle( fontSize: 20.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), ); @@ -109,7 +109,7 @@ Widget text25700FCFCFC(String text) { // textAlign: TextAlign.center, style: TextStyle( fontSize: 25.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontWeight: FontWeight.w700, fontFamily: 'Helvetica'), ); @@ -166,7 +166,7 @@ Widget text144005DFD63(String text) { // textAlign: TextAlign.center, style: TextStyle( fontSize: 14.sp, - color: Color(0xFF5DFD63), + color: const Color(0xFF5DFD63), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), ); @@ -233,7 +233,7 @@ Widget textA4856_20500(String text) { style: TextStyle( fontWeight: FontWeight.w500, fontSize: 20.sp, - color: Color(0XFF3A4856), + color: const Color(0XFF3A4856), ), ); } @@ -243,7 +243,7 @@ Widget text272424_18(String text) { text, style: TextStyle( fontSize: 18.sp, - color: Color(0XFF272424), + color: const Color(0XFF272424), ), ); } @@ -387,7 +387,7 @@ Widget text16w400_FCFCFC(String text) { text, style: TextStyle( fontSize: 16.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -398,7 +398,7 @@ Widget text16w400_FF0000(String text) { text, style: TextStyle( fontSize: 16.sp, - color: Color(0xFFFF0000), + color: const Color(0xFFFF0000), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -452,7 +452,7 @@ Widget text16w700_FCFCFC(String text) { text, style: TextStyle( fontSize: 16.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -463,9 +463,9 @@ Widget text16w700_D90B2E(String text, {TextDecoration? decoration}) { text, style: TextStyle( decoration: decoration, - decorationColor: Color(0xFFD90B2E), + decorationColor: const Color(0xFFD90B2E), fontSize: 16.sp, - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -476,7 +476,7 @@ Widget text16w700_FCFCFCblur(String text) { text, style: TextStyle( fontSize: 16.sp, - color: Color(0xFFFCFCFC).withOpacity(0.8), + color: const Color(0xFFFCFCFC).withOpacity(0.8), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -487,9 +487,9 @@ Widget text16w700_FCFCFCline(String text) { text, style: TextStyle( decoration: TextDecoration.underline, - decorationColor: Color(0xFFFCFCFC), + decorationColor: const Color(0xFFFCFCFC), fontSize: 16.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -500,9 +500,9 @@ Widget text16w700_FCFCFCUnderline(String text) { text, style: TextStyle( decoration: TextDecoration.underline, - decorationColor: Color(0xFFFCFCFC), + decorationColor: const Color(0xFFFCFCFC), fontSize: 16.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -524,7 +524,7 @@ Widget text16w400_FCFCFCblur(String text) { text, style: TextStyle( fontSize: 16.sp, - color: Color(0xFFFCFCFC).withOpacity(0.8), + color: const Color(0xFFFCFCFC).withOpacity(0.8), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -535,7 +535,7 @@ Widget text12w400_FCFCFC(String text) { text, style: TextStyle( fontSize: 12.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -545,7 +545,7 @@ Widget text12w400_8E8E8E(String text) { text, style: TextStyle( fontSize: 12.sp, - color: Color(0xFF8E8E8E), + color: const Color(0xFF8E8E8E), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -556,7 +556,7 @@ Widget text12w700_FCFCFC(String text) { text, style: TextStyle( fontSize: 12.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -567,7 +567,7 @@ Widget text20w700_FCFCFC(String text) { text, style: TextStyle( fontSize: 20.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -578,7 +578,18 @@ Widget text12w400_FCFCFC_blur(String text) { text, style: TextStyle( fontSize: 12.sp, - color: Color(0xFFFCFCFC).withOpacity(0.8), + color: const Color(0xFFFCFCFC).withOpacity(0.8), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ); +} + +Widget text16w400_FCFCFC_blur(String text) { + return Text( + text, + style: TextStyle( + fontSize: 16.sp, + color: const Color(0xFFFCFCFC).withOpacity(0.8), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -589,7 +600,7 @@ Widget text10w400_FCFCFC_blur(String text) { text, style: TextStyle( fontSize: 10.sp, - color: Color(0xFFFCFCFC).withOpacity(0.8), + color: const Color(0xFFFCFCFC).withOpacity(0.8), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -600,7 +611,7 @@ Widget text11w400_FCFCFC(String text) { text, style: TextStyle( fontSize: 11.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -611,7 +622,7 @@ Widget text11w400_F91D42(String text) { text, style: TextStyle( fontSize: 11.sp, - color: Color(0xFFF91D42), + color: const Color(0xFFF91D42), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -634,7 +645,7 @@ Widget text18w400_FCFCFC(String text, {TextAlign? textAlign}) { textAlign: textAlign, style: TextStyle( fontSize: 18.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -645,7 +656,7 @@ Widget text18w500_FCFCFC(String text) { text, style: TextStyle( fontSize: 18.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w500), ); @@ -657,7 +668,7 @@ Widget text18w500Center_FCFCFC(String text) { textAlign: TextAlign.center, style: TextStyle( fontSize: 18.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w500), ); @@ -668,7 +679,7 @@ Widget text18w700_FCFCFC(String text) { text, style: TextStyle( fontSize: 18.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w700), ); @@ -680,7 +691,7 @@ Widget text14w400_FCFCFC(String text, {TextAlign? textAlign}) { textAlign: textAlign, style: TextStyle( fontSize: 14.sp, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -691,7 +702,7 @@ Widget text14w400_FCFCFCblur(String text) { text, style: TextStyle( fontSize: 14.sp, - color: Color(0xFFFCFCFC).withOpacity(0.8), + color: const Color(0xFFFCFCFC).withOpacity(0.8), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); @@ -702,7 +713,7 @@ Widget text8w400_8A8A8A(String text) { text, style: TextStyle( fontSize: 8.sp, - color: Color(0xFF8A8A8A), + color: const Color(0xFF8A8A8A), fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ); diff --git a/lib/main.dart b/lib/main.dart index 59cf7bc..325010a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,16 +20,7 @@ Future main() async { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, - ]).then((value) => - // runApp(MyApp()) - runApp(const MyApp()) - - // StatsFl( - // align: Alignment.center, - // width: 200, - // height: 100, - // child: const MyApp())), - ); + ]).then((value) => runApp(const MyApp())); } final streamController = StreamController.broadcast(); @@ -42,34 +33,13 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State with WidgetsBindingObserver { - // var _connectionStatus = ConnectivityResult.values.toString(); - // final Connectivity _connectivity = Connectivity(); - // late StreamSubscription _connectivitySubscription; - List _connectionStatus = [ConnectivityResult.none]; final Connectivity _connectivity = Connectivity(); late StreamSubscription> _connectivitySubscription; - // Future checkInternet() async { - // final connectivityResult = await (Connectivity().checkConnectivity()); - - // if (connectivityResult == ConnectivityResult.wifi || - // connectivityResult == ConnectivityResult.mobile) { - // setState(() { - // _connectionStatus = connectivityResult.toString(); - // print("has internet"); - // }); - // } else { - // setState(() { - // _connectionStatus = connectivityResult.toString(); - // print("no internet"); - // }); - // } - // } - Future initConnectivity() async { late List result; - // Platform messages may fail, so we use a try/catch PlatformException. + try { result = await _connectivity.checkConnectivity(); print("initconnectivitity"); @@ -85,20 +55,7 @@ class _MyAppState extends State with WidgetsBindingObserver { return _updateConnectionStatus(result); } - // Future _updateConnectionStatus(List result) async { - // setState(() { - // _connectionStatus = result.toString(); - // }); - - // // ignore: avoid_print - // print('Connectivity changed: $_connectionStatus'); - // } - Future _updateConnectionStatus(List result) async { - // setState(() { - // _connectionStatus = result; - // }); - if (result.contains(ConnectivityResult.wifi) || result.contains(ConnectivityResult.mobile)) { setState(() { @@ -110,9 +67,8 @@ class _MyAppState extends State with WidgetsBindingObserver { _connectionStatus = result; Get.toNamed(RouteName.nointernet); }); - // Get.toNamed(RouteName.nointernet); } - // ignore: avoid_print + print('Connectivity changed: $_connectionStatus'); } @@ -121,33 +77,18 @@ class _MyAppState extends State with WidgetsBindingObserver { AndroidDeviceInfo android = await plugin.androidInfo; if (android.version.sdkInt < 33) { if (await Permission.storage.request().isGranted) { - // setState(() { - // permissionGranted = true; - // }); } else if (await Permission.storage.request().isPermanentlyDenied) { await openAppSettings(); await utils.showToast("Permission denied."); } - // else if (await Permission.audio.request().isDenied) { - // // setState(() { - // // permissionGranted = false; - // // }); - // } } else { if (await Permission.photos.request().isGranted) { - // await utils.showToast("Permission granted."); - // setState(() { - // permissionGranted = true; - // }); } else if (await Permission.photos.request().isPermanentlyDenied) { await openAppSettings(); await utils.showToast("Permission denied."); } else if (await Permission.photos.request().isDenied) { await openAppSettings(); await utils.showToast("Permission denied."); - // setState(() { - // permissionGranted = false; - // }); } } } @@ -159,7 +100,6 @@ class _MyAppState extends State with WidgetsBindingObserver { _connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus); -//do not remove this coomented code if (Platform.isAndroid) { _getStoragePermission(); } @@ -182,7 +122,7 @@ class _MyAppState extends State with WidgetsBindingObserver { fontFamily: 'Cambria', ), debugShowCheckedModeBanner: false, - initialRoute: RouteName.profiletabbusguest, + initialRoute: RouteName.splashScreen, getPages: AppRoutes.appRoutes(), ), designSize: const Size(390, 844), diff --git a/lib/onboarding/NewPass/View/NewPass.dart b/lib/onboarding/NewPass/View/NewPass.dart index 8da2bb9..a69dd24 100644 --- a/lib/onboarding/NewPass/View/NewPass.dart +++ b/lib/onboarding/NewPass/View/NewPass.dart @@ -65,14 +65,14 @@ class _NewPasswordState extends State { Get.snackbar( "Success!", 'Password has been reset successfully!', - 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, ); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(const Duration(seconds: 1), () { Get.toNamed(RouteName.loginScreen); }); // print('success'); @@ -80,10 +80,10 @@ class _NewPasswordState extends State { Get.snackbar( "Error!", 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, ); @@ -95,10 +95,10 @@ class _NewPasswordState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), body: Stack(children: [ @@ -120,7 +120,7 @@ class _NewPasswordState extends State { Container( height: 1.h, width: 250.w, - color: Color(0xFF858585), + color: const Color(0xFF858585), ), sizedBoxHeight(35.h), text16w400_FCFCFC("Create new password"), diff --git a/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart b/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart index 6ae2a71..9a678d8 100644 --- a/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart +++ b/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart @@ -26,12 +26,12 @@ class _SelectBusinessCommunityState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), - Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), - Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()), + const Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), + const Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), + const Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()), SingleChildScrollView( child: GlassmorphicContainer( width: MediaQuery.of(context).size.width, @@ -46,10 +46,10 @@ class _SelectBusinessCommunityState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), @@ -63,9 +63,9 @@ class _SelectBusinessCommunityState extends State { colors: [ // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), ], ), child: Padding( @@ -102,7 +102,7 @@ class _SelectBusinessCommunityState extends State { height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), @@ -116,7 +116,7 @@ class _SelectBusinessCommunityState extends State { width: 273.w, height: 15.h, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -135,7 +135,7 @@ class _SelectBusinessCommunityState extends State { width: 15, height: 15, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -171,7 +171,7 @@ class _SelectBusinessCommunityState extends State { Center( child: Container( width: 108.w, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( shape: RoundedRectangleBorder( side: BorderSide( width: 1, @@ -197,7 +197,7 @@ class _SelectBusinessCommunityState extends State { // ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -210,7 +210,7 @@ class _SelectBusinessCommunityState extends State { ], ), sizedBoxHeight(30.h), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ CommunitySelect( @@ -222,7 +222,7 @@ class _SelectBusinessCommunityState extends State { ], ), sizedBoxHeight(30.h), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ CommunitySelect( @@ -234,7 +234,7 @@ class _SelectBusinessCommunityState extends State { image: 'assets/images/png/community3.png'), ], ), - Spacer(flex: 1), + const Spacer(flex: 1), CustomButton( text: "Continue", onPressed: () { @@ -253,7 +253,7 @@ class CommunitySelect extends StatefulWidget { final String titleString; final String image; - CommunitySelect({ + const CommunitySelect({ Key? key, required this.titleString, required this.image, @@ -296,7 +296,7 @@ class _CommunitySelectState extends State { height: 23, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFFFF002B)), + side: const BorderSide(width: 1, color: Color(0xFFFF002B)), borderRadius: BorderRadius.circular(30), ), ), diff --git a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart index 3d577e6..73fe783 100644 --- a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart +++ b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart @@ -128,132 +128,141 @@ class _TellusaboutBusinessState extends State { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - backgroundColor: const Color.fromARGB(255, 18, 32, 47), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - ListView(physics: const ScrollPhysics(), children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(60.h), - Center( - child: text20400white('Tell us about your business')), - sizedBoxHeight(10.w), - Center( - child: Container( - width: 154, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF858585), - ), - ), - )), - ), - sizedBoxHeight(40.h), - text16400white('Business owner name'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: businessownerController, - texttype: TextInputType.text, - hintText: "Enter your business owner name", - leadingIcon: Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/user.png', - ), - validator: (value) { - if (value!.isEmpty) { - return 'Enter your business owner name'; - } - return null; - }, - inputFormatters: [ - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(10.h), - text16400white('Business name'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: businessNameController, - texttype: TextInputType.text, - hintText: "Enter your business name", - leadingIcon: Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/briefcase.png', - ), - validator: (value) { - if (value!.isEmpty) { - return 'Enter your business name '; - } - return null; - }, - inputFormatters: [ - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(10.h), - text16400white('Business location'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: businesslocationController, - texttype: TextInputType.text, - hintText: "Enter your business location", - leadingIcon: Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/location.png', - ), - validator: (value) { - if (value!.isEmpty) { - return 'Enter your business location '; - } - return null; - }, - inputFormatters: [ - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(10.h), - text16400white('Type of business'), - sizedBoxHeight(10.h), - CustomDropDownRadio( - header: 'Select type of business', - title: '', - listData: _businesslist, - onItemSelected: _onItemSelected, - leadingImage: - Image.asset('assets/images/png/briefcase.png'), - ), - sizedBoxHeight(50.h), - CustomButton( - text: "Continue", - onPressed: () { - _tellUsBusinessDone(); - }), - sizedBoxHeight(30.h), - ], - ), + return WillPopScope( + onWillPop: ()async { + // SystemNavigator.pop(); + Navigator.pop(context); + + return true; + + }, + child: GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), - ]) - ])), + ListView(physics: const ScrollPhysics(), children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(60.h), + Center( + child: text20400white('Tell us about your business')), + sizedBoxHeight(10.w), + Center( + child: Container( + width: 154, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + strokeAlign: BorderSide.strokeAlignCenter, + color: Color(0xFF858585), + ), + ), + )), + ), + sizedBoxHeight(40.h), + text16400white('Business owner name'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: businessownerController, + texttype: TextInputType.text, + hintText: "Enter your business owner name", + leadingIcon: Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/user.png', + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your business owner name'; + } + return null; + }, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(10.h), + text16400white('Business name'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: businessNameController, + texttype: TextInputType.text, + hintText: "Enter your business name", + leadingIcon: Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/briefcase.png', + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your business name '; + } + return null; + }, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(10.h), + text16400white('Business location'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: businesslocationController, + texttype: TextInputType.text, + hintText: "Enter your business location", + leadingIcon: Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/location.png', + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your business location '; + } + return null; + }, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(10.h), + text16400white('Type of business'), + sizedBoxHeight(10.h), + CustomDropDownRadio( + header: 'Select type of business', + title: '', + listData: _businesslist, + onItemSelected: _onItemSelected, + leadingImage: + Image.asset('assets/images/png/briefcase.png'), + ), + sizedBoxHeight(50.h), + CustomButton( + text: "Continue", + onPressed: () { + _tellUsBusinessDone(); + }), + sizedBoxHeight(30.h), + ], + ), + ), + ]) + ])), + ), ); } } diff --git a/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart b/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart index 6ec2b9b..097b0e0 100644 --- a/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart +++ b/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart @@ -23,12 +23,12 @@ class _SelectIndividualProfileState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), - Positioned(top: 310, right: -30, child: CommonBlurRightSecond()), - Positioned(top: 540, left: -30, child: CommonBlurLeftBlue()), + const Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), + const Positioned(top: 310, right: -30, child: CommonBlurRightSecond()), + const Positioned(top: 540, left: -30, child: CommonBlurLeftBlue()), GlassmorphicContainer( width: MediaQuery.of(context).size.width, height: @@ -42,10 +42,10 @@ class _SelectIndividualProfileState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), @@ -59,9 +59,9 @@ class _SelectIndividualProfileState extends State { colors: [ // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), + const Color(0XFF222935).withOpacity(0.60), ], ), child: Padding( @@ -99,7 +99,7 @@ class _SelectIndividualProfileState extends State { decoration: ShapeDecoration( shape: RoundedRectangleBorder( side: - BorderSide(width: 1, color: Color(0xFF434A53)), + const BorderSide(width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -112,7 +112,7 @@ class _SelectIndividualProfileState extends State { width: 15, height: 15, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -135,7 +135,7 @@ class _SelectIndividualProfileState extends State { Center( child: Container( width: 154.w, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( shape: RoundedRectangleBorder( side: BorderSide( width: 1, @@ -173,7 +173,7 @@ class _SelectIndividualProfileState extends State { selectedIndex: selectedIndex, index: 2, ), - Spacer(flex: 1), + const Spacer(flex: 1), CustomButton( text: "Continue", onPressed: () { @@ -194,7 +194,7 @@ class ProfileContainer extends StatefulWidget { final ValueNotifier selectedIndex; final int index; - ProfileContainer({ + const ProfileContainer({ Key? key, required this.titleString, required this.contentString, @@ -224,21 +224,21 @@ class _ProfileContainerState extends State { height: 126.h, decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: isSelected ? [ - Color(0XFFD90B2E).withOpacity(0.80), - Color(0XFFD90B2E).withOpacity(0.77), - Color(0XFFD90B2E).withOpacity(0.66), - Color(0XFFD90B2E).withOpacity(0.18), + const Color(0XFFD90B2E).withOpacity(0.80), + const Color(0XFFD90B2E).withOpacity(0.77), + const Color(0XFFD90B2E).withOpacity(0.66), + const Color(0XFFD90B2E).withOpacity(0.18), ] : [ Colors.white.withOpacity(0.06), Colors.white.withOpacity(0.08) ], ), - border: Border.all(width: 1, color: Color(0xFF434A53)), + border: Border.all(width: 1, color: const Color(0xFF434A53)), borderRadius: BorderRadius.circular(10), ), child: Padding( diff --git a/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart b/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart index ccfb471..78b3bd9 100644 --- a/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart +++ b/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart @@ -55,7 +55,7 @@ class _SelectIndividualCommunityState extends State { }); } - Uploadata() async { + uploadata() async { utils.loader(); String selectedIndicesString = '[${_selectedIndices.join(',')}]'; print('Selected Indices: $selectedIndicesString'); @@ -83,7 +83,7 @@ class _SelectIndividualCommunityState extends State { return GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ Container( @@ -125,7 +125,7 @@ class _SelectIndividualCommunityState extends State { height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFF434A53)), + side: const BorderSide(width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -139,7 +139,7 @@ class _SelectIndividualCommunityState extends State { // width: 216.w, height: 15.h, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -158,7 +158,7 @@ class _SelectIndividualCommunityState extends State { width: 15, height: 15, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -194,7 +194,7 @@ class _SelectIndividualCommunityState extends State { Center( child: Container( width: 108.w, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( shape: RoundedRectangleBorder( side: BorderSide( width: 1, @@ -218,7 +218,7 @@ class _SelectIndividualCommunityState extends State { // ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -244,13 +244,13 @@ class _SelectIndividualCommunityState extends State { if (snapshot.connectionState == ConnectionState.waiting) { // Display shimmer effect while waiting for data - return Center(child: CircularProgressIndicator()); + return const Center(child: CircularProgressIndicator()); } else if (snapshot.hasError) { // Handle error state return Center( child: Text( '${snapshot.error} occurred', - style: TextStyle(fontSize: 18), + style: const TextStyle(fontSize: 18), ), ); } else { @@ -259,9 +259,9 @@ class _SelectIndividualCommunityState extends State { ? _buildNoDataBody(context) : Expanded( child: GridView.builder( - physics: ScrollPhysics(), + physics: const ScrollPhysics(), gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( + const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, crossAxisSpacing: 12.0, mainAxisSpacing: 12.0, @@ -304,7 +304,7 @@ class _SelectIndividualCommunityState extends State { // _selectedIndices.join(','); // print( // 'Selected Indices: [$selectedIndicesString]'); - Uploadata(); + uploadata(); } }, ), @@ -359,7 +359,7 @@ class CommunitySelect extends StatelessWidget { height: 73.h, decoration: ShapeDecoration( image: image == null || image!.isEmpty - ? DecorationImage( + ? const DecorationImage( image: AssetImage("assets/images/png/groupindividual2.png"), fit: BoxFit.fill, ) @@ -375,7 +375,7 @@ class CommunitySelect extends StatelessWidget { sizedBoxHeight(15.h), Text( titleString, - style: TextStyle( + style: const TextStyle( color: Colors.white, fontSize: 12.0, overflow: TextOverflow.ellipsis), @@ -388,7 +388,7 @@ class CommunitySelect extends StatelessWidget { height: 23, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFFFF002B)), + side: const BorderSide(width: 1, color: Color(0xFFFF002B)), borderRadius: BorderRadius.circular(30), ), ), @@ -396,9 +396,9 @@ class CommunitySelect extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ isSelected - ? Text('Regrouping', + ? const Text('Regrouping', style: TextStyle(color: Colors.white, fontSize: 10.0)) - : Text('Join', + : const Text('Join', style: TextStyle(color: Colors.white, fontSize: 10.0)) ], ), diff --git a/lib/onboarding/Signup/View/Individual/tellusindividual.dart b/lib/onboarding/Signup/View/Individual/tellusindividual.dart index a698d8a..32364f3 100644 --- a/lib/onboarding/Signup/View/Individual/tellusindividual.dart +++ b/lib/onboarding/Signup/View/Individual/tellusindividual.dart @@ -154,96 +154,82 @@ class _TellusaboutIndividualState extends State { Get.toNamed(RouteName.individualactivitystep2); } else { Get.back(); - return utils.showToast(data.message); + utils.showToast(data.message); } } @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - backgroundColor: const Color.fromARGB(255, 18, 32, 47), - body: Stack( - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - ListView(physics: const ScrollPhysics(), children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // const Spacer(flex: 1), - sizedBoxHeight(50.h), - Center(child: text20400white('Tell us about yourself')), - sizedBoxHeight(10.w), - Center( - child: Container( - width: 154, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF858585), - ), - ), - )), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - false, - (result) { - print("File path is $result"); - editProfileImage.profilePicPath.value = result; - var filenameresult = extractFileName(result); - print("File name is $filenameresult"); - photographController.text = filenameresult; - }, - ); - }, - child: Center( - child: Column( - children: [ - Stack( - alignment: Alignment.center, - children: [ - // Outer circle - Container( - width: 139.w, - height: 139.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.transparent, - border: Border.all( - color: const Color(0XFFD90B2E) - .withOpacity(0.50), - width: 2), + return WillPopScope( + onWillPop: () async { + SystemNavigator.pop(); + // Navigator.pop(context); + + + return true; + + }, + + child: GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + ListView(physics: const ScrollPhysics(), children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // const Spacer(flex: 1), + sizedBoxHeight(50.h), + Center(child: text20400white('Tell us about yourself')), + sizedBoxHeight(10.w), + Center( + child: Container( + width: 154, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + strokeAlign: BorderSide.strokeAlignCenter, + color: Color(0xFF858585), ), ), - // Middle circle - Container( - width: 119.w, - height: 119.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.transparent, - border: Border.all( - color: const Color(0XFFD90B2E) - .withOpacity(0.50), - width: 2), - ), - ), - // Inner circle - Container( + )), + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + print("File path is $result"); + editProfileImage.profilePicPath.value = result; + var filenameresult = extractFileName(result); + print("File name is $filenameresult"); + photographController.text = filenameresult; + }, + ); + }, + child: Center( + child: Column( + children: [ + Stack( + alignment: Alignment.center, + children: [ + // Outer circle + Container( + width: 139.w, + height: 139.h, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.transparent, @@ -252,196 +238,221 @@ class _TellusaboutIndividualState extends State { .withOpacity(0.50), width: 2), ), - child: Obx(() => editProfileImage - .profilePicPath.value != - '' - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(50.r), - child: Image( - image: FileImage( - File( - editProfileImage - .profilePicPath - .value, + ), + // Middle circle + Container( + width: 119.w, + height: 119.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: const Color(0XFFD90B2E) + .withOpacity(0.50), + width: 2), + ), + ), + // Inner circle + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: const Color(0XFFD90B2E) + .withOpacity(0.50), + width: 2), + ), + child: Obx(() => editProfileImage + .profilePicPath.value != + '' + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: Image( + image: FileImage( + File( + editProfileImage + .profilePicPath + .value, + ), ), + fit: BoxFit.cover, + width: 200.w, + height: 200.h, ), - fit: BoxFit.cover, - width: 200.w, - height: 200.h, ), - ), - ) - : Image.asset( - "assets/images/png/camera.png") - // : Image.asset( - // "assets/images/png/camera.png") - )), - // Main button - ], - ), - const SizedBox(height: 9), - text16400white('Add profile picture') - ], - )), - ), - sizedBoxHeight(20.h), - text16400white('Full name'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: fullNameController, - texttype: TextInputType.text, - hintText: "Enter your full name", - leadingIcon: - // const Icon(Icons.mail_outline), - Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/user.png', + ) + : Image.asset( + "assets/images/png/camera.png") + // : Image.asset( + // "assets/images/png/camera.png") + )), + // Main button + ], + ), + const SizedBox(height: 9), + text16400white('Add profile picture') + ], + )), ), - // validatorText: "Enter your full name", - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(10.h), - text16400white('User name'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: userNameController, - texttype: TextInputType.text, - hintText: "Enter your user name", - leadingIcon: - // const Icon(Icons.mail_outline), - Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/user.png', - ), - // validatorText: "Enter your user name", - validator: (value) { - if (value!.isEmpty) { - return 'Enter your user name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(10.h), - text16400white('Date of birth'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: datecontroller, - readonly: true, - onTap: () { - _selectDate(context); - }, - // texttype: TextInputType.text, - hintText: "Enter your date of birth", - leadingIcon: - // const Icon(Icons.mail_outline), - Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/dateimage.png', - ), - // validatorText: "Enter date of birth", - validator: (value) { - if (value!.isEmpty) { - return 'Enter your date of birth'; - } - return null; - }, - ), - sizedBoxHeight(10.h), - text16400white('Gender'), - sizedBoxHeight(10.h), - CustomDropDownRadio( - header: 'Select gender', - title: '', - listData: _gender, - onItemSelected: _onItemSelected, - leadingImage: - Image.asset('assets/images/png/gendericon.png'), - ), - sizedBoxHeight(10.h), - Row( - children: [ - text16400white('Location'), - sizedBoxWidth(5.w), - Image.asset('assets/images/png/informationicon.png') - ], - ), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: locationcontroller, - texttype: TextInputType.text, - hintText: "Enter your location", - leadingIcon: - // const Icon(Icons.mail_outline), - Image.asset( - width: 22.w, - height: 17.h, - 'assets/images/png/location.png', - ), - // validatorText: "Enter your location", - validator: (value) { - if (value!.isEmpty) { - return 'Enter your location '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) - ], - ), - sizedBoxHeight(20.h), - CustomButton( - text: "Continue", - onPressed: () { - if (fullNameController.text.isBlank! || - userNameController.text.isBlank! || - datecontroller.text.isBlank! || - _selectedgendertype.isEmpty || - locationcontroller.text.isBlank! || - editProfileImage.profilePicPath.value == '') { - utils.showToast('Please fill all fields'); - } else { - TellusUploadData(); + sizedBoxHeight(20.h), + text16400white('Full name'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: fullNameController, + texttype: TextInputType.text, + hintText: "Enter your full name", + leadingIcon: + // const Icon(Icons.mail_outline), + Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/user.png', + ), + // validatorText: "Enter your full name", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; } - // if (_selectedgendertype.isNotEmpty) { - // Get.toNamed(RouteName.individualprofilestep1); - - // // Get.to(() => BusinessPage()); - // } else { - // // Handle case where no selection is made - // utils.showToast('Please select an gender type'); - // } - }), - sizedBoxHeight(30.h), - // const Spacer( - // flex: 3, - // ) - ], + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(10.h), + text16400white('User name'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: userNameController, + texttype: TextInputType.text, + hintText: "Enter your user name", + leadingIcon: + // const Icon(Icons.mail_outline), + Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/user.png', + ), + // validatorText: "Enter your user name", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your user name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(10.h), + text16400white('Date of birth'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: datecontroller, + readonly: true, + onTap: () { + _selectDate(context); + }, + // texttype: TextInputType.text, + hintText: "Enter your date of birth", + leadingIcon: + // const Icon(Icons.mail_outline), + Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/dateimage.png', + ), + // validatorText: "Enter date of birth", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your date of birth'; + } + return null; + }, + ), + sizedBoxHeight(10.h), + text16400white('Gender'), + sizedBoxHeight(10.h), + CustomDropDownRadio( + header: 'Select gender', + title: '', + listData: _gender, + onItemSelected: _onItemSelected, + leadingImage: + Image.asset('assets/images/png/gendericon.png'), + ), + sizedBoxHeight(10.h), + Row( + children: [ + text16400white('Location'), + sizedBoxWidth(5.w), + Image.asset('assets/images/png/informationicon.png') + ], + ), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: locationcontroller, + texttype: TextInputType.text, + hintText: "Enter your location", + leadingIcon: + // const Icon(Icons.mail_outline), + Image.asset( + width: 22.w, + height: 17.h, + 'assets/images/png/location.png', + ), + // validatorText: "Enter your location", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your location '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(20.h), + CustomButton( + text: "Continue", + onPressed: () { + if (fullNameController.text.isBlank! || + userNameController.text.isBlank! || + datecontroller.text.isBlank! || + _selectedgendertype.isEmpty || + locationcontroller.text.isBlank! || + editProfileImage.profilePicPath.value == '') { + utils.showToast('Please fill all fields'); + } else { + TellusUploadData(); + } + // if (_selectedgendertype.isNotEmpty) { + // Get.toNamed(RouteName.individualprofilestep1); + + // // Get.to(() => BusinessPage()); + // } else { + // // Handle case where no selection is made + // utils.showToast('Please select an gender type'); + // } + }), + sizedBoxHeight(30.h), + // const Spacer( + // flex: 3, + // ) + ], + ), ), - ), - ]) - ], - )), + ]) + ], + )), + ), ); } } diff --git a/lib/onboarding/Signup/View/signupendpage.dart b/lib/onboarding/Signup/View/signupendpage.dart index 68f0340..0fed976 100644 --- a/lib/onboarding/Signup/View/signupendpage.dart +++ b/lib/onboarding/Signup/View/signupendpage.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -16,11 +14,10 @@ class SignupendPage extends StatefulWidget { } class _SignupendPageState extends State { - final ScrollController _scrollController = ScrollController(); @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ Container( @@ -35,15 +32,15 @@ class _SignupendPageState extends State { height: 519.h, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white.withOpacity(0.05999999865889549), Colors.white.withOpacity(0.07999999821186066) ], ), shape: RoundedRectangleBorder( - side: BorderSide(width: 0.80, color: Color(0xFF434A53)), + side: const BorderSide(width: 0.80, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(5), ), ), @@ -63,7 +60,7 @@ class _SignupendPageState extends State { '''Congratulations, your account has been successfully created. Get ready to regroup with your community''', textAlign: TextAlign.center, style: TextStyle( - color: Color(0xCCFCFCFC), + color: const Color(0xCCFCFCFC), fontSize: 16.sp, fontFamily: 'Helvetica', fontWeight: FontWeight.w400, diff --git a/lib/onboarding/Signup/View/signupscreen.dart b/lib/onboarding/Signup/View/signupscreen.dart index ca16b13..f7f30d0 100644 --- a/lib/onboarding/Signup/View/signupscreen.dart +++ b/lib/onboarding/Signup/View/signupscreen.dart @@ -161,8 +161,8 @@ class _SignupScreenState extends State { "accounttype": selectedCategory, 'accountypenumber': accountTypeValue }); -await prefs.setString( - 'accountTypeValue', accountTypeValue.toString() ?? ""); + + return utils.showToast(data.message); } else { Get.back(); @@ -303,7 +303,7 @@ await prefs.setString( CustomDropDownRadio( header: 'Select account type', title: '', - listData: [ + listData: const [ 'Individual', 'Business', ], diff --git a/lib/onboarding/Signup/View/verifyuser.dart b/lib/onboarding/Signup/View/verifyuser.dart index ab0e64e..b076ffa 100644 --- a/lib/onboarding/Signup/View/verifyuser.dart +++ b/lib/onboarding/Signup/View/verifyuser.dart @@ -71,10 +71,10 @@ class _VerifyuserScreenStateState extends State { Get.snackbar( "Error!", res.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, ); @@ -102,10 +102,10 @@ class _VerifyuserScreenStateState extends State { Get.snackbar( "Success!", 'OTP has been sent to your email address!', - 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, ); @@ -127,10 +127,10 @@ class _VerifyuserScreenStateState 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, ); @@ -140,8 +140,8 @@ class _VerifyuserScreenStateState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), - appBar: CommonAppbar( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + appBar: const CommonAppbar( titleTxt: '', ), body: Stack( @@ -184,21 +184,21 @@ class _VerifyuserScreenStateState extends State { obscureText: false, animationType: AnimationType.fade, pinTheme: PinTheme( - selectedFillColor: Color(0xFF434A53), - inactiveFillColor: Color(0xFF434A53), - inactiveColor: Color(0xFF434A53), - activeColor: Color(0xFF434A53), - selectedColor: Color(0xFF434A53), + selectedFillColor: const Color(0xFF434A53), + inactiveFillColor: const Color(0xFF434A53), + inactiveColor: const Color(0xFF434A53), + activeColor: const Color(0xFF434A53), + selectedColor: const Color(0xFF434A53), shape: PinCodeFieldShape.underline, borderRadius: BorderRadius.circular(5), fieldHeight: 70, fieldWidth: 70, activeFillColor: // Colors.white - Color(0xFF303030).withOpacity(0.4), + const Color(0xFF303030).withOpacity(0.4), // textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size ), - animationDuration: Duration(milliseconds: 300), + animationDuration: const Duration(milliseconds: 300), enableActiveFill: true, autovalidateMode: AutovalidateMode.onUserInteraction, controller: pincode, @@ -226,9 +226,9 @@ class _VerifyuserScreenStateState extends State { sizedBoxHeight(10.h), Center( child: TimerButton( - disabledTextStyle: TextStyle(color: Colors.red), - activeTextStyle: TextStyle(color: Colors.white), - disabledColor: Color(0XFF222935).withOpacity(0.10), + disabledTextStyle: const TextStyle(color: Colors.red), + activeTextStyle: const TextStyle(color: Colors.white), + disabledColor: const Color(0XFF222935).withOpacity(0.10), buttonType: ButtonType.textButton, label: "Resend OTP", timeOutInSeconds: 120, @@ -239,7 +239,7 @@ class _VerifyuserScreenStateState extends State { }); }, // disabledColor: Colors.white, - color: Color(0XFF222935).withOpacity(0.10), + color: const Color(0XFF222935).withOpacity(0.10), ), ), const Spacer( diff --git a/lib/onboarding/Signup/view_model/getUserprofile.dart b/lib/onboarding/Signup/view_model/getUserprofile.dart index e847129..effc8b2 100644 --- a/lib/onboarding/Signup/view_model/getUserprofile.dart +++ b/lib/onboarding/Signup/view_model/getUserprofile.dart @@ -12,7 +12,6 @@ import 'package:shared_preferences/shared_preferences.dart'; GetuserdetailsModel? getuserobj; - class Getuserdetails { Getuserdetails(); @@ -27,19 +26,22 @@ class Getuserdetails { // Assuming response data is a map getuserobj = GetuserdetailsModel.fromJson(responseData); - await prefs.setString('fullname', getuserobj?.data?.userData?.fullName ?? ""); - await prefs.setString('username', getuserobj?.data?.userData?.userName ?? ""); - await prefs.setString('email', getuserobj?.data?.userData?.emailAddress ?? ""); - await prefs.setString('phone', getuserobj?.data?.userData?.phoneNumber ?? ""); - - emailid = prefs.getString('email'); - myusername = prefs.getString('username'); - fullname = prefs.getString('fullname'); - phonenumber = prefs.getString('phone'); - - + await prefs.setString( + 'fullname', getuserobj?.data?.userData?.fullName ?? ""); + 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'); + fullname = prefs.getString('fullname'); + phonenumber = prefs.getString('phone'); + globalAccountType = prefs.getString('accountTypefromLogin'); } else if (responseData is String) { - // Parse the JSON string into a map Map jsonMap; try { jsonMap = json.decode(responseData); @@ -49,18 +51,19 @@ class Getuserdetails { ResponseStatus.FAILED); } - - await prefs.setString('fullname', getuserobj?.data?.userData?.fullName ?? ""); - 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( + 'fullname', getuserobj?.data?.userData?.fullName ?? ""); + await prefs.setString( + 'username', getuserobj?.data?.userData?.userName ?? ""); + await prefs.setString( + 'email', getuserobj?.data?.userData?.emailAddress ?? ""); + await prefs.setString( + 'phone', getuserobj?.data?.userData?.phoneNumber ?? ""); - emailid = prefs.getString('email'); - myusername = prefs.getString('username'); - fullname = prefs.getString('fullname'); - phonenumber = prefs.getString('phone'); - - + emailid = prefs.getString('email'); + myusername = prefs.getString('username'); + fullname = prefs.getString('fullname'); + phonenumber = prefs.getString('phone'); } else { // Handle other types if necessary return ResponseData( @@ -69,4 +72,4 @@ class Getuserdetails { } return response; } -} \ No newline at end of file +} diff --git a/lib/onboarding/Signup/view_model/postmethod.dart b/lib/onboarding/Signup/view_model/postmethod.dart index e4396d9..ff9a2c8 100644 --- a/lib/onboarding/Signup/view_model/postmethod.dart +++ b/lib/onboarding/Signup/view_model/postmethod.dart @@ -124,4 +124,15 @@ class Onboard { print("response message is ${response.message}"); return response; } + + Future> postUserdevice(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postuserdevice, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } } diff --git a/lib/onboarding/SplashScreen.dart b/lib/onboarding/SplashScreen.dart index 99c4a71..841450c 100644 --- a/lib/onboarding/SplashScreen.dart +++ b/lib/onboarding/SplashScreen.dart @@ -1,15 +1,21 @@ import 'dart:async'; import 'dart:developer'; +import 'dart:io'; import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/svg.dart'; import 'package:get/get.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/NoInternet.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart'; +import 'package:regroup/onboarding/Signup/view_model/postmethod.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:shared_preferences/shared_preferences.dart'; // import 'package:shared_preferences/shared_preferences.dart'; @@ -34,9 +40,14 @@ class _SplashScreenState extends State { fullname = prefs.getString('fullname'); phonenumber = prefs.getString('phone'); + String deviceName = await getDeviceName(); + print('Device Name: $deviceName'); + if (token == null || token!.isEmpty) { Get.toNamed(RouteName.onboarding1); } else { + await InterestListApi().getinterestlistApi(); + await Uploadata(deviceName); await Getuserdetails().Getuser().then((value) { if (getuserobj?.data?.userData?.isProfileUpdated == 0) { String? accountype = @@ -57,6 +68,36 @@ class _SplashScreenState extends State { }); } + Future getDeviceName() async { + final deviceInfo = DeviceInfoPlugin(); + String deviceName = ''; + + if (Platform.isAndroid) { + final androidInfo = await deviceInfo.androidInfo; + deviceName = androidInfo.model; + } else if (Platform.isIOS) { + final iosInfo = await deviceInfo.iosInfo; + deviceName = iosInfo.model; + } else { + deviceName = 'Unknown Device'; + } + + return deviceName; + } + + Uploadata(String devicename) async { + Map updata = { + "device_name": devicename, + }; + final data = await Onboard().postUserdevice(updata); + if (data.status == ResponseStatus.SUCCESS) { + return utils.showToast(data.message); + } else { + print("device details not done"); + return utils.showToast(data.message); + } + } + @override Widget build(BuildContext context) { return Scaffold( diff --git a/lib/onboarding/forgotPass/View/ForgotPass.dart b/lib/onboarding/forgotPass/View/ForgotPass.dart index 670b1e4..fe19ab8 100644 --- a/lib/onboarding/forgotPass/View/ForgotPass.dart +++ b/lib/onboarding/forgotPass/View/ForgotPass.dart @@ -44,16 +44,16 @@ class _ForgotPassState extends State { Get.snackbar( "Success!", 'OTP sent successfully!', - 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, ); prefs.setString('email', emailController.text); prefs.setInt('principal_xid', resp.data['data']['iam_principal_xid']); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(const Duration(seconds: 1), () { Get.toNamed(RouteName.forgotOtp, arguments: emailController.text); }); // print('success'); @@ -61,10 +61,10 @@ class _ForgotPassState extends State { Get.snackbar( "Error!", resp.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, ); @@ -74,10 +74,10 @@ class _ForgotPassState extends State { Get.snackbar( "Error!", resp.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, ); @@ -89,10 +89,10 @@ class _ForgotPassState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), body: Stack(children: [ @@ -114,14 +114,14 @@ class _ForgotPassState extends State { Container( height: 1.h, width: 250.w, - color: Color(0xFF858585), + color: const Color(0xFF858585), ), sizedBoxHeight(35.h), text16w400_FCFCFC("Email address"), sizedBoxHeight(15.h), CustomTextFormField( textEditingController: emailController, - leadingIcon: Container( + leadingIcon: SizedBox( height: 18.h, width: 23.w, child: Center( diff --git a/lib/onboarding/onboarding1.dart b/lib/onboarding/onboarding1.dart index 7c9221f..b481711 100644 --- a/lib/onboarding/onboarding1.dart +++ b/lib/onboarding/onboarding1.dart @@ -28,13 +28,13 @@ class _Onboarding1State extends State { begin: Alignment.center, end: Alignment.bottomCenter, colors: [ - Color(0xFF222935).withOpacity(0.12), - Color(0xFF222935).withOpacity(0.60), - Color(0XFF222B37), - Color(0xFF222935), + const Color(0xFF222935).withOpacity(0.12), + const Color(0xFF222935).withOpacity(0.60), + const Color(0XFF222B37), + const Color(0xFF222935), ], ), - image: DecorationImage( + image: const DecorationImage( image: AssetImage("assets/images/png/onboarding1.png"), fit: BoxFit.fill)), child: Stack(children: [ @@ -48,7 +48,7 @@ class _Onboarding1State extends State { // shape: BoxShape.circle, color: // Colors.red - Color(0xFF009DAB).withOpacity(0.50), + const Color(0xFF009DAB).withOpacity(0.50), ), ), ), @@ -56,7 +56,7 @@ class _Onboarding1State extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ - Spacer(), + const Spacer(), SvgPicture.asset( "assets/images/svg/onboarding2.svg", width: 104.w, @@ -83,20 +83,20 @@ class _Onboarding1State extends State { begin: Alignment.topLeft, end: Alignment.centerRight, colors: [ - Color(0xFF222935).withOpacity(0.12), - Color(0xFF222935).withOpacity(0.60), - Color(0XFF222B37).withOpacity(0.12), - Color(0xFF222935).withOpacity(0.60), + const Color(0xFF222935).withOpacity(0.12), + const Color(0xFF222935).withOpacity(0.60), + const Color(0XFF222B37).withOpacity(0.12), + const Color(0xFF222935).withOpacity(0.60), ], ), borderGradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFF222935).withOpacity(0.12), - Color(0xFF222935).withOpacity(0.60), - Color(0XFF222B37), - Color(0xFF222935), + const Color(0xFF222935).withOpacity(0.12), + const Color(0xFF222935).withOpacity(0.60), + const Color(0XFF222B37), + const Color(0xFF222935), ], ), child: Padding( diff --git a/lib/resources/routes/route_name.dart b/lib/resources/routes/route_name.dart index 7a6dd1d..49dfdfd 100644 --- a/lib/resources/routes/route_name.dart +++ b/lib/resources/routes/route_name.dart @@ -131,4 +131,7 @@ class RouteName { static const String profiletabbusguest = '/profiletabbusguest'; + static const String addcertificate = '/addusercertificate'; + + } diff --git a/lib/resources/routes/routes.dart b/lib/resources/routes/routes.dart index 3999c62..12a47a7 100644 --- a/lib/resources/routes/routes.dart +++ b/lib/resources/routes/routes.dart @@ -32,6 +32,7 @@ import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/SubGro import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart'; import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Badges/Badges.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/Certificate.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Clubs/Clubs.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart'; @@ -39,8 +40,8 @@ import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/E import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Followers/Followers.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Following/Following.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Business/ProfileTabBusGuest.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Individual/ProfileTabIndGuest.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Business/ProfileTabBusGuest.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Individual/ProfileTabIndGuest.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/My%20Network/MyNetwork.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart'; @@ -523,5 +524,11 @@ class AppRoutes { name: RouteName.mynetwork, page: () => MyNetwork(), ), + GetPage( + name: RouteName.addcertificate, + page: () => AddCertificate(), + ), + + ]; } diff --git a/pubspec.lock b/pubspec.lock index 875b850..0919602 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -57,6 +57,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + url: "https://pub.dev" + source: hosted + version: "0.4.1" clock: dependency: transitive description: @@ -326,6 +342,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0-beta.2" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" + source: hosted + version: "0.13.1" flutter_lints: dependency: "direct dev" description: @@ -568,6 +592,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + url: "https://pub.dev" + source: hosted + version: "4.2.0" image_cropper: dependency: "direct main" description: @@ -680,6 +712,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" leak_tracker: dependency: transitive description: @@ -1245,6 +1285,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: dart: ">=3.3.0 <4.0.0" flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 81d2ac8..0772b32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -83,13 +83,18 @@ dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 + + flutter_launcher_icons: ^0.13.1 + +flutter_launcher_icons: + android: "launcher_icon" + ios: true + image_path: "assets/images/jpg/AppLogo.jpg" + min_sdk_android: 21 + remove_alpha_ios: true + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec