diff --git a/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png b/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png new file mode 100644 index 0000000..60bb8ba Binary files /dev/null and b/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png differ diff --git a/lib/Global.dart b/lib/Global.dart index ca8119d..665a8cf 100644 --- a/lib/Global.dart +++ b/lib/Global.dart @@ -14,4 +14,6 @@ RxInt notification = 0.obs; late Timer timerhomeglobal; bool isTimerInitialize = false; String? globalAccountType; +String? mainWelcomeName; + diff --git a/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart index a269c07..a80db9e 100644 --- a/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart @@ -30,8 +30,6 @@ class EditProfile extends StatefulWidget { State createState() => _EditProfileState(); } - - class _EditProfileState extends State { TextEditingController fullNameController = TextEditingController(); TextEditingController userNameController = TextEditingController(); @@ -73,7 +71,6 @@ class _EditProfileState extends State { RxBool isloading = true.obs; void getCatIdFromName(List selectedInterests) { - for (var name in selectedInterests) { for (var i = 0; i < interestlistobj!.data!.length; i++) { if (name == interestlistobj!.data![i].name) { @@ -140,22 +137,13 @@ class _EditProfileState extends State { } updata = FormData.fromMap({ - "full_name": fullNameController.text, "profile_image": editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null, - - - - - "user_name": userNameController.text, "date_of_birth": dateController.text, "gender": _selectedgenderType, - - "interest": - - abilitiesIds, + "interest": abilitiesIds, "about": aboutController.text, "position": positionController.text, "training_scores": trainingScoresController.text, @@ -172,7 +160,7 @@ class _EditProfileState extends State { Get.toNamed(RouteName.mainscreen, arguments: 4); } else { Get.back(); - + Get.snackbar( "Error!", data.data['message'], @@ -183,7 +171,6 @@ class _EditProfileState extends State { snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); - } } @@ -249,7 +236,6 @@ class _EditProfileState extends State { .value != '' ? Image( - image: FileImage( File( editProfileImage @@ -311,8 +297,6 @@ class _EditProfileState extends State { context, true, (result) { - - editProfileImage .usserprofilePicPath .value = result; @@ -416,7 +400,6 @@ class _EditProfileState extends State { ), ), ), - sizedBoxHeight(20.h), text16400white("Gender"), sizedBoxHeight(16.h), @@ -482,9 +465,6 @@ class _EditProfileState extends State { ], ), sizedBoxHeight(16.h), - - - CustomDropDownChexkBox( header: 'Select interest', title: "", @@ -495,11 +475,8 @@ class _EditProfileState extends State { width: 18.w, height: 17.h, ), - initiallySelected: listofUserInterests, ), - - sizedBoxHeight(20.h), text16400white("About"), sizedBoxHeight(16.h), @@ -509,8 +486,6 @@ class _EditProfileState extends State { "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", maxlines: 3, ), - - text16400white("Position"), sizedBoxHeight(16.h), CustomTextFormField( @@ -592,12 +567,7 @@ class _EditProfileState extends State { backgroundColor: Colors.red, colorText: Colors.white, ); - } - - - - - else { + } else { saveEditProfileInd(); } }, diff --git a/lib/Main_Screens/ProfileTab/Settings/Settings.dart b/lib/Main_Screens/ProfileTab/Settings/Settings.dart index 1667ae0..42c1ee7 100644 --- a/lib/Main_Screens/ProfileTab/Settings/Settings.dart +++ b/lib/Main_Screens/ProfileTab/Settings/Settings.dart @@ -1,10 +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/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; @@ -22,8 +22,8 @@ class Settings extends StatefulWidget { } class _SettingsState extends State { - String? accountTypeValue; - String? accounTypeLogin; + // String? accountTypeValue; + // String? accounTypeLogin; @override void initState() { @@ -32,14 +32,15 @@ class _SettingsState extends State { } 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'); - }); + // globalAccountType; + // 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 { @@ -108,7 +109,7 @@ class _SettingsState extends State { ), ), commonDivider(), - accounTypeLogin == '1' + globalAccountType == '1' ? Column( children: [ GestureDetector( @@ -155,7 +156,7 @@ class _SettingsState extends State { ), ), commonDivider(), - accounTypeLogin == '1' + globalAccountType == '1' ? const SizedBox() : Column( children: [ @@ -214,7 +215,7 @@ class _SettingsState extends State { child: commonGlassUI( width: double.infinity, height: 200.h, - borderRadius: BorderRadius.circular( 14), + borderRadius: BorderRadius.circular(14), opacity1: 0.09, opacity2: 0.13, borderwidth: 0.8, @@ -241,7 +242,7 @@ class _SettingsState extends State { child: commonGlassUI( width: 130.w, height: 40.h, - borderRadius: BorderRadius.circular( 30.r), + borderRadius: BorderRadius.circular(30.r), opacity1: 0.05, opacity2: 0.07, customWidget: diff --git a/lib/Utils/texts.dart b/lib/Utils/texts.dart index 52531db..dc44896 100644 --- a/lib/Utils/texts.dart +++ b/lib/Utils/texts.dart @@ -92,10 +92,10 @@ Widget text16400whiteblur(String text) { ); } -Widget text25700white(String text) { +Widget text25700white(String text, {TextAlign? textAlign}) { return Text( text, - // textAlign: TextAlign.center, + textAlign: textAlign, style: TextStyle( fontSize: 25.sp, color: AppColors.white, diff --git a/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart new file mode 100644 index 0000000..6f8796d --- /dev/null +++ b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart @@ -0,0 +1,588 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; +import 'package:regroup/Login/ViewModel/LoginApi.dart'; +import 'package:regroup/Utils/Common/AppleOAuthService.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/googleOAuthService.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/onboarding/Signup/view_model/postmethod.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 BusSignUpScreen extends StatefulWidget { + const BusSignUpScreen({super.key}); + + @override + State createState() => _BusSignUpScreenState(); +} + +class _BusSignUpScreenState extends State { + TextEditingController emailidcontroller = TextEditingController(); + TextEditingController passwordController = TextEditingController(); + TextEditingController confirmpasscontroller = TextEditingController(); + AccessToken? _accessToken; + + final GlobalKey _formKey = GlobalKey(); + GoogleAuthService googleSigninController = Get.put(GoogleAuthService()); + + final Map _accountTypeMap = { + 'Individual': 1, + 'Business': 2, + }; + + String _selectedAccountType = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedAccountType = value; + }); + } + + _loginWithApple() { + AppleOAuthService().logIn(); + } + + _loginWithGoogle() { + googleSigninController.handleGoogleSignIn().then((value) async { + final resp = await LoginAPI().storeGoogleSignin( + {"google_access_token": value, "one_signal_player_id": "ABCD"}); + if (value != 'Google Sign-In canceled') { + if (resp.message == "go-to-signin-via-oauth") { + Get.toNamed(RouteName.verifygoogleapplepage, + arguments: {"email": resp.data}); + } else if (value == null) { + Get.snackbar( + 'Error', + resp.data["message"][0], + duration: const Duration(seconds: 2), + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } else { + Get.snackbar( + "Success!", + 'Login successful!', + duration: const Duration(seconds: 2), + colorText: Colors.white, + backgroundColor: Colors.green, + margin: const EdgeInsets.all(8), + snackStyle: SnackStyle.FLOATING, + snackPosition: SnackPosition.BOTTOM, + ); + //Get.toNamed(RouteName.mainscreen); + logger.d("go to login"); + } + } else { + Get.snackbar( + 'Error', + resp.data["message"][0], + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + }); + } + + _checkIfisLoggedIn() async { + await _logout(); + final accessToken = await FacebookAuth.instance.accessToken; + if (accessToken != null) { + print("/////////////////////////////////////////xcheck"); + + final userData = await FacebookAuth.instance.getUserData(); + + logger.i(accessToken.token); + logger.i(userData.toString()); + } else { + print("/////////////////////////////////////////check"); + _login(); + } + } + + _login() async { + final LoginResult result = await FacebookAuth.instance.login(); + + if (result.status == LoginStatus.success) { + _accessToken = result.accessToken; + + final userData = await FacebookAuth.instance.getUserData(); + logger.i(userData['email']); + logger.i(userData['id']); + + await LoginAPI().storeFacebookSignin( + {"facebook_auth_token": userData['id']}, + emailReceived: userData['email']); + } else { + print(result.status); + print(result.message); + } + } + + _logout() async { + await FacebookAuth.instance.logOut(); + _accessToken = null; + setState(() {}); + } + + Uploadata() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + utils.loader(); + int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; + Map updata = { + "email_address": emailidcontroller.text, + "password": passwordController.text, + "account_type": "2", + }; + + final data = await Onboard().Postregisteration(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("Sign up done"); + globalAccountType = "2"; + + String selectedCategory = _selectedAccountType; + + Get.toNamed(RouteName.verifyusercreen, arguments: { + "emailid": emailidcontroller.text, + "password": passwordController.text, + "accounttype": "Business", + 'accountypenumber': 2 + }); + + return utils.showToast(data.message); + } else { + Get.back(); + print("registration not done"); + return utils.showToast(data.message); + } + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Choice screen.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + InkWell( + onTap: () { + Get.back(); + }, + child: commonGlassUI( + borderwidth: 0.5, + width: 40.w, + height: 40.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + customWidget: Center( + child: Image.asset( + 'assets/images/png/ph_arrow-up-thin.png', + height: 25.h, + width: 25.w, + )), + ), + ), + sizedBoxWidth(16.w), + text14400whiteblur( + "Back to individual account creation") + ], + ), + ), + sizedBoxHeight(50.h), + Center(child: text22400white('Create business account')), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 35.h), + child: SingleChildScrollView( + child: Form( + key: _formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white('Email address'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: emailidcontroller, + 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, + ), + ), + // validatorText: "Email Id", + 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; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + 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, + ), + // const Icon(Icons.lock_outline), + // validationMessage: "Enter your password", + validator: (val) { + if (val == null || val.isEmpty) { + return 'Please enter your password'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + text16400white('Confirm password'), + sizedBoxHeight(10.h), + CustomTextFormField( + isInputPassword: true, + textEditingController: confirmpasscontroller, + hintText: "Enter your password", + leadingIcon: Image.asset( + 'assets/images/png/lock.png', + width: 22.w, + height: 17.h, + ), + // const Icon(Icons.lock_outline), + // validatorText: "Enter your password", + validator: (val) { + if (val == null || val.isEmpty) { + return 'Please enter your password'; + } + if (val != passwordController.text) { + return 'Password does not match'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + // Row( + // children: [ + // text16400white('Account type'), + // sizedBoxWidth(5.w), + // Image.asset( + // 'assets/images/png/informationicon.png') + // ], + // ), + // sizedBoxHeight(10.h), + // CustomDropDownRadio( + // header: 'Select account type', + // title: '', + // listData: const [ + // 'Individual', + // 'Business', + // ], + // onItemSelected: _onItemSelected, + // leadingImage: Image.asset( + // 'assets/images/png/user.png', + // ), + // ), + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 320.w, + // height: 42.h, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: + 'By signing up to ReGroup you agree to our ', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Terms and Conditions', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700, + decoration: + TextDecoration.underline, + decorationColor: + const Color(0xffFCFCFC) + .withOpacity(0.80), + ), + ), + TextSpan( + text: ' and ', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Privacy Policy', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700, + decoration: + TextDecoration.underline, + decorationColor: + const Color(0xffFCFCFC) + .withOpacity(0.80), + ), + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + ], + ), + sizedBoxHeight(20.h), + CustomButton( + text: "Continue", + onPressed: () { + // _Signincheck(); + final isValid = + _formKey.currentState?.validate(); + if ( + // isValid! + emailidcontroller.text.isBlank! || + passwordController.text.isBlank! || + confirmpasscontroller.text.isBlank! + // && _selectedAccountType.isEmpty + ) { + print(emailidcontroller.text); + print(passwordController.text); + print(_selectedAccountType.toString()); + utils.showToast('Please fill all fields'); + } else { + Uploadata(); + } + }), + sizedBoxHeight(20.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'))), + ), + ), + 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'))), + ), + ), + 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(20.h), + ], + ), + ), + ), + ), + ) + ], + ), + ], + )), + ); + } +} diff --git a/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart b/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart index 2740593..44d681e 100644 --- a/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart +++ b/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart @@ -106,7 +106,9 @@ class _LetusUnderstandState extends State { snackPosition: SnackPosition.BOTTOM, ); - Get.toNamed(RouteName.individualgroupstep3); + // Get.toNamed(RouteName.individualgroupstep3); + + Get.toNamed(RouteName.individualcommunitystep4); } else if (data.status == ResponseStatus.FAILED) { Get.snackbar( "Error!", @@ -274,7 +276,8 @@ class _LetusUnderstandState extends State { height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: const BorderSide(width: 1, color: Color(0xFF434A53)), + side: const BorderSide( + width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -488,8 +491,8 @@ class _LetusUnderstandState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow( - RegExp('[a-zA-ZS0-9 ]')), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-ZS0-9 ]')), ], ), // sizedBoxHeight(10.h), @@ -518,8 +521,8 @@ class _LetusUnderstandState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow( - RegExp('[a-zA-ZS0-9 ]')), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-ZS0-9 ]')), ], ), // sizedBoxHeight(10.h), diff --git a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart index 8428a80..cbcddb9 100644 --- a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart +++ b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; @@ -83,7 +84,7 @@ class _TellusaboutBusinessState extends State { Map updata = { "business_name": businessNameController.text, "business_owner_name": businessownerController.text, - "business_location": businessownerController.text, + "business_location": businesslocationController.text, "business_type_xid": businessTypeId, }; final data = await BusinessAPI().tellUsBusinessApi(updata); @@ -98,6 +99,7 @@ class _TellusaboutBusinessState extends State { snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); + mainWelcomeName = businessownerController.text; Get.toNamed(RouteName.businessletusunderstandstep1); } else if (data.status == ResponseStatus.FAILED) { diff --git a/lib/onboarding/Signup/View/Individual/tellusindividual.dart b/lib/onboarding/Signup/View/Individual/tellusindividual.dart index 236d6c2..6e0deba 100644 --- a/lib/onboarding/Signup/View/Individual/tellusindividual.dart +++ b/lib/onboarding/Signup/View/Individual/tellusindividual.dart @@ -10,6 +10,7 @@ import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/profileimagecontroller.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; @@ -151,6 +152,7 @@ class _TellusaboutIndividualState extends State { final data = await Onboard().PosttellusIndividual(formData); if (data.status == ResponseStatus.SUCCESS) { Get.back(); + mainWelcomeName = fullNameController.text; Get.toNamed(RouteName.individualactivitystep2); } else { Get.back(); diff --git a/lib/onboarding/Signup/View/signupendpage.dart b/lib/onboarding/Signup/View/signupendpage.dart index 7c23f13..80d19e8 100644 --- a/lib/onboarding/Signup/View/signupendpage.dart +++ b/lib/onboarding/Signup/View/signupendpage.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/googleOAuthService.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -35,7 +37,10 @@ class _SignupendPageState extends State { children: [ Image.asset('assets/images/png/regroupredtexticon.png'), sizedBoxHeight(30.h), - text25700white('Welcome Edward '), + Center( + child: text25700white( + " Welcome $mainWelcomeName" ?? 'Welcome Edward ', + textAlign: TextAlign.center)), sizedBoxHeight(20.h), // 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 specimen book.'''), diff --git a/lib/onboarding/Signup/View/signupscreen.dart b/lib/onboarding/Signup/View/signupscreen.dart index b4e9c5f..f64ce17 100644 --- a/lib/onboarding/Signup/View/signupscreen.dart +++ b/lib/onboarding/Signup/View/signupscreen.dart @@ -140,33 +140,31 @@ class _SignupScreenState extends State { } Uploadata() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); + SharedPreferences prefs = await SharedPreferences.getInstance(); utils.loader(); int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; Map updata = { "email_address": emailidcontroller.text, "password": passwordController.text, - "account_type": accountTypeValue, + "account_type": "1", }; final data = await Onboard().Postregisteration(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); print("Sign up done"); - globalAccountType = accountTypeValue.toString(); + globalAccountType = "1"; String selectedCategory = _selectedAccountType; Get.toNamed(RouteName.verifyusercreen, arguments: { "emailid": emailidcontroller.text, "password": passwordController.text, - "accounttype": selectedCategory, - 'accountypenumber': accountTypeValue + "accounttype": "Individual", + 'accountypenumber': 1, }); - - + return utils.showToast(data.message); - } else { Get.back(); print("registration not done"); @@ -176,7 +174,6 @@ class _SignupScreenState extends State { @override void initState() { - super.initState(); } @@ -300,27 +297,27 @@ class _SignupScreenState extends State { ], ), sizedBoxHeight(10.h), - Row( - children: [ - text16400white('Account type'), - sizedBoxWidth(5.w), - Image.asset( - 'assets/images/png/informationicon.png') - ], - ), - sizedBoxHeight(10.h), - CustomDropDownRadio( - header: 'Select account type', - title: '', - listData: const [ - 'Individual', - 'Business', - ], - onItemSelected: _onItemSelected, - leadingImage: Image.asset( - 'assets/images/png/user.png', - ), - ), + // Row( + // children: [ + // text16400white('Account type'), + // sizedBoxWidth(5.w), + // Image.asset( + // 'assets/images/png/informationicon.png') + // ], + // ), + // sizedBoxHeight(10.h), + // CustomDropDownRadio( + // header: 'Select account type', + // title: '', + // listData: const [ + // 'Individual', + // 'Business', + // ], + // onItemSelected: _onItemSelected, + // leadingImage: Image.asset( + // 'assets/images/png/user.png', + // ), + // ), sizedBoxHeight(30.h), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -394,11 +391,12 @@ class _SignupScreenState extends State { _formKey.currentState?.validate(); if ( // isValid! - emailidcontroller.text.isBlank! && - passwordController.text.isBlank! && + emailidcontroller.text.isBlank! || + passwordController.text.isBlank! || confirmpasscontroller - .text.isBlank! && - _selectedAccountType.isEmpty) { + .text.isBlank! + // && _selectedAccountType.isEmpty + ) { print(emailidcontroller.text); print(passwordController.text); print(_selectedAccountType.toString()); @@ -547,6 +545,68 @@ class _SignupScreenState extends State { ), ), sizedBoxHeight(20.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 320.w, + // height: 42.h, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: + 'Are you a business looking to join ', + style: TextStyle( + color: const Color(0xFFFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Regroup?', + style: TextStyle( + color: const Color(0xFFD90B2E), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + ], + ), + sizedBoxHeight(25.h), + InkWell( + onTap: () { + Get.toNamed(RouteName.bussignupScreen); + }, + child: Container( + width: double.infinity, + height: 50.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(255, 255, 255, 0.036), + Color.fromRGBO(255, 255, 255, 0.048), + ], + ), + borderRadius: BorderRadius.circular(30.r), + border: Border.all( + color: Color(0xFF434A53), + width: 1, + ), + ), + child: Center( + child: text16w400_FCFCFC("Sign up here")), + ), + ), ], ), ), diff --git a/lib/resources/routes/route_name.dart b/lib/resources/routes/route_name.dart index 868c0c6..cbabf6d 100644 --- a/lib/resources/routes/route_name.dart +++ b/lib/resources/routes/route_name.dart @@ -19,6 +19,8 @@ class RouteName { static const String communitycommitscreen = '/communitycommitscreen'; static const String signupendpage = '/signupendpage'; + + static const String bussignupScreen = '/bussignupScreen'; static const String businessletusunderstandstep1 = '/businessletusunderstand'; static const String businessSelectgroupstep2 = '/businessselectgroup'; static const String businessSelectcommunitystep3 = '/businessselectcommunity'; diff --git a/lib/resources/routes/routes.dart b/lib/resources/routes/routes.dart index 38600c7..5bb7164 100644 --- a/lib/resources/routes/routes.dart +++ b/lib/resources/routes/routes.dart @@ -63,6 +63,7 @@ import 'package:regroup/Main_Screens/ProfileTab/Share%20profile/ShareProfile.dar import 'package:regroup/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart'; import 'package:regroup/Notifications/notification.dart'; +import 'package:regroup/onboarding/Signup/View/Business/View/busSignupScreen.dart'; import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart'; import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart'; @@ -195,7 +196,6 @@ class AppRoutes { name: RouteName.group, page: () => const Group(), ), - GetPage( name: RouteName.individualactivitystep2, page: () => const SelectIndividualActivity(), @@ -208,7 +208,7 @@ class AppRoutes { name: RouteName.individualcommunitystep4, page: () => const SelectIndividualCommunity(), ), - GetPage( + GetPage( name: RouteName.findcommunitypage, page: () => const FindCommunityPage(), ), @@ -220,12 +220,14 @@ class AppRoutes { name: RouteName.signupendpage, page: () => const SignupendPage(), ), + GetPage( + name: RouteName.bussignupScreen, + page: () => const BusSignUpScreen(), + ), GetPage( name: RouteName.businessletusunderstandstep1, page: () => const LetusUnderstand(), ), - - GetPage( name: RouteName.communitysetting, page: () => const CommunitySetting(),