Compare commits
78 Commits
fix/fix-is
...
master
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 844 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"default": "justmusic-435d5"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"hosting": {
|
||||||
|
"site": "justmusic-435d5",
|
||||||
|
"public": "build/web",
|
||||||
|
"ignore": [
|
||||||
|
"firebase.json",
|
||||||
|
"**/.*",
|
||||||
|
"**/node_modules/**"
|
||||||
|
],
|
||||||
|
"rewrites": [
|
||||||
|
{
|
||||||
|
"source": "**",
|
||||||
|
"destination": "/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
<?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>CLIENT_ID</key>
|
||||||
|
<string>994903990520-n6jd98ena56kb1tvtrd67tvb5et3nfbf.apps.googleusercontent.com</string>
|
||||||
|
<key>REVERSED_CLIENT_ID</key>
|
||||||
|
<string>com.googleusercontent.apps.994903990520-n6jd98ena56kb1tvtrd67tvb5et3nfbf</string>
|
||||||
|
<key>ANDROID_CLIENT_ID</key>
|
||||||
|
<string>994903990520-073l30b0afj0uq7apsvc8p8ukantpu6q.apps.googleusercontent.com</string>
|
||||||
|
<key>API_KEY</key>
|
||||||
|
<string>AIzaSyBbYqsR6t7JTi8_XFNEHd43IRuKlYGeI3U</string>
|
||||||
|
<key>GCM_SENDER_ID</key>
|
||||||
|
<string>994903990520</string>
|
||||||
|
<key>PLIST_VERSION</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>BUNDLE_ID</key>
|
||||||
|
<string>com.example.justmusic</string>
|
||||||
|
<key>PROJECT_ID</key>
|
||||||
|
<string>justmusic-435d5</string>
|
||||||
|
<key>STORAGE_BUCKET</key>
|
||||||
|
<string>justmusic-435d5.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:994903990520:ios:93188f32e320babe0a9b0d</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,34 @@
|
|||||||
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
|
import 'Music.dart';
|
||||||
|
|
||||||
|
class Capsule {
|
||||||
|
final String _id;
|
||||||
|
late Music _music;
|
||||||
|
Tuple2<String?,String?> _location;
|
||||||
|
DateTime _date;
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
Capsule(this._id, this._location, this._date);
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
|
String get id => _id;
|
||||||
|
|
||||||
|
Music get music => _music;
|
||||||
|
|
||||||
|
set music(Music value) {
|
||||||
|
_music = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple2<String?, String?> get location => _location;
|
||||||
|
|
||||||
|
set location(Tuple2<String?, String?> value) {
|
||||||
|
_location = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime get date => _date;
|
||||||
|
|
||||||
|
set date(DateTime value) {
|
||||||
|
_date = value;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
|
||||||
|
class CapsuleService {
|
||||||
|
Future<List<bool>> recapSevenDays(String id) async {
|
||||||
|
List<bool> recapList = [];
|
||||||
|
|
||||||
|
DateTime sevenDaysAgo = DateTime.now().subtract(Duration(days: 6));
|
||||||
|
|
||||||
|
QuerySnapshot<Map<String, dynamic>> response = await FirebaseFirestore
|
||||||
|
.instance
|
||||||
|
.collection("capsules")
|
||||||
|
.where("user_id", isEqualTo: id)
|
||||||
|
.get();
|
||||||
|
|
||||||
|
List<Map<String, dynamic>?> capsuleList = response.docs
|
||||||
|
.map((DocumentSnapshot<Map<String, dynamic>> doc) => doc.data())
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
|
DateTime date = sevenDaysAgo.add(Duration(days: i));
|
||||||
|
bool capsuleExists = capsuleList.any((post) =>
|
||||||
|
post?["date"] != null &&
|
||||||
|
post?["date"].toDate().year == date.year &&
|
||||||
|
post?["date"].toDate().month == date.month &&
|
||||||
|
post?["date"].toDate().day == date.day);
|
||||||
|
|
||||||
|
recapList.add(capsuleExists);
|
||||||
|
}
|
||||||
|
|
||||||
|
return recapList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
const geoKey = "85a2724ad38b3994c2b7ebe1d239bbff";
|
||||||
|
const clientId = "d9b82921bbdf43efa15d0c34c28c6f93";
|
||||||
|
const clientSecret = "ba01687f59ea4ab7ad00c769e89e44d8";
|
||||||
|
const keyApiFirebase =
|
||||||
|
"AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC";
|
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 41 KiB |
@ -0,0 +1,81 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--
|
||||||
|
If you are serving your web app in a path other than the root, change the
|
||||||
|
href value below to reflect the base path you are serving from.
|
||||||
|
|
||||||
|
The path provided below has to start and end with a slash "/" in order for
|
||||||
|
it to work correctly.
|
||||||
|
|
||||||
|
For more details:
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
||||||
|
|
||||||
|
This is a placeholder for base href that will be replaced by the value of
|
||||||
|
the `--base-href` argument provided to `flutter build`.
|
||||||
|
-->
|
||||||
|
<base href="$FLUTTER_BASE_HREF">
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="description" content="A new Flutter project.">
|
||||||
|
<meta name="google-signin-client_id" content="994903990520-pravk8o6o9ehkhe6asjrao4fmlve0lel.apps.googleusercontent.com">
|
||||||
|
<!-- iOS meta tags & icons -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="justmusic">
|
||||||
|
<link rel="apple-touch-icon" href="icons/icon-192.png">
|
||||||
|
|
||||||
|
<!-- Favicon -->
|
||||||
|
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||||
|
|
||||||
|
<title>justmusic</title>
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// The value below is injected by flutter build, do not touch.
|
||||||
|
const serviceWorkerVersion = null;
|
||||||
|
</script>
|
||||||
|
<!-- This script adds the flutter initialization JS code -->
|
||||||
|
<script src="flutter.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
window.addEventListener('load', function(ev) {
|
||||||
|
// Download main.dart.js
|
||||||
|
_flutter.loader.loadEntrypoint({
|
||||||
|
serviceWorker: {
|
||||||
|
serviceWorkerVersion: serviceWorkerVersion,
|
||||||
|
},
|
||||||
|
onEntrypointLoaded: function(engineInitializer) {
|
||||||
|
engineInitializer.initializeEngine().then(function(appRunner) {
|
||||||
|
appRunner.runApp();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<style>
|
||||||
|
/* Centers flutter canvas with a size of the viewport*/
|
||||||
|
flt-glass-pane {
|
||||||
|
position: fixed !important; /* Overrides absolute from flutter */
|
||||||
|
top: 50vh !important;
|
||||||
|
left: 50vw !important;
|
||||||
|
max-width: 100vw !important;
|
||||||
|
max-height: 100vh !important;
|
||||||
|
transform: translate(-50vw, -50vh) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Scrollbar hide doesn't work on iOS, they add a default one when overflow:true and -webkit-overflow-scrolling: touch;
|
||||||
|
Sadly since iOS 13, this value is forced on iOS -> https://developer.apple.com/documentation/safari-release-notes/safari-13-release-notes
|
||||||
|
*/
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: false;
|
||||||
|
width: 0px;
|
||||||
|
height: 0px; /* Remove scrollbar space */
|
||||||
|
background: transparent; /* Optional: just make scrollbar invisible */
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "justmusic",
|
||||||
|
"short_name": "justmusic",
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#0175C2",
|
||||||
|
"theme_color": "#0175C2",
|
||||||
|
"description": "A new Flutter project.",
|
||||||
|
"orientation": "portrait-primary",
|
||||||
|
"prefer_related_applications": false,
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-maskable-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-maskable-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|