diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9fc0f9d..30a4ef8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index fa63b98..0e94d49 100644 --- a/lib/Common/api_urls.dart +++ b/lib/Common/api_urls.dart @@ -3,7 +3,7 @@ class ApiUrls { static const getlogin = "${baseUrl}login"; static const forgotpassword = "${baseUrl}forgot-password"; - static const verifyotp = "${baseUrl}verify-otp"; + static const verifyotp = "${baseUrl}forgot-password/verify-otp"; static const tellUsBusinessApi = "${baseUrl}tell-us-about-your-business"; static const letUsUnderstandApi = "${baseUrl}update-business-profile-step-1"; static const resetpassword = "${baseUrl}reset-password"; diff --git a/lib/Login/ViewModel/LoginApi.dart b/lib/Login/ViewModel/LoginApi.dart index 431e8ee..b221af4 100644 --- a/lib/Login/ViewModel/LoginApi.dart +++ b/lib/Login/ViewModel/LoginApi.dart @@ -42,12 +42,18 @@ class LoginAPI { if (accountype == "1") { print('tell us individyal'); Get.toNamed(RouteName.tellusindividualscreen, - arguments: {'pageroute': "mainscreen"}); + // arguments: { + // 'pageroute' : "mainscreen" + // } + ); } else if (accountype == "2") { print('tell us business'); Get.toNamed(RouteName.tellusbusinessscreen, - arguments: {'pageroute': "mainscreen"}); + // arguments: { + // 'pageroute' : "mainscreen" + // } + ); } } else { Get.toNamed(RouteName.mainscreen); diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index 0ba659c..432fbc9 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -492,7 +492,6 @@ class _CustomDropDownTagState extends State { ); } } - class CustomDropDownRadio extends StatefulWidget { const CustomDropDownRadio({ Key? key, @@ -533,6 +532,7 @@ class _CustomDropDownRadioState extends State { selectedValue.value = item; _textController.clear(); widget.onItemSelected(item); + onDropTap.value = !onDropTap.value; }, child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -682,29 +682,29 @@ class _CustomDropDownRadioState extends State { ), border: Border.all(color: const Color(0xFF434A53)), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - widget.leadingImage!, - SizedBox(width: 16.w), - Text( - selectedValue.value.isEmpty - ? widget.header - : selectedValue.value, - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontFamily: 'Helvetica', - fontWeight: FontWeight.w400), - ), - ], - ), - onDropTap.value - ? Image.asset('assets/images/png/arrowup.png') - : Image.asset('assets/images/png/arrowdown.png'), - ], + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + widget.leadingImage!, + SizedBox(width: 12.w), + Text( + selectedValue.value.isEmpty + ? widget.header + : selectedValue.value, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ), + Spacer(), + onDropTap.value + ? Image.asset('assets/images/png/arrowup.png') + : Image.asset('assets/images/png/arrowdown.png'), + ], + ), ), ), ), diff --git a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart index 855791e..f5a9d71 100644 --- a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart +++ b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart @@ -46,7 +46,7 @@ class _TellusaboutBusinessState extends State { }); } - String pagename = Get.arguments["pageroute"]; + // String pagename = Get.arguments["pageroute"]; String getBusinessTypeId(String selectedBusinessType) { if (selectedBusinessType.contains("Retail")) { @@ -103,12 +103,12 @@ class _TellusaboutBusinessState extends State { snackPosition: SnackPosition.BOTTOM, ); - if (pagename == "nextscreen") { + // if (pagename == "nextscreen") { Get.toNamed(RouteName.businessletusunderstandstep1); - } else if (pagename == "mainscreen") { - Get.toNamed(RouteName.mainscreen); - } + // } else if (pagename == "mainscreen") { + // Get.toNamed(RouteName.mainscreen); + // } } else if (data.status == ResponseStatus.FAILED) { Get.snackbar( diff --git a/lib/onboarding/Signup/View/Individual/tellusindividual.dart b/lib/onboarding/Signup/View/Individual/tellusindividual.dart index b66ccf6..774d30a 100644 --- a/lib/onboarding/Signup/View/Individual/tellusindividual.dart +++ b/lib/onboarding/Signup/View/Individual/tellusindividual.dart @@ -36,7 +36,7 @@ class _TellusaboutIndividualState extends State { TextEditingController datecontroller = TextEditingController(); TextEditingController locationcontroller = TextEditingController(); - String pagename = Get.arguments["pageroute"]; + // String pagename = Get.arguments["pageroute"]; DateTime? _selectedDate; @@ -48,7 +48,22 @@ class _TellusaboutIndividualState extends State { Future _selectDate(BuildContext context) async { DateTime yesterday = DateTime.now().subtract(Duration(days: 1)); DateTime eighteenYearsAgo = - DateTime.now().subtract(const Duration(days: 365 * 18)); + DateTime.now().subtract(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: Color(0xFFD90B2E), + ), + )); + final DateTime? pickedDate = await showDatePicker( context: context, initialDate: yesterday, @@ -56,68 +71,54 @@ class _TellusaboutIndividualState extends State { lastDate: DateTime(2026), builder: (BuildContext context, Widget? child) { return Theme( - data: ThemeData.light().copyWith( - colorScheme: ColorScheme.dark( - primary: - Color(0XFF222935).withOpacity(0.60), // Change primary color - onPrimary: - // Color(0XFF222935).withOpacity(0.60), // Change primary color - Colors.white - - // Colors.white, // Change text color - ), - textButtonTheme: TextButtonThemeData( - style: TextButton.styleFrom( - foregroundColor: Colors.white, // Change button text color - ), - ), - dialogBackgroundColor: - // Color(0xFF434A53), - Color(0XFF222935).withOpacity(0.60), // Change primary color - - // // Change dialog background color - ), + 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.value = pickedDate; - _selectedDate = pickedDate; - datecontroller.text = - "${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}"; - }); - // // } else { - // showDialog( - // context: context, - // builder: (context) { - // return AlertDialog( - // backgroundColor: Colors.black, - // title: const Text( - // "Age Restriction", - // style: TextStyle(color: Colors.white), - // ), - // content: const Text( - // "Sorry, you must be above 18 years age", - // style: TextStyle(color: Colors.white), - // ), - // actions: [ - // TextButton( - // onPressed: () { - // Navigator.of(context).pop(); - // }, - // child: const Text( - // "OK", - // style: TextStyle(color: Colors.white), - // ), - // ), - // ], - // ); - // }, - // ); - // } + 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')}"; + }); + } else { + setState(() { + _selectedDate = null; + datecontroller.text = ''; // Clear the text field + }); + + Get.snackbar( + "Error!", + 'User should be 18+', + duration: const Duration(seconds: 2), + colorText: Colors.white, + backgroundColor: Colors.red, + margin: const EdgeInsets.all(8), + snackStyle: SnackStyle.FLOATING, + snackPosition: SnackPosition.BOTTOM, + ); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar( + // content: Text('User should be 18+'), + // ), + // ); + } } } @@ -164,12 +165,12 @@ class _TellusaboutIndividualState extends State { utils.showToast("tell us done Successfully!"); Get.back(); // Get.toNamed(RouteName.individualprofilestep1); - if (pagename == "nextscreen") { + // if (pagename == "nextscreen") { Get.toNamed(RouteName.individualactivitystep2); - } else if (pagename == "mainscreen") { - Get.toNamed(RouteName.mainscreen); - } + // } else if (pagename == "mainscreen") { + // Get.toNamed(RouteName.mainscreen); + // } } else { Get.back(); return utils.showToast(data.message); @@ -178,350 +179,342 @@ class _TellusaboutIndividualState extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async { - SystemNavigator.pop(); - Navigator.pop(context); - return true; - }, - child: GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - backgroundColor: 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: 510, left: -30, child: CommonBlurLeftBlue()), - GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - 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), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), - - Color(0XFF222935).withOpacity(0.60), - ], - ), - child: ListView(physics: 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: 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: Color(0XFFD90B2E) - .withOpacity(0.50), - width: 2), - ), - ), - // Middle circle - Container( - width: 119.w, - height: 119.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.transparent, - border: Border.all( - color: Color(0XFFD90B2E) - .withOpacity(0.50), - width: 2), - ), - ), - // Inner circle - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.transparent, - border: Border.all( - color: Color(0XFFD90B2E) - .withOpacity(0.50), - width: 2), - ), - child: Obx(() => - // editProfileImage - // .profilePicPath.value != - // '' - // ? - 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, - ), - ), - ) - : 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', + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: 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: 510, left: -30, child: CommonBlurLeftBlue()), + // GlassmorphicContainer( + // width: MediaQuery.of(context).size.width, + // height: + // // 500.h, + // MediaQuery.of(context).size.height, + // borderRadius: 2, + // blur: 6, + // alignment: Alignment.bottomLeft, + // border: 2, + // linearGradient: LinearGradient( + // 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), + + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // ], + // ), + // borderGradient: LinearGradient( + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // colors: [ + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // Color(0XFF222935).withOpacity(0.60), + + // Color(0XFF222935).withOpacity(0.60), + // ], + // ), + 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: [ + // const Spacer(flex: 1), + sizedBoxHeight(50.h), + Center(child: text20400white('Tell us about yourself')), + sizedBoxHeight(10.w), + Center( + child: Container( + width: 154, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + strokeAlign: BorderSide.strokeAlignCenter, + color: Color(0xFF858585), + ), ), - // 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), - CustomDropDownWidgetSignup( - 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 ( - // isValid! - // fullNameController.text.isBlank! && - // userNameController.text.isBlank! && - // datecontroller.text.isBlank! && - // _selectedgendertype.isEmpty && - // locationcontroller.text.isBlank! && - // editProfileImage.profilePicPath.value == - // '' - 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, - // ) - ], - ), + )), ), - ])), - ], - )), - ), + 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: + Color(0XFFD90B2E).withOpacity(0.50), + width: 2), + ), + ), + // Middle circle + Container( + width: 119.w, + height: 119.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: + Color(0XFFD90B2E).withOpacity(0.50), + width: 2), + ), + ), + // Inner circle + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: Color(0XFFD90B2E) + .withOpacity(0.50), + width: 2), + ), + child: Obx(() => + // editProfileImage + // .profilePicPath.value != + // '' + // ? + 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, + ), + ), + ) + : 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', + ), + // 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), + CustomDropDownWidgetSignup( + 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 ( + // isValid! + // fullNameController.text.isBlank! && + // userNameController.text.isBlank! && + // datecontroller.text.isBlank! && + // _selectedgendertype.isEmpty && + // locationcontroller.text.isBlank! && + // editProfileImage.profilePicPath.value == + // '' + 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/signupscreen.dart b/lib/onboarding/Signup/View/signupscreen.dart index c610f8e..590d9cb 100644 --- a/lib/onboarding/Signup/View/signupscreen.dart +++ b/lib/onboarding/Signup/View/signupscreen.dart @@ -90,21 +90,16 @@ class _SignupScreenState extends State { String selectedCategory = _selectedAccountType; - Get.toNamed(RouteName.verifyusercreen, - arguments: - { - "emailid" : emailidcontroller.text, - "password" : passwordController.text, - "accounttype" : selectedCategory, - 'accountypenumber' : accountTypeValue - - } - - ); + Get.toNamed(RouteName.verifyusercreen, arguments: { + "emailid": emailidcontroller.text, + "password": passwordController.text, + "accounttype": selectedCategory, + 'accountypenumber': accountTypeValue + }); // if (selectedCategory == "Individual") { // Get.toNamed(RouteName.verifyusercreen, - // arguments: + // arguments: // { // "emailid" : emailidcontroller.text, // "password" : passwordController.text, @@ -112,11 +107,11 @@ class _SignupScreenState extends State { // 'accountypenumber' : accountTypeValue // } - + // ); // } else if (selectedCategory == "Individual") { - // Get.toNamed(RouteName.verifyusercreen, - // arguments: + // Get.toNamed(RouteName.verifyusercreen, + // arguments: // { // "emailid" : emailidcontroller.text, // "password" : passwordController.text, @@ -282,7 +277,7 @@ class _SignupScreenState extends State { children: [ SizedBox( width: 320.w, - height: 42.h, + // height: 42.h, child: Text.rich( TextSpan( children: [ @@ -405,16 +400,18 @@ class _SignupScreenState extends State { children: [ GestureDetector( onTap: () { - Get.toNamed(RouteName.verifygoogleapplepage); + Get.toNamed( + RouteName.verifygoogleapplepage); }, child: Container( width: 55, height: 55, decoration: ShapeDecoration( gradient: LinearGradient( - begin: - const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), + begin: const Alignment( + 0.71, -0.70), + end: + const Alignment(-0.71, 0.7), colors: [ Colors.white.withOpacity( 0.07999999821186066), @@ -435,17 +432,18 @@ class _SignupScreenState extends State { const Spacer(), GestureDetector( onTap: () { - Get.toNamed(RouteName.verifygoogleapplepage); - + Get.toNamed( + RouteName.verifygoogleapplepage); }, child: Container( width: 55, height: 55, decoration: ShapeDecoration( gradient: LinearGradient( - begin: - const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), + begin: const Alignment( + 0.71, -0.70), + end: + const Alignment(-0.71, 0.7), colors: [ Colors.white.withOpacity( 0.07999999821186066), diff --git a/lib/onboarding/Signup/View/verifyuser.dart b/lib/onboarding/Signup/View/verifyuser.dart index 2338cbe..c6cf12d 100644 --- a/lib/onboarding/Signup/View/verifyuser.dart +++ b/lib/onboarding/Signup/View/verifyuser.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -21,7 +20,6 @@ import 'package:regroup/resources/routes/route_name.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:timer_button/timer_button.dart'; - class VerifyuserScreenState extends StatefulWidget { const VerifyuserScreenState({super.key}); @@ -55,25 +53,40 @@ class _VerifyuserScreenStateState extends State { if (accounttype == 'Individual') { print('individual selected'); Get.toNamed(RouteName.tellusindividualscreen, - arguments: { - 'pageroute' : "nextscreen" - } + // arguments: { + // 'pageroute' : "nextscreen" + // } ); } else if (accounttype == 'Business') { print('business selected'); Get.toNamed(RouteName.tellusbusinessscreen, - arguments: { - 'pageroute' : "nextscreen" - } + // arguments: { + // 'pageroute' : "nextscreen" + // } ); } return utils.showToast(data.message); - } else { - Get.back(); - print("verification not done"); - return utils.showToast(data.message); - } + } + else { + // btnController.error(); + // 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, + ); + } + // else { + // Get.back(); + // print("verification not done"); + // return utils.showToast(data.message); + // } } Uploadataresendotp() async { @@ -95,7 +108,6 @@ class _VerifyuserScreenStateState extends State { } } - @override Widget build(BuildContext context) { return Scaffold( @@ -153,9 +165,7 @@ class _VerifyuserScreenStateState extends State { text22400white('Check your email'), sizedBoxHeight(10.h), text14400white( - 'Enter the verification code that we sent to $email'), - sizedBoxHeight(40.h), text16400white('Enter code'), sizedBoxHeight(20.h), @@ -241,7 +251,6 @@ class _VerifyuserScreenStateState extends State { CustomButton( text: 'Continue', onPressed: () { - if (pincode.text.isEmpty) { utils.showToast('Pin field is empty'); } else if (pincode.text.length < 4) { @@ -258,7 +267,6 @@ class _VerifyuserScreenStateState extends State { // Get.toNamed(RouteName.tellusbusinessscreen); // } } - }), const Spacer( // flex: 2, @@ -270,4 +278,4 @@ class _VerifyuserScreenStateState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart b/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart index d25b700..6303873 100644 --- a/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart +++ b/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart @@ -19,7 +19,8 @@ class ForgotPassAPI { //Map responseData = jsonDecode(response.data); if (response.data['status'] == "success") { return ResponseData( - response.data['message'], ResponseStatus.SUCCESS,data: response.data); + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); } else { return ResponseData( response.data['message'], ResponseStatus.FAILED); @@ -50,4 +51,3 @@ class ForgotPassAPI { return response; } } -