diff --git a/.idea/Daflv4.iml b/.idea/Daflv4.iml
index 23209a3..2c95479 100644
--- a/.idea/Daflv4.iml
+++ b/.idea/Daflv4.iml
@@ -10,6 +10,5 @@
-
\ No newline at end of file
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
deleted file mode 100644
index 0fa6055..0000000
--- a/.idea/libraries/Dart_Packages.xml
+++ /dev/null
@@ -1,428 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
index 6ae284f..1aea070 100644
--- a/.idea/libraries/Dart_SDK.xml
+++ b/.idea/libraries/Dart_SDK.xml
@@ -1,25 +1,25 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/dafl_project_flutter/lib/controller/controller.dart b/Sources/dafl_project_flutter/lib/controller/controller.dart
new file mode 100644
index 0000000..f3e632f
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/controller/controller.dart
@@ -0,0 +1,35 @@
+import 'package:dafl_project_flutter/persistence/database_loader.dart';
+import 'package:dafl_project_flutter/persistence/database_saver.dart';
+import 'package:dafl_project_flutter/persistence/loader.dart';
+
+import '../persistence/saver.dart';
+import '../persistence/loader.dart';
+import '../model/user.dart';
+
+
+class Controller{
+ static Controller? _this;
+
+ static Saver? saver = DatabaseSaver();
+ static Loader? loader = DatabaseLoader();
+
+ Future? currentUser;
+
+ factory Controller(){
+ if (_this == null) _this = Controller._();
+ return _this!;
+ }
+
+ Controller._();
+
+ void save(User userToSave){
+ saver?.save(userToSave);
+ }
+
+ void load(String username, String password) async{
+ currentUser = loader?.load(username, password);
+ }
+}
+
+
+
diff --git a/Sources/dafl_project_flutter/lib/main.dart b/Sources/dafl_project_flutter/lib/main.dart
index 2ab1678..0803ff6 100644
--- a/Sources/dafl_project_flutter/lib/main.dart
+++ b/Sources/dafl_project_flutter/lib/main.dart
@@ -1,7 +1,6 @@
import 'dart:async';
-import 'package:dafl_project_flutter/views/pages/main/w_bottomsheet.dart';
+import 'package:dafl_project_flutter/persistence/database_saver.dart';
import 'package:fluttertoast/fluttertoast.dart';
-import 'package:vibration/vibration.dart';
import 'dart:math';
import './views/pages/home/p_home.dart';
import './views/pages/main/p_main.dart';
@@ -10,12 +9,18 @@ import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:rive/rive.dart';
+import 'package:dafl_project_flutter/controller/controller.dart';
+
+
+
void main() {
- runApp(MyApp());
+ MyApp mainApp = MyApp();
+
+ runApp(mainApp);
}
-class MyApp extends StatelessWidget {
+class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
@@ -32,7 +37,7 @@ class MyApp extends StatelessWidget {
}
}
-enum CardStatus { like, disLike, discovery, message}
+enum CardStatus { like, disLike, discovery}
class CardProvider extends ChangeNotifier{
List _urlImages = [];
@@ -82,7 +87,7 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
- void endPosition(context) {
+ void endPosition() {
_isDragging = false;
notifyListeners();
@@ -91,7 +96,7 @@ class CardProvider extends ChangeNotifier{
switch (status) {
case CardStatus.like:
- like(context);
+ like();
break;
case CardStatus.disLike:
dislike();
@@ -99,9 +104,6 @@ class CardProvider extends ChangeNotifier{
case CardStatus.discovery:
discovery();
break;
- case CardStatus.message:
- message(context);
- break;
default:
resetPosition();
}
@@ -125,8 +127,7 @@ class CardProvider extends ChangeNotifier{
CardStatus? getStatus({bool force = false}) {
final x = _position.dx;
final y = _position.dy;
- final forceDiscovery = x.abs() < 80;
- final forceMessage = x.abs() < 100;
+ final forceDiscovery = x.abs() < 20;
if(force) {
final delta = 100;
@@ -135,19 +136,15 @@ class CardProvider extends ChangeNotifier{
return CardStatus.like;
} else if ( x <= -delta){
return CardStatus.disLike;
- } else if ( y <= -delta/2 && forceDiscovery){
- return CardStatus.message;
- } else if (y >= delta * 2 && x.abs() < 100) {
+ } else if ( y <= -delta / 2 && forceDiscovery){
return CardStatus.discovery;
}
} else{
final delta = 20;
if(y <= -delta * 2 && forceDiscovery) {
- return CardStatus.message;
- } else if (y >= delta *2 && x.abs() < 80) {
return CardStatus.discovery;
- }else if ( x >= delta) {
+ } else if ( x >= delta) {
return CardStatus.like;
} else if ( x <= -delta) {
return CardStatus.disLike;
@@ -155,7 +152,6 @@ class CardProvider extends ChangeNotifier{
}
}
void dislike() {
- Vibration.vibrate(duration: 20, amplitude: 60);
print("dislike");
_angle = -20;
_position -= Offset(2 * _screenSize.width, 0);
@@ -165,10 +161,9 @@ class CardProvider extends ChangeNotifier{
}
void discovery() {
- Vibration.vibrate(duration: 20, amplitude: 60);
print("discovery");
_angle = 0;
- _position -= Offset(0, -_screenSize.height);
+ _position -= Offset(0, _screenSize.height);
_discovery_card();
Fluttertoast.showToast(
msg: 'Ajouté',
@@ -182,131 +177,13 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
- void message(context) {
- Vibration.vibrate(duration: 20, amplitude: 60);
- print("message");
- _angle = 0;
- _position -= Offset(0, _screenSize.height);
- _message_card();
- showModalBottomSheet(
- isDismissible: false,
- useRootNavigator: true,
- isScrollControlled: true,
- backgroundColor: Colors.transparent,
- context: context,
- constraints: BoxConstraints(
- maxWidth: 600,
- maxHeight: double.infinity,
- ),
- builder: (context) => buildSheet(),);
- notifyListeners();
- }
- Widget buildSheet() => Container(
- height: 550,
- width: 350,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.black.withOpacity(0.4),
- offset: const Offset(
- 0,
- 0,
- ),
- blurRadius: 10.0,
- spreadRadius: 2.0,
- ),
- BoxShadow(
- color: Colors.white.withOpacity(0.3),
- offset: const Offset(0.0, 0.0),
- blurRadius: 0.0,
- spreadRadius: 0.0,
- ),//BoxShadow//BoxShadow
- ],
- color: Color(0xFF232123),
- borderRadius: BorderRadius.only(
- topRight: Radius.circular(30),
- topLeft: Radius.circular(30),
- ),
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
- child: Column(
- children: [
-
- Container(
- height: 5,
- width: 130,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(20),
- color: Color(0xFF8A8A8A),
- ),
- ),
- SizedBox(height: 30,),
- Container(
- width: double.infinity,
- height: 300,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(20),
- color: Color(0xFF302C30),
- ),
- child: Padding(
- padding: EdgeInsets.all(20),
- child: TextField(
- maxLength: 300,
- style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),
- expands: true,
- maxLines: null,
- keyboardType: TextInputType.multiline,
- decoration: InputDecoration(
- hintStyle: TextStyle(
- color: Colors.white,
- ),
- border: InputBorder.none,
- hintText: "Mon message",
- ),
- ),
- ),
- ),
- SizedBox(height: 20,),
- SizedBox(
- width: double.infinity,
- height: 70,
- child: ElevatedButton(
- onPressed: () {},
- style: ElevatedButton.styleFrom(
- primary: Color(0xFF3F1DC3),
- textStyle: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.bold),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(17)
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Text("Envoyer"),
- Opacity(opacity: 0.2,
- child: Image.asset("assets/images/send_logo.png",),)
- ],
- ),
- ),
- )
- ],
- ),
- ),
-
- );
-
-
- void like(context) {
- Vibration.vibrate(duration: 20, amplitude: 60);
+ void like() {
print("like");
_angle = 20;
_position += Offset(2 * _screenSize.width, 0);
_nextCard();
- notifyListeners();
+ notifyListeners();
}
Future _nextCard() async {
@@ -321,12 +198,6 @@ class CardProvider extends ChangeNotifier{
await Future.delayed(Duration(milliseconds: 200));
resetPosition();
}
-
- Future _message_card() async {
- await Future.delayed(Duration(milliseconds: 200));
- resetPosition();
- }
-
}
diff --git a/Sources/dafl_project_flutter/lib/model/conversation.dart b/Sources/dafl_project_flutter/lib/model/conversation.dart
new file mode 100644
index 0000000..09f38cf
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/model/conversation.dart
@@ -0,0 +1,21 @@
+import 'message.dart';
+import 'user.dart';
+
+class Conversation{
+ User firstUser;
+ User secondUser;
+ List messages=[];
+
+ Conversation(this.firstUser,this.secondUser);
+
+ void addMessage(User sender,String content){
+ messages.add(Message(sender, content));
+ }
+
+ void displayMessages(){
+ print("-----Conversation entre $firstUser et $secondUser-----");
+ for (var element in messages) {
+ print(element);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/model/message.dart b/Sources/dafl_project_flutter/lib/model/message.dart
new file mode 100644
index 0000000..2fe88a8
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/model/message.dart
@@ -0,0 +1,11 @@
+import 'user.dart';
+
+class Message{
+ User sender;
+ String content;
+
+ Message(this.sender,this.content);
+
+ @override
+ String toString() => "$sender : $content";
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/model/user.dart b/Sources/dafl_project_flutter/lib/model/user.dart
new file mode 100644
index 0000000..c23a3e2
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/model/user.dart
@@ -0,0 +1,46 @@
+import 'conversation.dart';
+
+class User{
+ //attributes from DAFL
+ int? idDafl;
+ String? usernameDafl;
+ String? passwDafl;
+ //attributes to link with API
+ String? usernameAPI;
+ String? passwAPI;
+
+ //constructors
+ User(this.usernameDafl, this.passwDafl);
+
+ User.name(this.usernameDafl);
+
+ User.fromDatabase(this.idDafl, this.usernameDafl);
+
+
+ //lists
+ Set likedUsers={};
+ Map conversations={};
+
+
+ void like(User liked){
+ likedUsers.add(liked);
+ Conversation? conv = liked.conversations[this];
+ if(conv==null) {
+ conversations[liked]= Conversation(this, liked);
+ } else {
+ conversations[liked]= conv;
+ }
+ }
+
+ void chat(User recipient,String content){
+ Conversation? conv = conversations[recipient];
+ if(conv != null) conv.addMessage(this, content);
+ }
+
+ void displayConversations(){
+ conversations.forEach((k,v) => v.displayMessages());
+ }
+
+ @override
+ String toString() => "$usernameDafl ($idDafl)";
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/model/user_creator.dart b/Sources/dafl_project_flutter/lib/model/user_creator.dart
new file mode 100644
index 0000000..07029e6
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/model/user_creator.dart
@@ -0,0 +1,8 @@
+import 'user.dart';
+
+class UserCreator{
+
+ User? createUser(int id, String username){
+
+ }
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/persistence/.logs/.gitkeep b/Sources/dafl_project_flutter/lib/persistence/.logs/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Sources/dafl_project_flutter/lib/persistence/.logs/logs.txt b/Sources/dafl_project_flutter/lib/persistence/.logs/logs.txt
new file mode 100644
index 0000000..f589036
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/.logs/logs.txt
@@ -0,0 +1,5 @@
+postgres
+mdpDaflBd
+89.83.54.48
+BD-DaflMusic
+
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart b/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart
new file mode 100644
index 0000000..f9cf314
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart
@@ -0,0 +1,20 @@
+import '../model/user.dart';
+import 'package:postgresql2/constants.dart';
+import 'package:postgresql2/pool.dart';
+import 'package:postgresql2/postgresql.dart';
+
+class DatabaseConnexion{
+ String? psqlUser = 'postgres';
+ String? psqlPswd = 'mdpDaflBd';
+ String? psqlHost = '89.83.54.48';
+ String? psqlDataBase = 'BD-DaflMusic';
+
+
+ //Initialise connexion to the database
+ Future initConnexion(){
+ var uri = 'postgres://$psqlUser:$psqlPswd@$psqlHost:5442/$psqlDataBase';
+
+ return connect(uri);
+ }
+
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_loader.dart b/Sources/dafl_project_flutter/lib/persistence/database_loader.dart
new file mode 100644
index 0000000..c8ec16a
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/database_loader.dart
@@ -0,0 +1,21 @@
+import '../persistence/loader.dart';
+import '../model/user.dart';
+import 'database_connexion.dart';
+
+class DatabaseLoader extends Loader{
+ DatabaseConnexion dbConnexion = DatabaseConnexion();
+
+
+ @override
+ Future load(String? username, String? password) async {
+
+ final connection = await dbConnexion.initConnexion();
+
+ connection.query('select * from utilisateur where username = @username AND password = @password',
+ {'username': username,
+ 'password': password}).toList()
+ .then((result) {
+ print(result); });
+ }
+}
+
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_saver.dart b/Sources/dafl_project_flutter/lib/persistence/database_saver.dart
new file mode 100644
index 0000000..3f824d1
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/database_saver.dart
@@ -0,0 +1,20 @@
+import 'dart:io';
+import 'database_connexion.dart';
+import 'saver.dart';
+import '../model/user.dart';
+
+
+class DatabaseSaver extends Saver{
+ DatabaseConnexion dbConnexion = DatabaseConnexion();
+
+ @override
+ void save(User userToSave) async{
+
+ final connection = await dbConnexion.initConnexion();
+
+ connection.execute('insert into utilisateur (username, password) values (@username, @password)',
+ { 'id' : '',
+ 'username': userToSave.usernameDafl,
+ 'password' : userToSave.passwDafl}).then((_) { print('Ajout'); });
+ }
+}
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_search.dart b/Sources/dafl_project_flutter/lib/persistence/database_search.dart
new file mode 100644
index 0000000..e69de29
diff --git a/Sources/dafl_project_flutter/lib/persistence/loader.dart b/Sources/dafl_project_flutter/lib/persistence/loader.dart
new file mode 100644
index 0000000..9133993
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/loader.dart
@@ -0,0 +1,5 @@
+import '../model/user.dart';
+
+abstract class Loader{
+ Future load(String? username, String? password);
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/persistence/saver.dart b/Sources/dafl_project_flutter/lib/persistence/saver.dart
new file mode 100644
index 0000000..da1ca5d
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/saver.dart
@@ -0,0 +1,5 @@
+import '../model/user.dart';
+
+abstract class Saver{
+ void save(User userToSave);
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/persistence/searcher.dart b/Sources/dafl_project_flutter/lib/persistence/searcher.dart
new file mode 100644
index 0000000..735a714
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/searcher.dart
@@ -0,0 +1,5 @@
+import '../model/user.dart';
+
+abstract class Search{
+
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/views/pages/home/p_home.dart b/Sources/dafl_project_flutter/lib/views/pages/home/p_home.dart
index 1f6f308..737d33c 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/home/p_home.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/home/p_home.dart
@@ -28,12 +28,30 @@ class _HomePageState extends State {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
- Spacer(),
+
Image.asset(
'assets/images/Logo.png',
- width: 230,
+ width: 200,
),
- SizedBox(height: height*0.08,),
+ SizedBox(height: height*0.04,),
+ SizedBox(
+ height: 55,
+ width: width*0.75,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFF24CF5F),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(15.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ },
+ child: Text("CONTINUER AVEC SPOTIFY",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.bold),
+ textAlign: TextAlign.center,
+ ),
+ ),),
+ SizedBox(height: height*0.015,),
SizedBox(
height: 55,
width: width*0.75,
@@ -58,7 +76,7 @@ class _HomePageState extends State {
textAlign: TextAlign.center,
),
),),
- Spacer(),
+ SizedBox(height: 220,),
GestureDetector(
onTap: (){
Navigator.of(context).push(
@@ -94,6 +112,15 @@ class _HomePageState extends State {
],
),
+ Align(
+ alignment: Alignment.topRight,
+ child: Container(
+ padding: EdgeInsets.fromLTRB(0, 20, 20, 0),
+ child: Text("v1.0",
+ style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.5) ,fontSize: 17, fontWeight: FontWeight.w700),
+ ),
+ )
+ ),
],
),
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart
deleted file mode 100644
index e2d6e3c..0000000
--- a/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart
+++ /dev/null
@@ -1,150 +0,0 @@
-import 'package:flutter/cupertino.dart';
-import 'package:flutter/material.dart';
-import 'package:fluttericon/font_awesome5_icons.dart';
-
-class ConversationPage extends StatefulWidget {
- const ConversationPage({Key? key}) : super(key: key);
-
- @override
- State createState() => _ConversationPageState();
-}
-
-class _ConversationPageState extends State {
- @override
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
- return Scaffold(
- resizeToAvoidBottomInset: true,
- backgroundColor: Color(0xFF141414),
- appBar: AppBar(
- toolbarHeight: 100,
- title: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(40),
- color: Colors.blue,
- ),
- ),
- SizedBox(width: 20,),
- Text("Max"),
-
- ],
- ),
-
- backgroundColor: Color(0xFF141414),
- elevation: 0,
- ),
- body: SingleChildScrollView(
- child: Column(
- children: [
- Container(
- color: Color(0xFF141414),
- height: height*0.76,
- width: double.infinity,
- child: ListView(
- scrollDirection: Axis.vertical,
- children: [
- Message('Adolescebat autem obstinatum propositum erga haec et similia multa scrutanda, stimulos admovente regina, quae abrupte mariti fortunas trudebat in exitium praeceps, cum eum potius lenitate feminea ad veritatis humanitatisque viam reducere utilia suadendo deberet, ut in Gordianorum actibus factitasse Maximini truculenti illius imperatoris rettulimus coniugem.', 0),
- Message('Claudiopolis olim Seleucia Caesar potens quidem olim interneciva enim et.', 1),
- Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
- Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
- Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
- Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
- ],
- ),
-
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- crossAxisAlignment: CrossAxisAlignment.center,
-
- children: [
- Container(
- height: height*0.08,
- color: Color(0xFF141414),
- width: width*0.8,
- child: Container(
- margin: EdgeInsets.fromLTRB(20, 10, 0, 10),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(100),
- color: Colors.white,
-
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
- child: TextField(
- decoration: InputDecoration(
- border: InputBorder.none,
- hintText: "Envoyer un message..."
- ),
- cursorColor: Colors.purple,
- textAlign: TextAlign.left,
- ),
- ),
- ),
- ),
- Container(
- width: 40,
- height: 40,
- margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(100),
- color: Colors.blue,
- ),
- child: Icon(Icons.send, size: 20, color: Colors.white,),
- )
- ],
- ),
- ],
- ),
- ),
- );
- }
-
- Widget Message(String message, int user) {
- if(user == 0){
- return Container(
- margin: EdgeInsets.fromLTRB(40, 7, 80, 7),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.only(
- bottomRight: Radius.circular(20),
- topLeft: Radius.circular(20),
- topRight: Radius.circular(20),
- bottomLeft: Radius.circular(20),
- ),
- border: Border.all(width: 1.5,
- color: Color(0xFF9C9C9C).withOpacity(0.3)),
- color: Color(0xFF191919),
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
- child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 19, fontWeight: FontWeight.w400),
- )),
- );
- }
- else{
- return Container(
- margin: EdgeInsets.fromLTRB(80, 7, 40, 7),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.only(
- bottomRight: Radius.circular(20),
- bottomLeft: Radius.circular(20),
- topLeft: Radius.circular(20),
- topRight: Radius.circular(20),
- ),
- color: Color(0xFF2F2F2F),
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
- child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 19, fontWeight: FontWeight.w400),
- )),
- );
- }
-
-
- }
-}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
index 616f9b8..bbdb13e 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
@@ -4,7 +4,6 @@ import './w_settings.dart';
import './w_spot.dart';
import './w_discovery.dart';
import './w_profile.dart';
-import './w_messages.dart';
class MainPage extends StatefulWidget {
const MainPage({Key? key}) : super(key: key);
@@ -22,14 +21,13 @@ class _MainPageState extends State {
DiscoveryWidget(),
SpotsWidget(),
Center(child: Text('Tops'),),
- MessagesWidget(),
+ Center(child: Text('Messages'),),
SettingsWidget(),
];
@override
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
return Scaffold(
- resizeToAvoidBottomInset: false,
body: screens[_index],
bottomNavigationBar: NavigationBarTheme(
data: NavigationBarThemeData(
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_bottomsheet.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_bottomsheet.dart
deleted file mode 100644
index 27ec3c4..0000000
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_bottomsheet.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-import 'package:flutter/cupertino.dart';
-
-
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart
index 8009b40..6eef2c1 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart
@@ -12,7 +12,7 @@ class User{
required this.chanteur,
required this.titre,
required this.urlImage,
- });
+});
}
@@ -44,21 +44,21 @@ class _CardWidgetState extends State{
}
@override
Widget build(BuildContext context) => SizedBox.expand(
- child: widget.isFront ? buildFrontCard() : buildCard(),
- );
+ child: widget.isFront ? buildFrontCard() : buildCard(),
+ );
Widget buildCard() => ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage(widget.urlImage),
+ fit: BoxFit.cover,
+ alignment: Alignment(0,0),
+ ),
borderRadius: BorderRadius.all(Radius.circular(20))
),
- child: FadeInImage.assetNetwork(
- height: double.infinity,
- width: double.infinity,
- fit: BoxFit.cover,
- placeholder: "assets/images/loadingPlaceholder.gif", image: widget.urlImage),
),
);
@@ -77,9 +77,6 @@ class _CardWidgetState extends State{
case CardStatus.discovery:
final child = buildStamp(image: 'assets/images/icon_discovery.png', opacity: opacity);
return child;
- case CardStatus.message:
- final child = buildStamp(image: 'assets/images/icon_messages.png', opacity: opacity);
- return child;
default:
return Container();
@@ -87,29 +84,29 @@ class _CardWidgetState extends State{
}
Widget buildStamp({
- double angle = 0,
+ double angle = 0,
required String image,
required double opacity,
- }) {
+}) {
return Opacity(opacity: opacity,
- child: ClipRRect(
- borderRadius: BorderRadius.circular(20),
- child: Container(
- decoration: BoxDecoration(
- color: Colors.black.withOpacity(0.75),
- border: Border.all(color: Color(0xFF3F1DC3), width: 6),
-
- borderRadius: BorderRadius.all(Radius.circular(20))
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(20),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Colors.black.withOpacity(0.75),
+ border: Border.all(color: Color(0xFF3F1DC3), width: 6),
+
+ borderRadius: BorderRadius.all(Radius.circular(20))
+ ),
+ child: Center(
+ child: Image.asset(
+ image,
+ width: 100,
),
- child: Center(
- child: Image.asset(
- image,
- width: 100,
- ),
- ),
),
- ),);
+ ),
+ ),);
}
Widget buildFrontCard() => GestureDetector(
@@ -127,7 +124,7 @@ class _CardWidgetState extends State{
..translate(-center.dx, -center.dy);
return AnimatedContainer(
- curve: Curves.easeOut,
+ curve: Curves.easeInOut,
duration: Duration(milliseconds: milliseconds),
transform: rotatedMatrix..translate(position.dx, position.dy),
child: Stack(
@@ -152,7 +149,7 @@ class _CardWidgetState extends State{
onPanEnd: (details) {
final provider = Provider.of(context, listen: false);
- provider.endPosition(this.context);
+ provider.endPosition();
},
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart
index e06afd6..0939e2b 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart
@@ -13,197 +13,162 @@ class _DiscoveryWidgetState extends State {
@override
Widget build(BuildContext context) {
- return Container(
- color: Color(0xFF141414),
-
- child: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Text('Playlist découverte', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25),),
- Spacer(),
- Icon(FontAwesome5.sort_amount_down, size: 30, color: Colors.white,),
- ]
- ),
- Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
- Text('Retrouvez ici vos nouvelles découvertes.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
- ],
- ),
- ),
- Expanded(
- child: ListView(
-
- children: [
- SizedBox(height: 40,),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
-
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),
- child: Container(
- child: FadeInImage.assetNetwork(placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
- ),
- ),
-
-
- ],
- )
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
+ return Scaffold(
+ backgroundColor: Color(0xFF141414),
+ resizeToAvoidBottomInset: false,
+
+ body: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
children: [
-
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),
- child: Container(
- child: FadeInImage.assetNetwork(placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
+ Text('Playlist découverte', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25),),
+ Spacer(),
+ Icon(FontAwesome5.sort_amount_down, size: 30, color: Colors.white,),
+ ]
+ ),
+ Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
+ Text('Retrouvez ici vos nouvelles découvertes.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
+ ],
+ ),
+ ),
+ Expanded(
+ child: ListView(
+
+ children: [
+ SizedBox(height: 40,),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Column(
+ children: [
+
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
+ width: double.infinity,
+ child: Row(
+ children: [
+ Container(
+ height: 60,
+ width: 60,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(10)),
+ ),),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),
),
- ),
-
- ],
- )
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),
- child: Container(
- child: FadeInImage.assetNetwork(placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
+ ],
+ )
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Column(
+ children: [
+
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
+ width: double.infinity,
+ child: Row(
+ children: [
+ Container(
+ height: 60,
+ width: 60,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(10)),
+ ),),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),
),
- ),
-
- ],
- )
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),
- child: Container(
- child: FadeInImage.assetNetwork(placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
+ ],
+ )
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Column(
+ children: [
+
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
+ width: double.infinity,
+ child: Row(
+ children: [
+ Container(
+ height: 60,
+ width: 60,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(10)),
+ ),),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('IVERSON',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),
),
- ),
- ],
- )
- ),
+ ],
+ )
+ ),
- ],
+ ],
+ ),
),
- ),
- ],
- ),),
+ ],
+ ),),
);
}
}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart
deleted file mode 100644
index 3c5db1a..0000000
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart
+++ /dev/null
@@ -1,228 +0,0 @@
-import 'package:dafl_project_flutter/views/pages/main/p_conversation.dart';
-import 'package:dafl_project_flutter/views/pages/main/p_main.dart';
-import 'package:flutter/material.dart';
-import 'package:fluttericon/font_awesome5_icons.dart';
-import 'package:page_transition/page_transition.dart';
-
-class MessagesWidget extends StatefulWidget {
- const MessagesWidget({Key? key}) : super(key: key);
-
- @override
- State createState() => _MessagesWidgetState();
-}
-
-class _MessagesWidgetState extends State {
- int indexSectedButton = 0;
- Widget listeActuelle = ListConfirmedWidget();
-
-
- var colorConfirm = Color(0xFFFFFFFF);
- var colorWaiting = Color(0xFFA8A8A8);
- void changeSelected(int num){
- if(indexSectedButton == num){
- return;
- }
- else{
- if(num == 0){
- setState((){
- colorConfirm = Color(0xFFFFFFFF);
- colorWaiting = Color(0xFFA8A8A8);
- listeActuelle = ListConfirmedWidget();
- indexSectedButton = num;
- });
-
-
- }
- else{
- setState((){
- colorConfirm = Color(0xFFA8A8A8);
- colorWaiting = Color(0xFFFFFFFF);
- listeActuelle = ListWaitingWidget();
- indexSectedButton = num;
- });
- }
-
- }
- }
-
- @override
-
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
- return Container(
- color: Color(0xFF141414),
-
- child: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('Messages', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25)),
- Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
- Text('Retrouvez ici vos discussions.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
- Padding(
- padding: EdgeInsets.fromLTRB(0, height*0.01, 0, 0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: [
- SizedBox(
- height: 35,
- width: width*0.35,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: colorConfirm,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(15.0),
- ),// background// foreground
- ),
- onPressed: () {
- changeSelected(0);
- },
- child: Text("Validées",
- style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
- textAlign: TextAlign.center,
- ),
- ),),
- SizedBox(
- height: 35,
- width: width*0.35,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: colorWaiting,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(15.0),
- ),// background// foreground
- ),
- onPressed: () {
- changeSelected(1);
- },
- child: Text("En attente",
- style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
- textAlign: TextAlign.center,
- ),
- ),),
- ],
- ),),
- ],
- ),
- ),
- Expanded(
- child:
- listeActuelle,
-
-
- ),
- ],
- ),),
- );
- }
-}
-
-class MessagesButtonWidget extends StatelessWidget{
- @override
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
- return Container(
- margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
- child: Column(
- children: [
-
- Container(
- color: Colors.transparent,
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(30)),
- ),),
- Container(
- width: width-160,
- margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('Max',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('1 jour(s)',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.8) ,fontSize: 15, fontWeight: FontWeight.w400),),
- ],
- ),
- Text('A envoyé un musique.',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
- ),
- ),
-
-
- ],
- )
- );
-
- }
-}
-
-class ListConfirmedWidget extends StatelessWidget{
- @override
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
- return ListView(
-
- children: [
- SizedBox(height: 40,),
- MessagesButtonWidget(),
- MessagesButtonWidget(),
- MessagesButtonWidget(),
- MessagesButtonWidget(),
-
-
- ],
- );
-
- }
-}
-
-class ListWaitingWidget extends StatelessWidget{
- @override
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
- return ListView(
-
- children: [
- SizedBox(height: 40,),
- GestureDetector(
- onTap: () {
- Navigator.of(context).push(PageTransition(
- duration: Duration(milliseconds: 200),
- reverseDuration: Duration(milliseconds: 200),
- type: PageTransitionType.rightToLeftWithFade,
- childCurrent: context.widget,
- child: ConversationPage()));
- },
- child: MessagesButtonWidget(),
- ),
-
- ],
- );
-
- }
-}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
index bec4151..b38784c 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
@@ -16,209 +16,198 @@ class _ProfilWidgetState extends State {
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
- return MainPageProfil();
- }
-}
-
-class MainPageProfil extends StatelessWidget {
- const MainPageProfil({super.key});
-
- @override
- Widget build(BuildContext context) {
- double height = MediaQuery.of(context).size.height;
- double width = MediaQuery.of(context).size.width;
return Container(
color: Color(0xFF141414),
- child: Container(
- width: double.infinity,
- height: double.infinity,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- width: double.infinity,
- margin: EdgeInsets.fromLTRB(30, 50, 0, 0),
- child: Text(
- "Profil",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white),),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 40),
- height: height*0.14,
- width: height*0.14,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(100.0),
- color: Colors.blue,border: Border.all(width: 6.0, color: Colors.white),
+ child: Container(
+ width: double.infinity,
+ height: double.infinity,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ width: double.infinity,
+ margin: EdgeInsets.fromLTRB(30, 50, 0, 0),
+ child: Text(
+ "Profil",
+ style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white),),
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 40),
+ height: height*0.14,
+ width: height*0.14,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(100.0),
+ color: Colors.blue,border: Border.all(width: 6.0, color: Colors.white),
- ),
),
- Container(
- height: 55,
- width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
- ),
- margin: EdgeInsets.fromLTRB(30, 0, 30, 0),
- child: SizedBox(
- height: 55,
- width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- },
- child: Row(
- children: [
- Image.asset('assets/images/fav_logo.png', height: 25,),
- SizedBox(width: 12,),
- Text("Préférences musicales",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
- ],
- )
- ),),
+ ),
+ Container(
+ height: 55,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
),
- Container(
+ margin: EdgeInsets.fromLTRB(30, 0, 30, 0),
+ child: SizedBox(
height: 55,
width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
- ),
- margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
- child: SizedBox(
- height: 55,
- width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- Navigator.push(context,MaterialPageRoute(builder: (context)=> DisplayInfoWidget()));
- },
- child: Row(
- children: [
- Icon(Icons.remove_red_eye, color: Colors.white,size: 30,),
- SizedBox(width: 12,),
- Text("Aperçu de mon profil",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
- ],
- )
- ),),
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ },
+ child: Row(
+ children: [
+ Image.asset('assets/images/fav_logo.png', height: 25,),
+ SizedBox(width: 12,),
+ Text("Préférences musicales",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
+ ],
+ )
+ ),),
+ ),
+ Container(
+ height: 55,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
),
- Container(
- height: height*0.27,
+ margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
+ child: SizedBox(
+ height: 55,
width: double.infinity,
- margin: EdgeInsets.fromLTRB(30, 15, 30, 0),
- child: Column(
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ Navigator.push(context,MaterialPageRoute(builder: (context)=> DisplayInfoWidget()));
+ },
+ child: Row(
children: [
- Icon(Icons.wifi_tethering, color: Colors.white, size: 35,),
- SizedBox(width: 10,),
- Text("En cours d'écoute...",
+ Icon(Icons.remove_red_eye, color: Colors.white,size: 30,),
+ SizedBox(width: 12,),
+ Text("Aperçu de mon profil",
style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
textAlign: TextAlign.center,
),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
],
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- height: height*0.14,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15.0),
- color: Color(0xFFD9D9D9).withOpacity(0.08),
+ )
+ ),),
+ ),
+ Container(
+ height: height*0.27,
+ width: double.infinity,
+ margin: EdgeInsets.fromLTRB(30, 15, 30, 0),
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Icon(Icons.wifi_tethering, color: Colors.white, size: 35,),
+ SizedBox(width: 10,),
+ Text("En cours d'écoute...",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
),
- child:
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(15),
- child: FadeInImage.assetNetwork(
- height: 90,
- width: 90,
- placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ height: height*0.14,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(15.0),
+ color: Color(0xFFD9D9D9).withOpacity(0.08),
+ ),
+ child:
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(15),
+ child: Image(
+ height: 90,
+ width: 90,
+ image: NetworkImage('https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'),
),
),
- Container(
- margin: EdgeInsets.fromLTRB(12, 20, 0, 0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('BAMBINA', style: TextStyle(fontSize:18, fontWeight: FontWeight.w500, color: Colors.white),),
- Text('PNL', style: TextStyle(fontSize:16, fontWeight: FontWeight.w400, color: Colors.grey),),
- ],
- ),
- )
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(12, 20, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('BAMBINA', style: TextStyle(fontSize:18, fontWeight: FontWeight.w500, color: Colors.white),),
+ Text('PNL', style: TextStyle(fontSize:16, fontWeight: FontWeight.w400, color: Colors.grey),),
+ ],
+ ),
+ )
- ],
- ),
+ ],
),
- ],
- ),
+ ),
+ ],
+ ),
+ ),
+ Spacer(),
+ Container(
+ height: 55,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
),
- Spacer(),
- Container(
+ margin: EdgeInsets.fromLTRB(30, 0, 30, height*0.04),
+ child: SizedBox(
height: 55,
width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
- ),
- margin: EdgeInsets.fromLTRB(30, 0, 30, height*0.04),
- child: SizedBox(
- height: 55,
- width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- Navigator.push(context,MaterialPageRoute(builder: (context)=> SettingsWidget()));
- },
- child: Row(
- children: [
- Icon(Icons.settings, color: Colors.white,size: 30,),
- SizedBox(width: 12,),
- Text("Paramètres",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
- ],
- )
- ),),
- ),
- ],
- ),
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ Navigator.push(context,MaterialPageRoute(builder: (context)=> SettingsWidget()));
+ },
+ child: Row(
+ children: [
+ Icon(Icons.settings, color: Colors.white,size: 30,),
+ SizedBox(width: 12,),
+ Text("Paramètres",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
+ ],
+ )
+ ),),
+ ),
+ ],
),
+ ),
);
-
}
}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
index 40f2bc7..19db674 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
@@ -30,21 +30,21 @@ class _SettingsWidgetState extends State {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
- margin: EdgeInsets.fromLTRB(30, height*0.07, 30, 0),
- width: double.infinity,
- height: 30,
- alignment: Alignment.centerLeft,
- decoration: BoxDecoration(
- color: Color(0xFFD9D9D9).withOpacity(0.16),
- borderRadius: BorderRadius.circular(7.0),
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Text('Pseudo',
- style: TextStyle(
- color: Color(0xFFAEAEAE)
- ),),
- )
+ margin: EdgeInsets.fromLTRB(30, height*0.07, 30, 0),
+ width: double.infinity,
+ height: 30,
+ alignment: Alignment.centerLeft,
+ decoration: BoxDecoration(
+ color: Color(0xFFD9D9D9).withOpacity(0.16),
+ borderRadius: BorderRadius.circular(7.0),
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Text('Pseudo',
+ style: TextStyle(
+ color: Color(0xFFAEAEAE)
+ ),),
+ )
),
Padding(padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
child: SizedBox(
@@ -68,8 +68,8 @@ class _SettingsWidgetState extends State {
),
Spacer(),
Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
- child: Text('modifier',
- style: TextStyle( color: Colors.blue, fontSize: 17),),),
+ child: Text('modifier',
+ style: TextStyle( color: Colors.blue, fontSize: 17),),),
],
),
@@ -129,4 +129,3 @@ class _SettingsWidgetState extends State {
);
}
}
-
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart
index a3f34ad..bca1061 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart
@@ -6,7 +6,6 @@ import 'package:provider/provider.dart';
import '../../../main.dart';
import 'package:rive/rive.dart';
import 'package:animations/animations.dart';
-import 'package:vibration/vibration.dart';
class SpotsWidget extends StatefulWidget {
const SpotsWidget({Key? key}) : super(key: key);
@@ -27,30 +26,33 @@ class _SpotsWidgetState extends State {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
final provider = Provider.of(context);
- return Container(
+ return Scaffold(
- color: Color(0xFF141414),
- child: Container(
- height: double.maxFinite,
- child: Stack(
- children: [
- Transform.scale(scale: 1.1,
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage(provider.urlImages.isEmpty != true
- ?provider.urlImages.last
- :"https://i.imgur.com/Uovh293.png"),
- fit: BoxFit.cover,
+ resizeToAvoidBottomInset: false,
+ backgroundColor: Color(0xFF141414),
+ body: Container(
+ height: double.maxFinite,
+ child: Stack(
+ children: [
+ Transform.scale(scale: 1.1,
+ child: Container(
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage(provider.urlImages.isEmpty != true
+ ?provider.urlImages.last
+ :"https://i.imgur.com/Uovh293.png"),
+ fit: BoxFit.cover,
- ),
- ),
- child: BackdropFilter(filter: ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0),
- child: Container(
- decoration: BoxDecoration(color: Colors.black.withOpacity(0.4)),
- ),),
+ ),
+ ),
+ child: BackdropFilter(filter: ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0),
+ child: Container(
+ decoration: BoxDecoration(color: Colors.black.withOpacity(0.4)),
),),
- Align(
+ ),),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, 0, 0,height*0.03),
+ child: Align(
alignment: FractionalOffset.bottomCenter,
child: OpenContainer(
@@ -65,74 +67,68 @@ class _SpotsWidgetState extends State {
},
),
),
- Center(
- child: Container(
- width: 300,
- height: 300,
- child: RiveAnimation.asset('assets/images/search_spot_animation.riv'),
- ),
+ ),
+ Center(
+ child: Container(
+ width: 300,
+ height: 300,
+ child: RiveAnimation.asset('assets/images/search_spot_animation.riv'),
),
- Positioned(
- top: height*0.68,
- width: width,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.dislike();
-
-
- },
- child: Image.asset(
- 'assets/images/bouton_dislike.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
- ),
- ),
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.discovery();
- },
- child: Image.asset(
- 'assets/images/bouton_discovery.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
- ),
+ ),
+ Positioned(
+ top: height*0.68,
+ width: width,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.dislike();
+
+ },
+ child: Image.asset(
+ 'assets/images/bouton_dislike.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
),
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.message(this.context);
- },
- child: Image.asset(
- 'assets/images/bouton_messages.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
- ),
+ ),
+ SizedBox(
+ width: width*0.1,
+ ),
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.discovery();
+ },
+ child: Image.asset(
+ 'assets/images/bouton_discovery.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
),
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.like(this.context);
- },
- child: Image.asset(
- 'assets/images/bouton_like.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
- ),
+ ),
+ SizedBox(
+ width: width*0.1,
+ ),
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.like();
+ },
+ child: Image.asset(
+ 'assets/images/bouton_like.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
),
- ],
- ),
+ ),
+ ],
),
- Align(
- child:Container(
+ ),
+ Align(
+ child:Container(
width: 400,
height: height*0.8,
margin: EdgeInsets.fromLTRB(width*0.09,height/5,width*0.09,height/3.7),
@@ -140,28 +136,28 @@ class _SpotsWidgetState extends State {
child: Container(
child: buildCards(),
)
- ) ,
- ),
- IgnorePointer(child: Container(height: 200,
- decoration: BoxDecoration(
- gradient: gradiant.LinearGradient(
- colors: [Colors.black, Colors.transparent],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- )
-
- ),),),
- Padding(padding: EdgeInsets.fromLTRB(20, 60, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('COULEURS',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Khali',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),),
- ],
- ),),
- ],
- ),
- )
+ ) ,
+ ),
+ IgnorePointer(child: Container(height: 200,
+ decoration: BoxDecoration(
+ gradient: gradiant.LinearGradient(
+ colors: [Colors.black, Colors.transparent],
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ )
+
+ ),),),
+ Padding(padding: EdgeInsets.fromLTRB(20, 60, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('COULEURS',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Khali',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),),
+ ],
+ ),),
+ ],
+ ),
+ )
);
}
@@ -172,15 +168,13 @@ class _SpotsWidgetState extends State {
return Stack(
children: urlImages
.map((urlImage) => CardWidget(
- urlImage: urlImage,
- isFront: urlImages.last == urlImage,
+ urlImage: urlImage,
+ isFront: urlImages.last == urlImage,
))
.toList(),
);
}
-
-
}
@@ -198,61 +192,61 @@ class DisplayInfoWidget extends StatelessWidget{
body: ListView(
children: [
Container(
- margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
- child: Column(
- children: [
- Text('Pour mon mariage',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
+ child: Column(
+ children: [
+ Text('Pour mon mariage',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- decoration: BoxDecoration(
- color: Color(0xFF2E2C2E),
- border: Border.all(width: 1, color: Colors.grey.withOpacity(0.05)),
- borderRadius: BorderRadius.all(Radius.circular(20)),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withOpacity(0.2),
- blurRadius: 5,
- spreadRadius: 1,
- offset: Offset(2.0, 2.0), // shadow direction: bottom right
- )
- ],
-
- ),
- width: double.infinity,
- height: 100,
- child: Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),child: Row(
- children: [
- Container(
- height: 75,
- width: 75,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage("assets/images/dadju-cover-poison.png"),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(15)),
- ),),
- SizedBox(
- ),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Ma vie',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Dadju',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ decoration: BoxDecoration(
+ color: Color(0xFF2E2C2E),
+ border: Border.all(width: 1, color: Colors.grey.withOpacity(0.05)),
+ borderRadius: BorderRadius.all(Radius.circular(20)),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.2),
+ blurRadius: 5,
+ spreadRadius: 1,
+ offset: Offset(2.0, 2.0), // shadow direction: bottom right
+ )
+ ],
- ],
- ),),
- ],
- ),),
),
+ width: double.infinity,
+ height: 100,
+ child: Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),child: Row(
+ children: [
+ Container(
+ height: 75,
+ width: 75,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage("assets/images/dadju-cover-poison.png"),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(15)),
+ ),),
+ SizedBox(
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('Ma vie',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Dadju',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),),
+ ),
- ],
- )
+ ],
+ )
),
Container(
margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
@@ -672,16 +666,13 @@ class PreviewInfoWidget extends StatelessWidget{
decoration: BoxDecoration(
color: Color(0xFF24243A).withOpacity(0.40),
border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(20),
- topRight: Radius.circular(20),
- ),
+ borderRadius: BorderRadius.all(Radius.circular(15)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Me découvrir...',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w800),),
- ],
+ children: [
+ Text('Me découvrir...',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w800),),
+ ],
),
);
diff --git a/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart b/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
index 78fac5e..3e401d1 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
@@ -1,6 +1,9 @@
+
import 'dart:ui';
+import 'package:dafl_project_flutter/persistence/database_saver.dart';
import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart';
+import '../../../controller/controller.dart';
import '../../../main.dart';
import '../sign_up/p_sign_up.dart';
@@ -13,6 +16,10 @@ class SignInPage extends StatefulWidget {
class _SignInPageState extends State {
var boxColor = Colors.white;
+ Controller ctrl = Controller();
+
+ TextEditingController password = new TextEditingController();
+ TextEditingController username = new TextEditingController();
@override
bool isChecked = false;
@@ -68,6 +75,7 @@ class _SignInPageState extends State {
),
Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
+ controller: username,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -111,7 +119,7 @@ class _SignInPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- obscureText: true,
+ controller: password,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -165,6 +173,10 @@ class _SignInPageState extends State {
highlightColor: Colors.grey.shade100,
splashColor: Color(0xFF406DE1),
onTap: (){
+
+ ctrl.load(username.text, password.text);
+
+
Navigator.of(context).push(
PageTransition(
type: PageTransitionType.fade,
@@ -175,10 +187,9 @@ class _SignInPageState extends State {
child:Ink(
child: Align(
alignment: Alignment.center,
- child: Icon(
- Icons.check,
- color: Color(0xFF406DE1),
- size: 60.0,
+ child: Image.asset(
+ 'assets/images/valid_logo.png',
+ width: 40,
),
),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
@@ -204,7 +215,7 @@ class _SignInPageState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Text('Tu n’as pas de compte ?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
+ Text('Tu n’as pas de compte?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
GestureDetector(
onTap: () {
Navigator.of(context).push(
@@ -222,6 +233,15 @@ class _SignInPageState extends State {
SizedBox(height: 60,),
],
),
+ Align(
+ alignment: Alignment.topRight,
+ child: Container(
+ padding: EdgeInsets.fromLTRB(0, 20, 20, 0),
+ child: Text("v1.0",
+ style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.5) ,fontSize: 17, fontWeight: FontWeight.w700),
+ ),
+ )
+ ),
],
),
diff --git a/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart b/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart
index 276bd32..3a9eba0 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart
@@ -1,7 +1,16 @@
+import 'package:dafl_project_flutter/controller/controller.dart';
+import 'package:dafl_project_flutter/persistence/loader.dart';
import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart';
+import '../../../persistence/saver.dart';
import '../home/p_home.dart';
import '../sign_in/p_sign_in.dart';
+import '../../../persistence/database_saver.dart';
+import '../../../persistence/database_loader.dart';
+import '../../../controller/controller.dart';
+import '../../../model/user.dart';
+
+
class SignUpPage extends StatefulWidget {
const SignUpPage({Key? key}) : super(key: key);
@@ -11,11 +20,17 @@ class SignUpPage extends StatefulWidget {
}
class _SignUpPageState extends State {
+ final Controller ctrl = Controller();
Color boxColor = Colors.white;
bool isHovering = false;
@override
TextEditingController passwordconfirm = new TextEditingController();
+
+ //Text field that entered the username of the user
+ TextEditingController username = new TextEditingController();
+
+
bool isChecked = false;
Widget build(BuildContext context) {
return Scaffold(
@@ -69,6 +84,7 @@ class _SignUpPageState extends State {
),
Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
+ controller: username,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -112,7 +128,6 @@ class _SignUpPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- obscureText: true,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -156,7 +171,6 @@ class _SignUpPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- obscureText: true,
controller: passwordconfirm,
decoration: InputDecoration(
border: InputBorder.none,
@@ -231,6 +245,8 @@ class _SignUpPageState extends State {
highlightColor: Colors.grey.shade100,
splashColor: Color(0xFF406DE1),
onTap: (){
+ ctrl.save(User(username.text, passwordconfirm.text));
+
setState(() {
boxColor = Colors.blue;
});
@@ -246,10 +262,9 @@ class _SignUpPageState extends State {
child:Ink(
child: Align(
alignment: Alignment.center,
- child: Icon(
- Icons.check,
- color: Color(0xFF406DE1),
- size: 60.0,
+ child: Image.asset(
+ 'assets/images/valid_logo.png',
+ width: 47,
),
),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
@@ -275,7 +290,7 @@ class _SignUpPageState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Text('Tu as déjà un compte ?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
+ Text('Tu n’as déjà un compte?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
GestureDetector(
onTap: () {
Navigator.of(context).push(
@@ -293,6 +308,15 @@ class _SignUpPageState extends State {
SizedBox(height: 60,),
],
),
+ Align(
+ alignment: Alignment.topRight,
+ child: Container(
+ padding: EdgeInsets.fromLTRB(0, 20, 20, 0),
+ child: Text("v1.0",
+ style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.5) ,fontSize: 17, fontWeight: FontWeight.w700),
+ ),
+ )
+ ),
],
),
diff --git a/Sources/dafl_project_flutter/test/testController.dart b/Sources/dafl_project_flutter/test/testController.dart
new file mode 100644
index 0000000..d892d84
--- /dev/null
+++ b/Sources/dafl_project_flutter/test/testController.dart
@@ -0,0 +1,7 @@
+import '../lib/controller/controller.dart';
+import '../lib/persistence/database_saver.dart';
+
+
+void main(){
+
+}
diff --git a/Sources/dafl_project_flutter/test/test_database_acces.dart b/Sources/dafl_project_flutter/test/test_database_acces.dart
new file mode 100644
index 0000000..cbf05a4
--- /dev/null
+++ b/Sources/dafl_project_flutter/test/test_database_acces.dart
@@ -0,0 +1,20 @@
+import 'dart:async';
+
+import 'package:dafl_project_flutter/persistence/database_connexion.dart';
+import 'package:postgresql2/postgresql.dart';
+
+import '../lib/persistence/database_saver.dart';
+
+
+void main() async{
+ DatabaseConnexion d = DatabaseConnexion();
+
+ final conn = await d.initConnexion();
+
+ conn.query('select * from utilisateur').toList().then((rows) {
+ for (var row in rows) {
+ print(row[0]); // Or by column index.
+ }
+ });
+
+}