Compare commits
No commits in common. 'master' and 'FIX/FEED_PAGINATION' have entirely different histories.
master
...
FIX/FEED_P
Before Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 844 KiB |
@ -1,34 +0,0 @@
|
||||
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/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:justmusic/values/constants.dart';
|
||||
|
||||
import '../components/join_button.dart';
|
||||
|
||||
class WellcomeScreen extends StatelessWidget {
|
||||
const WellcomeScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(defaultPadding),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/wellcome_background.png"),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Align(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 10,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 100),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Bienvenue sur,",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 34),
|
||||
),
|
||||
Image(
|
||||
image: AssetImage("assets/images/logo.png"),
|
||||
width: 230,
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 520),
|
||||
child: Text(
|
||||
"Explore les nouvelles découvertes musicales de tes amis, et partage leur ton mood.",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w200,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
JoinButton(),
|
||||
SizedBox(
|
||||
height: defaultPadding,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/login');
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Text(
|
||||
"Tu as déja un compte ? Connexion",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
) /* add child content here */,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:justmusic/values/constants.dart';
|
||||
|
||||
import '../components/join_button.dart';
|
||||
|
||||
class WellcomeScreen extends StatelessWidget {
|
||||
const WellcomeScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(defaultPadding),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/wellcome_background.png"),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Align(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 10,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 100),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Bienvenue sur,",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 34),
|
||||
),
|
||||
Image(
|
||||
image: AssetImage("assets/images/logo.png"),
|
||||
width: 230,
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 520),
|
||||
child: Text(
|
||||
"Explore les nouvelles découvertes musicales de tes amis, et partage leur ton mood.",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w200,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
JoinButton(),
|
||||
SizedBox(
|
||||
height: defaultPadding,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/login');
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Text(
|
||||
"Tu as déja un compte? Connexion",
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
) /* add child content here */,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
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