Skip to content

Commit

Permalink
Merge pull request #188 from Hash-Studios/enhancement/setup_upload
Browse files Browse the repository at this point in the history
Enhancement/setup upload (v2.6.0)
  • Loading branch information
LiquidatorCoder authored Nov 7, 2020
2 parents ed1c263 + c0702c1 commit 60f654a
Show file tree
Hide file tree
Showing 147 changed files with 38,267 additions and 31,943 deletions.
Binary file removed App Bundle/app-release.aab
Binary file not shown.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
## Changelog

### v2.6.0
- Setups' uploading is now out of beta
- Added new themes & theme designer
- Removed "Premium required" for variants
- Added new Wallpaper Filters (beta)
- Added new & improved in-app notifications
- Fixed thousands of lint issues
- Updated Sliding Up Panel
- Added New About Page
- Swapped Firebase Storage with GitHub in setups
- Redesigned new category popup
- Changed HomeScreen Layout to Tabs
- Setups now don't require signin to view
- Improved Scrolling Performance
- Added High Refresh Rate Support
- Twitter and Instagram now visible in wallpapers' info
- Added verfied users
- Added dynamic svg Strings
- Removed tutorial coach mark
- Reduced assets & app size
- Minor bug fixes and improvements

### v2.5.7
- Redesigned settings screen
- Now customise the accent color of the app
Expand Down
687 changes: 346 additions & 341 deletions README.md

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions analysis_options.yaml
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
38 changes: 19 additions & 19 deletions android/app/src/main/res/values/styles.xml
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>
12 changes: 6 additions & 6 deletions android/gradle/wrapper/gradle-wrapper.properties
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 removed assets/animations/Prism Splash Dark.flr
Binary file not shown.
Binary file removed assets/fonts/Proxima Nova Alt Bold.otf
Binary file not shown.
Binary file removed assets/fonts/Proxima Nova Alt Light.otf
Binary file not shown.
Binary file removed assets/fonts/Proxima Nova Alt Thin.otf
Binary file not shown.
Binary file removed assets/images/AB.jpg
Binary file not shown.
Binary file removed assets/images/AK.jpg
Binary file not shown.
Binary file removed assets/images/AT.jpg
Binary file not shown.
Binary file removed assets/images/AY.jpg
Binary file not shown.
Binary file removed assets/images/PT.jpg
Binary file not shown.
Binary file removed assets/images/Premium.png
Binary file not shown.
Binary file removed assets/images/dark_theme.jpg
Binary file not shown.
Binary file removed assets/images/light_theme.jpg
Binary file not shown.
Binary file removed bin/app-arm64-v8a-release.apk
Binary file not shown.
Binary file removed bin/app-armeabi-v7a-release.apk
Binary file not shown.
Binary file removed bin/app-x86_64-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion flutter_01.sksl.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions flutter_03.sksl.json

Large diffs are not rendered by default.

226 changes: 114 additions & 112 deletions lib/auth/google_auth.dart
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;
});
}
}
Loading

0 comments on commit 60f654a

Please sign in to comment.