Compare commits
25 Commits
fix/web-im
...
master
Author | SHA1 | Date |
---|---|---|
|
3fb79fcb30 | 1 year ago |
|
28d58c398a | 1 year ago |
|
a2eb549ba2 | 1 year ago |
|
b08b5434ac | 1 year ago |
|
210e4e4d4e | 1 year ago |
|
67c734aaf3 | 1 year ago |
|
efc86170a8 | 1 year ago |
|
7699c1b883 | 1 year ago |
|
9db264c0d1 | 1 year ago |
|
db866e7955 | 1 year ago |
|
d4eaefc03c | 1 year ago |
|
5efab7ea60 | 1 year ago |
|
2908d00b0f | 1 year ago |
|
d17f5d7687 | 1 year ago |
|
d9df95b6d2 | 1 year ago |
|
f951b513aa | 1 year ago |
|
b84d8394ac | 1 year ago |
|
30c5d2248f | 1 year ago |
|
d74ac5d9ec | 1 year ago |
|
dc61eae0d4 | 1 year ago |
|
08856fe818 | 1 year ago |
|
d45d9b53ec | 1 year ago |
|
83968d90a5 | 1 year ago |
|
f4bd188e2e | 1 year ago |
|
374ff13888 | 1 year ago |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 844 KiB |
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,98 +1,98 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:justmusic/values/constants.dart';
|
import 'package:justmusic/values/constants.dart';
|
||||||
|
|
||||||
import '../components/join_button.dart';
|
import '../components/join_button.dart';
|
||||||
|
|
||||||
class WellcomeScreen extends StatelessWidget {
|
class WellcomeScreen extends StatelessWidget {
|
||||||
const WellcomeScreen({Key? key}) : super(key: key);
|
const WellcomeScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
padding: EdgeInsets.all(defaultPadding),
|
padding: EdgeInsets.all(defaultPadding),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/wellcome_background.png"),
|
image: AssetImage("assets/images/wellcome_background.png"),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 10,
|
flex: 10,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(bottom: 100),
|
padding: EdgeInsets.only(bottom: 100),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Bienvenue sur,",
|
"Bienvenue sur,",
|
||||||
style: GoogleFonts.plusJakartaSans(
|
style: GoogleFonts.plusJakartaSans(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 34),
|
fontSize: 34),
|
||||||
),
|
),
|
||||||
Image(
|
Image(
|
||||||
image: AssetImage("assets/images/logo.png"),
|
image: AssetImage("assets/images/logo.png"),
|
||||||
width: 230,
|
width: 230,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 25,
|
height: 25,
|
||||||
),
|
),
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxWidth: 520),
|
constraints: BoxConstraints(maxWidth: 520),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Explore les nouvelles découvertes musicales de tes amis, et partage leur ton mood.",
|
"Explore les nouvelles découvertes musicales de tes amis, et partage leur ton mood.",
|
||||||
style: GoogleFonts.plusJakartaSans(
|
style: GoogleFonts.plusJakartaSans(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.w200,
|
fontWeight: FontWeight.w200,
|
||||||
fontSize: 15),
|
fontSize: 15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
JoinButton(),
|
JoinButton(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: defaultPadding,
|
height: defaultPadding,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, '/login');
|
Navigator.pushNamed(context, '/login');
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(3.0),
|
padding: const EdgeInsets.all(3.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Tu as déja un compte? Connexion",
|
"Tu as déja un compte ? Connexion",
|
||||||
style: GoogleFonts.plusJakartaSans(
|
style: GoogleFonts.plusJakartaSans(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
fontSize: 15),
|
fontSize: 15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
) /* add child content here */,
|
) /* add child content here */,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue