fix current track displayed in profile page
continuous-integration/drone/push Build is passing Details

#MSG01/chat_firebase
Lucas DELANIER 2 years ago
parent bd4543bd56
commit 4395bfe519

@ -1,4 +1,5 @@
import '../../../main.dart'; import '../../../main.dart';
import '../../../model/music.dart';
import './w_settings.dart'; import './w_settings.dart';
import './w_spot.dart'; import './w_spot.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -27,12 +28,14 @@ class MainPageProfil extends StatefulWidget {
class _MainPageProfilState extends State<MainPageProfil> { class _MainPageProfilState extends State<MainPageProfil> {
String? username = MyApp.controller.currentUser.usernameDafl; String? username = MyApp.controller.currentUser.usernameDafl;
late Music currentmusic;
@override @override
initState() { initState() {
super.initState();
username = MyApp.controller.currentUser.usernameDafl; username = MyApp.controller.currentUser.usernameDafl;
MyApp.controller.currentUser.actualiseCurrentMusic(); MyApp.controller.currentUser.actualiseCurrentMusic();
super.initState(); currentmusic = MyApp.controller.currentUser.currentMusic;
} }
@override @override
@ -243,8 +246,7 @@ class _MainPageProfilState extends State<MainPageProfil> {
width: 90, width: 90,
placeholder: placeholder:
"assets/images/loadingPlaceholder.gif", "assets/images/loadingPlaceholder.gif",
image: MyApp.controller.currentUser image: currentmusic.linkCover))),
.currentMusic.linkCover))),
Container( Container(
margin: const EdgeInsets.fromLTRB(12, 20, 0, 0), margin: const EdgeInsets.fromLTRB(12, 20, 0, 0),
child: Column( child: Column(
@ -252,15 +254,14 @@ class _MainPageProfilState extends State<MainPageProfil> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
MyApp.controller.currentUser.currentMusic.name, currentmusic.name,
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white), color: Colors.white),
), ),
Text( Text(
MyApp currentmusic.artist,
.controller.currentUser.currentMusic.artist,
style: const TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,

Loading…
Cancel
Save