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

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

@ -27,8 +27,14 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Paint.enableDithering = true; Paint.enableDithering = true;
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, SystemChrome.setEnabledSystemUIMode(
overlays: [SystemUiOverlay.top]); SystemUiMode.manual,
overlays: [SystemUiOverlay.top],
);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.dark, // For Android (dark icons)
statusBarBrightness: Brightness.dark, // For iOS (dark icons)
));
return ChangeNotifierProvider( return ChangeNotifierProvider(
create: (context) => CardProvider(), create: (context) => CardProvider(),
child: const MaterialApp( child: const MaterialApp(

@ -24,7 +24,7 @@ class User {
//constructors //constructors
User(this.usernameDafl, this.passwDafl) { User(this.usernameDafl, this.passwDafl) {
_actualiseCurrentMusic(); actualiseCurrentMusic();
} }
Music get currentMusic => _currentMusic; //lists Music get currentMusic => _currentMusic; //lists
@ -38,7 +38,7 @@ class User {
discovery.add(music); discovery.add(music);
} }
_actualiseCurrentMusic() async { actualiseCurrentMusic() async {
try { try {
_currentMusic = Music(await MyApp.api.getCurrentlyPlayingTrack()); _currentMusic = Music(await MyApp.api.getCurrentlyPlayingTrack());
} on ApiException { } on ApiException {

@ -31,6 +31,7 @@ class _MainPageProfilState extends State<MainPageProfil> {
@override @override
initState() { initState() {
username = MyApp.controller.currentUser.usernameDafl; username = MyApp.controller.currentUser.usernameDafl;
MyApp.controller.currentUser.actualiseCurrentMusic();
super.initState(); super.initState();
} }

@ -79,6 +79,7 @@ class _SignInPageState extends State<SignInPage> {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(50, 0, 20, 0), padding: const EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField( child: TextField(
keyboardAppearance: Brightness.dark,
controller: userNameTextField, controller: userNameTextField,
decoration: const InputDecoration( decoration: const InputDecoration(
border: InputBorder.none, border: InputBorder.none,
@ -123,6 +124,7 @@ class _SignInPageState extends State<SignInPage> {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(50, 0, 20, 0), padding: const EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField( child: TextField(
keyboardAppearance: Brightness.dark,
controller: passwordTextField, controller: passwordTextField,
obscureText: true, obscureText: true,
decoration: const InputDecoration( decoration: const InputDecoration(

Loading…
Cancel
Save