This commit is contained in:
kleponijo 2026-04-20 22:31:03 +07:00
parent a31c3c001f
commit 7e88c0f8e8
6 changed files with 100 additions and 29 deletions

65
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,65 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "klimatologi",
"request": "launch",
"type": "dart"
},
{
"name": "klimatologi (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "klimatologi (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "monitoring_repository",
"cwd": "packages\\monitoring_repository",
"request": "launch",
"type": "dart"
},
{
"name": "monitoring_repository (profile mode)",
"cwd": "packages\\monitoring_repository",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "monitoring_repository (release mode)",
"cwd": "packages\\monitoring_repository",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "user_repository",
"cwd": "packages\\user_repository",
"request": "launch",
"type": "dart"
},
{
"name": "user_repository (profile mode)",
"cwd": "packages\\user_repository",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "user_repository (release mode)",
"cwd": "packages\\user_repository",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}

View File

@ -73,6 +73,8 @@ class FirebaseUserRepo implements UserRepository {
/// == Melakukan Implement Log Out == ///
@override
Future<void> logOut() async {
final GoogleSignIn googleSignIn = GoogleSignIn();
await googleSignIn.signOut();
await _firebaseAuth.signOut();
}
@ -94,14 +96,18 @@ class FirebaseUserRepo implements UserRepository {
@override
Future<void> signInWithGoogle() async {
try {
final account = await GoogleSignIn.instance.authenticate(
serverClientId: "1234567890-abcxyz.apps.googleusercontent.com",
);
final GoogleSignIn googleSignIn = GoogleSignIn();
final auth = await account.authentication;
final GoogleSignInAccount? googleUser = await googleSignIn.signIn();
if (googleUser == null) return;
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
final credential = GoogleAuthProvider.credential(
idToken: auth.idToken,
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final userCredential =

View File

@ -164,42 +164,42 @@ packages:
dependency: "direct main"
description:
name: google_sign_in
sha256: "521031b65853b4409b8213c0387d57edaad7e2a949ce6dea0d8b2afc9cb29763"
sha256: d0a2c3bcb06e607bb11e4daca48bd4b6120f0bbc4015ccebbe757d24ea60ed2a
url: "https://pub.dev"
source: hosted
version: "7.2.0"
version: "6.3.0"
google_sign_in_android:
dependency: transitive
description:
name: google_sign_in_android
sha256: be0d0733a6a7c5da165879d844a239aa87587a3c767a9163faedde581f731f76
sha256: d5e23c56a4b84b6427552f1cf3f98f716db3b1d1a647f16b96dbb5b93afa2805
url: "https://pub.dev"
source: hosted
version: "7.2.10"
version: "6.2.1"
google_sign_in_ios:
dependency: transitive
description:
name: google_sign_in_ios
sha256: ac1e4c1205267cb7999d1d81333fccffdfda29e853f434bbaf71525498bb6950
sha256: "102005f498ce18442e7158f6791033bbc15ad2dcc0afa4cf4752e2722a516c96"
url: "https://pub.dev"
source: hosted
version: "6.3.0"
version: "5.9.0"
google_sign_in_platform_interface:
dependency: transitive
description:
name: google_sign_in_platform_interface
sha256: "7f59208c42b415a3cca203571128d6f84f885fead2d5b53eb65a9e27f2965bb5"
sha256: "5f6f79cf139c197261adb6ac024577518ae48fdff8e53205c5373b5f6430a8aa"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
version: "2.5.0"
google_sign_in_web:
dependency: transitive
description:
name: google_sign_in_web
sha256: d473003eeca892f96a01a64fc803378be765071cb0c265ee872c7f8683245d14
sha256: "460547beb4962b7623ac0fb8122d6b8268c951cf0b646dd150d60498430e4ded"
url: "https://pub.dev"
source: hosted
version: "1.1.3"
version: "0.12.4+4"
http:
dependency: transitive
description:
@ -382,5 +382,5 @@ packages:
source: hosted
version: "1.1.1"
sdks:
dart: ">=3.10.0 <4.0.0"
flutter: ">=3.38.0"
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.27.0"

View File

@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
google_sign_in: ^7.1.1
google_sign_in: ^6.3.0
# equatable: ^2.0.5
firebase_auth: ^6.1.3
cloud_firestore: ^6.1.1

View File

@ -292,42 +292,42 @@ packages:
dependency: "direct main"
description:
name: google_sign_in
sha256: "521031b65853b4409b8213c0387d57edaad7e2a949ce6dea0d8b2afc9cb29763"
sha256: d0a2c3bcb06e607bb11e4daca48bd4b6120f0bbc4015ccebbe757d24ea60ed2a
url: "https://pub.dev"
source: hosted
version: "7.2.0"
version: "6.3.0"
google_sign_in_android:
dependency: transitive
description:
name: google_sign_in_android
sha256: be0d0733a6a7c5da165879d844a239aa87587a3c767a9163faedde581f731f76
sha256: d5e23c56a4b84b6427552f1cf3f98f716db3b1d1a647f16b96dbb5b93afa2805
url: "https://pub.dev"
source: hosted
version: "7.2.10"
version: "6.2.1"
google_sign_in_ios:
dependency: transitive
description:
name: google_sign_in_ios
sha256: ac1e4c1205267cb7999d1d81333fccffdfda29e853f434bbaf71525498bb6950
sha256: "102005f498ce18442e7158f6791033bbc15ad2dcc0afa4cf4752e2722a516c96"
url: "https://pub.dev"
source: hosted
version: "6.3.0"
version: "5.9.0"
google_sign_in_platform_interface:
dependency: transitive
description:
name: google_sign_in_platform_interface
sha256: "7f59208c42b415a3cca203571128d6f84f885fead2d5b53eb65a9e27f2965bb5"
sha256: "5f6f79cf139c197261adb6ac024577518ae48fdff8e53205c5373b5f6430a8aa"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
version: "2.5.0"
google_sign_in_web:
dependency: transitive
description:
name: google_sign_in_web
sha256: d473003eeca892f96a01a64fc803378be765071cb0c265ee872c7f8683245d14
sha256: "460547beb4962b7623ac0fb8122d6b8268c951cf0b646dd150d60498430e4ded"
url: "https://pub.dev"
source: hosted
version: "1.1.3"
version: "0.12.4+4"
hooks:
dependency: transitive
description:

View File

@ -18,7 +18,7 @@ dependencies:
sdk: flutter
flutter_bloc: ^8.1.0
google_fonts: ^8.0.2
google_sign_in: ^7.1.1
google_sign_in: ^6.3.0
intl: ^0.20.2
monitoring_repository:
path: packages/monitoring_repository