-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from Hash-Studios/enhancement/setup_upload
Enhancement/setup upload (v2.6.0)
- Loading branch information
Showing
147 changed files
with
38,267 additions
and
31,943 deletions.
There are no files selected for viewing
Binary file not shown.
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,6 +1,16 @@ | ||
# include: package:effective_dart/analysis_options.yaml | ||
analyzer: | ||
errors: | ||
# unused_import: ignore | ||
# deprecated_member_use: ignore | ||
missing_return: ignore | ||
# include: package:effective_dart/analysis_options.yaml | ||
include: package:lint/analysis_options.yaml | ||
analyzer: | ||
errors: | ||
# unused_import: ignore | ||
# deprecated_member_use: ignore | ||
missing_return: ignore | ||
# library_prefixes: ignore | ||
# file_names: ignore | ||
# prefer_if_elements_to_conditional_expressions: ignore | ||
# non_constant_identifier_names: ignore | ||
# avoid_function_literals_in_foreach_calls: ignore | ||
# avoid_positional_boolean_parameters: ignore | ||
# unnecessary_this: ignore | ||
exclude: | ||
- lib/theme/jam_icons_icons.dart |
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,19 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Theme applied to the Android Window while the process is starting --> | ||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<!-- Show a splash screen on the activity. Automatically removed when | ||
Flutter draws its first frame --> | ||
<item name="android:windowBackground">@drawable/launch_background</item> | ||
</style> | ||
<!-- Theme applied to the Android Window as soon as the process has started. | ||
This theme determines the color of the Android Window while your | ||
Flutter UI initializes, as well as behind your Flutter UI while its | ||
running. | ||
This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<item name="android:windowBackground">@android:color/white</item> | ||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> | ||
</style> | ||
</resources> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Theme applied to the Android Window while the process is starting --> | ||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<!-- Show a splash screen on the activity. Automatically removed when | ||
Flutter draws its first frame --> | ||
<item name="android:windowBackground">@drawable/launch_background</item> | ||
</style> | ||
<!-- Theme applied to the Android Window as soon as the process has started. | ||
This theme determines the color of the Android Window while your | ||
Flutter UI initializes, as well as behind your Flutter UI while its | ||
running. | ||
This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
<item name="android:windowBackground">@android:color/white</item> | ||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> | ||
</style> | ||
</resources> |
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,6 +1,6 @@ | ||
#Fri Jun 23 08:50:38 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip | ||
#Fri Jun 23 08:50:38 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,112 +1,114 @@ | ||
import 'package:Prism/analytics/analytics_service.dart'; | ||
import 'package:Prism/payments/upgrade.dart'; | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:google_sign_in/google_sign_in.dart'; | ||
import 'package:hive/hive.dart'; | ||
import 'package:purchases_flutter/purchases_flutter.dart'; | ||
|
||
class GoogleAuth { | ||
final FirebaseAuth _auth = FirebaseAuth.instance; | ||
final GoogleSignIn googleSignIn = GoogleSignIn(); | ||
|
||
String name; | ||
String email; | ||
String imageUrl; | ||
String errorMsg = ""; | ||
Box prefs; | ||
bool isLoggedIn = false; | ||
bool isLoading = false; | ||
|
||
Future<String> signInWithGoogle() async { | ||
isLoading = true; | ||
prefs = await Hive.openBox('prefs'); | ||
final GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn(); | ||
final GoogleSignInAuthentication googleSignInAuthentication = | ||
await googleSignInAccount.authentication; | ||
|
||
final AuthCredential credential = GoogleAuthProvider.getCredential( | ||
accessToken: googleSignInAuthentication.accessToken, | ||
idToken: googleSignInAuthentication.idToken, | ||
); | ||
|
||
final AuthResult authResult = await _auth.signInWithCredential(credential); | ||
final FirebaseUser user = authResult.user; | ||
assert(user.email != null); | ||
assert(user.displayName != null); | ||
assert(user.photoUrl != null); | ||
name = user.displayName; | ||
email = user.email; | ||
if (user != null) { | ||
final QuerySnapshot result = await Firestore.instance | ||
.collection('users') | ||
.where('id', isEqualTo: user.uid) | ||
.getDocuments(); | ||
final List<DocumentSnapshot> documents = result.documents; | ||
if (documents.length == 0) { | ||
Firestore.instance.collection('users').document(user.uid).setData({ | ||
'name': user.displayName, | ||
'email': user.email, | ||
'id': user.uid, | ||
'createdAt': DateTime.now().toIso8601String(), | ||
'premium': false, | ||
'twitter': "", | ||
'instagram': "", | ||
}); | ||
await prefs.put('id', user.uid); | ||
await prefs.put('name', user.displayName); | ||
await prefs.put('email', user.email); | ||
await prefs.put('logged', "true"); | ||
await prefs.put('premium', false); | ||
await prefs.put('twitter', ""); | ||
await prefs.put('instagram', ""); | ||
} else { | ||
await prefs.put('id', documents[0]['id']); | ||
await prefs.put('name', documents[0]['name']); | ||
await prefs.put('email', documents[0]['email']); | ||
await prefs.put('logged', "true"); | ||
await prefs.put('premium', documents[0]['premium'] ?? false); | ||
await prefs.put('twitter', documents[0]['twitter'] ?? ""); | ||
await prefs.put('instagram', documents[0]['instagram'] ?? ""); | ||
} | ||
isLoading = false; | ||
} | ||
Hive.openBox('prefs').then((value) { | ||
value.put('googlename', user.displayName); | ||
value.put('googleemail', user.email); | ||
value.put('googleimage', user.photoUrl); | ||
}); | ||
assert(!user.isAnonymous); | ||
assert(await user.getIdToken() != null); | ||
final FirebaseUser currentUser = await _auth.currentUser(); | ||
assert(user.uid == currentUser.uid); | ||
analytics.logLogin(); | ||
await checkPremium(); | ||
return 'signInWithGoogle succeeded: $user'; | ||
} | ||
|
||
void signOutGoogle() async { | ||
await googleSignIn.signOut(); | ||
Hive.openBox('prefs').then((value) { | ||
value.put('googlename', ""); | ||
value.put('googleemail', ""); | ||
value.put('googleimage', ""); | ||
value.put('id', ""); | ||
value.put('name', ""); | ||
value.put('email', ""); | ||
value.put('logged', "false"); | ||
value.put('premium', false); | ||
value.put('twitter', ""); | ||
value.put('instagram', ""); | ||
}); | ||
await Purchases.reset(); | ||
print("User Sign Out"); | ||
} | ||
|
||
Future<bool> isSignedIn() async { | ||
googleSignIn.isSignedIn().then((value) { | ||
print(value); | ||
return value; | ||
}); | ||
} | ||
} | ||
import 'package:Prism/analytics/analytics_service.dart'; | ||
import 'package:Prism/payments/upgrade.dart'; | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:google_sign_in/google_sign_in.dart'; | ||
import 'package:hive/hive.dart'; | ||
import 'package:purchases_flutter/purchases_flutter.dart'; | ||
|
||
class GoogleAuth { | ||
final FirebaseAuth _auth = FirebaseAuth.instance; | ||
final GoogleSignIn googleSignIn = GoogleSignIn(); | ||
|
||
String name; | ||
String email; | ||
String imageUrl; | ||
String errorMsg = ""; | ||
Box prefs; | ||
bool isLoggedIn = false; | ||
bool isLoading = false; | ||
|
||
Future<String> signInWithGoogle() async { | ||
isLoading = true; | ||
prefs = await Hive.openBox('prefs'); | ||
final GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn(); | ||
final GoogleSignInAuthentication googleSignInAuthentication = | ||
await googleSignInAccount.authentication; | ||
|
||
final AuthCredential credential = GoogleAuthProvider.getCredential( | ||
accessToken: googleSignInAuthentication.accessToken, | ||
idToken: googleSignInAuthentication.idToken, | ||
); | ||
|
||
final AuthResult authResult = await _auth.signInWithCredential(credential); | ||
final FirebaseUser user = authResult.user; | ||
assert(user.email != null); | ||
assert(user.displayName != null); | ||
assert(user.photoUrl != null); | ||
name = user.displayName; | ||
email = user.email; | ||
if (user != null) { | ||
final QuerySnapshot result = await Firestore.instance | ||
.collection('users') | ||
.where('id', isEqualTo: user.uid) | ||
.getDocuments(); | ||
final List<DocumentSnapshot> documents = result.documents; | ||
if (documents.isEmpty) { | ||
Firestore.instance.collection('users').document(user.uid).setData({ | ||
'name': user.displayName, | ||
'email': user.email, | ||
'id': user.uid, | ||
'createdAt': DateTime.now().toIso8601String(), | ||
'premium': false, | ||
'twitter': "", | ||
'instagram': "", | ||
}); | ||
await prefs.put('id', user.uid); | ||
await prefs.put('name', user.displayName); | ||
await prefs.put('email', user.email); | ||
await prefs.put('logged', "true"); | ||
await prefs.put('premium', false); | ||
await prefs.put('twitter', ""); | ||
await prefs.put('instagram', ""); | ||
} else { | ||
await prefs.put('id', documents[0]['id']); | ||
await prefs.put('name', documents[0]['name']); | ||
await prefs.put('email', documents[0]['email']); | ||
await prefs.put('logged', "true"); | ||
await prefs.put('premium', documents[0]['premium'] ?? false); | ||
await prefs.put('twitter', documents[0]['twitter'] ?? ""); | ||
await prefs.put('instagram', documents[0]['instagram'] ?? ""); | ||
} | ||
isLoading = false; | ||
} | ||
Hive.openBox('prefs').then((value) { | ||
value.put('googlename', user.displayName); | ||
value.put('googleemail', user.email); | ||
value.put('googleimage', user.photoUrl); | ||
}); | ||
assert(!user.isAnonymous); | ||
assert(await user.getIdToken() != null); | ||
final FirebaseUser currentUser = await _auth.currentUser(); | ||
assert(user.uid == currentUser.uid); | ||
analytics.logLogin(); | ||
await checkPremium(); | ||
return 'signInWithGoogle succeeded: $user'; | ||
} | ||
|
||
Future<bool> signOutGoogle() async { | ||
await googleSignIn.signOut(); | ||
Hive.openBox('prefs').then((value) { | ||
value.put('googlename', ""); | ||
value.put('googleemail', ""); | ||
value.put('googleimage', ""); | ||
value.put('id', ""); | ||
value.put('name', ""); | ||
value.put('email', ""); | ||
value.put('logged', "false"); | ||
value.put('premium', false); | ||
value.put('twitter', ""); | ||
value.put('instagram', ""); | ||
}); | ||
await Purchases.reset(); | ||
debugPrint("User Sign Out"); | ||
return true; | ||
} | ||
|
||
Future<bool> isSignedIn() async { | ||
googleSignIn.isSignedIn().then((value) { | ||
debugPrint(value.toString()); | ||
return value; | ||
}); | ||
} | ||
} |
Oops, something went wrong.