onboard flow api done.

This commit is contained in:
Dakshesh42
2024-08-02 19:52:50 +05:30
parent dad5d8d9cf
commit 2863f827a6
13 changed files with 733 additions and 96 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

View File

@@ -14,4 +14,6 @@ RxInt notification = 0.obs;
late Timer timerhomeglobal;
bool isTimerInitialize = false;
String? globalAccountType;
String? mainWelcomeName;

View File

@@ -30,8 +30,6 @@ class EditProfile extends StatefulWidget {
State<EditProfile> createState() => _EditProfileState();
}
class _EditProfileState extends State<EditProfile> {
TextEditingController fullNameController = TextEditingController();
TextEditingController userNameController = TextEditingController();
@@ -73,7 +71,6 @@ class _EditProfileState extends State<EditProfile> {
RxBool isloading = true.obs;
void getCatIdFromName(List<String> 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<EditProfile> {
}
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<EditProfile> {
Get.toNamed(RouteName.mainscreen, arguments: 4);
} else {
Get.back();
Get.snackbar(
"Error!",
data.data['message'],
@@ -183,7 +171,6 @@ class _EditProfileState extends State<EditProfile> {
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
}
@@ -249,7 +236,6 @@ class _EditProfileState extends State<EditProfile> {
.value !=
''
? Image(
image: FileImage(
File(
editProfileImage
@@ -311,8 +297,6 @@ class _EditProfileState extends State<EditProfile> {
context,
true,
(result) {
editProfileImage
.usserprofilePicPath
.value = result;
@@ -416,7 +400,6 @@ class _EditProfileState extends State<EditProfile> {
),
),
),
sizedBoxHeight(20.h),
text16400white("Gender"),
sizedBoxHeight(16.h),
@@ -482,9 +465,6 @@ class _EditProfileState extends State<EditProfile> {
],
),
sizedBoxHeight(16.h),
CustomDropDownChexkBox(
header: 'Select interest',
title: "",
@@ -495,11 +475,8 @@ class _EditProfileState extends State<EditProfile> {
width: 18.w,
height: 17.h,
),
initiallySelected: listofUserInterests,
),
sizedBoxHeight(20.h),
text16400white("About"),
sizedBoxHeight(16.h),
@@ -509,8 +486,6 @@ class _EditProfileState extends State<EditProfile> {
"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<EditProfile> {
backgroundColor: Colors.red,
colorText: Colors.white,
);
}
else {
} else {
saveEditProfileInd();
}
},

View File

@@ -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<Settings> {
String? accountTypeValue;
String? accounTypeLogin;
// String? accountTypeValue;
// String? accounTypeLogin;
@override
void initState() {
@@ -32,14 +32,15 @@ class _SettingsState extends State<Settings> {
}
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<Settings> {
),
),
commonDivider(),
accounTypeLogin == '1'
globalAccountType == '1'
? Column(
children: [
GestureDetector(
@@ -155,7 +156,7 @@ class _SettingsState extends State<Settings> {
),
),
commonDivider(),
accounTypeLogin == '1'
globalAccountType == '1'
? const SizedBox()
: Column(
children: [
@@ -214,7 +215,7 @@ class _SettingsState extends State<Settings> {
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<Settings> {
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:

View File

@@ -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,

View File

@@ -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<BusSignUpScreen> createState() => _BusSignUpScreenState();
}
class _BusSignUpScreenState extends State<BusSignUpScreen> {
TextEditingController emailidcontroller = TextEditingController();
TextEditingController passwordController = TextEditingController();
TextEditingController confirmpasscontroller = TextEditingController();
AccessToken? _accessToken;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
final Map<String, int> _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<String, dynamic> 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),
],
),
),
),
),
)
],
),
],
)),
);
}
}

View File

@@ -106,7 +106,9 @@ class _LetusUnderstandState extends State<LetusUnderstand> {
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<LetusUnderstand> {
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<LetusUnderstand> {
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<LetusUnderstand> {
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
// FilteringTextInputFormatter.allow(
// RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),

View File

@@ -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<TellusaboutBusiness> {
Map<String, String> 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<TellusaboutBusiness> {
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
mainWelcomeName = businessownerController.text;
Get.toNamed(RouteName.businessletusunderstandstep1);
} else if (data.status == ResponseStatus.FAILED) {

View File

@@ -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<TellusaboutIndividual> {
final data = await Onboard().PosttellusIndividual(formData);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
mainWelcomeName = fullNameController.text;
Get.toNamed(RouteName.individualactivitystep2);
} else {
Get.back();

View File

@@ -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<SignupendPage> {
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.'''),

View File

@@ -140,33 +140,31 @@ class _SignupScreenState extends State<SignupScreen> {
}
Uploadata() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
SharedPreferences prefs = await SharedPreferences.getInstance();
utils.loader();
int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0;
Map<String, dynamic> 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<SignupScreen> {
@override
void initState() {
super.initState();
}
@@ -300,27 +297,27 @@ class _SignupScreenState extends State<SignupScreen> {
],
),
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<SignupScreen> {
_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<SignupScreen> {
),
),
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")),
),
),
],
),
),

View File

@@ -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';

View File

@@ -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';
@@ -192,7 +193,6 @@ class AppRoutes {
name: RouteName.group,
page: () => const Group(),
),
GetPage(
name: RouteName.individualactivitystep2,
page: () => const SelectIndividualActivity(),
@@ -205,7 +205,7 @@ class AppRoutes {
name: RouteName.individualcommunitystep4,
page: () => const SelectIndividualCommunity(),
),
GetPage(
GetPage(
name: RouteName.findcommunitypage,
page: () => const FindCommunityPage(),
),
@@ -217,12 +217,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(),