-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
217 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "653980426563", | ||
"firebase_url": "https://istart-c130a.firebaseio.com", | ||
"project_id": "istart-c130a", | ||
"storage_bucket": "istart-c130a.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:653980426563:android:84187d91af3c634e7b4ff6", | ||
"android_client_info": { | ||
"package_name": "nov1kov.ru.istart" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "653980426563-mh68vb30ovkq1lpsm5rj0pvpdqinpa8c.apps.googleusercontent.com", | ||
"client_type": 1, | ||
"android_info": { | ||
"package_name": "nov1kov.ru.istart", | ||
"certificate_hash": "65a9b1f45a975d0cd4d8da765a4cbf86085dfbf9" | ||
} | ||
}, | ||
{ | ||
"client_id": "653980426563-f7j1a72db8t6gl6cm3p2f2981spgd8q3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCrQyWJaPb6EAeT3OnVJWJF7svRxqDUmv8" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "653980426563-f7j1a72db8t6gl6cm3p2f2981spgd8q3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:653980426563:android:e89511fadcac1d917b4ff6", | ||
"android_client_info": { | ||
"package_name": "ru.nov1kov.istart" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "653980426563-hmacfcpbs8f4m8akj7eoegqa3bn8140p.apps.googleusercontent.com", | ||
"client_type": 1, | ||
"android_info": { | ||
"package_name": "ru.nov1kov.istart", | ||
"certificate_hash": "65a9b1f45a975d0cd4d8da765a4cbf86085dfbf9" | ||
} | ||
}, | ||
{ | ||
"client_id": "653980426563-f7j1a72db8t6gl6cm3p2f2981spgd8q3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCrQyWJaPb6EAeT3OnVJWJF7svRxqDUmv8" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "653980426563-f7j1a72db8t6gl6cm3p2f2981spgd8q3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
|
||
android.enableJetifier=true | ||
android.useAndroidX=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'dart:async'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:google_sign_in/google_sign_in.dart'; | ||
|
||
|
||
class Auth { | ||
final GoogleSignIn _googleSignIn = GoogleSignIn(); | ||
final FirebaseAuth _auth = FirebaseAuth.instance; | ||
|
||
static final Auth _instance = Auth._internal(); | ||
|
||
FirebaseUser user; | ||
|
||
factory Auth() { | ||
return _instance; | ||
} | ||
|
||
Auth._internal(); | ||
|
||
Future<FirebaseUser> googleSignIn() async { | ||
final GoogleSignInAccount googleUser = await _googleSignIn.signIn(); | ||
final GoogleSignInAuthentication googleAuth = await googleUser.authentication; | ||
|
||
final AuthCredential credential = GoogleAuthProvider.getCredential( | ||
accessToken: googleAuth.accessToken, | ||
idToken: googleAuth.idToken, | ||
); | ||
|
||
final FirebaseUser user = (await _auth.signInWithCredential(credential)).user; | ||
print("signed in " + user.displayName); | ||
this.user = user; | ||
return user; | ||
} | ||
|
||
Future<FirebaseUser> getCurrentUser() async { | ||
FirebaseUser user = await _auth.currentUser(); | ||
this.user = user; | ||
return user; | ||
} | ||
|
||
Future<void> signOut() async { | ||
return _auth.signOut(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters