diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
index ff3c8ed..ed0eead 100644
--- a/.idea/libraries/Dart_Packages.xml
+++ b/.idea/libraries/Dart_Packages.xml
@@ -5,718 +5,718 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
index 008f0f6..6ae284f 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/views/pages/main/w_discovery.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart
index 6df0077..a9c8b33 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
@@ -14,6 +14,14 @@ class DiscoveryWidget extends StatefulWidget {
}
class _DiscoveryWidgetState extends State {
+ @override
+ initState() {
+ MyApp.controller.getDiscoveries();
+ MyApp.controller.setDiscoveries();
+
+ super.initState();
+ }
+
@override
Widget build(BuildContext context) {
return Container(
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 d783e36..e0f33a4 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
@@ -1,4 +1,7 @@
+import 'package:scroll_loop_auto_scroll/scroll_loop_auto_scroll.dart';
+
import '../../../main.dart';
+import '../../../model/music.dart';
import './w_settings.dart';
import './w_spot.dart';
import 'package:flutter/material.dart';
@@ -30,6 +33,7 @@ class _MainPageProfilState extends State {
@override
initState() {
+ MyApp.controller.setCurrentMusic();
username = MyApp.controller.getIdDafl();
super.initState();
}
@@ -218,125 +222,231 @@ class _MainPageProfilState extends State {
child: riv.RiveAnimation.asset(
'assets/images/playing_animation.riv')))
]),
- Container(
- margin: const EdgeInsets.fromLTRB(0, 10, 0, 0),
- height: height * 0.14,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15.0),
- color: const Color(0xFFD9D9D9).withOpacity(0.08),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- margin: const EdgeInsets.fromLTRB(
- 15, 0, 0, 0),
- child: ClipRRect(
- borderRadius:
- BorderRadius.circular(15),
- child: FadeInImage.assetNetwork(
- height: 90,
- width: 90,
- placeholder:
+ FutureBuilder(
+ future: MyApp.controller.getCompleteMusic(
+ MyApp.controller.getCurrentMusic().id),
+ builder: (BuildContext context,
+ AsyncSnapshot snapshot) {
+ print(snapshot.connectionState);
+ if (snapshot.connectionState ==
+ ConnectionState.waiting) {
+ return Container(
+ margin:
+ const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ height: height * 0.14,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(15.0),
+ color: const Color(0xFFD9D9D9)
+ .withOpacity(0.08),
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment:
+ CrossAxisAlignment.center,
+ children: [
+ Container(
+ margin: const EdgeInsets.fromLTRB(
+ 15, 0, 0, 0),
+ child: ClipRRect(
+ borderRadius:
+ BorderRadius.circular(10),
+ child: Image.asset(
"assets/images/loadingPlaceholder.gif",
- image: MyApp.controller
- .getCurrentMusic()
- .linkCover))),
- Container(
- margin: const EdgeInsets.fromLTRB(
- 12, 20, 0, 0),
- child: Column(
+ height: 90,
+ width: 90))),
+ Container(
+ margin: const EdgeInsets.fromLTRB(
+ 12, 20, 0, 0),
+ child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
- Text(
- MyApp.controller
- .getCurrentMusic()
- .name,
- style: const TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w500,
- color: Colors.white),
+ Container(
+ width: 150,
+ height: 20,
+ decoration: BoxDecoration(
+ borderRadius:
+ BorderRadius.circular(5.0),
+ color: Colors.grey
+ .withOpacity(0.7),
+ ),
+ ),
+ SizedBox(
+ height: 10,
),
- Text(
- MyApp.controller
- .getCurrentMusic()
- .artist,
- style: const TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w400,
- color: Colors.grey))
- ])),
- const Spacer(),
- Container(
- height: 55,
- width: double.infinity,
+ Container(
+ width: 100,
+ height: 20,
+ decoration: BoxDecoration(
+ borderRadius:
+ BorderRadius.circular(5.0),
+ color: Colors.grey
+ .withOpacity(0.4),
+ ),
+ ),
+ ],
+ ),
+ )
+ ],
+ ),
+ );
+ } else if (snapshot.connectionState ==
+ ConnectionState.done) {
+ if (snapshot.hasError) {
+ return const Text('Error');
+ } else if (snapshot.hasData) {
+ return Container(
+ margin: const EdgeInsets.fromLTRB(
+ 0, 10, 0, 0),
+ height: height * 0.14,
decoration: BoxDecoration(
borderRadius:
- BorderRadius.circular(10.0),
- color: Colors.transparent,
+ BorderRadius.circular(15.0),
+ color: const Color(0xFFD9D9D9)
+ .withOpacity(0.08),
),
- margin: const EdgeInsets.fromLTRB(
- 30, 0, 30, 0),
- child: SizedBox(
- height: 55,
- width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor:
- const Color(0xFFD9D9D9)
- .withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius:
- BorderRadius.circular(
- 10.0),
- ), // background// foreground
+ child: Row(
+ mainAxisAlignment:
+ MainAxisAlignment.start,
+ crossAxisAlignment:
+ CrossAxisAlignment.center,
+ children: [
+ Container(
+ margin:
+ const 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: snapshot
+ .data!.linkCover))),
+ Container(
+ margin: const EdgeInsets.fromLTRB(
+ 12, 20, 0, 0),
+ child: Column(
+ mainAxisAlignment:
+ MainAxisAlignment.start,
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ snapshot.data!.name.length >
+ 22
+ ? SizedBox(
+ width: 220,
+ child:
+ ScrollLoopAutoScroll(
+ delayAfterScrollInput:
+ Duration(
+ seconds: 1),
+ delay: Duration(
+ seconds: 1),
+ child: Text(
+ snapshot
+ .data!.name,
+ style: TextStyle(
+ fontSize: 20,
+ color: Colors
+ .white,
+ fontWeight:
+ FontWeight
+ .bold),
+ ),
+ duration: Duration(
+ seconds: 100),
+ scrollDirection:
+ Axis.horizontal,
+ ),
+ )
+ : Text(
+ snapshot.data!.name,
+ style: TextStyle(
+ fontSize: 20,
+ color:
+ Colors.white,
+ fontWeight:
+ FontWeight
+ .bold),
+ ),
+ Text(
+ snapshot.data!.artist,
+ style: const TextStyle(
+ fontSize: 16,
+ fontWeight:
+ FontWeight.w400,
+ color: Colors.grey),
+ ),
+ ],
),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) =>
- const SettingsWidget()))
- .then(
- (value) => setState(() {
- username = MyApp
- .controller
- .getIdDafl()
- .toString();
- }));
- },
- child: Row(children: [
- const Icon(
- Icons.settings,
- color: Colors.white,
- size: 30,
- ),
- const SizedBox(
- width: 12,
- ),
- const Text(
- "Paramètres",
- style: TextStyle(
- color: Colors.white,
- fontSize: 17,
- fontWeight:
- FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- const Spacer(),
- Icon(
- Icons.arrow_forward_ios,
- color: Colors.white
- .withOpacity(0.3),
- )
- ])))),
- const Spacer()
- ]))
- ]))
+ )
+ ]));
+ } else {
+ return const Text('Empty data');
+ }
+ } else {
+ return Text(
+ 'State: ${snapshot.connectionState}');
+ }
+ }),
+ ])),
+ const Spacer(),
+ Container(
+ height: 55,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
+ ),
+ margin: const EdgeInsets.fromLTRB(30, 0, 30, 0),
+ child: SizedBox(
+ height: 55,
+ width: double.infinity,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor:
+ const Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ), // background// foreground
+ ),
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ const SettingsWidget()));
+ },
+ child: Row(children: [
+ const Icon(
+ Icons.settings,
+ color: Colors.white,
+ size: 30,
+ ),
+ const SizedBox(
+ width: 12,
+ ),
+ const Text(
+ "Paramètres",
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 17,
+ fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ const Spacer(),
+ Icon(
+ Icons.arrow_forward_ios,
+ color: Colors.white.withOpacity(0.3),
+ )
+ ])))),
+ const Spacer()
])));
}
}
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 a6bb740..096b598 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
@@ -196,26 +196,8 @@ class _SignUpPageState extends State {
padding: const EdgeInsets.fromLTRB(45, 10, 45, 0),
child: Stack(
children: [
- Container(
- height: 43,
- decoration: BoxDecoration(
- color: const Color(0xFF24CF5F),
- borderRadius:
- const BorderRadius.all(Radius.circular(50)),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withOpacity(0.3),
- spreadRadius: 5,
- blurRadius: 7,
- offset: const Offset(
- 0, 3), // changes position of shadow
- ),
- ],
- ),
- ),
SizedBox(
height: 43,
- width: width * 0.75,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF24CF5F),
@@ -343,6 +325,7 @@ class _SignUpPageState extends State {
} else if (password != confirmPassword) {
notify(1, context);
} else {
+ MyApp.controller.save(username, password);
// create user in database
Navigator.of(context).push(
@@ -354,5 +337,5 @@ class _SignUpPageState extends State {
child: const HomePage()),
);
}
+ }
}
-}