Merge pull request #44 from WDI-Ideas/hotfixes

Hotfixes
This commit is contained in:
Kishan Bhuta
2024-07-12 11:33:23 +05:30
committed by GitHub
18 changed files with 690 additions and 80 deletions

View File

@@ -22,6 +22,9 @@ if (flutterVersionName == null) {
}
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

View File

@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "563133114654",
"project_id": "regroup-9aed2",
"storage_bucket": "regroup-9aed2.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:563133114654:android:9032ddcb6dc5add26c010f",
"android_client_info": {
"package_name": "com.example.regroup"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyA7z_Q3xN1IHZFzhfOtkXTyryGEJMOZrPY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -6,6 +6,9 @@ buildscript {
}
dependencies {
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.15'
// END: FlutterFire Configuration
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

1
firebase.json Normal file
View File

@@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"regroup-9aed2","appId":"1:563133114654:android:9032ddcb6dc5add26c010f","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"regroup-9aed2","appId":"1:563133114654:ios:d5ce57e5b214757e6c010f","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"regroup-9aed2","configurations":{"android":"1:563133114654:android:9032ddcb6dc5add26c010f","ios":"1:563133114654:ios:d5ce57e5b214757e6c010f"}}}}}}

View File

@@ -1,4 +1,10 @@
PODS:
- AppAuth (1.7.5):
- AppAuth/Core (= 1.7.5)
- AppAuth/ExternalUserAgent (= 1.7.5)
- AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core
- connectivity_plus (0.0.1):
- Flutter
- FlutterMacOS
@@ -46,6 +52,32 @@ PODS:
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Firebase/Auth (10.25.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 10.25.0)
- Firebase/CoreOnly (10.25.0):
- FirebaseCore (= 10.25.0)
- firebase_auth (4.20.0):
- Firebase/Auth (= 10.25.0)
- firebase_core
- Flutter
- firebase_core (2.32.0):
- Firebase/CoreOnly (= 10.25.0)
- Flutter
- FirebaseAppCheckInterop (10.28.0)
- FirebaseAuth (10.25.0):
- FirebaseAppCheckInterop (~> 10.17)
- FirebaseCore (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- GoogleUtilities/Environment (~> 7.8)
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
- RecaptchaInterop (~> 100.0)
- FirebaseCore (10.25.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.28.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- Flutter (1.0.0)
- flutter_facebook_auth (6.0.4):
- FBSDKLoginKit (~> 16.3.1)
@@ -58,11 +90,51 @@ PODS:
- google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps (< 9.0)
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 7.1)
- GTMSessionFetcher (>= 3.4.0)
- GoogleMaps (6.2.1):
- GoogleMaps/Maps (= 6.2.1)
- GoogleMaps/Base (6.2.1)
- GoogleMaps/Maps (6.2.1):
- GoogleMaps/Base
- GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Privacy
- GoogleUtilities/Environment (7.13.3):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/Network (7.13.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.13.3)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.3)
- GoogleUtilities/Reachability (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.4.1):
- GTMSessionFetcher/Full (= 3.4.1)
- GTMSessionFetcher/Core (3.4.1)
- GTMSessionFetcher/Full (3.4.1):
- GTMSessionFetcher/Core
- image_cropper (0.0.4):
- Flutter
- TOCropViewController (~> 2.7.3)
@@ -75,12 +147,16 @@ PODS:
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- PromisesObjC (2.4.0)
- RecaptchaInterop (100.0.0)
- SDWebImage (5.19.2):
- SDWebImage/Core (= 5.19.2)
- SDWebImage/Core (5.19.2)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sign_in_with_apple (0.0.1):
- Flutter
- SwiftyGif (5.4.5)
- Toast (4.1.1)
- TOCropViewController (2.7.4)
@@ -89,27 +165,43 @@ DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
SPEC REPOS:
trunk:
- AppAuth
- DKImagePickerController
- DKPhotoGallery
- FBAEMKit
- FBSDKCoreKit
- FBSDKCoreKit_Basics
- FBSDKLoginKit
- Firebase
- FirebaseAppCheckInterop
- FirebaseAuth
- FirebaseCore
- FirebaseCoreInternal
- GoogleMaps
- GoogleSignIn
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- PromisesObjC
- RecaptchaInterop
- SDWebImage
- SwiftyGif
- Toast
@@ -122,6 +214,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: Flutter
flutter_facebook_auth:
@@ -132,6 +228,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/geolocator_apple/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_gallery_saver:
@@ -144,8 +242,11 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
@@ -155,19 +256,34 @@ SPEC CHECKSUMS:
FBSDKCoreKit_Basics: cd7b5f5d1e8868c26706917919d058999ca672c3
FBSDKLoginKit: 572cca0bc6c90067ef197187697cb3b584310c52
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
firebase_auth: 5719ddc9f654b813405899480e84971bd8e61235
firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197
FirebaseAppCheckInterop: 5315f40293191bfec04b2cfab0215760e441540a
FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483
FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_facebook_auth: c8700ab1770f3d8e5e7456220e4f3bbcdb831454
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
geolocator_apple: 6cbaf322953988e009e5ecb481f07efece75c450
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd
image_cropper: 2c150b3d63f4feaad31054d20381ddac0a460e63
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654

View File

@@ -14,6 +14,7 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
9FD3FE5A0194B5B2D8202DCF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -35,6 +36,7 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3E093EFD052120EBB5EFE242 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
5210D9302C4006FC0040021E /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -46,6 +48,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
DC7FC30109CCD5376F6BFA0F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -90,6 +93,7 @@
97C146EF1CF9000F007C117D /* Products */,
01448FBCAC46C16EC8BC1181 /* Pods */,
DE8E73CF7AB07643531FB23E /* Frameworks */,
D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */,
);
sourceTree = "<group>";
};
@@ -104,6 +108,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
5210D9302C4006FC0040021E /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -192,6 +197,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
9FD3FE5A0194B5B2D8202DCF /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -375,6 +381,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;
@@ -508,6 +515,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;
@@ -535,6 +543,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyCvettUZf1thSh9xO5-SxR_IYx-tCmVnc0</string>
<key>GCM_SENDER_ID</key>
<string>563133114654</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.regroup.wdi</string>
<key>PROJECT_ID</key>
<string>regroup-9aed2</string>
<key>STORAGE_BUCKET</key>
<string>regroup-9aed2.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:563133114654:ios:d5ce57e5b214757e6c010f</string>
</dict>
</plist>

View File

@@ -4,5 +4,9 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
</dict>
</plist>

View File

@@ -35,4 +35,5 @@ class ApiUrls {
static const googlelogin = "${baseUrl}sign-in-with-google-login";
}

View File

@@ -161,11 +161,8 @@ class NetworkApiServices {
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
String? token = prefs.getString('access-token');
String? token = prefs.getString('token');
log(token.toString());
log(basicAuth);
try {
response = await dio.post(
url,

View File

@@ -3,10 +3,13 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:logger/web.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/CustomNextButton.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.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';
@@ -23,71 +26,107 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State<LoginScreen> {
Map<String, dynamic>? _userData;
AccessToken? _accessToken;
String _accessToken = "";
Map _userData = {};
bool _checking = true;
final TextEditingController _emailController = TextEditingController();
RxBool isObscured = true.obs;
final TextEditingController _passwordController = TextEditingController();
// final GlobalKey<FormState> _form = GlobalKey<FormState>();
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
// RxString errormsg = ''.obs;
// RxString errormsgpass = ''.obs;
@override
void initState() {
// TODO: implement initState
super.initState();
}
_checkIfisLoggedIn() async {
//user token
final accessToken = await FacebookAuth.instance.accessToken;
setState(() {
_checking = false;
});
if (accessToken != null) {
print("/////////////////////////////////////////check");
print("worked");
print(accessToken.toJson());
final userData = await FacebookAuth.instance.getUserData();
_accessToken = accessToken;
setState(() {
_userData = userData;
});
} else {
print("/////////////////////////////////////////check");
print("not worked");
_login();
}
_loginWithApple() {
AppleOAuthService().logIn();
}
_login() async {
final LoginResult result = await FacebookAuth.instance.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.to(()=> );
if (result.status == LoginStatus.success) {
_accessToken = result.accessToken;
logger.d("go to sign in");
} 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,
);
final userData = await FacebookAuth.instance.getUserData();
_userData = userData;
} else {
print(result.status);
print(result.message);
}
setState(() {
_checking = false;
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,
);
}
});
}
_logout() async {
await FacebookAuth.instance.logOut();
_accessToken = null;
_userData = null;
setState(() {});
}
// _checkIfisLoggedIn() async {
// //user token
// final accessToken = await FacebookAuth.instance.accessToken;
// setState(() {
// _checking = false;
// });
// if (accessToken != null) {
// print("/////////////////////////////////////////xcheck");
// print("worked");
// print(accessToken.toJson());
// final userData = await FacebookAuth.instance.getUserData();
// // _accessToken = accessToken;
// setState(() {
// _userData = userData;
// });
// } else {
// print("/////////////////////////////////////////check");
// print("not worked");
// _login();
// }
// }
// _login() async {
// final LoginResult result = await FacebookAuth.instance.login();
// if (result.status == LoginStatus.success) {
// _accessToken = result.accessToken;
// final userData = await FacebookAuth.instance.getUserData();
// _userData = userData;
// } else {
// print(result.status);
// print(result.message);
// }
// setState(() {
// _checking = false;
// });
// }
// _logout() async {
// await FacebookAuth.instance.logOut();
// _accessToken = null;
// _userData = null;
// setState(() {});
// }
_logincheck() async {
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
@@ -121,10 +160,10 @@ class _LoginScreenState extends State<LoginScreen> {
Get.snackbar(
"Success!",
'Login successful!',
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,
);
@@ -134,10 +173,10 @@ class _LoginScreenState extends State<LoginScreen> {
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,
);
@@ -147,10 +186,10 @@ class _LoginScreenState extends State<LoginScreen> {
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,
);
@@ -362,6 +401,7 @@ class _LoginScreenState extends State<LoginScreen> {
children: [
GestureDetector(
onTap: () {
_loginWithApple();
Get.toNamed(RouteName.verifygoogleapplepage);
},
child: Container(
@@ -391,6 +431,7 @@ class _LoginScreenState extends State<LoginScreen> {
const Spacer(),
GestureDetector(
onTap: () {
_loginWithGoogle();
Get.toNamed(RouteName.verifygoogleapplepage);
},
child: Container(
@@ -420,8 +461,6 @@ class _LoginScreenState extends State<LoginScreen> {
const Spacer(),
GestureDetector(
onTap: () async {
_checkIfisLoggedIn();
/* FacebookAuth.instance.login(
permissions: ['public_profile', 'email'],
).then((value) {

View File

@@ -5,7 +5,6 @@ import 'package:regroup/Login/Model/LoginModel.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginAPI {
LoginAPI();
Future<ResponseData> loginApi(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices().postApi(data,
@@ -32,4 +31,21 @@ class LoginAPI {
return response;
}
Future<ResponseData> storeGoogleSignin(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.googlelogin, 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) {
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
} else {
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
}

View File

@@ -0,0 +1,22 @@
import 'package:get/get.dart';
import 'package:regroup/Utils/Common/googleOAuthService.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
class AppleOAuthService {
void logIn() async {
try {
final credential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
logger.d("email is ${credential.email}");
logger.d("fullname is ${credential.givenName}");
logger.d("token is ${credential.userIdentifier}");
} catch (e) {
print("Error occured");
}
}
}

View File

@@ -0,0 +1,94 @@
import 'package:get/get.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:logger/logger.dart';
String? userName;
String? mobileNumber;
String? emailAddress;
String? firebaseidTokenGoogleSignin;
String? packageidTokenGoogleSignin;
var logger = Logger(
printer: PrettyPrinter(
// methodCount: 2, // Number of method calls to be displayed
// errorMethodCount: 8, // Number of method calls if stacktrace is provided
// lineLength: 120, // Width of the output
colors: true, // Colorful log messages
// printEmojis: true, // Print an emoji for each log message
// printTime: false // Should each log print contain a timestamp
),
);
class GoogleAuthService extends GetxController {
final GoogleSignIn _googleSignIn = GoogleSignIn(scopes: ['email']);
Rx<User?> user = Rx<User?>(FirebaseAuth.instance.currentUser);
@override
void onInit() {
super.onInit();
FirebaseAuth.instance.authStateChanges().listen((User? newUser) {
user.value = newUser;
});
}
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();
// This will show the Google Sign-In popup and allow the user to select an account.
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
if (googleUser == null) {
return 'Google Sign-In canceled';
}
// // If the user signed in successfully, we can get their user information.
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
final String? accessToken = googleAuth.accessToken;
packageidTokenGoogleSignin = googleAuth.accessToken;
final String? idToken = googleAuth.idToken;
logger.d(packageidTokenGoogleSignin);
//new method
// Sign in with Google credentials using Firebase Authentication.
final AuthCredential credential = GoogleAuthProvider.credential(
accessToken: accessToken,
idToken: idToken,
);
// Use Firebase Authentication to sign in with the provided credential.
final UserCredential authResult =
await FirebaseAuth.instance.signInWithCredential(credential);
// Firebase user information is available in authResult.user.
final User? firebaseUser = authResult.user;
print("Firebase user ID: ${firebaseUser?.uid}");
print("Firebase user email: ${firebaseUser?.email}");
print("Firebase user display name: ${firebaseUser?.displayName}");
print("Firebase user metadata: ${firebaseUser?.metadata}");
print("Firebase user number: ${firebaseUser?.phoneNumber}");
userName = firebaseUser?.displayName;
mobileNumber = firebaseUser?.phoneNumber;
emailAddress = firebaseUser?.email;
firebaseidTokenGoogleSignin = firebaseUser?.uid;
return packageidTokenGoogleSignin;
} catch (error) {
// Handle any errors that occurred during the sign-in process.
print('Error during Google Sign-In: $error');
}
return null;
}
}

68
lib/firebase_options.dart Normal file
View File

@@ -0,0 +1,68 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyA7z_Q3xN1IHZFzhfOtkXTyryGEJMOZrPY',
appId: '1:563133114654:android:9032ddcb6dc5add26c010f',
messagingSenderId: '563133114654',
projectId: 'regroup-9aed2',
storageBucket: 'regroup-9aed2.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCvettUZf1thSh9xO5-SxR_IYx-tCmVnc0',
appId: '1:563133114654:ios:d5ce57e5b214757e6c010f',
messagingSenderId: '563133114654',
projectId: 'regroup-9aed2',
storageBucket: 'regroup-9aed2.appspot.com',
iosBundleId: 'com.regroup.wdi',
);
}

View File

@@ -1,16 +1,21 @@
import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/Common/NoInternet.dart';
import 'package:regroup/firebase_options.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:regroup/resources/routes/routes.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,

View File

@@ -1,6 +1,14 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_flutterfire_internals:
dependency: transitive
description:
name: _flutterfire_internals
sha256: "37a42d06068e2fe3deddb2da079a8c4d105f241225ba27b7122b37e9865fd8f7"
url: "https://pub.dev"
source: hosted
version: "1.3.35"
animations:
dependency: "direct main"
description:
@@ -85,10 +93,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
url: "https://pub.dev"
source: hosted
version: "0.3.3+8"
version: "0.3.4+1"
crypto:
dependency: transitive
description:
@@ -217,6 +225,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.9.3+1"
firebase_auth:
dependency: "direct main"
description:
name: firebase_auth
sha256: cfc2d970829202eca09e2896f0a5aa7c87302817ecc0bdfa954f026046bf10ba
url: "https://pub.dev"
source: hosted
version: "4.20.0"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
sha256: a0270e1db3b2098a14cb2a2342b3cd2e7e458e0c391b1f64f6f78b14296ec093
url: "https://pub.dev"
source: hosted
version: "7.3.0"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
sha256: "64e067e763c6378b7e774e872f0f59f6812885e43020e25cde08f42e9459837b"
url: "https://pub.dev"
source: hosted
version: "5.12.0"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "26de145bb9688a90962faec6f838247377b0b0d32cc0abecd9a4e43525fc856c"
url: "https://pub.dev"
source: hosted
version: "2.32.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: "1003a5a03a61fc9a22ef49f37cbcb9e46c86313a7b2e7029b9390cf8c6fc32cb"
url: "https://pub.dev"
source: hosted
version: "5.1.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: "23509cb3cddfb3c910c143279ac3f07f06d3120f7d835e4a5d4b42558e978712"
url: "https://pub.dev"
source: hosted
version: "2.17.3"
fixnum:
dependency: transitive
description:
@@ -392,6 +448,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.0"
google_identity_services_web:
dependency: transitive
description:
name: google_identity_services_web
sha256: "9482364c9f8b7bd36902572ebc3a7c2b5c8ee57a9c93e6eb5099c1a9ec5265d8"
url: "https://pub.dev"
source: hosted
version: "0.3.1+1"
google_maps_flutter:
dependency: "direct main"
description:
@@ -424,14 +488,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.8.0"
google_sign_in:
dependency: "direct main"
description:
name: google_sign_in
sha256: "0b8787cb9c1a68ad398e8010e8c8766bfa33556d2ab97c439fb4137756d7308f"
url: "https://pub.dev"
source: hosted
version: "6.2.1"
google_sign_in_android:
dependency: transitive
description:
name: google_sign_in_android
sha256: "7647893c65e6720973f0e579051c8f84b877b486614d9f70a404259c41a4632e"
url: "https://pub.dev"
source: hosted
version: "6.1.23"
google_sign_in_ios:
dependency: transitive
description:
name: google_sign_in_ios
sha256: a058c9880be456f21e2e8571c1126eaacd570bdc5b6c6d9d15aea4bdf22ca9fe
url: "https://pub.dev"
source: hosted
version: "5.7.6"
google_sign_in_platform_interface:
dependency: transitive
description:
name: google_sign_in_platform_interface
sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971"
url: "https://pub.dev"
source: hosted
version: "2.4.5"
google_sign_in_web:
dependency: transitive
description:
name: google_sign_in_web
sha256: d606264c7a1a526a3aa79d938b85a601d8589731a478bd4a3dcbdeb14a572228
url: "https://pub.dev"
source: hosted
version: "0.12.4+1"
http:
dependency: transitive
description:
name: http
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
http_parser:
dependency: transitive
description:
@@ -552,6 +656,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints:
dependency: transitive
description:
@@ -560,6 +688,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
logger:
dependency: "direct main"
description:
name: logger
sha256: af05cc8714f356fd1f3888fb6741cbe9fbe25cdb6eedbab80e1a6db21047d4a4
url: "https://pub.dev"
source: hosted
version: "2.3.0"
lottie:
dependency: "direct main"
description:
@@ -572,26 +708,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
mime:
dependency: transitive
description:
@@ -612,10 +748,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_drawing:
dependency: transitive
description:
@@ -812,10 +948,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.3.0"
shared_preferences_windows:
dependency: transitive
description:
@@ -840,6 +976,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.6"
sign_in_with_apple:
dependency: "direct main"
description:
name: sign_in_with_apple
sha256: "5c34c601d6910d7db0077063001ccd9d9329ee58b9038ee07153ffcdd76e91bd"
url: "https://pub.dev"
source: hosted
version: "6.1.1"
sign_in_with_apple_platform_interface:
dependency: transitive
description:
name: sign_in_with_apple_platform_interface
sha256: c2ef2ce6273fce0c61acd7e9ff5be7181e33d7aa2b66508b39418b786cca2119
url: "https://pub.dev"
source: hosted
version: "1.1.0"
sign_in_with_apple_web:
dependency: transitive
description:
name: sign_in_with_apple_web
sha256: c009e9beeb6c376e86aaa154fcc8b4e075d4bad90c56286b9668a51cdb6129ea
url: "https://pub.dev"
source: hosted
version: "2.1.0"
sky_engine:
dependency: transitive
description: flutter
@@ -1005,14 +1165,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "13.0.0"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.5.1"
win32:
dependency: transitive
description:
@@ -1046,5 +1214,5 @@ packages:
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

View File

@@ -69,6 +69,11 @@ dependencies:
statsfl: ^2.3.0
glass_kit: ^4.0.1
flutter_facebook_auth: ^6.0.4
firebase_core: ^2.25.5
google_sign_in: ^6.2.1
firebase_auth: ^4.20.0
logger: ^2.3.0
sign_in_with_apple: any
timer_button: ^2.1.1