Ajout de la dernière musique écoutée sur la page profil.
continuous-integration/drone/push Build is passing Details

Nettoyage du code.
messagerie_lucas_test
Félix MIELCAREK 2 years ago
parent c227d05883
commit 850fb277d3

@ -1,9 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'dart:developer' as dev;
import '../exceptions/api_exception.dart'; import '../exceptions/api_exception.dart';
import '../main.dart'; import '../main.dart';
import 'track.dart';
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
var options = InAppBrowserClassOptions( var options = InAppBrowserClassOptions(
@ -29,12 +27,7 @@ class MyInAppBrowser extends InAppBrowser {
if (url!.origin + url.path == MyApp.api.redirectUri) { if (url!.origin + url.path == MyApp.api.redirectUri) {
try { try {
await MyApp.api.requestUserAuthorization(url); await MyApp.api.requestUserAuthorization(url);
//await MyApp.api.getPlaylists();
/*String id = await MyApp.api.getRecentlyPlayedTrack();
Track track = await MyApp.api.getTrackInfo(id);
dev.log('${track.artist} ${track.name} ${track.albumImage}');*/
await MyApp.api.getPlaylists();
} on ApiException { } on ApiException {
// TODO : add notification to show that an error occured // TODO : add notification to show that an error occured
} finally { } finally {

@ -14,12 +14,12 @@ class Controller {
static Saver saver = DatabaseSaver(); static Saver saver = DatabaseSaver();
static Loader loader = DatabaseLoader(); static Loader loader = DatabaseLoader();
static Searcher _searcher = DatabaseSearcher(); static final Searcher _searcher = DatabaseSearcher();
User currentUser = User("", ""); User currentUser = User("", "");
factory Controller() { factory Controller() {
if (_this == null) _this = Controller._(); _this ??= Controller._();
return _this!; return _this!;
} }
@ -38,34 +38,51 @@ class Controller {
} }
void changeCurrentUser(User user) { void changeCurrentUser(User user) {
this.currentUser = user; currentUser = user;
} }
void changeUsernameCourant(String newName) { void changeUsernameCourant(String newName) {
if (newName != null) { currentUser.usernameDafl = newName;
this.currentUser.usernameDafl = newName;
}
} }
void changePasswordCourant(String newPass) { void changePasswordCourant(String newPass) {
if (newPass != null) { currentUser.passwDafl = newPass;
this.currentUser.passwDafl = newPass;
}
} }
Future<bool> searchByUsername(String username) async { Future<bool> searchByUsername(String username) async {
return await _searcher.searchByUsername(username); return await _searcher.searchByUsername(username);
} }
void chargeExample(){ void chargeExample() {
currentUser.spots = [ currentUser.spots = [
Spot( User('Félix','1234'), Music('Couleurs','Khali','https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg')), Spot(
Spot( User('Audric','1234'), Music("J'suis PNL",'PNL','https://m.media-amazon.com/images/I/61aUOMzwS8L._SL1440_.jpg')), User('Félix', '1234'),
Spot( User('Dorian','1234'), Music('Sundance','Nepal','https://pbs.twimg.com/media/ExJ-My-XMAE3Ko2.jpg')), Music('Couleurs', 'Khali',
Spot( User('Lucas','1234'), Music('Eternelle 2','So La Lune','https://cdns-images.dzcdn.net/images/cover/2818a661c6d533155ce6dffc256b1f51/500x500.jpg')), 'https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg')),
Spot( User('David','1234'), Music('M.I.L.S 3','Ninho','https://cdns-images.dzcdn.net/images/cover/b351f0e935c9c3901f8d893b92ab952a/500x500.jpg')), Spot(
Spot( User('Hugo','1234'), Music('Deux frères','PNL','https://cdns-images.dzcdn.net/images/cover/65147b581f2ace9e0f0723ee76e70fda/500x500.jpg')), User('Audric', '1234'),
Spot( User('Alban','1234'), Music('Paradis','Sopico','https://cdns-images.dzcdn.net/images/cover/17a9747927ac3e5ea56f92f635d9180c/500x500.jpg')), Music("J'suis PNL", 'PNL',
'https://m.media-amazon.com/images/I/61aUOMzwS8L._SL1440_.jpg')),
Spot(
User('Dorian', '1234'),
Music('Sundance', 'Nepal',
'https://pbs.twimg.com/media/ExJ-My-XMAE3Ko2.jpg')),
Spot(
User('Lucas', '1234'),
Music('Eternelle 2', 'So La Lune',
'https://cdns-images.dzcdn.net/images/cover/2818a661c6d533155ce6dffc256b1f51/500x500.jpg')),
Spot(
User('David', '1234'),
Music('M.I.L.S 3', 'Ninho',
'https://cdns-images.dzcdn.net/images/cover/b351f0e935c9c3901f8d893b92ab952a/500x500.jpg')),
Spot(
User('Hugo', '1234'),
Music('Deux frères', 'PNL',
'https://cdns-images.dzcdn.net/images/cover/65147b581f2ace9e0f0723ee76e70fda/500x500.jpg')),
Spot(
User('Alban', '1234'),
Music('Paradis', 'Sopico',
'https://cdns-images.dzcdn.net/images/cover/17a9747927ac3e5ea56f92f635d9180c/500x500.jpg')),
].reversed.toList(); ].reversed.toList();
} }
} }

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'dart:math'; import 'dart:math';
import './views/pages/home/p_home.dart'; import './views/pages/home/p_home.dart';
@ -20,7 +19,6 @@ void main() {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
static Controller controller = Controller(); static Controller controller = Controller();
static Api api = Api(); static Api api = Api();
const MyApp({super.key}); const MyApp({super.key});
@ -29,15 +27,15 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Paint.enableDithering = true; Paint.enableDithering = true;
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]); SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.top]);
return ChangeNotifierProvider( return ChangeNotifierProvider(
create: (context) => CardProvider(), create: (context) => CardProvider(),
child: const MaterialApp( child: const MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Flutter Demo', title: 'Flutter Demo',
home: HomePage(), home: HomePage(),
), ));
);
} }
} }
@ -131,19 +129,19 @@ class CardProvider extends ChangeNotifier {
} else if (y >= delta * 2 && x.abs() < 100) { } else if (y >= delta * 2 && x.abs() < 100) {
return CardStatus.discovery; return CardStatus.discovery;
} }
} else {
const 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) {
return CardStatus.like;
} else if (x <= -delta) {
return CardStatus.disLike;
}
} }
const 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) {
return CardStatus.like;
} else if (x <= -delta) {
return CardStatus.disLike;
}
return null;
} }
void dislike() { void dislike() {
@ -173,18 +171,16 @@ class CardProvider extends ChangeNotifier {
backgroundColor: Colors.red, backgroundColor: Colors.red,
textColor: Colors.white); textColor: Colors.white);
} else { } else {
if (MyApp.controller.currentUser.spots.last != null) { MyApp.controller.currentUser
MyApp.controller.currentUser .addDiscovery(MyApp.controller.currentUser.spots.last.music);
.addDiscovery(MyApp.controller.currentUser.spots.last.music); Fluttertoast.showToast(
Fluttertoast.showToast( msg: 'Ajouté',
msg: 'Ajouté', toastLength: Toast.LENGTH_SHORT,
toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.TOP,
gravity: ToastGravity.TOP, timeInSecForIosWeb: 2,
timeInSecForIosWeb: 2, backgroundColor: Colors.deepPurple,
backgroundColor: Colors.deepPurple, textColor: Colors.white);
textColor: Colors.white); notifyListeners();
notifyListeners();
}
} }
} }
@ -234,14 +230,14 @@ class CardProvider extends ChangeNotifier {
spreadRadius: 0.0, spreadRadius: 0.0,
), //BoxShadow//BoxShadow ), //BoxShadow//BoxShadow
], ],
color: Color(0xFF232123), color: const Color(0xFF232123),
borderRadius: BorderRadius.only( borderRadius: const BorderRadius.only(
topRight: Radius.circular(30), topRight: Radius.circular(30),
topLeft: Radius.circular(30), topLeft: Radius.circular(30),
), ),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10), padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -249,10 +245,10 @@ class CardProvider extends ChangeNotifier {
width: 130, width: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
color: Color(0xFF8A8A8A), color: const Color(0xFF8A8A8A),
), ),
), ),
SizedBox( const SizedBox(
height: 30, height: 30,
), ),
Container( Container(
@ -260,10 +256,10 @@ class CardProvider extends ChangeNotifier {
height: 300, height: 300,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
color: Color(0xFF302C30), color: const Color(0xFF302C30),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: TextField( child: TextField(
keyboardAppearance: Brightness.dark, keyboardAppearance: Brightness.dark,
controller: messageTextField, controller: messageTextField,
@ -276,7 +272,7 @@ class CardProvider extends ChangeNotifier {
expands: true, expands: true,
maxLines: null, maxLines: null,
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
decoration: InputDecoration( decoration: const InputDecoration(
hintStyle: TextStyle( hintStyle: TextStyle(
color: Colors.white, color: Colors.white,
), ),
@ -286,7 +282,7 @@ class CardProvider extends ChangeNotifier {
), ),
), ),
), ),
SizedBox( const SizedBox(
height: 20, height: 20,
), ),
SizedBox( SizedBox(
@ -298,16 +294,16 @@ class CardProvider extends ChangeNotifier {
MyApp.controller.currentUser.spots.last.user); MyApp.controller.currentUser.spots.last.user);
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Color(0xFF3F1DC3), backgroundColor: const Color(0xFF3F1DC3),
textStyle: textStyle: const TextStyle(
TextStyle(fontSize: 20, fontWeight: FontWeight.bold), fontSize: 20, fontWeight: FontWeight.bold),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17)), borderRadius: BorderRadius.circular(17)),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text("Envoyer"), const Text("Envoyer"),
Opacity( Opacity(
opacity: 0.2, opacity: 0.2,
child: Image.asset( child: Image.asset(
@ -383,27 +379,24 @@ class _SplashState extends State<Splash> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: const Color(0xFF141414), backgroundColor: const Color(0xFF141414),
body: Center( body: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const [ children: const [
SizedBox( SizedBox(
height: 300, height: 300,
width: 300, width: 300,
child: riv.RiveAnimation.asset('assets/images/new_file (2).riv'), child:
), riv.RiveAnimation.asset('assets/images/new_file (2).riv'),
SizedBox(height: 50), ),
], SizedBox(height: 50),
), ])));
),
);
} }
} }
Object notify(int index, context, {bool isError = true}) { Object notify(int index, context, {bool isError = true}) {
double height = MediaQuery.of(context).size.height; double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
String message; String message;
if (isError == true) { if (isError == true) {
switch (index) { switch (index) {
@ -447,51 +440,44 @@ Object notify(int index, context, {bool isError = true}) {
clipBehavior: Clip.none, clipBehavior: Clip.none,
children: [ children: [
Container( Container(
padding: EdgeInsets.fromLTRB(20, height / 110, 20, 0), padding: EdgeInsets.fromLTRB(20, height / 110, 20, 0),
height: 90, height: 90,
child: Row( decoration: BoxDecoration(
children: [ image: const DecorationImage(
Container( image: AssetImage("assets/images/backgroundNotify.png"),
fit: BoxFit.cover),
gradient: const LinearGradient(
colors: [Color(0xFF81052a), Color(0xFF810548)],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
borderRadius: const BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 10,
offset: const Offset(4, 8), // Shadow position
),
],
),
child: Row(children: [
const SizedBox(
height: 48, height: 48,
width: 48, width: 48,
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( const Text(
"Ho ho !", "Ho ho !",
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
Text( Text(message,
message, style: const TextStyle(),
style: TextStyle(), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, maxLines: 2)
maxLines: 2, ]))
), ])),
],
),
),
],
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/backgroundNotify.png"),
fit: BoxFit.cover),
gradient: LinearGradient(
colors: [Color(0xFF81052a), Color(0xFF810548)],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
borderRadius: BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 10,
offset: Offset(4, 8), // Shadow position
),
],
),
),
Positioned( Positioned(
top: -50, top: -50,
left: -20, left: -20,

@ -1,3 +1,5 @@
import '../api/track.dart';
import '../exceptions/api_exception.dart';
import '../main.dart'; import '../main.dart';
import 'conversation.dart'; import 'conversation.dart';
import 'music.dart'; import 'music.dart';
@ -13,8 +15,14 @@ class User {
late String usernameAPI; late String usernameAPI;
late String passwAPI; late String passwAPI;
//attributes with Spotify API
late String _id;
late Track track;
//constructors //constructors
User(this.usernameDafl, this.passwDafl); User(this.usernameDafl, this.passwDafl) {
_actualiseTrack();
}
User.name(this.usernameDafl); User.name(this.usernameDafl);
@ -55,6 +63,15 @@ class User {
conversations.forEach((k, v) => v.displayMessages()); conversations.forEach((k, v) => v.displayMessages());
} }
_actualiseTrack() async {
try {
_id = await MyApp.api.getRecentlyPlayedTrack();
track = await MyApp.api.getTrackInfo(_id);
} on ApiException {
// TODO : add notification to show that an error occured
}
}
@override @override
String toString() => "$usernameDafl ($passwDafl)"; String toString() => "$usernameDafl ($passwDafl)";
} }

@ -6,8 +6,12 @@ class CustomIcons {
static const _kFontFam = 'CustomIcons'; static const _kFontFam = 'CustomIcons';
static const String? _kFontPkg = null; static const String? _kFontPkg = null;
static const IconData podium_outline = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData podiumOutline =
static const IconData spot = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData podium = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData spot =
static const IconData spot_outline = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData podium =
IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData spotOutline =
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -1,10 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:dafl_project_flutter/main.dart'; import 'package:dafl_project_flutter/main.dart';
import 'package:dafl_project_flutter/model/user.dart'; import 'package:dafl_project_flutter/model/user.dart';
import 'package:dafl_project_flutter/views/pages/main/w_messages.dart';
import 'package:flutter/cupertino.dart';
import 'package:dafl_project_flutter/model/message.dart'; import 'package:dafl_project_flutter/model/message.dart';
import 'dart:developer' as dev;
class ConversationPage extends StatefulWidget { class ConversationPage extends StatefulWidget {
const ConversationPage({Key? key}) : super(key: key); const ConversationPage({Key? key}) : super(key: key);
@ -14,41 +12,41 @@ class ConversationPage extends StatefulWidget {
} }
class _ConversationPageState extends State<ConversationPage> { class _ConversationPageState extends State<ConversationPage> {
User destinataire = new User("test1", '1234'); User destinataire = User("test1", '1234');
List<Widget> messages = []; List<Widget> messages = [];
bool isNull = true; bool isNull = true;
final messageTextField = TextEditingController(); final messageTextField = TextEditingController();
void SendMessage(String content) { void sendMessage(String content) {
setState(() { setState(() {
messages messages
.add(MessageWidget(Message(MyApp.controller.currentUser, content))); .add(messageWidget(Message(MyApp.controller.currentUser, content)));
}); });
} }
Widget MessageWidget(Message message) { Widget messageWidget(Message message) {
if (message.sender != MyApp.controller.currentUser) { if (message.sender != MyApp.controller.currentUser) {
return Align( return Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(40, 7, 80, 7), margin: const EdgeInsets.fromLTRB(40, 7, 80, 7),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(20), bottomRight: Radius.circular(20),
topLeft: Radius.circular(20), topLeft: Radius.circular(20),
topRight: Radius.circular(20), topRight: Radius.circular(20),
bottomLeft: Radius.circular(20), bottomLeft: Radius.circular(20),
), ),
border: Border.all( border: Border.all(
width: 1.5, color: Color(0xFF9C9C9C).withOpacity(0.3)), width: 1.5, color: const Color(0xFF9C9C9C).withOpacity(0.3)),
color: Color(0xFF191919), color: const Color(0xFF191919),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(15, 15, 15, 15), padding: const EdgeInsets.fromLTRB(15, 15, 15, 15),
child: Text( child: Text(
message.content, message.content,
style: TextStyle( style: const TextStyle(
fontFamily: 'DMSans', fontFamily: 'DMSans',
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
@ -60,8 +58,8 @@ class _ConversationPageState extends State<ConversationPage> {
return Align( return Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(80, 7, 40, 7), margin: const EdgeInsets.fromLTRB(80, 7, 40, 7),
decoration: BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(20), bottomRight: Radius.circular(20),
bottomLeft: Radius.circular(20), bottomLeft: Radius.circular(20),
@ -71,10 +69,10 @@ class _ConversationPageState extends State<ConversationPage> {
color: Color(0xFF2F2F2F), color: Color(0xFF2F2F2F),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(15), padding: const EdgeInsets.all(15),
child: Text( child: Text(
message.content, message.content,
style: TextStyle( style: const TextStyle(
fontFamily: 'DMSans', fontFamily: 'DMSans',
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
@ -90,7 +88,7 @@ class _ConversationPageState extends State<ConversationPage> {
void initState() { void initState() {
super.initState(); super.initState();
messageTextField.addListener(_checkIfNull); messageTextField.addListener(_checkIfNull);
print("INITSATE"); dev.log("INITSATE");
} }
@override @override
@ -100,7 +98,7 @@ class _ConversationPageState extends State<ConversationPage> {
} }
void _checkIfNull() { void _checkIfNull() {
if (messageTextField.text.length > 0) { if (messageTextField.text.isNotEmpty) {
setState(() { setState(() {
isNull = false; isNull = false;
}); });
@ -122,67 +120,65 @@ class _ConversationPageState extends State<ConversationPage> {
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: AppBar( appBar: AppBar(
elevation: 20, elevation: 20,
backgroundColor: Color(0xFF141414), backgroundColor: const Color(0xFF141414),
toolbarHeight: 70, toolbarHeight: 70,
title: Container( title: Row(
child: Row( children: [
children: [ Container(
Container( padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0), height: 40,
height: 40, width: 40,
width: 40, decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(40),
borderRadius: BorderRadius.circular(40), color: Colors.blue,
color: Colors.blue,
),
),
SizedBox(
width: 20,
), ),
Text("Max"), ),
Spacer(), const SizedBox(
IconButton( width: 20,
splashColor: Colors.grey.withOpacity(0.2), ),
splashRadius: 30, const Text("Max"),
onPressed: () { const Spacer(),
showModalBottomSheet( IconButton(
isDismissible: true, splashColor: Colors.grey.withOpacity(0.2),
useRootNavigator: true, splashRadius: 30,
isScrollControlled: true, onPressed: () {
backgroundColor: Colors.transparent, showModalBottomSheet(
context: context, isDismissible: true,
constraints: BoxConstraints( useRootNavigator: true,
maxWidth: 600, isScrollControlled: true,
maxHeight: double.infinity, backgroundColor: Colors.transparent,
), context: context,
builder: (context) => buildSheet(), constraints: const BoxConstraints(
); maxWidth: 600,
}, maxHeight: double.infinity,
icon: Icon( ),
Icons.report_problem, builder: (context) => buildSheet(),
color: Colors.grey.withOpacity(0.3), );
size: 25, },
), icon: Icon(
Icons.report_problem,
color: Colors.grey.withOpacity(0.3),
size: 25,
), ),
], ),
), ],
), ),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
color: Color(0xFF141414), color: const Color(0xFF141414),
height: height * 0.92, height: height * 0.92,
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
controller: listScrollController, controller: listScrollController,
physics: BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
itemCount: messages.length, itemCount: messages.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return messages[index]; return messages[index];
})), })),
), ),
bottomSheet: BottomAppBar( bottomSheet: BottomAppBar(
color: Color(0xFF141414), color: const Color(0xFF141414),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -192,20 +188,20 @@ class _ConversationPageState extends State<ConversationPage> {
color: Colors.transparent, color: Colors.transparent,
width: width * 0.9, width: width * 0.9,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: const EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1, width: 1,
color: Color(0xFF2F2F2F), color: const Color(0xFF2F2F2F),
), ),
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
color: Color(0xFF141414), color: const Color(0xFF141414),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(15, 0, 15, 0), padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
child: TextField( child: TextField(
controller: messageTextField, controller: messageTextField,
style: TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
decoration: InputDecoration( decoration: InputDecoration(
hintStyle: hintStyle:
TextStyle(color: Colors.white.withOpacity(0.7)), TextStyle(color: Colors.white.withOpacity(0.7)),
@ -222,7 +218,7 @@ class _ConversationPageState extends State<ConversationPage> {
onTap: isNull onTap: isNull
? null ? null
: () { : () {
SendMessage(messageTextField.text); sendMessage(messageTextField.text);
if (listScrollController.hasClients) { if (listScrollController.hasClients) {
final position = final position =
listScrollController.position.maxScrollExtent; listScrollController.position.maxScrollExtent;
@ -231,24 +227,24 @@ class _ConversationPageState extends State<ConversationPage> {
messageTextField.clear(); messageTextField.clear();
}, },
child: isNull == true child: isNull == true
? Container( ? const SizedBox(
height: 1, height: 1,
width: 1, width: 1,
) )
: Container( : Container(
width: 40, width: 40,
height: 40, height: 40,
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: const EdgeInsets.fromLTRB(0, 0, 0, 0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xff8e24a1), Color(0xff8163ff)], colors: [Color(0xff8e24a1), Color(0xff8163ff)],
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
)), )),
child: Transform.rotate( child: Transform.rotate(
angle: -300, angle: -300,
child: Icon( child: const Icon(
Icons.arrow_back, Icons.arrow_back,
size: 26, size: 26,
color: Colors.white, color: Colors.white,
@ -262,8 +258,6 @@ class _ConversationPageState extends State<ConversationPage> {
} }
Widget buildSheet() { Widget buildSheet() {
String dropdownValue = list.first;
final messageTextField = TextEditingController();
return SingleChildScrollView( return SingleChildScrollView(
padding: padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
@ -288,14 +282,14 @@ class _ConversationPageState extends State<ConversationPage> {
spreadRadius: 0.0, spreadRadius: 0.0,
), //BoxShadow//BoxShadow ), //BoxShadow//BoxShadow
], ],
color: Color(0xFF232123), color: const Color(0xFF232123),
borderRadius: BorderRadius.only( borderRadius: const BorderRadius.only(
topRight: Radius.circular(30), topRight: Radius.circular(30),
topLeft: Radius.circular(30), topLeft: Radius.circular(30),
), ),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10), padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -304,10 +298,10 @@ class _ConversationPageState extends State<ConversationPage> {
width: 130, width: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
color: Color(0xFF8A8A8A), color: const Color(0xFF8A8A8A),
), ),
), ),
Padding( const Padding(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20), padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
child: Text( child: Text(
'Signaler', 'Signaler',
@ -318,14 +312,14 @@ class _ConversationPageState extends State<ConversationPage> {
), ),
), ),
Container( Container(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10), padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade900, color: Colors.grey.shade900,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: Column( child: Column(
children: [ children: const [
Text( Text(
'Vous êtes sur le point de signaler cet utilisateur. Veuillez renseigner le motif du signalement.', 'Vous êtes sur le point de signaler cet utilisateur. Veuillez renseigner le motif du signalement.',
style: TextStyle(color: Colors.grey), style: TextStyle(color: Colors.grey),
@ -339,11 +333,11 @@ class _ConversationPageState extends State<ConversationPage> {
), ),
), ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20), padding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10), padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.07), color: Colors.grey.withOpacity(0.07),
@ -359,7 +353,7 @@ class _ConversationPageState extends State<ConversationPage> {
fontWeight: FontWeight.w200), fontWeight: FontWeight.w200),
maxLines: 3, maxLines: 3,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
decoration: InputDecoration( decoration: const InputDecoration(
hintText: '* Commentaires', hintText: '* Commentaires',
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 15, fontSize: 15,
@ -371,18 +365,18 @@ class _ConversationPageState extends State<ConversationPage> {
), ),
], ],
)), )),
Spacer(), const Spacer(),
Padding( Padding(
padding: EdgeInsets.fromLTRB(0, 0, 0, 50), padding: const EdgeInsets.fromLTRB(0, 0, 0, 50),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
height: 70, height: 70,
child: ElevatedButton( child: ElevatedButton(
onPressed: () {}, onPressed: () {},
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Colors.red, backgroundColor: Colors.red,
textStyle: textStyle: const TextStyle(
TextStyle(fontSize: 20, fontWeight: FontWeight.bold), fontSize: 20, fontWeight: FontWeight.bold),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17)), borderRadius: BorderRadius.circular(17)),
), ),
@ -396,7 +390,7 @@ class _ConversationPageState extends State<ConversationPage> {
size: 100, size: 100,
color: Colors.white.withOpacity(0.2), color: Colors.white.withOpacity(0.2),
)), )),
Center( const Center(
child: Text("Envoyer le signalement"), child: Text("Envoyer le signalement"),
), ),
], ],

@ -42,12 +42,12 @@ class _MainPageState extends State<MainPage> {
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.grey)), fontSize: 12, fontWeight: FontWeight.w400, color: Colors.grey)),
), ),
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints( constraints: const BoxConstraints(
minHeight: 100, minHeight: 100,
maxHeight: 100, maxHeight: 100,
), ),
child: NavigationBar( child: NavigationBar(
animationDuration: Duration(microseconds: 800), animationDuration: const Duration(microseconds: 800),
selectedIndex: index, selectedIndex: index,
height: height * 0.1, height: height * 0.1,
onDestinationSelected: (index) => setState(() => _index = index), onDestinationSelected: (index) => setState(() => _index = index),
@ -77,12 +77,12 @@ class _MainPageState extends State<MainPage> {
NavigationDestination( NavigationDestination(
icon: Icon(CustomIcons.spot, color: Colors.grey), icon: Icon(CustomIcons.spot, color: Colors.grey),
selectedIcon: selectedIcon:
Icon(CustomIcons.spot_outline, color: Colors.white), Icon(CustomIcons.spotOutline, color: Colors.white),
label: 'Spots', label: 'Spots',
), ),
NavigationDestination( NavigationDestination(
icon: Icon( icon: Icon(
CustomIcons.podium_outline, CustomIcons.podiumOutline,
color: Colors.grey, color: Colors.grey,
), ),
label: 'Tops', label: 'Tops',
@ -111,7 +111,9 @@ class _MainPageState extends State<MainPage> {
} }
class GradientText extends StatelessWidget { class GradientText extends StatelessWidget {
const GradientText(this.text, {super.key, const GradientText(
this.text, {
super.key,
required this.gradient, required this.gradient,
this.style, this.style,
}); });
@ -124,10 +126,9 @@ class GradientText extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ShaderMask( return ShaderMask(
blendMode: BlendMode.srcIn, blendMode: BlendMode.srcIn,
shaderCallback: (bounds) => shaderCallback: (bounds) => gradient.createShader(
gradient.createShader( Rect.fromLTWH(0, 0, bounds.width, bounds.height),
Rect.fromLTWH(0, 0, bounds.width, bounds.height), ),
),
child: Text(text, style: style), child: Text(text, style: style),
); );
} }

@ -91,95 +91,92 @@ class _DiscoveryListState extends State<DiscoveryList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RefreshIndicator( return RefreshIndicator(
child: ListView.builder( onRefresh: () async {
itemCount: MyApp.controller.currentUser.discovery.length, refreshList();
itemBuilder: (context, index) { },
int itemCount = MyApp.controller.currentUser.discovery.length; key: refreshKey,
int reversedIndex = itemCount - 1 - index; child: ListView.builder(
return Dismissible( itemCount: MyApp.controller.currentUser.discovery.length,
key: Key( itemBuilder: (context, index) {
MyApp.controller.currentUser.discovery[reversedIndex].name), int itemCount = MyApp.controller.currentUser.discovery.length;
direction: DismissDirection.startToEnd, int reversedIndex = itemCount - 1 - index;
child: Container( return Dismissible(
margin: EdgeInsets.fromLTRB(0, 10, 0, 0), key: Key(MyApp
padding: EdgeInsets.fromLTRB(30, 0, 30, 0), .controller.currentUser.discovery[reversedIndex].name),
child: Column( direction: DismissDirection.startToEnd,
children: [ onDismissed: (direction) {
Container( if (direction == DismissDirection.startToEnd) {
margin: EdgeInsets.fromLTRB(0, 5, 0, 0), MyApp.controller.currentUser.discovery
width: double.infinity, .removeAt(reversedIndex);
child: Row( }
children: [ setState(() {
Container( itemCount -= 1;
height: 60, });
width: 60, },
decoration: BoxDecoration( background: Container(
border: Border.all( decoration: const BoxDecoration(
width: 0, image: DecorationImage(
color: Colors.grey.withOpacity(0)), image: AssetImage(
borderRadius: "assets/images/delete_background.png"),
BorderRadius.all(Radius.circular(10)), fit: BoxFit.cover))),
), child: Container(
child: Container( margin: const EdgeInsets.fromLTRB(0, 10, 0, 0),
padding: const EdgeInsets.fromLTRB(30, 0, 30, 0),
child: Column(children: [
Container(
margin: const 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: const BorderRadius.all(
Radius.circular(10)),
),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: placeholder:
"assets/images/loadingPlaceholder.gif", "assets/images/loadingPlaceholder.gif",
image: MyApp.controller.currentUser image: MyApp.controller.currentUser
.discovery[reversedIndex].linkCover), .discovery[reversedIndex].linkCover),
), ),
), Container(
Container( margin:
margin: EdgeInsets.fromLTRB(20, 0, 0, 0), const EdgeInsets.fromLTRB(20, 0, 0, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center, CrossAxisAlignment.start,
children: [ mainAxisAlignment:
Text( MainAxisAlignment.center,
MyApp.controller.currentUser children: [
.discovery[reversedIndex].name, Text(
style: TextStyle( MyApp.controller.currentUser
fontFamily: 'DMSans', .discovery[reversedIndex].name,
color: Colors.white.withOpacity(1), style: TextStyle(
fontSize: 20, fontFamily: 'DMSans',
fontWeight: FontWeight.w800), color:
), Colors.white.withOpacity(1),
Text( fontSize: 20,
MyApp.controller.currentUser fontWeight: FontWeight.w800),
.discovery[reversedIndex].artist, ),
style: TextStyle( Text(
fontFamily: 'DMSans', MyApp
color: Colors.white.withOpacity(0.6), .controller
fontSize: 16, .currentUser
fontWeight: FontWeight.w400), .discovery[reversedIndex]
), .artist,
], style: TextStyle(
), fontFamily: 'DMSans',
), color: Colors.white
], .withOpacity(0.6),
), fontSize: 16,
), fontWeight: FontWeight.w400))
], ]))
)), ]))
onDismissed: (direction) { ])));
if (direction == DismissDirection.startToEnd) }));
MyApp.controller.currentUser.discovery
.removeAt(reversedIndex);
setState(() {
itemCount -= 1;
});
},
background: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/delete_background.png"),
fit: BoxFit.cover),
)),
);
}),
onRefresh: () async {
refreshList();
},
key: refreshKey,
);
} }
} }

@ -12,10 +12,10 @@ class MessagesWidget extends StatefulWidget {
class _MessagesWidgetState extends State<MessagesWidget> { class _MessagesWidgetState extends State<MessagesWidget> {
int indexSectedButton = 0; int indexSectedButton = 0;
Widget currentList = ListConfirmedWidget(); Widget currentList = const ListConfirmedWidget();
var colorConfirm = Color(0xFFFFFFFF); var colorConfirm = const Color(0xFFFFFFFF);
var colorWaiting = Color(0xFFA8A8A8); var colorWaiting = const Color(0xFFA8A8A8);
void changeSelected(int num) { void changeSelected(int num) {
if (indexSectedButton == num) { if (indexSectedButton == num) {
@ -23,16 +23,16 @@ class _MessagesWidgetState extends State<MessagesWidget> {
} else { } else {
if (num == 0) { if (num == 0) {
setState(() { setState(() {
colorConfirm = Color(0xFFFFFFFF); colorConfirm = const Color(0xFFFFFFFF);
colorWaiting = Color(0xFFA8A8A8); colorWaiting = const Color(0xFFA8A8A8);
currentList = ListConfirmedWidget(); currentList = const ListConfirmedWidget();
indexSectedButton = num; indexSectedButton = num;
}); });
} else { } else {
setState(() { setState(() {
colorConfirm = Color(0xFFA8A8A8); colorConfirm = const Color(0xFFA8A8A8);
colorWaiting = Color(0xFFFFFFFF); colorWaiting = const Color(0xFFFFFFFF);
currentList = ListWaitingWidget(); currentList = const ListWaitingWidget();
indexSectedButton = num; indexSectedButton = num;
}); });
} }
@ -44,83 +44,81 @@ class _MessagesWidgetState extends State<MessagesWidget> {
double height = MediaQuery.of(context).size.height; double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width; double width = MediaQuery.of(context).size.width;
return Container( return Container(
color: Color(0xFF141414), color: const Color(0xFF141414),
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(30, 50, 30, 0), padding: const EdgeInsets.fromLTRB(30, 50, 30, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ const Text('Messages',
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( style: TextStyle(
color: Colors.grey.withOpacity(0.4), fontSize: 15), color: Colors.white,
), fontWeight: FontWeight.w500,
Padding( fontSize: 25)),
padding: EdgeInsets.fromLTRB(0, height * 0.01, 0, 0), const Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
child: Row( Text(
mainAxisAlignment: MainAxisAlignment.spaceAround, 'Retrouvez ici vos discussions.',
children: [ style: TextStyle(
SizedBox( color: Colors.grey.withOpacity(0.4), fontSize: 15),
height: 35, ),
width: width * 0.35, Padding(
child: ElevatedButton( padding: EdgeInsets.fromLTRB(0, height * 0.01, 0, 0),
style: ElevatedButton.styleFrom( child: Row(
backgroundColor: colorConfirm, mainAxisAlignment: MainAxisAlignment.spaceAround,
shape: RoundedRectangleBorder( children: [
borderRadius: BorderRadius.circular(15.0), SizedBox(
), // background// foreground height: 35,
), width: width * 0.35,
onPressed: () { child: ElevatedButton(
changeSelected(0); style: ElevatedButton.styleFrom(
}, backgroundColor: colorConfirm,
child: Text( shape: RoundedRectangleBorder(
"Validées", borderRadius: BorderRadius.circular(15.0),
style: TextStyle( ), // background// foreground
color: Colors.black, ),
fontSize: 17, onPressed: () {
fontWeight: FontWeight.bold), changeSelected(0);
textAlign: TextAlign.center, },
), child: const Text(
"Validées",
style: TextStyle(
color: Colors.black,
fontSize: 17,
fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
), ),
), ),
SizedBox( ),
height: 35, SizedBox(
width: width * 0.35, height: 35,
child: ElevatedButton( width: width * 0.35,
style: ElevatedButton.styleFrom( child: ElevatedButton(
backgroundColor: colorWaiting, style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder( backgroundColor: colorWaiting,
borderRadius: BorderRadius.circular(15.0), shape: RoundedRectangleBorder(
), // background// foreground borderRadius: BorderRadius.circular(15.0),
), ), // background// foreground
onPressed: () { ),
changeSelected(1); onPressed: () {
}, changeSelected(1);
child: Text( },
"En attente", child: const Text(
style: TextStyle( "En attente",
color: Colors.black, style: TextStyle(
fontSize: 17, color: Colors.black,
fontWeight: FontWeight.bold), fontSize: 17,
textAlign: TextAlign.center, fontWeight: FontWeight.bold),
), textAlign: TextAlign.center,
), ),
), ),
], ),
), ],
), ),
], ),
), ],
), ),
Expanded( Expanded(
child: currentList, child: currentList,
@ -133,36 +131,37 @@ class _MessagesWidgetState extends State<MessagesWidget> {
} }
class MessagesButtonWidget extends StatelessWidget { class MessagesButtonWidget extends StatelessWidget {
const MessagesButtonWidget({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width; double width = MediaQuery.of(context).size.width;
return Container( return Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 10), margin: const EdgeInsets.fromLTRB(0, 0, 0, 10),
child: Column( child: Column(
children: [ children: [
Container( Container(
color: Colors.transparent, color: Colors.transparent,
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Row( child: Row(
children: [ children: [
Container( Container(
height: 60, height: 60,
width: 60, width: 60,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: const DecorationImage(
image: NetworkImage( image: NetworkImage(
'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'), 'https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
border: Border.all( border: Border.all(
width: 0, color: Colors.grey.withOpacity(0)), width: 0, color: Colors.grey.withOpacity(0)),
borderRadius: BorderRadius.all(Radius.circular(30)), borderRadius: const BorderRadius.all(Radius.circular(30)),
), ),
), ),
Container( Container(
width: width - 160, width: width - 160,
margin: EdgeInsets.fromLTRB(20, 0, 20, 0), margin: const EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -209,38 +208,36 @@ class MessagesButtonWidget extends StatelessWidget {
} }
class ListConfirmedWidget extends StatelessWidget { class ListConfirmedWidget extends StatelessWidget {
const ListConfirmedWidget({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height; return ListView(children: const [
double width = MediaQuery.of(context).size.width; MessagesButtonWidget(),
return ListView( MessagesButtonWidget(),
children: [ MessagesButtonWidget(),
MessagesButtonWidget(), MessagesButtonWidget(),
MessagesButtonWidget(), ]);
MessagesButtonWidget(),
MessagesButtonWidget(),
],
);
} }
} }
class ListWaitingWidget extends StatelessWidget { class ListWaitingWidget extends StatelessWidget {
const ListWaitingWidget({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
return ListView( return ListView(
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).push(PageTransition( Navigator.of(context).push(PageTransition(
duration: Duration(milliseconds: 200), duration: const Duration(milliseconds: 200),
reverseDuration: Duration(milliseconds: 200), reverseDuration: const Duration(milliseconds: 200),
type: PageTransitionType.rightToLeftWithFade, type: PageTransitionType.rightToLeftWithFade,
childCurrent: context.widget, childCurrent: context.widget,
child: ConversationPage())); child: const ConversationPage()));
}, },
child: MessagesButtonWidget(), child: const MessagesButtonWidget(),
), ),
], ],
); );

@ -28,15 +28,14 @@ class _MainPageProfilState extends State<MainPageProfil> {
String? username = MyApp.controller.currentUser.usernameDafl; String? username = MyApp.controller.currentUser.usernameDafl;
@override @override
void initState() { initState() {
username = MyApp.controller.currentUser.usernameDafl;
super.initState(); super.initState();
String username = MyApp.controller.currentUser.usernameDafl ?? "default";
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height; double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
return Container( return Container(
color: const Color(0xFF141414), color: const Color(0xFF141414),
child: SizedBox( child: SizedBox(
@ -56,36 +55,32 @@ class _MainPageProfilState extends State<MainPageProfil> {
fontFamily: "DMSans")), fontFamily: "DMSans")),
), ),
Container( Container(
margin: const EdgeInsets.fromLTRB(0, 10, 0, 10), margin: const EdgeInsets.fromLTRB(0, 10, 0, 10),
height: height * 0.14, height: height * 0.14,
width: height * 0.14, width: height * 0.14,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0), borderRadius: BorderRadius.circular(100.0),
color: Colors.blue, color: Colors.blue,
border: Border.all(width: 6.0, color: Colors.white), border: Border.all(width: 6.0, color: Colors.white),
boxShadow: const [ boxShadow: const [
BoxShadow( BoxShadow(
offset: Offset(0, 0), offset: Offset(0, 0),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 10, blurRadius: 10,
color: Color.fromRGBO(0, 0, 0, 1), color: Color.fromRGBO(0, 0, 0, 1),
), ),
], ],
),
child: Center(
child: Text(
username![0],
style: TextStyle(
color: Colors.white,
fontSize: 60,
fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
), ),
), child: Center(
), child: Text(username![0],
style: const TextStyle(
color: Colors.white,
fontSize: 60,
fontWeight: FontWeight.w500),
textAlign: TextAlign.center))),
Text( Text(
username!, username!,
style: TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 17, fontSize: 17,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400),
@ -229,34 +224,32 @@ class _MainPageProfilState extends State<MainPageProfil> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
margin: const EdgeInsets.fromLTRB(15, 0, 0, 0), margin: const EdgeInsets.fromLTRB(15, 0, 0, 0),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
height: 90, height: 90,
width: 90, width: 90,
placeholder: placeholder:
"assets/images/loadingPlaceholder.gif", "assets/images/loadingPlaceholder.gif",
image: image: MyApp.controller.currentUser.track
'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'), .albumImage))),
),
),
Container( Container(
margin: const EdgeInsets.fromLTRB(12, 20, 0, 0), margin: const EdgeInsets.fromLTRB(12, 20, 0, 0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const [ children: [
Text( Text(
'BAMBINA', MyApp.controller.currentUser.track.name,
style: TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white), color: Colors.white),
), ),
Text( Text(
'PNL', MyApp.controller.currentUser.track.artist,
style: TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Colors.grey), color: Colors.grey),
@ -294,10 +287,10 @@ class _MainPageProfilState extends State<MainPageProfil> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => SettingsWidget())) builder: (context) => const SettingsWidget()))
.then((value) => setState(() { .then((value) => setState(() {
username = username =
MyApp.controller.currentUser.usernameDafl!; MyApp.controller.currentUser.usernameDafl;
})); }));
}, },
child: Row( child: Row(

@ -65,8 +65,6 @@ class TopWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
return Container( return Container(
padding: const EdgeInsets.fromLTRB(30, 0, 30, 0), padding: const EdgeInsets.fromLTRB(30, 0, 30, 0),
width: double.infinity, width: double.infinity,
@ -128,12 +126,12 @@ class TopWidget extends StatelessWidget {
'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'), 'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'),
), ),
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Container( Container(
margin: EdgeInsets.fromLTRB(12, 5, 0, 0), margin: const EdgeInsets.fromLTRB(12, 5, 0, 0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -155,21 +153,21 @@ class TopWidget extends StatelessWidget {
], ],
), ),
), ),
GradientText( const GradientText(
'7,2%', '7,2%',
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 40), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 40),
gradient: LinearGradient(colors: [ gradient: LinearGradient(colors: [
Colors.orange, Colors.orange,
Colors.red, Colors.red,
Colors.purple, Colors.purple,
]), ]),
), ),
],
),
], ],
), ),
], ],
), ),
],
),
); );
} }
} }

@ -1,8 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart'; import 'package:page_transition/page_transition.dart';
import '../../../main.dart'; import '../../../main.dart';
import '../../../model/music.dart';
import '../../../model/user.dart';
import '../sign_up/p_sign_up.dart'; import '../sign_up/p_sign_up.dart';
class SignInPage extends StatefulWidget { class SignInPage extends StatefulWidget {
@ -15,11 +13,11 @@ class SignInPage extends StatefulWidget {
class _SignInPageState extends State<SignInPage> { class _SignInPageState extends State<SignInPage> {
var boxColor = Colors.white; var boxColor = Colors.white;
@override
bool isChecked = false; bool isChecked = false;
final userNameTextField = TextEditingController(); final userNameTextField = TextEditingController();
final passwordTextField = TextEditingController(); final passwordTextField = TextEditingController();
@override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
@ -148,7 +146,7 @@ class _SignInPageState extends State<SignInPage> {
const SizedBox( const SizedBox(
height: 10, height: 10,
), ),
Container( SizedBox(
width: double.infinity, width: double.infinity,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -179,43 +177,39 @@ class _SignInPageState extends State<SignInPage> {
height: 50, height: 50,
), ),
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(22), borderRadius: BorderRadius.circular(22),
child: Material( child: Material(
child: InkWell( child: InkWell(
highlightColor: Colors.grey.shade100, highlightColor: Colors.grey.shade100,
splashColor: const Color(0xFF406DE1), splashColor: const Color(0xFF406DE1),
onTap: () { onTap: () {
checkInformations( checkInformations(
userNameTextField.text, passwordTextField.text); userNameTextField.text, passwordTextField.text);
}, },
child: Ink( child: Ink(
child: const Align( padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
alignment: Alignment.center, width: 83,
child: Icon( height: 83,
Icons.check, decoration: BoxDecoration(
color: Color(0xFF406DE1), color: Colors.white,
size: 60.0, // Set rounded corner radius
), boxShadow: [
), BoxShadow(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0), color: Colors.black.withOpacity(0.3),
width: 83, spreadRadius: 5,
height: 83, blurRadius: 7,
decoration: BoxDecoration( offset: const Offset(
color: Colors.white, // Set rounded corner radius 0, 3), // changes position of shadow
boxShadow: [ ),
BoxShadow( ],
color: Colors.black.withOpacity(0.3), ),
spreadRadius: 5, child: const Align(
blurRadius: 7, alignment: Alignment.center,
offset: const Offset( child: Icon(
0, 3), // changes position of shadow Icons.check,
), color: Color(0xFF406DE1),
], size: 60.0,
), )))))),
),
),
),
),
const SizedBox( const SizedBox(
height: 100, height: 100,
), ),

@ -43,10 +43,10 @@ class _SignUpPageState extends State<SignUpPage> {
'assets/images/Logo.png', 'assets/images/Logo.png',
width: 250, width: 250,
), ),
SizedBox( const SizedBox(
height: 45, height: 45,
), ),
Text( const Text(
"S'INSCRIRE", "S'INSCRIRE",
style: TextStyle( style: TextStyle(
fontFamily: 'DMSans', fontFamily: 'DMSans',
@ -55,36 +55,37 @@ class _SignUpPageState extends State<SignUpPage> {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( const SizedBox(
height: 10, height: 10,
), ),
Container( Container(
width: 500, width: 500,
padding: EdgeInsets.fromLTRB(45, 0, 45, 0), padding: const EdgeInsets.fromLTRB(45, 0, 45, 0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
height: 43, height: 43,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(50)), borderRadius:
const BorderRadius.all(Radius.circular(50)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 7, blurRadius: 7,
offset: offset: const Offset(
Offset(0, 3), // changes position of shadow 0, 3), // changes position of shadow
), ),
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(50, 0, 20, 0), padding: const EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField( child: TextField(
keyboardAppearance: Brightness.dark, keyboardAppearance: Brightness.dark,
controller: userNameTextField, controller: userNameTextField,
decoration: InputDecoration( decoration: const InputDecoration(
border: InputBorder.none, border: InputBorder.none,
), ),
cursorColor: Colors.purple, cursorColor: Colors.purple,
@ -92,7 +93,7 @@ class _SignUpPageState extends State<SignUpPage> {
), ),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(15, 12, 0, 0), margin: const EdgeInsets.fromLTRB(15, 12, 0, 0),
child: Image.asset( child: Image.asset(
'assets/images/profil_logo.png', 'assets/images/profil_logo.png',
height: 16, height: 16,
@ -104,32 +105,33 @@ class _SignUpPageState extends State<SignUpPage> {
)), )),
Container( Container(
width: 500, width: 500,
padding: EdgeInsets.fromLTRB(45, 10, 45, 0), padding: const EdgeInsets.fromLTRB(45, 10, 45, 0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
height: 43, height: 43,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(50)), borderRadius:
const BorderRadius.all(Radius.circular(50)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 7, blurRadius: 7,
offset: offset: const Offset(
Offset(0, 3), // changes position of shadow 0, 3), // changes position of shadow
), ),
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(50, 0, 20, 0), padding: const EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField( child: TextField(
keyboardAppearance: Brightness.dark, keyboardAppearance: Brightness.dark,
controller: passwordTextField, controller: passwordTextField,
obscureText: true, obscureText: true,
decoration: InputDecoration( decoration: const InputDecoration(
border: InputBorder.none, border: InputBorder.none,
), ),
cursorColor: Colors.purple, cursorColor: Colors.purple,
@ -137,7 +139,7 @@ class _SignUpPageState extends State<SignUpPage> {
), ),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(15, 12, 0, 0), margin: const EdgeInsets.fromLTRB(15, 12, 0, 0),
child: Image.asset( child: Image.asset(
'assets/images/password_logo.png', 'assets/images/password_logo.png',
height: 16, height: 16,
@ -149,7 +151,7 @@ class _SignUpPageState extends State<SignUpPage> {
)), )),
Container( Container(
width: 500, width: 500,
padding: EdgeInsets.fromLTRB(45, 10, 45, 0), padding: const EdgeInsets.fromLTRB(45, 10, 45, 0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
@ -157,13 +159,13 @@ class _SignUpPageState extends State<SignUpPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(50)), const BorderRadius.all(Radius.circular(50)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 7, blurRadius: 7,
offset: Offset( offset: const Offset(
0, 3), // changes position of shadow 0, 3), // changes position of shadow
), ),
])), ])),
@ -349,7 +351,7 @@ class _SignUpPageState extends State<SignUpPage> {
reverseDuration: const Duration(milliseconds: 300), reverseDuration: const Duration(milliseconds: 300),
type: PageTransitionType.leftToRightJoined, type: PageTransitionType.leftToRightJoined,
childCurrent: widget, childCurrent: widget,
child: HomePage()), child: const HomePage()),
); );
} }
} }

@ -56,6 +56,7 @@ flutter:
assets: assets:
- assets/images/ - assets/images/
- assets/fonts/ - assets/fonts/
- assets/
fonts: fonts:
- family: DMSans - family: DMSans

Loading…
Cancel
Save