Merge pull request #50 from WDI-Ideas/hotfixes

Hotfixes
This commit is contained in:
Kishan Bhuta
2024-07-15 12:04:39 +05:30
committed by GitHub
23 changed files with 983 additions and 1109 deletions

View File

@@ -1,4 +0,0 @@
{
"CodeGPT.apiKey": "CodeGPT Plus Beta",
"dart.flutterSdkPath": "D:\\pooja\\fluttersdk\\flutter_3.16.9\\flutter"
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ReGroup123</string>
<string name="facebook_app_id">8076081959097016</string>
<string name="fb_login_protocol_scheme">fb8076081959097016</string>
<string name="facebook_client_token">ca5a1805872edbec0d3a0a0b02229ba5</string>
<string name="app_name">Regroup</string>
<string name="facebook_app_id">803386025107790</string>
<string name="fb_login_protocol_scheme">fb803386025107790</string>
<string name="facebook_client_token">fa69ee794ff94e50c7ddbfac1e035cb9</string>
</resources>

View File

@@ -151,6 +151,8 @@
dependencies = (
);
name = Runner;
packageProductDependencies = (
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -179,6 +181,8 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";

View File

@@ -0,0 +1,15 @@
{
"originHash" : "ca3cf5f8f83d297b47d2cb0edff3e06f294951e2e06fa55cfc82831103499b2a",
"pins" : [
{
"identity" : "facebook-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/facebook/facebook-ios-sdk",
"state" : {
"revision" : "c19607d535864533523d1f437c84035e5fb101cf",
"version" : "14.1.0"
}
}
],
"version" : 3
}

View File

@@ -51,5 +51,29 @@
<string>Regroup get write-only access to the user photo library</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow access to photo library</string>
<key>NSCameraUsageDescription</key>
<string>To capture profile photo please grant camera access</string>
<!-- facebook start -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb803386025107790</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>803386025107790</string>
<key>FacebookClientToken</key>
<string>fa69ee794ff94e50c7ddbfac1e035cb9</string>
<key>FacebookDisplayName</key>
<string>Regroup</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
<!-- facebook end -->
</dict>
</plist>

View File

@@ -27,9 +27,10 @@ class ApiUrls {
static const postcommunities = "${baseUrl}select-communities";
static const googlelogin = "${baseUrl}sign-in-with-google-login";
static const applelogin = "${baseUrl}apple-login-or-registration";
static const facebooklogin = "${baseUrl}facebook-login";
static const storeDetailsOfOAuth = "${baseUrl}update-user-account-type";
static const getuserdetails = "${baseUrl}get-auth-user-data";
}

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
@@ -9,6 +10,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 Settings extends StatefulWidget {
const Settings({super.key});
@@ -146,18 +148,26 @@ class _SettingsState extends State<Settings> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
commonGlassContainer(
width: 140.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget:
Center(child: text14400white("Yes, I want to")),
border: 1),
GestureDetector(
onTap: () async {
SharedPreferences prefs =
await SharedPreferences.getInstance();
await prefs.clear();
Get.offAllNamed(RouteName.loginScreen);
},
child: commonGlassContainer(
width: 130.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget:
Center(child: text14400white("Yes, I want to")),
border: 1),
),
Container(
height: 40.h,
width: 140.w,
width: 130.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),

View File

@@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -13,6 +15,7 @@ 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/getUserprofile.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
@@ -27,9 +30,7 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State<LoginScreen> {
String _accessToken = "";
Map _userData = {};
bool _checking = true;
AccessToken? _accessToken;
final TextEditingController _emailController = TextEditingController();
RxBool isObscured = true.obs;
final TextEditingController _passwordController = TextEditingController();
@@ -50,9 +51,16 @@ class _LoginScreenState extends State<LoginScreen> {
final resp = await LoginAPI().storeGoogleSignin(
{"google_access_token": value, "one_signal_player_id": "ABCD"});
if (resp.message == "go-to-signin-via-oauth") {
// Get.to(()=> );
Get.toNamed(RouteName.verifygoogleapplepage);
logger.d("go to sign in");
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": resp.data});
} else if (value == null) {
Get.snackbar(
'Error',
'Google Sign-In canceled',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else {
Get.snackbar(
"Success!",
@@ -64,8 +72,7 @@ class _LoginScreenState extends State<LoginScreen> {
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.toNamed(RouteName.mainscreen);
//Get.toNamed(RouteName.mainscreen);
logger.d("go to login");
}
} else {
@@ -80,54 +87,46 @@ class _LoginScreenState extends State<LoginScreen> {
});
}
// _checkIfisLoggedIn() async {
// //user token
// final accessToken = await FacebookAuth.instance.accessToken;
_checkIfisLoggedIn() async {
await _logout();
final accessToken = await FacebookAuth.instance.accessToken;
if (accessToken != null) {
print("/////////////////////////////////////////xcheck");
// setState(() {
// _checking = false;
// });
final userData = await FacebookAuth.instance.getUserData();
// if (accessToken != null) {
// print("/////////////////////////////////////////xcheck");
// print("worked");
// print(accessToken.toJson());
// final userData = await FacebookAuth.instance.getUserData();
// // _accessToken = accessToken;
// setState(() {
// _userData = userData;
// });
// } else {
// print("/////////////////////////////////////////check");
logger.i(accessToken.token);
logger.i(userData.toString());
} else {
print("/////////////////////////////////////////check");
_login();
}
}
// print("not worked");
// _login();
// }
// }
_login() async {
final LoginResult result = await FacebookAuth.instance.login();
// _login() async {
// final LoginResult result = await FacebookAuth.instance.login();
if (result.status == LoginStatus.success) {
_accessToken = result.accessToken;
// if (result.status == LoginStatus.success) {
// _accessToken = result.accessToken;
final userData = await FacebookAuth.instance.getUserData();
logger.i(userData['email']);
logger.i(userData['id']);
// final userData = await FacebookAuth.instance.getUserData();
// _userData = userData;
// } else {
// print(result.status);
// print(result.message);
// }
// setState(() {
// _checking = false;
// });
// }
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;
// _userData = null;
// setState(() {});
// }
_logout() async {
await FacebookAuth.instance.logOut();
_accessToken = null;
setState(() {});
}
_logincheck() async {
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
@@ -397,79 +396,71 @@ class _LoginScreenState extends State<LoginScreen> {
child: SizedBox(
width: 220.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
GestureDetector(
onTap: () {
_loginWithApple();
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),
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.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(),
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(),
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(),
// const Spacer(),
GestureDetector(
onTap: () async {
/* FacebookAuth.instance.login(
permissions: ['public_profile', 'email'],
).then((value) {
FacebookAuth.instance.getUserData().then((userData) {
setState(() {
/* _isLoggedIn = true;
_userObj = userData; */
});
});
}); */
_checkIfisLoggedIn();
},
child: Container(
width: 55,
@@ -499,7 +490,7 @@ class _LoginScreenState extends State<LoginScreen> {
),
),
),
sizedBoxHeight(100)
// sizedBoxHeight(100)
],
),
),

View File

@@ -1,8 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
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/Common/controller/CommonTextFormField.dart';
import 'package:regroup/Global.dart';
import 'package:regroup/Login/ViewModel/LoginApi.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
@@ -10,10 +14,13 @@ 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';
class Verifygoogleandapple extends StatefulWidget {
const Verifygoogleandapple({super.key});
Verifygoogleandapple({
super.key,
});
@override
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
@@ -22,20 +29,53 @@ class Verifygoogleandapple extends StatefulWidget {
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
TextEditingController emailidcontroller = TextEditingController();
final Map<String, int> _accountTypeMap = {
'Individual': 1,
'Business': 2,
};
String _selectedAccountType = '';
@override
void initState() {
emailidcontroller.text = Get.arguments['email'];
super.initState();
}
void _onItemSelected(String value) {
setState(() {
_selectedAccountType = value;
});
}
getIdFromAccountType() {
if (_selectedAccountType == 'Individual') {
return 1;
} else {
return 2;
}
}
_createAccountWithOAuth() async {
var updata = {
"principal_type_xid": getIdFromAccountType(),
"email_address": emailidcontroller.text,
};
final resp = await LoginAPI()
.storeUserDetailsWhenComingFromGoogleAppleSignin(updata);
if (resp.status == ResponseStatus.SUCCESS) {
if (_selectedAccountType == 'Individual') {
Get.toNamed(RouteName.tellusindividualscreen);
} else {
Get.toNamed(RouteName.tellusbusinessscreen);
}
} else {
Get.snackbar(
'Error',
'Google Sign-In canceled',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
}
}
@override
Widget build(BuildContext context) {
@@ -169,13 +209,11 @@ class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
CustomButton(
text: "Continue",
onPressed: () {
if (
// isValid!
emailidcontroller.text.isEmpty &&
_selectedAccountType.isEmpty) {
if (emailidcontroller.text.isEmpty &&
_selectedAccountType.isEmpty) {
utils.showToast('Please fill all fields');
} else {
// Uploadata();
_createAccountWithOAuth();
}
}),
const Spacer()

View File

@@ -4,6 +4,7 @@ import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart';
import 'package:regroup/Global.dart';
import 'package:regroup/Login/Model/LoginModel.dart';
import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -40,18 +41,20 @@ class LoginAPI {
if (accountype == "1") {
print('tell us individyal');
Get.toNamed(RouteName.tellusindividualscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
Get.toNamed(
RouteName.tellusindividualscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
);
} else if (accountype == "2") {
print('tell us business');
Get.toNamed(RouteName.tellusbusinessscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
Get.toNamed(
RouteName.tellusbusinessscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
);
}
} else {
@@ -73,9 +76,52 @@ class LoginAPI {
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS,
data: response.data['data']['email']);
} else {
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
Future<ResponseData> storeAppleSignin(var data,
{String? emailReceived}) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.applelogin, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": emailReceived});
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
} else {
Get.toNamed(RouteName.mainscreen);
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
Future<ResponseData> storeFacebookSignin(var data,
{String? emailReceived}) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.facebooklogin, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": emailReceived});
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
} else {
Get.toNamed(RouteName.mainscreen);
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
@@ -85,10 +131,12 @@ class LoginAPI {
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {}
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: false);
if (response.status == ResponseStatus.SUCCESS) {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
}
return response;
}

View File

@@ -1,4 +1,5 @@
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';
@@ -14,7 +15,9 @@ class AppleOAuthService {
logger.d("email is ${credential.email}");
logger.d("fullname is ${credential.givenName}");
logger.d("token is ${credential.userIdentifier}");
await LoginAPI()
.storeAppleSignin({"apple_auth_token": credential.userIdentifier}, emailReceived:credential.email );
} catch (e) {
print("Error occured");
}

View File

@@ -53,7 +53,7 @@ class ImageUploadBottomSheet {
.getImage(ImageSource.camera);
onImagePicked(result);
Get.back();
// Get.back();
},
child: Column(
children: [
@@ -116,7 +116,7 @@ class ImageUploadBottomSheet {
onTap: () async {
var result = await FilePickerMethod().pickFile();
onImagePicked(result?.path ?? "");
Get.back();
// Get.back();
},
child: Column(
children: [
@@ -155,7 +155,7 @@ class ImageUploadBottomSheet {
.getImage(ImageSource.camera);
onImagePicked(result);
Get.back();
// Get.back();
},
child: Column(
children: [
@@ -187,7 +187,7 @@ class ImageUploadBottomSheet {
var result = await ImagePickerMethod()
.getImage(ImageSource.gallery);
onImagePicked(result);
Get.back();
// Get.back();
},
child: Column(
children: [

View File

@@ -32,16 +32,6 @@ class GoogleAuthService extends GetxController {
}
Future<String?> handleGoogleSignIn() async {
// await FirebaseAuth.instance.signOut();
// Map<String, dynamic> updata = {
// "username": "kishan1",
// "email": "kishan1@gmail.com",
// "phone": "123456564",
// "ID": "efsfsfsefsef"
// };
// GoogleSigninApi().googleSigninApi(updata);
try {
// Sign out the user if they are already signed in
await _googleSignIn.signOut();
@@ -88,7 +78,7 @@ class GoogleAuthService extends GetxController {
} catch (error) {
// Handle any errors that occurred during the sign-in process.
print('Error during Google Sign-In: $error');
return null;
}
return null;
}
}

View File

@@ -15,15 +15,13 @@ class utils {
elevation: 0,
backgroundColor: Colors.transparent,
child: WillPopScope(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(
color: Color(0xffc18948),
),
],
),
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(
color: Color(0xffc18948),
),
],
),
onWillPop: () async => false),
),

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:firebase_core/firebase_core.dart';
@@ -45,10 +46,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// final Connectivity _connectivity = Connectivity();
// late StreamSubscription<ConnectivityResult> _connectivitySubscription;
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
final Connectivity _connectivity = Connectivity();
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
// Future<void> checkInternet() async {
// final connectivityResult = await (Connectivity().checkConnectivity());
@@ -97,25 +98,25 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// setState(() {
// _connectionStatus = result;
// });
if (result.contains(ConnectivityResult.wifi) || result.contains(ConnectivityResult.mobile)) {
setState(() {
_connectionStatus = result;
Get.back(result: true);
});
if (result.contains(ConnectivityResult.wifi) ||
result.contains(ConnectivityResult.mobile)) {
setState(() {
_connectionStatus = result;
Get.back(result: true);
});
} else {
setState(() {
_connectionStatus = result;
Get.toNamed(RouteName.nointernet);
});
setState(() {
_connectionStatus = result;
Get.toNamed(RouteName.nointernet);
});
// Get.toNamed(RouteName.nointernet);
}
// ignore: avoid_print
print('Connectivity changed: $_connectionStatus');
}
Future<void> _getStoragePermission() async {
Future<void> _getStoragePermission() async {
DeviceInfoPlugin plugin = DeviceInfoPlugin();
AndroidDeviceInfo android = await plugin.androidInfo;
if (android.version.sdkInt < 33) {
@@ -155,13 +156,13 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
void initState() {
initConnectivity();
WidgetsBinding.instance.addObserver(this);
_connectivitySubscription =
_connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
//do not remove this coomented code
// if (Platform.isAndroid) {
// _getStoragePermission();
// }
if (Platform.isAndroid) {
_getStoragePermission();
}
super.initState();
}

View File

@@ -38,7 +38,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
];
String _selectedbusinesstype = '';
// String business_type = '';
void _onItemSelected(String value) {
setState(() {
@@ -46,8 +45,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
});
}
// String pagename = Get.arguments["pageroute"];
String getBusinessTypeId(String selectedBusinessType) {
if (selectedBusinessType.contains("Retail")) {
return '1';
@@ -91,244 +88,174 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
};
final data = await BusinessAPI().tellUsBusinessApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
Get.snackbar(
"Success!",
'success!',
duration: Duration(seconds: 2),
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// if (pagename == "nextscreen") {
Get.toNamed(RouteName.businessletusunderstandstep1);
// } else if (pagename == "mainscreen") {
// Get.toNamed(RouteName.mainscreen);
// }
Get.toNamed(RouteName.businessletusunderstandstep1);
} else if (data.status == ResponseStatus.FAILED) {
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,
);
// _controller.isTextFieldEnabled.value = true;
} else {
// 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,
);
// _controller.isTextFieldEnabled.value = true;
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(children: [
// Positioned(top: 90, left: -30, child: CommonBlurLeftSecond()),
// Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
// Positioned(top: 490, 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(60.h),
Center(child: text20400white('Tell us about your business')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154,
decoration: 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:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business owner name';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
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:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/briefcase.png',
),
// validatorText: "Enter your business name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
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:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/location.png',
),
// validatorText: "Enter your business location",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business location ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Type of business'),
sizedBoxHeight(10.h),
CustomDropDownWidgetSignup(
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();
// if (_selectedbusinesstype.isNotEmpty) {
// Get.toNamed(RouteName.businessletusunderstandstep1);
// // 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 WillPopScope(
onWillPop: () {
return Future.value(false);
},
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),
CustomDropDownWidgetSignup(
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),
],
),
),
])
])),
);
}
}

View File

@@ -8,17 +8,11 @@ class BusinessAPI {
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices().postApi(
data,
ApiUrls.tellUsBusinessApi
// "https://regroup.betadelivery.com/api/v1/tell-us-about-your-business",
// optionalpar: true
);
final response =
await NetworkApiServices().postApi(data, ApiUrls.tellUsBusinessApi);
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == 'success') {
// LoginModel loginObj = LoginModel.fromJson(response.data);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
@@ -27,16 +21,13 @@ class BusinessAPI {
return response;
}
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
final response = await NetworkApiServices().postApi(
data,
ApiUrls.letUsUnderstandApi,
// "https://regroup.betadelivery.com/api/v1/update-business-profile-step-1",
);
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == "success") {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);

View File

@@ -74,7 +74,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
Color _getGradientColor(int id) {
if (_selectedIndices.contains(id)) {
return Color(0XFFD90B2E); // Selected color
return const Color(0XFFD90B2E); // Selected color
}
return Colors.transparent; // Default color
}
@@ -108,7 +108,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
bottomNavigationBar: Padding(
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
child: CustomButton(
@@ -129,311 +129,309 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
// RouteName.individualgroupstep3);
}),
),
body: FutureBuilder(
future: Getonboard().getIndividualactivity(),
builder: (ctx, snapshot) {
if (snapshot.data == null) {
return const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [Center(child: CircularProgressIndicator())],
);
}
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.spMin),
),
body: SafeArea(
child: FutureBuilder(
future: Getonboard().getIndividualactivity(),
builder: (ctx, snapshot) {
if (snapshot.data == null) {
return const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [Center(child: CircularProgressIndicator())],
);
}
}
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.spMin),
),
);
}
}
return Stack(
children: [
Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
Positioned(
top: 450, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
GlassmorphicContainer(
width: MediaQuery.of(context).size.width,
height: 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: Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.communitycommitscreen);
},
child: Text(
'Skip',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
decoration: TextDecoration.underline,
decorationColor: Colors.white),
return Stack(
children: [
const Positioned(
top: 220, left: -30, child: CommonBlurLeftSecond()),
const Positioned(
top: 450, right: -30, child: CommonBlurRightSecond()),
const Positioned(
top: 530, left: -30, child: CommonBlurLeftBlue()),
GlassmorphicContainer(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
borderRadius: 2,
blur: 6,
alignment: Alignment.bottomLeft,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
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: [
const Color(0XFF222935).withOpacity(0.60),
const Color(0XFF222935).withOpacity(0.60),
],
),
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.communitycommitscreen);
},
child: Text(
'Skip',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
decoration: TextDecoration.underline,
decorationColor: Colors.white),
),
),
),
),
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 1 of 3')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(30),
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 1 of 3')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: const BorderSide(
width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(30),
),
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Container(
width: 120.w,
height: 15.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xA5D90B2E),
Color(0x42D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(30),
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Container(
width: 15,
height: 15,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xFFD90B2E),
Color(0x60D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(30),
),
),
)
],
))
],
),
),
),
sizedBoxHeight(40.h),
indiactivityobj!.data == null ||
indiactivityobj!.data!.isEmpty
? _buildNoDataBody(context)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Center(
child: _selectedIndices.isEmpty
? text20400white(
'What is your main activity ?')
: text20400white(
'What else do you do?')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
Container(
width: 120.w,
height: 15.h,
decoration: ShapeDecoration(
gradient: const LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xA5D90B2E),
Color(0x42D90B2E)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign:
BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
borderRadius:
BorderRadius.circular(30),
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Container(
width: 15,
height: 15,
decoration: ShapeDecoration(
gradient: const LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xFFD90B2E),
Color(0x60D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(30),
),
),
)
],
))
],
),
),
),
sizedBoxHeight(40.h),
indiactivityobj!.data == null ||
indiactivityobj!.data!.isEmpty
? _buildNoDataBody(context)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Center(
child: _selectedIndices.isEmpty
? text20400white(
'What is your main activity ?')
: text20400white(
'What else do you do?')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
decoration: const ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide
.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
),
sizedBoxHeight(30.h),
GridView.builder(
physics: ScrollPhysics(),
shrinkWrap: true,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount:
3, // Number of items in each row
crossAxisSpacing: 12
.w, // Horizontal spacing between items
mainAxisSpacing: 12
.h, // Vertical spacing between items
sizedBoxHeight(30.h),
GridView.builder(
physics: const ScrollPhysics(),
shrinkWrap: true,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount:
3, // Number of items in each row
crossAxisSpacing: 12
.w, // Horizontal spacing between items
mainAxisSpacing: 12
.h, // Vertical spacing between items
),
itemCount:
indiactivityobj!.data!.length,
itemBuilder: (context, index) {
return ActivityContainer(
index: indiactivityobj!
.data![index].id!,
titleString: indiactivityobj!
.data![index].name!,
image: indiactivityobj!
.data![index].image,
// 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices
.contains(indiactivityobj!
.data![index].id!),
gradientColor: _getGradientColor(
indiactivityobj!
.data![index].id!),
onTap: _onContainerTap,
);
},
),
itemCount: indiactivityobj!.data!.length,
itemBuilder: (context, index) {
return ActivityContainer(
index:
indiactivityobj!.data![index].id!,
titleString: indiactivityobj!
.data![index].name!,
image: indiactivityobj!
.data![index].image,
// 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(
indiactivityobj!
.data![index].id!),
gradientColor: _getGradientColor(
indiactivityobj!
.data![index].id!),
onTap: _onContainerTap,
);
},
),
sizedBoxHeight(30.h),
text20400FCFCFC("Add other activity"),
sizedBoxHeight(25.h),
CustomTextFormField(
textEditingController:
otheractivitycontroller,
texttype: TextInputType.text,
hintText: "Enter other activity",
// 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 ]'))
],
),
// CustomDropDownRadio(
// header: "",
// title: "",
// listData: [
// "American football",
// "Archery",
// "Athletics",
// "Baseball",
// "Basketball",
// "Boxing",
// "Canoeing",
// "Clay pigeon shooting",
// "Climbing",
// "Combat sports",
// "Cricket",
// "Dodgeball",
// "Equestrian",
// "Fencing",
// "Gaelic football",
// "Golf",
// "Gymnastics",
// "Handball",
// "Hockey",
// "Lacrosse",
// "Modern biathlon and pentathlon",
// "Netball",
// "Orienteering",
// "Pool and snooker",
// "Powerlifting",
// "Rifle",
// "Rugby league",
// "Rugby union",
// "Sailing",
// "Snowsports",
// "Squash",
// "Surfing",
// "Swimming",
// "Softball",
// "Table tennis",
// "Tennis",
// "Touch rugby",
// "Trampoline",
// "Triathlon",
// "Ultimate frisbee",
// "Volleyball",
// "Water polo",
// "Windsurfing"
// ],
// onItemSelected: (p0) {},
// leadingImage: SizedBox()),
// // Spacer(flex: 1),
sizedBoxHeight(30.h),
text20400FCFCFC("Add other activity"),
sizedBoxHeight(25.h),
CustomTextFormField(
textEditingController:
otheractivitycontroller,
texttype: TextInputType.text,
hintText: "Enter other activity",
// 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 ]'))
],
),
// CustomDropDownRadio(
// header: "",
// title: "",
// listData: [
// "American football",
// "Archery",
// "Athletics",
// "Baseball",
// "Basketball",
// "Boxing",
// "Canoeing",
// "Clay pigeon shooting",
// "Climbing",
// "Combat sports",
// "Cricket",
// "Dodgeball",
// "Equestrian",
// "Fencing",
// "Gaelic football",
// "Golf",
// "Gymnastics",
// "Handball",
// "Hockey",
// "Lacrosse",
// "Modern biathlon and pentathlon",
// "Netball",
// "Orienteering",
// "Pool and snooker",
// "Powerlifting",
// "Rifle",
// "Rugby league",
// "Rugby union",
// "Sailing",
// "Snowsports",
// "Squash",
// "Surfing",
// "Swimming",
// "Softball",
// "Table tennis",
// "Tennis",
// "Touch rugby",
// "Trampoline",
// "Triathlon",
// "Ultimate frisbee",
// "Volleyball",
// "Water polo",
// "Windsurfing"
// ],
// onItemSelected: (p0) {},
// leadingImage: SizedBox()),
// // Spacer(flex: 1),
sizedBoxHeight(35.h),
],
)
],
sizedBoxHeight(35.h),
],
)
],
),
),
),
),
)
],
);
},
)
],
);
},
),
),
//
@@ -471,12 +469,12 @@ class ActivityContainer extends StatelessWidget {
return GestureDetector(
onTap: () => onTap(index),
child: Container(
width: 110.w,
height: 120.h,
// width: 110.w,
// height: 120.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: const Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
end: const Alignment(-0.98, 0.21),
colors: isSelected
? [
gradientColor.withOpacity(0.80),
@@ -490,12 +488,12 @@ class ActivityContainer extends StatelessWidget {
],
),
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Color(0xFF434A53)),
side: const BorderSide(width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(10),
),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@@ -523,7 +521,7 @@ class ActivityContainer extends StatelessWidget {
width: 50.w,
height: 50.h,
),
Spacer(flex: 3),
const Spacer(flex: 3),
SizedBox(
child: Text(
titleString,

View File

@@ -36,9 +36,6 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
TextEditingController datecontroller = TextEditingController();
TextEditingController locationcontroller = TextEditingController();
// String pagename = Get.arguments["pageroute"];
DateTime? _selectedDate;
final photographController = TextEditingController();
@@ -46,9 +43,9 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
Get.put(ProfileImageController());
Future<void> _selectDate(BuildContext context) async {
DateTime yesterday = DateTime.now().subtract(Duration(days: 1));
DateTime yesterday = DateTime.now().subtract(const Duration(days: 1));
DateTime eighteenYearsAgo =
DateTime.now().subtract(Duration(days: 365 * 18));
DateTime.now().subtract(const Duration(days: 365 * 18));
final ThemeData customTheme = Theme.of(context).copyWith(
colorScheme: const ColorScheme.light(
@@ -60,7 +57,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
onSecondary: Colors.white),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Color(0xFFD90B2E),
foregroundColor: const Color(0xFFD90B2E),
),
));
@@ -141,36 +138,20 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
filename: path.basename(editProfileImage.profilePicPath.value),
);
}
// else {
// imageFile = await Helper.assetImageToMultipartFile(
// "assets/images/png/camera.png", "profile");
// }
FormData formData = FormData.fromMap({
"full_name": fullNameController.text,
"username": userNameController.text,
"date_of_birth": datecontroller.text,
"gender": _selectedgendertype,
'profile_photo':
// editProfileImage.profilePicPath.value.isNotEmpty ?
imageFile,
// : null,
'profile_photo': imageFile,
'location': locationcontroller.text,
});
print("formData is $formData");
log(formData.toString());
final data = await Onboard().PosttellusIndividual(formData);
if (data.status == ResponseStatus.SUCCESS) {
utils.showToast("tell us done Successfully!");
Get.back();
// Get.toNamed(RouteName.individualprofilestep1);
// if (pagename == "nextscreen") {
Get.toNamed(RouteName.individualactivitystep2);
// } else if (pagename == "mainscreen") {
// Get.toNamed(RouteName.mainscreen);
// }
Get.toNamed(RouteName.individualactivitystep2);
} else {
Get.back();
return utils.showToast(data.message);
@@ -182,54 +163,16 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
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: [
// 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: [
ListView(physics: const ScrollPhysics(), children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
@@ -242,7 +185,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
Center(
child: Container(
width: 154,
decoration: ShapeDecoration(
decoration: const ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
@@ -281,8 +224,8 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color:
Color(0XFFD90B2E).withOpacity(0.50),
color: const Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
),
@@ -294,8 +237,8 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color:
Color(0XFFD90B2E).withOpacity(0.50),
color: const Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
),
@@ -305,38 +248,32 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: Color(0XFFD90B2E)
color: const 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,
child: Obx(() => editProfileImage
.profilePicPath.value !=
''
? ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(50.r),
child: Image(
image: FileImage(
File(
editProfileImage
.profilePicPath
.value,
),
),
)
: Image.asset(
"assets/images/png/camera.png")
fit: BoxFit.cover,
width: 200.w,
height: 200.h,
),
),
)
: Image.asset(
"assets/images/png/camera.png")
// : Image.asset(
// "assets/images/png/camera.png")
)),
@@ -476,22 +413,12 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
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 ==
'') {
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();

View File

@@ -1,11 +1,18 @@
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/base_manager.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';
@@ -24,13 +31,10 @@ class _SignupScreenState extends State<SignupScreen> {
TextEditingController emailidcontroller = TextEditingController();
TextEditingController passwordController = TextEditingController();
TextEditingController confirmpasscontroller = TextEditingController();
AccessToken? _accessToken;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
List<String> _dropdownProductItems = [
'Individual',
'Business',
];
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
final Map<String, int> _accountTypeMap = {
'Individual': 1,
@@ -45,35 +49,92 @@ class _SignupScreenState extends State<SignupScreen> {
});
}
// void _Signincheck() async {
// if (emailidcontroller.text.isBlank! ||
// passwordController.text.isBlank! ||
// confirmpasscontroller.text.isBlank!) {
// Get.snackbar(
// 'Error',
// 'Enter your credentials',
// snackPosition: SnackPosition.BOTTOM,
// backgroundColor: Colors.red,
// colorText: Colors.white,
// );
// } else if (!emailidcontroller.text.isEmail) {
// Get.snackbar(
// 'Error',
// 'Enter a valid e-mail address',
// snackPosition: SnackPosition.BOTTOM,
// backgroundColor: Colors.red,
// colorText: Colors.white,
// );
// } else if (_selectedAccountType == 'Individual') {
// print('individual selected');
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
// } else if (_selectedAccountType == 'Business') {
// print('business selected');
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
// } else {
// utils.showToast('Please select an account type');
// }
// }
_loginWithApple() {
AppleOAuthService().logIn();
}
_loginWithGoogle() {
googleSigninController.handleGoogleSignIn().then((value) async {
if (value != 'Google Sign-In canceled') {
final resp = await LoginAPI().storeGoogleSignin(
{"google_access_token": value, "one_signal_player_id": "ABCD"});
if (resp.message == "go-to-signin-via-oauth") {
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": resp.data});
} else if (value == null) {
Get.snackbar(
'Error',
'Google Sign-In canceled',
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',
'Google Sign-In canceled',
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 {
utils.loader();
@@ -97,31 +158,6 @@ class _SignupScreenState extends State<SignupScreen> {
'accountypenumber': accountTypeValue
});
// if (selectedCategory == "Individual") {
// Get.toNamed(RouteName.verifyusercreen,
// arguments:
// {
// "emailid" : emailidcontroller.text,
// "password" : passwordController.text,
// "accounttype" : selectedCategory,
// 'accountypenumber' : accountTypeValue
// }
// );
// } else if (selectedCategory == "Individual") {
// Get.toNamed(RouteName.verifyusercreen,
// arguments:
// {
// "emailid" : emailidcontroller.text,
// "password" : passwordController.text,
// "accounttype" : selectedCategory,
// 'accountypenumber' : accountTypeValue
// }
// );
// }
return utils.showToast(data.message);
} else {
Get.back();
@@ -397,11 +433,74 @@ class _SignupScreenState extends State<SignupScreen> {
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: () {
Get.toNamed(
RouteName.verifygoogleapplepage);
onTap: () async {
_checkIfisLoggedIn();
},
child: Container(
width: 55,
@@ -426,66 +525,9 @@ class _SignupScreenState extends State<SignupScreen> {
),
image: const DecorationImage(
image: AssetImage(
'assets/images/png/login2.png'))),
'assets/images/png/login4.png'))),
),
),
const Spacer(),
GestureDetector(
onTap: () {
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),
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(),
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'))),
),
],
),
),

View File

@@ -22,167 +22,39 @@ class SplashScreen extends StatefulWidget {
}
class _SplashScreenState extends State<SplashScreen> {
// var _connectionStatus;
final Connectivity _connectivity = Connectivity();
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
// Future<void> checkInternet() async {
// final connectivityResult = await (Connectivity().checkConnectivity());
// if (connectivityResult == ConnectivityResult.wifi ||
// connectivityResult == ConnectivityResult.mobile) {
// setState(() {
// _connectionStatus = connectivityResult;
// });
// } else {
// setState(() {
// _connectionStatus = connectivityResult;
// });
// }
// }
Future<void> initConnectivity() async {
late List<ConnectivityResult> result;
try {
result = await _connectivity.checkConnectivity();
} on PlatformException catch (e) {
log('Couldn\'t check connectivity status', error: e);
return;
}
if (!mounted) {
return Future.value(null);
}
return _updateConnectionStatus(result);
}
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
setState(() {
_connectionStatus = result;
});
// ignore: avoid_print
print('Connectivity changed: $_connectionStatus');
}
@override
void initState() {
// TODO: implement initState
super.initState();
initConnectivity();
log(_connectionStatus.toString());
Future.delayed(Duration(seconds: 2), () async {
if (_connectionStatus.contains(ConnectivityResult.none)) {
var result = await Get.to(NoInternet());
if (result != null && result) {
print('this is first');
Timer(const Duration(seconds: 1), () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
Future.delayed(const Duration(seconds: 2), () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('access-token');
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
token = prefs.getString('access-token');
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
if (token == null || token!.isEmpty) {
Get.toNamed(RouteName.onboarding1);
} else {
Getuserdetails().Getuser().then((value) {
print(getuserobj!.data!.userData!.isProfileUpdated!);
// .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);
}
});
// print(getuserobj!.data!.userData!.isProfileUpdated!);
// // .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);
// }
// } else {
// Get.toNamed(RouteName.mainscreen);
// }
// }
// );
}
});
}
if (token == null || token!.isEmpty) {
Get.toNamed(RouteName.onboarding1);
} else {
Timer(const Duration(seconds: 2), () async {
print('this is second');
await Getuserdetails().Getuser().then((value) {
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
String? accountype =
getuserobj?.data?.userData?.principalTypeXid.toString();
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('access-token');
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
if (token == null || token!.isEmpty) {
Get.toNamed(RouteName.onboarding1);
if (accountype == "1") {
Get.toNamed(RouteName.tellusindividualscreen,
arguments: {'pageroute': "mainscreen"});
} else if (accountype == "2") {
Get.toNamed(RouteName.tellusbusinessscreen,
arguments: {'pageroute': "mainscreen"});
}
} else {
Getuserdetails().Getuser().then((value) {
print(getuserobj!.data!.userData!.isProfileUpdated!);
// .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);
}
});
// }
// );
Get.toNamed(RouteName.mainscreen);
}
});
}
});
// Future.delayed(Duration(seconds: 2), () async {
// Timer(const Duration(seconds: 1), () async {
// Get.toNamed(RouteName.onboarding1);
// });
// });
}
@override
@@ -197,11 +69,11 @@ class _SplashScreenState extends State<SplashScreen> {
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xff009DAB).withOpacity(0.25),
Color(0xff35798C).withOpacity(0.44),
Color(0xffD90B2E).withOpacity(0.33),
Color(0xffD90B2E).withOpacity(0.52),
Color(0xffD90B2E).withOpacity(0.59),
const Color(0xff009DAB).withOpacity(0.25),
const Color(0xff35798C).withOpacity(0.44),
const Color(0xffD90B2E).withOpacity(0.33),
const Color(0xffD90B2E).withOpacity(0.52),
const Color(0xffD90B2E).withOpacity(0.59),
],
)),
child: Column(

View File

@@ -52,11 +52,9 @@ class _ForgotPassState extends State<ForgotPass> {
snackPosition: SnackPosition.BOTTOM,
);
prefs.setString('email', emailController.text);
prefs.setInt(
'principal_xid', resp.data['data']['iam_principal_xid']);
prefs.setInt('principal_xid', resp.data['data']['iam_principal_xid']);
Future.delayed(Duration(seconds: 1), () {
Get.toNamed(RouteName.forgotOtp,
arguments: emailController.text);
Get.toNamed(RouteName.forgotOtp, arguments: emailController.text);
});
// print('success');
} else if (resp.status == ResponseStatus.FAILED) {
@@ -134,7 +132,7 @@ class _ForgotPassState extends State<ForgotPass> {
),
),
),
hintText: "loremipsum@gmail.comess",
// hintText: "loremipsum@gmail.comess",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your e-mail address';

View File

@@ -495,7 +495,7 @@ class AppRoutes {
),
GetPage(
name: RouteName.verifygoogleapplepage,
page: () => const Verifygoogleandapple(),
page: () => Verifygoogleandapple(),
),
];
}