Merge branch 'FinalDateBaseForLocation' into LinkDataPhpFlutter
continuous-integration/drone/push Build is passing
Details
# Conflicts: # .idea/libraries/Dart_SDK.xml # Sources/dafl_project_flutter/ios/Runner/Info.plist # Sources/dafl_project_flutter/lib/main.dart # Sources/dafl_project_flutter/lib/persistence/database_connexion.dart # Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart # Sources/dafl_project_flutter/pubspec.lock # Sources/dafl_project_flutter/pubspec.yamlmessagerie_lucas_test
After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 194 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 3.1 MiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 206 KiB |
@ -0,0 +1,19 @@
|
||||
class Music{
|
||||
String name;
|
||||
String artist;
|
||||
String linkCover;
|
||||
|
||||
Music(this.name, this.artist, this.linkCover);
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is Music &&
|
||||
runtimeType == other.runtimeType &&
|
||||
name == other.name &&
|
||||
artist == other.artist;
|
||||
|
||||
@override
|
||||
int get hashCode => name.hashCode ^ artist.hashCode;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import 'user.dart';
|
||||
|
||||
class UserCreator{
|
||||
|
||||
User? createUser(int id, String username){
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
postgres
|
||||
mdpDaflBd
|
||||
89.83.54.48
|
||||
BD-DaflMusic
|
||||
|
@ -0,0 +1,26 @@
|
||||
import 'package:dafl_project_flutter/persistence/database_connexion.dart';
|
||||
|
||||
import 'searcher.dart';
|
||||
|
||||
|
||||
|
||||
class DatabaseSearcher extends Searcher{
|
||||
Future<bool> searchUser(String? username, String? password) async { return true; }
|
||||
|
||||
|
||||
|
||||
// Search an user in the database by username
|
||||
@override
|
||||
Future<bool> searchByUsername(String? usernameToSearch) async{
|
||||
final connection = await DatabaseConnexion.initConnexion();
|
||||
|
||||
bool queryResult = await connection.query('select * from utilisateur where username = @username',{ 'username' : usernameToSearch})
|
||||
.toList()
|
||||
.then((rows) { return rows.isEmpty; }).whenComplete(() {
|
||||
connection.close();});
|
||||
|
||||
|
||||
return queryResult;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import '../model/user.dart';
|
||||
|
||||
abstract class Loader{
|
||||
Future<User?> load(String? username, String? password);
|
||||
Future<User> load(String username, String password);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import '../model/user.dart';
|
||||
|
||||
abstract class Search{
|
||||
bool searchUser(String? username, String? password);
|
||||
bool searchUsername(String? username);
|
||||
abstract class Searcher{
|
||||
Future<bool> searchUser(String? username, String? password);
|
||||
Future<bool> searchByUsername(String? username);
|
||||
}
|
@ -0,0 +1,161 @@
|
||||
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<ConversationPage> createState() => _ConversationPageState();
|
||||
}
|
||||
|
||||
class _ConversationPageState extends State<ConversationPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Color(0xFF141414),
|
||||
toolbarHeight: 70,
|
||||
title: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
height: 40,
|
||||
width: 40,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 20,),
|
||||
Text("Max"),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
elevation: 0,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child:
|
||||
Container(
|
||||
color: Color(0xFF141414),
|
||||
height: height*0.92,
|
||||
width: double.infinity,
|
||||
child: ListView(
|
||||
reverse: true,
|
||||
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),
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
bottomSheet: BottomAppBar(
|
||||
color: Color(0xFF141414),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Container(
|
||||
height: height*0.08,
|
||||
color: Colors.transparent,
|
||||
width: width*0.8,
|
||||
child: Container(
|
||||
margin: EdgeInsets.fromLTRB(20, 10, 0, 10),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: Color(0xFF2F2F2F),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xFF141414),
|
||||
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
child: TextField(
|
||||
style: TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(color: Colors.white),
|
||||
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(15, 15, 15, 15),
|
||||
child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 15, 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(15, 15, 15, 15),
|
||||
child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 15, fontWeight: FontWeight.w400),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
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<MessagesWidget> createState() => _MessagesWidgetState();
|
||||
}
|
||||
|
||||
class _MessagesWidgetState extends State<MessagesWidget> {
|
||||
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, 0, 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(),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
// This is a generated file; do not edit or check into version control.
|
||||
FLUTTER_ROOT=C:\src\flutter
|
||||
FLUTTER_APPLICATION_PATH=C:\Users\delan\AndroidStudioProjects\dafl_musicv3\Sources\dafl_project_flutter
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
export "FLUTTER_ROOT=C:\src\flutter"
|
||||
export "FLUTTER_APPLICATION_PATH=C:\Users\delan\AndroidStudioProjects\dafl_musicv3\Sources\dafl_project_flutter"
|
||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||
export "FLUTTER_BUILD_DIR=build"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "DART_OBFUSCATION=false"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
export "TREE_SHAKE_ICONS=false"
|
||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|