Compare commits
No commits in common. 'master' and 'ui/fix-web-responsive' have entirely different histories.
master
...
ui/fix-web
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/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 */,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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