From e4364cfb1e8977d108dbd654113283ccc51700c1 Mon Sep 17 00:00:00 2001 From: emkartal1 Date: Wed, 2 Aug 2023 20:44:13 +0200 Subject: [PATCH 1/4] Starting Notification --- Sources/justMUSIC/android/app/build.gradle | 1 + Sources/justMUSIC/lib/main.dart | 2 ++ .../lib/services/NotificationService.dart | 18 ++++++++++++++ Sources/justMUSIC/pubspec.lock | 24 +++++++++++++++++++ Sources/justMUSIC/pubspec.yaml | 1 + 5 files changed, 46 insertions(+) create mode 100644 Sources/justMUSIC/lib/services/NotificationService.dart diff --git a/Sources/justMUSIC/android/app/build.gradle b/Sources/justMUSIC/android/app/build.gradle index 97e5ae2..f318bc7 100644 --- a/Sources/justMUSIC/android/app/build.gradle +++ b/Sources/justMUSIC/android/app/build.gradle @@ -24,6 +24,7 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { diff --git a/Sources/justMUSIC/lib/main.dart b/Sources/justMUSIC/lib/main.dart index 7baa4cb..b9448c7 100644 --- a/Sources/justMUSIC/lib/main.dart +++ b/Sources/justMUSIC/lib/main.dart @@ -16,6 +16,7 @@ import 'package:justmusic/screens/post_screen.dart'; import 'package:justmusic/screens/profile_screen.dart'; import 'package:justmusic/screens/registration_screen.dart'; import 'package:justmusic/screens/welcome_screen.dart'; +import 'package:justmusic/services/NotificationService.dart'; import 'package:justmusic/values/constants.dart'; import 'package:justmusic/view_model/MusicViewModel.dart'; import 'package:justmusic/view_model/PostViewModel.dart'; @@ -28,6 +29,7 @@ Future main() async { await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); + await NotificationService().initNotifications(); runApp(const MyApp()); } diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart new file mode 100644 index 0000000..8582741 --- /dev/null +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -0,0 +1,18 @@ +import 'package:firebase_messaging/firebase_messaging.dart'; + +class NotificationService { + final _firebaseMessaging = FirebaseMessaging.instance; + + Future handleBackgroundMessage(RemoteMessage message) async { + print('Title: ${message.notification?.title}'); + print('Body: ${message.notification?.body}'); + print('Payload: ${message.data}'); + } + + Future initNotifications() async { + await _firebaseMessaging.requestPermission(); + final token = await _firebaseMessaging.getToken(); + print("Grrrpaw:"+token!); + //FirebaseMessaging.onBackgroundMessage(handleBackgroundMessage); + } +} \ No newline at end of file diff --git a/Sources/justMUSIC/pubspec.lock b/Sources/justMUSIC/pubspec.lock index 30973dd..9fc8484 100644 --- a/Sources/justMUSIC/pubspec.lock +++ b/Sources/justMUSIC/pubspec.lock @@ -337,6 +337,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.6.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0" + url: "https://pub.dev" + source: hosted + version: "14.6.5" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a + url: "https://pub.dev" + source: hosted + version: "4.5.4" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7" + url: "https://pub.dev" + source: hosted + version: "3.5.4" firebase_storage: dependency: "direct main" description: diff --git a/Sources/justMUSIC/pubspec.yaml b/Sources/justMUSIC/pubspec.yaml index d56b47b..98020d4 100644 --- a/Sources/justMUSIC/pubspec.yaml +++ b/Sources/justMUSIC/pubspec.yaml @@ -72,6 +72,7 @@ dependencies: animations: ^2.0.7 flutter_svg: ^2.0.7 flutter_keyboard_visibility: ^5.4.1 + firebase_messaging: ^14.6.5 dev_dependencies: flutter_test: -- 2.36.3 From 5ef83b3340c984fc6df0cb123dfb244b24ba0267 Mon Sep 17 00:00:00 2001 From: emkartal1 Date: Thu, 3 Aug 2023 02:33:04 +0200 Subject: [PATCH 2/4] Add Function sendPushMessage and fix error UserService --- Sources/justMUSIC/lib/main.dart | 56 ++++++++++--------- Sources/justMUSIC/lib/model/User.dart | 11 +++- .../lib/model/mapper/UserMapper.dart | 1 + .../justMUSIC/lib/services/AuthService.dart | 10 ++++ .../lib/services/NotificationService.dart | 42 +++++++++----- .../justMUSIC/lib/services/PostService.dart | 2 +- .../justMUSIC/lib/services/UserService.dart | 27 +++++++-- .../lib/view_model/UserViewModel.dart | 29 ++++++++-- 8 files changed, 123 insertions(+), 55 deletions(-) diff --git a/Sources/justMUSIC/lib/main.dart b/Sources/justMUSIC/lib/main.dart index b9448c7..577a1d4 100644 --- a/Sources/justMUSIC/lib/main.dart +++ b/Sources/justMUSIC/lib/main.dart @@ -3,6 +3,7 @@ import 'package:audioplayers/audioplayers.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -16,7 +17,6 @@ import 'package:justmusic/screens/post_screen.dart'; import 'package:justmusic/screens/profile_screen.dart'; import 'package:justmusic/screens/registration_screen.dart'; import 'package:justmusic/screens/welcome_screen.dart'; -import 'package:justmusic/services/NotificationService.dart'; import 'package:justmusic/values/constants.dart'; import 'package:justmusic/view_model/MusicViewModel.dart'; import 'package:justmusic/view_model/PostViewModel.dart'; @@ -29,7 +29,7 @@ Future main() async { await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); - await NotificationService().initNotifications(); + await FirebaseMessaging.instance.requestPermission(sound: true); runApp(const MyApp()); } @@ -63,7 +63,8 @@ class _MyAppState extends State { print('User is currently signed out!'); return null; } else { - MyApp.userViewModel.userCurrent = (await (MyApp.userViewModel.getUser(user.uid)))!; + MyApp.userViewModel.userCurrent = + (await (MyApp.userViewModel.getUser(user.uid)))!; userCurrent = Stream.value(MyApp.userViewModel.userCurrent); print('User is signed in!'); } @@ -112,31 +113,32 @@ class _MyAppState extends State { ), home: FirebaseAuth.instance.currentUser != null ? StreamBuilder( - stream: userCurrent, - initialData: null, - builder: (context, snapshot) { - if (snapshot.hasData) { - print("hasdata"); + stream: userCurrent, + initialData: null, + builder: (context, snapshot) { + if (snapshot.hasData) { + print("hasdata"); - return AnimatedSwitcher( - duration: Duration(milliseconds: 1000), - transitionBuilder: (child, animation) { - return FadeTransition(opacity: animation, child: child); - }, - child: FeedScreen(), - ); - } else { - return Scaffold( - backgroundColor: bgColor, - body: Center( - child: Image( - image: AssetImage("assets/images/logo.png"), - width: 130, - ), - ), - ); - } - }) + return AnimatedSwitcher( + duration: Duration(milliseconds: 1000), + transitionBuilder: (child, animation) { + return FadeTransition( + opacity: animation, child: child); + }, + child: FeedScreen(), + ); + } else { + return Scaffold( + backgroundColor: bgColor, + body: Center( + child: Image( + image: AssetImage("assets/images/logo.png"), + width: 130, + ), + ), + ); + } + }) : WellcomeScreen()); }, designSize: Size(390, 844), diff --git a/Sources/justMUSIC/lib/model/User.dart b/Sources/justMUSIC/lib/model/User.dart index 2507da7..d88a05e 100644 --- a/Sources/justMUSIC/lib/model/User.dart +++ b/Sources/justMUSIC/lib/model/User.dart @@ -4,13 +4,14 @@ class User { String _uniquePseudo; String _mail; String _pp; + String _token; List _followers; int _capsules; List _followed; // Constructor - User(this._id, this._pseudo, this._uniquePseudo, this._mail, - this._pp, this._followers, this._capsules, this._followed); + User(this._id, this._pseudo, this._uniquePseudo, this._mail, this._pp, + this._token, this._followers, this._capsules, this._followed); //Getters and setters String get id => _id; @@ -39,6 +40,12 @@ class User { _pp = value; } + String get token => _token; + + set token(String value) { + _token = value; + } + int get capsules => _capsules; set capsules(int value) { diff --git a/Sources/justMUSIC/lib/model/mapper/UserMapper.dart b/Sources/justMUSIC/lib/model/mapper/UserMapper.dart index 7d4c6c1..7d0c5ab 100644 --- a/Sources/justMUSIC/lib/model/mapper/UserMapper.dart +++ b/Sources/justMUSIC/lib/model/mapper/UserMapper.dart @@ -10,6 +10,7 @@ class UserMapper { data?["unique_id"], data?["mail"], data?["picture"], + data?["token_notify"], List.from(data?["followers"] as List), data?["nbCapsules"] ?? 0, List.from(data?["followed"] as List)); diff --git a/Sources/justMUSIC/lib/services/AuthService.dart b/Sources/justMUSIC/lib/services/AuthService.dart index 818fddf..39ba6c2 100644 --- a/Sources/justMUSIC/lib/services/AuthService.dart +++ b/Sources/justMUSIC/lib/services/AuthService.dart @@ -1,15 +1,24 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/foundation.dart'; import '../main.dart'; class AuthService { register(String pseudo, String email, String password) async { try { + var token; final data = await FirebaseAuth.instance.createUserWithEmailAndPassword( email: email, password: password, ); + if (kIsWeb) { + token = "empty"; + } else { + token = await FirebaseMessaging.instance.getToken(); + } + String uniqueId = await generateUniqueId(pseudo); final user = { @@ -19,6 +28,7 @@ class AuthService { "followed": [], "nbCapsules": 0, "followers": [], + "token_notify": token, "picture": "https://firebasestorage.googleapis.com/v0/b/justmusic-435d5.appspot.com/o/justMusicDefaultImage.png?alt=media&token=020d0fcb-b7df-4d4d-b380-e99597293fcc" }; diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart index 8582741..e37f2b3 100644 --- a/Sources/justMUSIC/lib/services/NotificationService.dart +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -1,18 +1,30 @@ -import 'package:firebase_messaging/firebase_messaging.dart'; +import 'dart:convert'; +import 'package:http/http.dart' as http; class NotificationService { - final _firebaseMessaging = FirebaseMessaging.instance; - - Future handleBackgroundMessage(RemoteMessage message) async { - print('Title: ${message.notification?.title}'); - print('Body: ${message.notification?.body}'); - print('Payload: ${message.data}'); - } - - Future initNotifications() async { - await _firebaseMessaging.requestPermission(); - final token = await _firebaseMessaging.getToken(); - print("Grrrpaw:"+token!); - //FirebaseMessaging.onBackgroundMessage(handleBackgroundMessage); + sendPushMessage(String token, String title, String body) async { + try { + await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'key=' + }, + body: jsonEncode({ + 'priority': 'high', + 'data': { + 'click_action': 'FLUTTER_NOTIFICATION_CLICK', + 'status': 'done', + 'body': body, + 'title': title + }, + "notification": { + "title": title, + "body": body, + }, + "to": token, + })); + } catch (e) { + print("error push notification"); + } } -} \ No newline at end of file +} diff --git a/Sources/justMUSIC/lib/services/PostService.dart b/Sources/justMUSIC/lib/services/PostService.dart index 7e71ff4..4f86827 100644 --- a/Sources/justMUSIC/lib/services/PostService.dart +++ b/Sources/justMUSIC/lib/services/PostService.dart @@ -56,7 +56,7 @@ class PostService { .get(); var filteredPosts = response.docs.where((doc) { - String user = doc["user_id"]; // Assuming the field name is "date" + String user = doc["user_id"]; return user != MyApp.userViewModel.userCurrent.id; }).toList(); return filteredPosts; diff --git a/Sources/justMUSIC/lib/services/UserService.dart b/Sources/justMUSIC/lib/services/UserService.dart index 0a66793..b299f3d 100644 --- a/Sources/justMUSIC/lib/services/UserService.dart +++ b/Sources/justMUSIC/lib/services/UserService.dart @@ -3,11 +3,14 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import '../main.dart'; class UserService { - Future>>> getUsersByIdUnique(String uniqueId) async { - QuerySnapshot> response = await FirebaseFirestore.instance + Future>>> getUsersByIdUnique( + String uniqueId) async { + QuerySnapshot> response = await FirebaseFirestore + .instance .collection("users") .where("unique_id", isGreaterThanOrEqualTo: uniqueId) - .where("unique_id", isLessThanOrEqualTo: uniqueId + "zzzzzzzzzzzzzzzzzzzzzzzzzzzz") + .where("unique_id", + isLessThanOrEqualTo: uniqueId + "zzzzzzzzzzzzzzzzzzzzzzzzzzzz") .limit(20) .get(); var users = response.docs.where((doc) { @@ -18,8 +21,20 @@ class UserService { return users; } + updateTokenNotify(String idUser, String token) { + FirebaseFirestore.instance + .collection('users') + .doc(idUser) + .update({'token_notify': token}).then((_) { + print("Mise à jour réussie !"); + }).catchError((error) { + print("Erreur lors de la mise à jour : $error"); + }); + } + addOrDeleteFriend(String id) async { - var userRef = MyApp.db.collection("users").doc(MyApp.userViewModel.userCurrent.id); + var userRef = + MyApp.db.collection("users").doc(MyApp.userViewModel.userCurrent.id); var actionUserRef = MyApp.db.collection("users").doc(id); if (MyApp.userViewModel.isFriend(id)) { @@ -28,7 +43,7 @@ class UserService { 'followed': FieldValue.arrayRemove([id]) }); transaction.update(actionUserRef, { - 'followers': FieldValue.arrayRemove([id]) + 'followers': FieldValue.arrayRemove([userRef.id]) }); }); MyApp.userViewModel.userCurrent.followed.remove(id); @@ -38,7 +53,7 @@ class UserService { 'followed': FieldValue.arrayUnion([id]) }); transaction.update(actionUserRef, { - 'followers': FieldValue.arrayUnion([id]) + 'followers': FieldValue.arrayUnion([userRef.id]) }); }); MyApp.userViewModel.userCurrent.followed.add(id); diff --git a/Sources/justMUSIC/lib/view_model/UserViewModel.dart b/Sources/justMUSIC/lib/view_model/UserViewModel.dart index 1817835..b3cf791 100644 --- a/Sources/justMUSIC/lib/view_model/UserViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/UserViewModel.dart @@ -1,4 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart' as firebase_auth; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/foundation.dart'; import 'package:justmusic/services/AuthService.dart'; import 'package:justmusic/services/UserService.dart'; @@ -27,8 +29,20 @@ class UserViewModel { login(String pseudo, String password) async { try { + var token; await authService.login(pseudo, password); - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); + if (!kIsWeb) { + token = await FirebaseMessaging.instance.getToken(); + if (MyApp.userViewModel.userCurrent.token != token) { + _userService.updateTokenNotify( + MyApp.userViewModel.userCurrent.id, token); + MyApp.userViewModel.userCurrent.token = token; + } + } User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -43,7 +57,10 @@ class UserViewModel { updateUserCurrent() async { try { - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -58,7 +75,10 @@ class UserViewModel { try { await authService.register(pseudo.toLowerCase(), email, password); - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -68,7 +88,8 @@ class UserViewModel { Future> getUsersByUniqueId(String uniqueId) async { try { - var response = await _userService.getUsersByIdUnique(uniqueId.toLowerCase()); + var response = + await _userService.getUsersByIdUnique(uniqueId.toLowerCase()); var users = response.map((value) { return UserMapper.toModel(value); }).toList(); -- 2.36.3 From 1a723656feecd09098759588c3400de1a24cb09d Mon Sep 17 00:00:00 2001 From: Emre Date: Thu, 3 Aug 2023 12:58:38 +0200 Subject: [PATCH 3/4] Add Key Serveur and test work --- Sources/justMUSIC/lib/services/NotificationService.dart | 3 ++- Sources/justMUSIC/test/Notification_test.dart | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Sources/justMUSIC/test/Notification_test.dart diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart index e37f2b3..9f583b7 100644 --- a/Sources/justMUSIC/lib/services/NotificationService.dart +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -7,7 +7,8 @@ class NotificationService { await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), headers: { 'Content-Type': 'application/json', - 'Authorization': 'key=' + 'Authorization': + 'key=AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC' }, body: jsonEncode({ 'priority': 'high', diff --git a/Sources/justMUSIC/test/Notification_test.dart b/Sources/justMUSIC/test/Notification_test.dart new file mode 100644 index 0000000..bf9f23c --- /dev/null +++ b/Sources/justMUSIC/test/Notification_test.dart @@ -0,0 +1,6 @@ +import 'package:justmusic/services/NotificationService.dart'; + +Future main() async { + var notif = NotificationService(); + await notif.sendPushMessage("cAJAJw_aR7yPQbFTMS-r6H:APA91bEZs34Ab3-xSYeIGykHrxD5pRj-OyODaEcNBPtds1eLzEH0uzFkzCSQY7BvZQHEFPfeHSN7nri4webskXbu1zzgwe9NIdPagsc6IHaouuewWqWd9V7ucTeDeYt1Sbby4-pb6jtA", "Just Music", "Vien voir les nouveautés"); +} \ No newline at end of file -- 2.36.3 From 2c9b8c1336cc5d50fc7d979c8434974db4215d70 Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Thu, 3 Aug 2023 13:16:06 +0200 Subject: [PATCH 4/4] Merge with master --- .../lib/components/comment_component.dart | 136 +- .../lib/components/post_component.dart | 876 +++---- .../lib/components/top_nav_bar_component.dart | 538 ++--- .../lib/model/mapper/CommentMapper.dart | 34 +- .../lib/screens/detail_post_screen.dart | 902 +++---- .../justMUSIC/lib/screens/feed_screen.dart | 600 ++--- .../lib/services/CommentService.dart | 54 +- .../lib/services/NotificationService.dart | 62 +- .../lib/view_model/CommentViewModel.dart | 74 +- Sources/justMUSIC/pubspec.lock | 2084 ++++++++--------- Sources/justMUSIC/pubspec.yaml | 258 +- Sources/justMUSIC/test/Notification_test.dart | 10 +- 12 files changed, 2814 insertions(+), 2814 deletions(-) diff --git a/Sources/justMUSIC/lib/components/comment_component.dart b/Sources/justMUSIC/lib/components/comment_component.dart index 2f86d14..31878e6 100644 --- a/Sources/justMUSIC/lib/components/comment_component.dart +++ b/Sources/justMUSIC/lib/components/comment_component.dart @@ -1,68 +1,68 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; - -import '../values/constants.dart'; - -class CommentComponent extends StatelessWidget { - const CommentComponent({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - decoration: BoxDecoration(color: bgComment, borderRadius: BorderRadius.circular(20)), - padding: EdgeInsets.all(20), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: AssetImage("assets/images/exemple_profile.png"), - width: 40, - ), - ), - ), - Expanded( - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 10, - ), - Text( - "Melina", - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), - ), - Padding( - padding: EdgeInsets.only(top: 6, left: 10), - child: Text( - "Il y a 2 min(s)", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.6), fontWeight: FontWeight.w400, fontSize: 10), - ), - ), - ], - ), - SizedBox( - height: 8, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: Text( - "J’adore ce son aussi, je trouve qu’il avait vraiment une plume de fou.", - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w300, fontSize: 11), - ), - ), - ], - ), - ) - ], - ), - ); - } -} +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +import '../values/constants.dart'; + +class CommentComponent extends StatelessWidget { + const CommentComponent({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + decoration: BoxDecoration(color: bgComment, borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.all(20), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: AssetImage("assets/images/exemple_profile.png"), + width: 40, + ), + ), + ), + Expanded( + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 10, + ), + Text( + "Melina", + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + ), + Padding( + padding: EdgeInsets.only(top: 6, left: 10), + child: Text( + "Il y a 2 min(s)", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.6), fontWeight: FontWeight.w400, fontSize: 10), + ), + ), + ], + ), + SizedBox( + height: 8, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + "J’adore ce son aussi, je trouve qu’il avait vraiment une plume de fou.", + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w300, fontSize: 11), + ), + ), + ], + ), + ) + ], + ), + ); + } +} diff --git a/Sources/justMUSIC/lib/components/post_component.dart b/Sources/justMUSIC/lib/components/post_component.dart index 4b1b9a2..4c912e5 100644 --- a/Sources/justMUSIC/lib/components/post_component.dart +++ b/Sources/justMUSIC/lib/components/post_component.dart @@ -1,438 +1,438 @@ -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:gradient_borders/box_borders/gradient_box_border.dart'; -import 'package:text_scroll/text_scroll.dart'; -import 'package:zoom_tap_animation/zoom_tap_animation.dart'; - -import '../model/Post.dart'; - -class PostComponent extends StatefulWidget { - final Function(int)? callback; - final Post post; - final int index; - - PostComponent({Key? key, required this.callback, required this.post, required this.index}) : super(key: key); - - @override - State createState() => _PostComponentState(); -} - -class _PostComponentState extends State with TickerProviderStateMixin { - bool choice = false; - DateTime today = DateTime.now(); - - void switchChoice() { - setState(() { - choice = !choice; - }); - } - - @override - void initState() { - print("post: ${widget.post.date.toString()}"); - print("ajrd: ${DateTime.now().toString()}"); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: switchChoice, - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - if (widget.callback == null) { - return SizedBox( - width: double.infinity, - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: NetworkImage(widget.post.user.pp), - width: 40, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.post.user.pseudo, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), - ), - widget.post.location.item2 != null - ? Text( - "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - : Text( - "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - ], - ), - ), - ), - DateTime(today.year, today.month, today.day).isAtSameMomentAs( - DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) - ? Text( - "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ) - : Text( - "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ), - ], - ), - SizedBox(height: 10), - ZoomTapAnimation( - onTap: () { - if (widget.post.selfie != null) { - switchChoice(); - } - }, - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - end: 0.99, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: AspectRatio( - aspectRatio: 1 / 1, - child: Container( - decoration: BoxDecoration( - // add border - border: const GradientBoxBorder( - gradient: LinearGradient(colors: [ - Colors.transparent, - Color(0xFF323232), - ], begin: Alignment.topCenter, end: Alignment.bottomCenter), - width: 2.5, - ), - // set border radius - borderRadius: BorderRadius.circular(20), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(18), - // implement image - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image( - image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!), - fit: BoxFit.cover, - width: double.infinity, - ), - widget.post.selfie != null - ? Positioned( - top: 0, - right: 0, - child: Padding( - padding: EdgeInsets.all(12), - child: Container( - constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 90.sp, - height: 90.sp, - decoration: BoxDecoration( - color: Colors.white, - // add border - border: Border.all(width: 3, color: Colors.white), - // set border radius - borderRadius: BorderRadius.circular(15), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(13), - // implement image - child: Image( - image: NetworkImage( - choice ? widget.post.music.cover! : widget.post.selfie!), - fit: BoxFit.cover, - ), - ), - ), - )) - : Container(), - ], - ), - ), - ), - )), - SizedBox(height: 15), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - flex: 8, - child: TextScroll( - widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), - )), - Padding( - padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w), - child: ClipOval( - child: Container( - width: 5.h, - height: 5.h, - color: Colors.white, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: EdgeInsets.only(bottom: 2), - child: TextScroll( - widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h), - mode: TextScrollMode.endless, - velocity: Velocity(pixelsPerSecond: Offset(50, 20)), - pauseBetween: Duration(milliseconds: 500), - ), - )), - Container(width: 10), - AutoSizeText( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h), - textAlign: TextAlign.end, - maxFontSize: 20, - ), - ], - ), - ], - )); - } - - return SizedBox( - width: double.infinity, - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: NetworkImage(widget.post.user.pp), - width: 40, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.post.user.pseudo, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), - ), - widget.post.location.item2 != null - ? Text( - "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - : Text( - "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - ], - ), - ), - ), - DateTime(today.year, today.month, today.day).isAtSameMomentAs( - DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) - ? Text( - "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ) - : Text( - "hier, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ), - ], - ), - SizedBox(height: 10), - ZoomTapAnimation( - onTap: () { - widget.callback!(widget.index); - }, - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - end: 0.99, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: AspectRatio( - aspectRatio: 1 / 1, - child: Container( - decoration: BoxDecoration( - // add border - border: const GradientBoxBorder( - gradient: LinearGradient(colors: [ - Colors.transparent, - Color(0xFF323232), - ], begin: Alignment.topCenter, end: Alignment.bottomCenter), - width: 2.5, - ), - // set border radius - borderRadius: BorderRadius.circular(20), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(18), - // implement image - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image( - image: NetworkImage(widget.post.music.cover!), - fit: BoxFit.cover, - width: double.infinity, - ), - Image( - image: AssetImage("assets/images/shadow_post.png"), - opacity: AnimationController(vsync: this, value: 0.7), - fit: BoxFit.fitHeight, - width: double.infinity, - ), - widget.post.description == null - ? Container() - : Padding( - padding: EdgeInsets.all(15), - child: AutoSizeText( - '“${widget.post.description}”', - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15.sp), - maxFontSize: 20, - maxLines: 1, - ), - ), - widget.post.selfie != null - ? Positioned( - top: 0, - right: 0, - child: Padding( - padding: EdgeInsets.all(12), - child: Container( - constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 90.sp, - height: 90.sp, - decoration: BoxDecoration( - color: Colors.white, - // add border - border: Border.all(width: 3, color: Colors.white), - // set border radius - borderRadius: BorderRadius.circular(15), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(13), - // implement image - child: Image( - image: NetworkImage(widget.post.selfie!), - fit: BoxFit.cover, - ), - ), - ), - )) - : Container(), - ], - ), - ), - ), - )), - SizedBox(height: 15), - SizedBox( - height: 60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Padding( - padding: EdgeInsets.only(bottom: 2), - child: TextScroll( - widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - mode: TextScrollMode.endless, - velocity: Velocity(pixelsPerSecond: Offset(50, 20)), - pauseBetween: Duration(milliseconds: 500), - ), - )), - Container(width: 10), - AutoSizeText( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - textAlign: TextAlign.end, - maxFontSize: 20, - ), - ], - ), - Expanded( - flex: 8, - child: TextScroll( - widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white.withOpacity(0.5), - fontWeight: FontWeight.w300, - fontSize: 16.h), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), - )), - ], - ), - ) - ], - )); - }, - ), - ); - } -} +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:gradient_borders/box_borders/gradient_box_border.dart'; +import 'package:text_scroll/text_scroll.dart'; +import 'package:zoom_tap_animation/zoom_tap_animation.dart'; + +import '../model/Post.dart'; + +class PostComponent extends StatefulWidget { + final Function(int)? callback; + final Post post; + final int index; + + PostComponent({Key? key, required this.callback, required this.post, required this.index}) : super(key: key); + + @override + State createState() => _PostComponentState(); +} + +class _PostComponentState extends State with TickerProviderStateMixin { + bool choice = false; + DateTime today = DateTime.now(); + + void switchChoice() { + setState(() { + choice = !choice; + }); + } + + @override + void initState() { + print("post: ${widget.post.date.toString()}"); + print("ajrd: ${DateTime.now().toString()}"); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: switchChoice, + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + if (widget.callback == null) { + return SizedBox( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: NetworkImage(widget.post.user.pp), + width: 40, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: const EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.user.pseudo, + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + ), + widget.post.location.item2 != null + ? Text( + "${widget.post.location.item1}, ${widget.post.location.item2}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + : Text( + "", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + ], + ), + ), + ), + DateTime(today.year, today.month, today.day).isAtSameMomentAs( + DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) + ? Text( + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ) + : Text( + "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ), + ], + ), + SizedBox(height: 10), + ZoomTapAnimation( + onTap: () { + if (widget.post.selfie != null) { + switchChoice(); + } + }, + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.99, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: AspectRatio( + aspectRatio: 1 / 1, + child: Container( + decoration: BoxDecoration( + // add border + border: const GradientBoxBorder( + gradient: LinearGradient(colors: [ + Colors.transparent, + Color(0xFF323232), + ], begin: Alignment.topCenter, end: Alignment.bottomCenter), + width: 2.5, + ), + // set border radius + borderRadius: BorderRadius.circular(20), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + // implement image + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + Image( + image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!), + fit: BoxFit.cover, + width: double.infinity, + ), + widget.post.selfie != null + ? Positioned( + top: 0, + right: 0, + child: Padding( + padding: EdgeInsets.all(12), + child: Container( + constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), + width: 90.sp, + height: 90.sp, + decoration: BoxDecoration( + color: Colors.white, + // add border + border: Border.all(width: 3, color: Colors.white), + // set border radius + borderRadius: BorderRadius.circular(15), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(13), + // implement image + child: Image( + image: NetworkImage( + choice ? widget.post.music.cover! : widget.post.selfie!), + fit: BoxFit.cover, + ), + ), + ), + )) + : Container(), + ], + ), + ), + ), + )), + SizedBox(height: 15), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 8, + child: TextScroll( + widget.post.music.artists.first.name!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + )), + Padding( + padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w), + child: ClipOval( + child: Container( + width: 5.h, + height: 5.h, + color: Colors.white, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: EdgeInsets.only(bottom: 2), + child: TextScroll( + widget.post.music.title!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h), + mode: TextScrollMode.endless, + velocity: Velocity(pixelsPerSecond: Offset(50, 20)), + pauseBetween: Duration(milliseconds: 500), + ), + )), + Container(width: 10), + AutoSizeText( + widget.post.music.date.toString(), + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h), + textAlign: TextAlign.end, + maxFontSize: 20, + ), + ], + ), + ], + )); + } + + return SizedBox( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: NetworkImage(widget.post.user.pp), + width: 40, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: const EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.user.pseudo, + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + ), + widget.post.location.item2 != null + ? Text( + "${widget.post.location.item1}, ${widget.post.location.item2}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + : Text( + "", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + ], + ), + ), + ), + DateTime(today.year, today.month, today.day).isAtSameMomentAs( + DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) + ? Text( + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ) + : Text( + "hier, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ), + ], + ), + SizedBox(height: 10), + ZoomTapAnimation( + onTap: () { + widget.callback!(widget.index); + }, + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.99, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: AspectRatio( + aspectRatio: 1 / 1, + child: Container( + decoration: BoxDecoration( + // add border + border: const GradientBoxBorder( + gradient: LinearGradient(colors: [ + Colors.transparent, + Color(0xFF323232), + ], begin: Alignment.topCenter, end: Alignment.bottomCenter), + width: 2.5, + ), + // set border radius + borderRadius: BorderRadius.circular(20), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + // implement image + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + Image( + image: NetworkImage(widget.post.music.cover!), + fit: BoxFit.cover, + width: double.infinity, + ), + Image( + image: AssetImage("assets/images/shadow_post.png"), + opacity: AnimationController(vsync: this, value: 0.7), + fit: BoxFit.fitHeight, + width: double.infinity, + ), + widget.post.description == null + ? Container() + : Padding( + padding: EdgeInsets.all(15), + child: AutoSizeText( + '“${widget.post.description}”', + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15.sp), + maxFontSize: 20, + maxLines: 1, + ), + ), + widget.post.selfie != null + ? Positioned( + top: 0, + right: 0, + child: Padding( + padding: EdgeInsets.all(12), + child: Container( + constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), + width: 90.sp, + height: 90.sp, + decoration: BoxDecoration( + color: Colors.white, + // add border + border: Border.all(width: 3, color: Colors.white), + // set border radius + borderRadius: BorderRadius.circular(15), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(13), + // implement image + child: Image( + image: NetworkImage(widget.post.selfie!), + fit: BoxFit.cover, + ), + ), + ), + )) + : Container(), + ], + ), + ), + ), + )), + SizedBox(height: 15), + SizedBox( + height: 60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Padding( + padding: EdgeInsets.only(bottom: 2), + child: TextScroll( + widget.post.music.title!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + mode: TextScrollMode.endless, + velocity: Velocity(pixelsPerSecond: Offset(50, 20)), + pauseBetween: Duration(milliseconds: 500), + ), + )), + Container(width: 10), + AutoSizeText( + widget.post.music.date.toString(), + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + textAlign: TextAlign.end, + maxFontSize: 20, + ), + ], + ), + Expanded( + flex: 8, + child: TextScroll( + widget.post.music.artists.first.name!, + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white.withOpacity(0.5), + fontWeight: FontWeight.w300, + fontSize: 16.h), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + )), + ], + ), + ) + ], + )); + }, + ), + ); + } +} diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index d567ce2..7a63204 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -1,269 +1,269 @@ -import 'package:another_flushbar/flushbar.dart'; -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:ionicons/ionicons.dart'; -import 'package:lottie/lottie.dart'; -import 'package:zoom_tap_animation/zoom_tap_animation.dart'; - -import '../config/routes.dart'; -import '../main.dart'; -import '../values/constants.dart'; - -class TopNavBarComponent extends StatefulWidget { - final Function(bool) callback; - const TopNavBarComponent({Key? key, required this.callback}) : super(key: key); - - @override - State createState() => _TopNavBarComponentState(); -} - -class _TopNavBarComponentState extends State with TickerProviderStateMixin { - bool choice = true; - late AnimationController _controller; - bool isDismissed = true; - - final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); - - void actionSurBouton() async { - widget.callback(choice); - await MyApp.postViewModel.getBestPosts(); - await MyApp.postViewModel.getPostsFriends(); - } - - @override - void initState() { - _controller = AnimationController( - vsync: this, - duration: Duration(seconds: 3), - ); - super.initState(); - } - - void showCapsuleDot(bool isAvailable) { - isAvailable - ? Flushbar( - maxWidth: 210, - animationDuration: Duration(seconds: 1), - forwardAnimationCurve: Curves.easeOutCirc, - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - icon: Icon( - Ionicons.sparkles, - color: Colors.white, - size: 18, - ), - padding: EdgeInsets.fromLTRB(8, 8, 8, 8), - messageText: Align( - alignment: Alignment.centerLeft, - child: Text( - "Capsule disponible", - style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), - ), - ), - flushbarStyle: FlushbarStyle.FLOATING, - flushbarPosition: FlushbarPosition.BOTTOM, - textDirection: Directionality.of(context), - borderRadius: BorderRadius.circular(1000), - borderWidth: 1, - borderColor: Colors.white.withOpacity(0.04), - duration: const Duration(minutes: 100), - leftBarIndicatorColor: Colors.transparent, - positionOffset: 20, - onTap: (_) { - Navigator.pop(context); - Navigator.pushNamed(context, '/post'); - }, - ).show(context) - : Flushbar( - maxWidth: 155, - animationDuration: Duration(seconds: 1), - forwardAnimationCurve: Curves.easeOutCirc, - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - icon: Lottie.asset( - 'assets/animations/LottieHourGlass.json', - width: 26, - fit: BoxFit.fill, - ), - padding: EdgeInsets.fromLTRB(8, 8, 8, 8), - messageText: Align( - alignment: Alignment.centerLeft, - child: CountdownTimer( - endTime: midnight.millisecondsSinceEpoch - 2 * 60 * 60 * 1000, - textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), - ), - ), - flushbarStyle: FlushbarStyle.FLOATING, - flushbarPosition: FlushbarPosition.BOTTOM, - textDirection: Directionality.of(context), - borderRadius: BorderRadius.circular(1000), - borderWidth: 1, - borderColor: Colors.white.withOpacity(0.04), - duration: const Duration(minutes: 100), - leftBarIndicatorColor: Colors.transparent, - positionOffset: 20, - onTap: (_) { - Navigator.pop(context); - }, - ).show(context); - } - - void checkAvailable() async { - print("test"); - var res = await MyApp.postViewModel.getAvailable(); - print(res); - ModalRoute? route = ModalRoute.of(context); - if (route != null) { - if (route.settings.name != '/flushbarRoute') { - print("yes"); - showCapsuleDot(res); - } - } - } - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(top: defaultPadding), - child: Container( - padding: EdgeInsets.symmetric(horizontal: defaultPadding), - width: double.infinity, - height: 100, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - flex: 1, - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () async { - Navigator.of(context).push(routeAddFriend()); - }, - child: const Icon( - Icons.person_add_alt_1_rounded, - color: Colors.white, - size: 30, - ), - ), - ), - ConstrainedBox( - constraints: BoxConstraints(maxWidth: 200), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - ZoomTapAnimation( - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - onTap: () { - checkAvailable(); - }, - end: 0.97, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: Image( - image: AssetImage("assets/images/logo.png"), - height: 30, - )), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - if (!choice) { - setState(() { - choice = !choice; - actionSurBouton(); - }); - } - }, - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - if (choice) { - return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), - child: AutoSizeText( - "Mes amis", - style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), - ), - ); - } else { - return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), - child: AutoSizeText( - "Mes amis", - style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), - )); - } - }, - ), - ), - GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - if (choice) { - setState(() { - choice = !choice; - actionSurBouton(); - }); - } - }, - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - if (choice) { - return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), - child: AutoSizeText( - "Discovery", - style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), - )); - } else { - return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), - child: AutoSizeText( - "Discovery", - style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), - )); - } - }, - ), - ), - ], - ), - ], - ), - ), - Flexible( - flex: 1, - child: GestureDetector( - onTap: () async { - await MyApp.userViewModel.updateUserCurrent(); - Navigator.of(context).push(routeProfile()); - }, - child: ClipOval( - child: SizedBox.fromSize( - // Image radius - child: FadeInImage.assetNetwork( - placeholder: 'assets/images/loadingPlaceholder.gif', - image: MyApp.userViewModel.userCurrent.pp, - width: 30, - )), - ), - ), - ) - ], - ), - ), - ); - } -} +import 'package:another_flushbar/flushbar.dart'; +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:ionicons/ionicons.dart'; +import 'package:lottie/lottie.dart'; +import 'package:zoom_tap_animation/zoom_tap_animation.dart'; + +import '../config/routes.dart'; +import '../main.dart'; +import '../values/constants.dart'; + +class TopNavBarComponent extends StatefulWidget { + final Function(bool) callback; + const TopNavBarComponent({Key? key, required this.callback}) : super(key: key); + + @override + State createState() => _TopNavBarComponentState(); +} + +class _TopNavBarComponentState extends State with TickerProviderStateMixin { + bool choice = true; + late AnimationController _controller; + bool isDismissed = true; + + final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + + void actionSurBouton() async { + widget.callback(choice); + await MyApp.postViewModel.getBestPosts(); + await MyApp.postViewModel.getPostsFriends(); + } + + @override + void initState() { + _controller = AnimationController( + vsync: this, + duration: Duration(seconds: 3), + ); + super.initState(); + } + + void showCapsuleDot(bool isAvailable) { + isAvailable + ? Flushbar( + maxWidth: 210, + animationDuration: Duration(seconds: 1), + forwardAnimationCurve: Curves.easeOutCirc, + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + icon: Icon( + Ionicons.sparkles, + color: Colors.white, + size: 18, + ), + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + messageText: Align( + alignment: Alignment.centerLeft, + child: Text( + "Capsule disponible", + style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + ), + ), + flushbarStyle: FlushbarStyle.FLOATING, + flushbarPosition: FlushbarPosition.BOTTOM, + textDirection: Directionality.of(context), + borderRadius: BorderRadius.circular(1000), + borderWidth: 1, + borderColor: Colors.white.withOpacity(0.04), + duration: const Duration(minutes: 100), + leftBarIndicatorColor: Colors.transparent, + positionOffset: 20, + onTap: (_) { + Navigator.pop(context); + Navigator.pushNamed(context, '/post'); + }, + ).show(context) + : Flushbar( + maxWidth: 155, + animationDuration: Duration(seconds: 1), + forwardAnimationCurve: Curves.easeOutCirc, + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + icon: Lottie.asset( + 'assets/animations/LottieHourGlass.json', + width: 26, + fit: BoxFit.fill, + ), + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + messageText: Align( + alignment: Alignment.centerLeft, + child: CountdownTimer( + endTime: midnight.millisecondsSinceEpoch - 2 * 60 * 60 * 1000, + textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + ), + ), + flushbarStyle: FlushbarStyle.FLOATING, + flushbarPosition: FlushbarPosition.BOTTOM, + textDirection: Directionality.of(context), + borderRadius: BorderRadius.circular(1000), + borderWidth: 1, + borderColor: Colors.white.withOpacity(0.04), + duration: const Duration(minutes: 100), + leftBarIndicatorColor: Colors.transparent, + positionOffset: 20, + onTap: (_) { + Navigator.pop(context); + }, + ).show(context); + } + + void checkAvailable() async { + print("test"); + var res = await MyApp.postViewModel.getAvailable(); + print(res); + ModalRoute? route = ModalRoute.of(context); + if (route != null) { + if (route.settings.name != '/flushbarRoute') { + print("yes"); + showCapsuleDot(res); + } + } + } + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: defaultPadding), + child: Container( + padding: EdgeInsets.symmetric(horizontal: defaultPadding), + width: double.infinity, + height: 100, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 1, + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () async { + Navigator.of(context).push(routeAddFriend()); + }, + child: const Icon( + Icons.person_add_alt_1_rounded, + color: Colors.white, + size: 30, + ), + ), + ), + ConstrainedBox( + constraints: BoxConstraints(maxWidth: 200), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ZoomTapAnimation( + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + onTap: () { + checkAvailable(); + }, + end: 0.97, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: Image( + image: AssetImage("assets/images/logo.png"), + height: 30, + )), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + if (!choice) { + setState(() { + choice = !choice; + actionSurBouton(); + }); + } + }, + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + if (choice) { + return Padding( + padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + child: AutoSizeText( + "Mes amis", + style: GoogleFonts.plusJakartaSans( + fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), + ), + ); + } else { + return Padding( + padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + child: AutoSizeText( + "Mes amis", + style: GoogleFonts.plusJakartaSans( + fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), + )); + } + }, + ), + ), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + if (choice) { + setState(() { + choice = !choice; + actionSurBouton(); + }); + } + }, + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + if (choice) { + return Padding( + padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + child: AutoSizeText( + "Discovery", + style: GoogleFonts.plusJakartaSans( + fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), + )); + } else { + return Padding( + padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + child: AutoSizeText( + "Discovery", + style: GoogleFonts.plusJakartaSans( + fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), + )); + } + }, + ), + ), + ], + ), + ], + ), + ), + Flexible( + flex: 1, + child: GestureDetector( + onTap: () async { + await MyApp.userViewModel.updateUserCurrent(); + Navigator.of(context).push(routeProfile()); + }, + child: ClipOval( + child: SizedBox.fromSize( + // Image radius + child: FadeInImage.assetNetwork( + placeholder: 'assets/images/loadingPlaceholder.gif', + image: MyApp.userViewModel.userCurrent.pp, + width: 30, + )), + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart b/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart index cbd52e6..cfa69f7 100644 --- a/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart +++ b/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart @@ -1,17 +1,17 @@ -import 'package:cloud_firestore/cloud_firestore.dart'; - -import '../../main.dart'; -import '../Comment.dart'; -import '../User.dart'; - -class CommentMapper { - static Future toModel(DocumentSnapshot> snapshot) async { - final data = snapshot.data(); - User? user = await MyApp.userViewModel.getUser(data?['user_id']); - return Comment( - snapshot.id, - user!, - data?["text"], - data?["date"]); - } -} +import 'package:cloud_firestore/cloud_firestore.dart'; + +import '../../main.dart'; +import '../Comment.dart'; +import '../User.dart'; + +class CommentMapper { + static Future toModel(DocumentSnapshot> snapshot) async { + final data = snapshot.data(); + User? user = await MyApp.userViewModel.getUser(data?['user_id']); + return Comment( + snapshot.id, + user!, + data?["text"], + data?["date"]); + } +} diff --git a/Sources/justMUSIC/lib/screens/detail_post_screen.dart b/Sources/justMUSIC/lib/screens/detail_post_screen.dart index 92be9b3..93b13c3 100644 --- a/Sources/justMUSIC/lib/screens/detail_post_screen.dart +++ b/Sources/justMUSIC/lib/screens/detail_post_screen.dart @@ -1,451 +1,451 @@ -import 'dart:async'; - -import 'package:flutter/Material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:google_fonts/google_fonts.dart'; - -import 'package:text_scroll/text_scroll.dart'; -import 'package:zoom_tap_animation/zoom_tap_animation.dart'; - -import '../components/button_play_component.dart'; -import '../components/comment_component.dart'; - -import '../main.dart'; -import '../model/Post.dart'; -import '../values/constants.dart'; - -class DetailPostScreen extends StatefulWidget { - final Post post; - const DetailPostScreen({super.key, required this.post}); - - @override - State createState() => _DetailPostScreenState(); -} - -class _DetailPostScreenState extends State { - TextEditingController _textController = TextEditingController(); - late FocusNode myFocusNode; - late StreamSubscription keyboardSubscription; - Future resetFullScreen() async { - await SystemChannels.platform.invokeMethod( - 'SystemChrome.restoreSystemUIOverlays', - ); - } - - bool choice = false; - DateTime today = DateTime.now(); - - void switchChoice() { - setState(() { - choice = !choice; - }); - } - - @override - void dispose() { - MyApp.audioPlayer.release(); - myFocusNode.dispose(); - super.dispose(); - } - - @override - void initState() { - print("post: ${widget.post.date.toString()}"); - print("ajrd: ${DateTime.now().toString()}"); - myFocusNode = FocusNode(); - var keyboardVisibilityController = KeyboardVisibilityController(); - print('Keyboard visibility direct query: ${keyboardVisibilityController.isVisible}'); - - super.initState(); - - keyboardSubscription = keyboardVisibilityController.onChange.listen((bool visible) { - if (!visible) { - myFocusNode.unfocus(); - } - }); - } - - final ScrollController _scrollController = ScrollController(); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - resetFullScreen(); - } - }, - child: Container( - height: 760.h, - child: Column( - children: [ - Expanded( - child: Stack( - children: [ - ScrollConfiguration( - behavior: MyBehavior(), - child: SingleChildScrollView( - controller: _scrollController, - physics: AlwaysScrollableScrollPhysics(), - child: Stack( - clipBehavior: Clip.hardEdge, - children: [ - Align( - alignment: Alignment.topCenter, - child: Container( - height: 400, - width: double.infinity, - child: FadeInImage.assetNetwork( - placeholder: "assets/images/loadingPlaceholder.gif", - image: choice ? widget.post.selfie! : widget.post.music.cover!, - width: double.infinity, - fit: BoxFit.cover, - ), - )), - Column( - children: [ - Container( - height: 200, - margin: EdgeInsets.only(top: 230), - width: double.infinity, - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Colors.transparent, bgModal], - stops: [0, 0.8]), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(20, 0, 20, 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsets.only(right: 10), - child: choice - ? Padding( - padding: const EdgeInsets.all(4), - child: ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: NetworkImage(widget.post.user.pp), - width: 45, - ), - ), - ), - ) - : widget.post.music.previewUrl != null - ? ButtonPlayComponent(music: widget.post.music) - : Container(), - ), - Flexible( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: ScrollConfiguration( - behavior: ScrollBehavior().copyWith(scrollbars: false), - child: TextScroll( - choice - ? widget.post.user.pseudo - : widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w800, - fontSize: 22), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), - ))), - Padding( - padding: const EdgeInsets.only(left: 20.0), - child: choice - ? DateTime(today.year, today.month, today.day) - .isAtSameMomentAs(DateTime(widget.post.date.year, - widget.post.date.month, widget.post.date.day)) - ? Text( - "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, - fontSize: 18), - ) - : Text( - "hier, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, - fontSize: 18), - ) - : Text( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, - fontSize: 18), - ), - ) - ], - ), - ), - choice - ? widget.post.location.item2 != null - ? Text( - "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.5), - fontWeight: FontWeight.w400, - fontSize: 15), - ) - : Text( - "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - : ScrollConfiguration( - behavior: ScrollBehavior().copyWith(scrollbars: false), - child: TextScroll(widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w500, - fontSize: 17), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0))), - ) - ], - ), - ), - ], - ), - ), - ), - widget.post.description != null - ? Align( - alignment: Alignment.bottomLeft, - child: Padding( - padding: const EdgeInsets.fromLTRB(50, 35, 50, 35), - child: Text( - widget.post.description!, - textAlign: TextAlign.left, - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w400, - fontSize: 14), - ), - ), - ) - : Container( - height: 30, - ), - Container( - width: double.infinity, - decoration: const BoxDecoration( - color: bgAppBar, - border: Border( - top: BorderSide( - color: Color(0xFF262626), // Couleur de la bordure - width: 1.0, // Épaisseur de la bordure - ), - ), - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - SvgPicture.asset("assets/images/heart.svg", semanticsLabel: 'Like Logo'), - GestureDetector( - onTap: () { - myFocusNode.requestFocus(); - }, - child: SvgPicture.asset("assets/images/chat.svg", - semanticsLabel: 'Chat Logo')), - SvgPicture.asset("assets/images/add.svg", - semanticsLabel: 'Add playlist Logo'), - SvgPicture.asset("assets/images/save.svg", semanticsLabel: 'Save Logo'), - SvgPicture.asset("assets/images/report.svg", - semanticsLabel: 'Report Logo'), - ], - ), - ), - Padding( - padding: const EdgeInsets.all(15.0), - child: RichText( - text: TextSpan( - text: "3", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w800), - children: [ - TextSpan( - text: " commentaires", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w400), - ) - ])), - ), - Padding( - padding: EdgeInsets.fromLTRB(20, 0, 20, 20), - child: Wrap( - runSpacing: 13, - children: [ - CommentComponent(), - CommentComponent(), - CommentComponent(), - ], - ), - ) - ], - ), - ), - ], - ), - widget.post.selfie != null - ? Align( - alignment: Alignment.topRight, - child: ZoomTapAnimation( - onTap: () { - if (widget.post.selfie != null) { - switchChoice(); - } - }, - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - end: 0.96, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: Container( - margin: EdgeInsets.all(20), - width: 120, - height: 120, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - border: Border.all(width: 4, color: Colors.white)), - child: ClipRRect( - borderRadius: BorderRadius.circular(15), - // implement image - child: Image( - image: NetworkImage( - choice ? widget.post.music.cover! : widget.post.selfie!), - fit: BoxFit.cover, - )), - ), - ), - ) - : Container() - ], - ), - )), - Align( - alignment: Alignment.topCenter, - child: Container( - height: 50, - width: double.infinity, - color: Colors.transparent, - child: Align( - alignment: Alignment.topCenter, - child: Container( - margin: EdgeInsets.only(top: 10), - width: 60, - height: 5, - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.6), borderRadius: BorderRadius.circular(20))), - ), - ), - ), - ], - ), - ), - Padding( - padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), - child: Container( - height: 70, - width: double.infinity, - decoration: BoxDecoration( - border: Border(top: BorderSide(color: grayColor, width: 2)), color: textFieldMessage), - child: Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Row( - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image.network( - MyApp.userViewModel.userCurrent.pp, - width: 45, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: TextField( - keyboardAppearance: Brightness.dark, - controller: _textController, - focusNode: myFocusNode, - cursorColor: primaryColor, - keyboardType: TextInputType.emailAddress, - style: GoogleFonts.plusJakartaSans(color: Colors.white), - decoration: InputDecoration( - suffixIcon: Icon( - Icons.send, - color: grayText, - size: 20, - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(width: 1, color: grayText), - borderRadius: BorderRadius.all(Radius.circular(100))), - contentPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20), - fillColor: bgModal, - filled: true, - focusColor: Color.fromRGBO(255, 255, 255, 0.30), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(width: 1, color: grayText), - borderRadius: BorderRadius.all(Radius.circular(100))), - hintText: 'Ajoutez une réponse...', - hintStyle: GoogleFonts.plusJakartaSans(color: grayText)), - ), - ) - ], - ), - ), - )), - ), - ], - ), - )); - } -} - -class MyBehavior extends ScrollBehavior { - @override - Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { - return child; - } -} +import 'dart:async'; + +import 'package:flutter/Material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:google_fonts/google_fonts.dart'; + +import 'package:text_scroll/text_scroll.dart'; +import 'package:zoom_tap_animation/zoom_tap_animation.dart'; + +import '../components/button_play_component.dart'; +import '../components/comment_component.dart'; + +import '../main.dart'; +import '../model/Post.dart'; +import '../values/constants.dart'; + +class DetailPostScreen extends StatefulWidget { + final Post post; + const DetailPostScreen({super.key, required this.post}); + + @override + State createState() => _DetailPostScreenState(); +} + +class _DetailPostScreenState extends State { + TextEditingController _textController = TextEditingController(); + late FocusNode myFocusNode; + late StreamSubscription keyboardSubscription; + Future resetFullScreen() async { + await SystemChannels.platform.invokeMethod( + 'SystemChrome.restoreSystemUIOverlays', + ); + } + + bool choice = false; + DateTime today = DateTime.now(); + + void switchChoice() { + setState(() { + choice = !choice; + }); + } + + @override + void dispose() { + MyApp.audioPlayer.release(); + myFocusNode.dispose(); + super.dispose(); + } + + @override + void initState() { + print("post: ${widget.post.date.toString()}"); + print("ajrd: ${DateTime.now().toString()}"); + myFocusNode = FocusNode(); + var keyboardVisibilityController = KeyboardVisibilityController(); + print('Keyboard visibility direct query: ${keyboardVisibilityController.isVisible}'); + + super.initState(); + + keyboardSubscription = keyboardVisibilityController.onChange.listen((bool visible) { + if (!visible) { + myFocusNode.unfocus(); + } + }); + } + + final ScrollController _scrollController = ScrollController(); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + resetFullScreen(); + } + }, + child: Container( + height: 760.h, + child: Column( + children: [ + Expanded( + child: Stack( + children: [ + ScrollConfiguration( + behavior: MyBehavior(), + child: SingleChildScrollView( + controller: _scrollController, + physics: AlwaysScrollableScrollPhysics(), + child: Stack( + clipBehavior: Clip.hardEdge, + children: [ + Align( + alignment: Alignment.topCenter, + child: Container( + height: 400, + width: double.infinity, + child: FadeInImage.assetNetwork( + placeholder: "assets/images/loadingPlaceholder.gif", + image: choice ? widget.post.selfie! : widget.post.music.cover!, + width: double.infinity, + fit: BoxFit.cover, + ), + )), + Column( + children: [ + Container( + height: 200, + margin: EdgeInsets.only(top: 230), + width: double.infinity, + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [Colors.transparent, bgModal], + stops: [0, 0.8]), + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: choice + ? Padding( + padding: const EdgeInsets.all(4), + child: ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: NetworkImage(widget.post.user.pp), + width: 45, + ), + ), + ), + ) + : widget.post.music.previewUrl != null + ? ButtonPlayComponent(music: widget.post.music) + : Container(), + ), + Flexible( + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: ScrollConfiguration( + behavior: ScrollBehavior().copyWith(scrollbars: false), + child: TextScroll( + choice + ? widget.post.user.pseudo + : widget.post.music.title!, + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w800, + fontSize: 22), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + ))), + Padding( + padding: const EdgeInsets.only(left: 20.0), + child: choice + ? DateTime(today.year, today.month, today.day) + .isAtSameMomentAs(DateTime(widget.post.date.year, + widget.post.date.month, widget.post.date.day)) + ? Text( + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w900, + fontSize: 18), + ) + : Text( + "hier, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w900, + fontSize: 18), + ) + : Text( + widget.post.music.date.toString(), + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w900, + fontSize: 18), + ), + ) + ], + ), + ), + choice + ? widget.post.location.item2 != null + ? Text( + "${widget.post.location.item1}, ${widget.post.location.item2}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.5), + fontWeight: FontWeight.w400, + fontSize: 15), + ) + : Text( + "", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + : ScrollConfiguration( + behavior: ScrollBehavior().copyWith(scrollbars: false), + child: TextScroll(widget.post.music.artists.first.name!, + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 17), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0))), + ) + ], + ), + ), + ], + ), + ), + ), + widget.post.description != null + ? Align( + alignment: Alignment.bottomLeft, + child: Padding( + padding: const EdgeInsets.fromLTRB(50, 35, 50, 35), + child: Text( + widget.post.description!, + textAlign: TextAlign.left, + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white, + fontWeight: FontWeight.w400, + fontSize: 14), + ), + ), + ) + : Container( + height: 30, + ), + Container( + width: double.infinity, + decoration: const BoxDecoration( + color: bgAppBar, + border: Border( + top: BorderSide( + color: Color(0xFF262626), // Couleur de la bordure + width: 1.0, // Épaisseur de la bordure + ), + ), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SvgPicture.asset("assets/images/heart.svg", semanticsLabel: 'Like Logo'), + GestureDetector( + onTap: () { + myFocusNode.requestFocus(); + }, + child: SvgPicture.asset("assets/images/chat.svg", + semanticsLabel: 'Chat Logo')), + SvgPicture.asset("assets/images/add.svg", + semanticsLabel: 'Add playlist Logo'), + SvgPicture.asset("assets/images/save.svg", semanticsLabel: 'Save Logo'), + SvgPicture.asset("assets/images/report.svg", + semanticsLabel: 'Report Logo'), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(15.0), + child: RichText( + text: TextSpan( + text: "3", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w800), + children: [ + TextSpan( + text: " commentaires", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w400), + ) + ])), + ), + Padding( + padding: EdgeInsets.fromLTRB(20, 0, 20, 20), + child: Wrap( + runSpacing: 13, + children: [ + CommentComponent(), + CommentComponent(), + CommentComponent(), + ], + ), + ) + ], + ), + ), + ], + ), + widget.post.selfie != null + ? Align( + alignment: Alignment.topRight, + child: ZoomTapAnimation( + onTap: () { + if (widget.post.selfie != null) { + switchChoice(); + } + }, + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.96, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: Container( + margin: EdgeInsets.all(20), + width: 120, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all(width: 4, color: Colors.white)), + child: ClipRRect( + borderRadius: BorderRadius.circular(15), + // implement image + child: Image( + image: NetworkImage( + choice ? widget.post.music.cover! : widget.post.selfie!), + fit: BoxFit.cover, + )), + ), + ), + ) + : Container() + ], + ), + )), + Align( + alignment: Alignment.topCenter, + child: Container( + height: 50, + width: double.infinity, + color: Colors.transparent, + child: Align( + alignment: Alignment.topCenter, + child: Container( + margin: EdgeInsets.only(top: 10), + width: 60, + height: 5, + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.6), borderRadius: BorderRadius.circular(20))), + ), + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + child: Container( + height: 70, + width: double.infinity, + decoration: BoxDecoration( + border: Border(top: BorderSide(color: grayColor, width: 2)), color: textFieldMessage), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image.network( + MyApp.userViewModel.userCurrent.pp, + width: 45, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: TextField( + keyboardAppearance: Brightness.dark, + controller: _textController, + focusNode: myFocusNode, + cursorColor: primaryColor, + keyboardType: TextInputType.emailAddress, + style: GoogleFonts.plusJakartaSans(color: Colors.white), + decoration: InputDecoration( + suffixIcon: Icon( + Icons.send, + color: grayText, + size: 20, + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(width: 1, color: grayText), + borderRadius: BorderRadius.all(Radius.circular(100))), + contentPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20), + fillColor: bgModal, + filled: true, + focusColor: Color.fromRGBO(255, 255, 255, 0.30), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(width: 1, color: grayText), + borderRadius: BorderRadius.all(Radius.circular(100))), + hintText: 'Ajoutez une réponse...', + hintStyle: GoogleFonts.plusJakartaSans(color: grayText)), + ), + ) + ], + ), + ), + )), + ), + ], + ), + )); + } +} + +class MyBehavior extends ScrollBehavior { + @override + Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { + return child; + } +} diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index 0324f71..d52babe 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -1,300 +1,300 @@ -import 'dart:async'; - -import 'package:another_flushbar/flushbar.dart'; -import 'package:circular_reveal_animation/circular_reveal_animation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:ionicons/ionicons.dart'; -import 'package:justmusic/main.dart'; -import 'package:lottie/lottie.dart'; - -import '../components/post_component.dart'; -import '../components/top_nav_bar_component.dart'; -import '../model/Post.dart'; -import '../values/constants.dart'; -import 'detail_post_screen.dart'; - -class FeedScreen extends StatefulWidget { - const FeedScreen({Key? key}) : super(key: key); - - @override - State createState() => _FeedScreenState(); -} - -class _FeedScreenState extends State with SingleTickerProviderStateMixin { - late AnimationController animationController; - late Animation animation; - late List friendFeed; - Timer? timer; - - late List discoveryFeed; - late List displayFeed; - final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); - bool isDismissed = true; - - @override - void initState() { - super.initState(); - - MyApp.postViewModel.getPostsFriends(); - friendFeed = MyApp.postViewModel.postsFriends; - MyApp.postViewModel.getBestPosts(); - discoveryFeed = MyApp.postViewModel.bestPosts; - displayFeed = []; - animationController = AnimationController( - vsync: this, - duration: Duration(milliseconds: 400), - ); - animation = CurvedAnimation( - parent: animationController, - curve: Curves.easeInOutSine, - ); - animationController.forward(); - } - - Future showCapsuleDot() async { - bool res = await MyApp.postViewModel.getAvailable(); - if (isDismissed) { - if (res) { - setState(() { - isDismissed = !isDismissed; - }); - Flushbar( - maxWidth: 210, - animationDuration: Duration(seconds: 1), - forwardAnimationCurve: Curves.easeOutCirc, - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - icon: Icon( - Ionicons.sparkles, - color: Colors.white, - size: 18, - ), - padding: EdgeInsets.fromLTRB(8, 8, 8, 8), - messageText: Align( - alignment: Alignment.centerLeft, - child: Text( - "Capsule disponible", - style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), - ), - ), - flushbarStyle: FlushbarStyle.FLOATING, - flushbarPosition: FlushbarPosition.BOTTOM, - textDirection: Directionality.of(context), - borderRadius: BorderRadius.circular(1000), - borderWidth: 1, - isDismissible: false, - borderColor: Colors.white.withOpacity(0.04), - duration: const Duration(minutes: 100), - leftBarIndicatorColor: Colors.transparent, - positionOffset: 20, - onTap: (_) { - Navigator.pop(context); - Navigator.pushNamed(context, '/post'); - }, - ).show(context).then((value) { - isDismissed = !isDismissed; - }); - } else { - setState(() { - isDismissed = !isDismissed; - }); - Flushbar( - maxWidth: 155, - animationDuration: Duration(seconds: 1), - isDismissible: false, - forwardAnimationCurve: Curves.easeOutCirc, - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - icon: Lottie.asset( - 'assets/animations/LottieHourGlass.json', - width: 26, - fit: BoxFit.fill, - ), - padding: EdgeInsets.fromLTRB(8, 8, 8, 8), - messageText: Align( - alignment: Alignment.centerLeft, - child: CountdownTimer( - endTime: midnight.millisecondsSinceEpoch - 2 * 60 * 60 * 1000, - textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), - ), - ), - flushbarStyle: FlushbarStyle.FLOATING, - flushbarPosition: FlushbarPosition.BOTTOM, - textDirection: Directionality.of(context), - borderRadius: BorderRadius.circular(1000), - borderWidth: 1, - borderColor: Colors.white.withOpacity(0.04), - duration: const Duration(minutes: 100), - leftBarIndicatorColor: Colors.transparent, - positionOffset: 20, - onTap: (_) {}, - ).show(context).then((value) { - { - setState(() { - isDismissed = !isDismissed; - }); - } - }); - } - } - } - - Future _refresh() async { - print("refresh"); - discoveryFeed = await MyApp.postViewModel.getBestPosts(); - setState(() { - displayFeed = discoveryFeed.reversed.toList(); - }); - } - - void changeFeed(bool choice) { - // Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre - if (choice) { - setState(() { - animationController.reset(); - displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); - animationController.forward(); - print(displayFeed.length); - }); - } else { - setState(() { - animationController.reset(); - displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); - print(displayFeed.length); - animationController.forward(); - }); - } - } - - void openDetailPost(int index) { - showModalBottomSheet( - backgroundColor: bgModal, - elevation: 1, - constraints: const BoxConstraints( - maxWidth: 600, - ), - isScrollControlled: true, - context: context, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))), - builder: ((BuildContext context) { - return ClipRRect( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), - child: DetailPostScreen(post: displayFeed[index])); - }), - ); - } - - @override - Widget build(BuildContext context) { - showCapsuleDot(); - return Scaffold( - resizeToAvoidBottomInset: true, - backgroundColor: bgColor, - extendBodyBehindAppBar: true, - body: displayFeed.isEmpty - ? Container( - width: double.infinity, - child: Stack( - fit: StackFit.expand, - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/empty_bg.png"), fit: BoxFit.cover, opacity: 0.3), - ), - child: Padding( - padding: EdgeInsets.only(top: 140.h, left: defaultPadding), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("Suis tes amis pour voir leurs capsules", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontSize: 23, fontWeight: FontWeight.w800)) - ], - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: IgnorePointer( - child: Container( - height: 240.h, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topRight, - stops: [0.3, 1], - colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: 800), - child: TopNavBarComponent(callback: changeFeed), - ), - ), - ], - ), - ) - : Container( - width: double.infinity, - child: Stack( - fit: StackFit.expand, - children: [ - Align( - alignment: Alignment.topCenter, - child: CircularRevealAnimation( - animation: animation, - centerOffset: Offset(30.w, -100), - child: Container( - constraints: BoxConstraints(maxWidth: 600), - padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0), - child: RefreshIndicator( - displacement: 20, - triggerMode: RefreshIndicatorTriggerMode.onEdge, - onRefresh: _refresh, - child: ListView.builder( - physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast), - clipBehavior: Clip.none, - shrinkWrap: true, - itemCount: displayFeed.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: const EdgeInsets.only(bottom: 40), - child: - PostComponent(callback: openDetailPost, post: displayFeed[index], index: index), - ); - }, - ), - )), - ), - ), - Align( - alignment: Alignment.topCenter, - child: IgnorePointer( - child: Container( - height: 240.h, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topRight, - stops: [0.3, 1], - colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: 800), - child: TopNavBarComponent(callback: changeFeed), - ), - ), - ], - ), - )); - } -} +import 'dart:async'; + +import 'package:another_flushbar/flushbar.dart'; +import 'package:circular_reveal_animation/circular_reveal_animation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:ionicons/ionicons.dart'; +import 'package:justmusic/main.dart'; +import 'package:lottie/lottie.dart'; + +import '../components/post_component.dart'; +import '../components/top_nav_bar_component.dart'; +import '../model/Post.dart'; +import '../values/constants.dart'; +import 'detail_post_screen.dart'; + +class FeedScreen extends StatefulWidget { + const FeedScreen({Key? key}) : super(key: key); + + @override + State createState() => _FeedScreenState(); +} + +class _FeedScreenState extends State with SingleTickerProviderStateMixin { + late AnimationController animationController; + late Animation animation; + late List friendFeed; + Timer? timer; + + late List discoveryFeed; + late List displayFeed; + final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + bool isDismissed = true; + + @override + void initState() { + super.initState(); + + MyApp.postViewModel.getPostsFriends(); + friendFeed = MyApp.postViewModel.postsFriends; + MyApp.postViewModel.getBestPosts(); + discoveryFeed = MyApp.postViewModel.bestPosts; + displayFeed = []; + animationController = AnimationController( + vsync: this, + duration: Duration(milliseconds: 400), + ); + animation = CurvedAnimation( + parent: animationController, + curve: Curves.easeInOutSine, + ); + animationController.forward(); + } + + Future showCapsuleDot() async { + bool res = await MyApp.postViewModel.getAvailable(); + if (isDismissed) { + if (res) { + setState(() { + isDismissed = !isDismissed; + }); + Flushbar( + maxWidth: 210, + animationDuration: Duration(seconds: 1), + forwardAnimationCurve: Curves.easeOutCirc, + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + icon: Icon( + Ionicons.sparkles, + color: Colors.white, + size: 18, + ), + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + messageText: Align( + alignment: Alignment.centerLeft, + child: Text( + "Capsule disponible", + style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + ), + ), + flushbarStyle: FlushbarStyle.FLOATING, + flushbarPosition: FlushbarPosition.BOTTOM, + textDirection: Directionality.of(context), + borderRadius: BorderRadius.circular(1000), + borderWidth: 1, + isDismissible: false, + borderColor: Colors.white.withOpacity(0.04), + duration: const Duration(minutes: 100), + leftBarIndicatorColor: Colors.transparent, + positionOffset: 20, + onTap: (_) { + Navigator.pop(context); + Navigator.pushNamed(context, '/post'); + }, + ).show(context).then((value) { + isDismissed = !isDismissed; + }); + } else { + setState(() { + isDismissed = !isDismissed; + }); + Flushbar( + maxWidth: 155, + animationDuration: Duration(seconds: 1), + isDismissible: false, + forwardAnimationCurve: Curves.easeOutCirc, + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + icon: Lottie.asset( + 'assets/animations/LottieHourGlass.json', + width: 26, + fit: BoxFit.fill, + ), + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + messageText: Align( + alignment: Alignment.centerLeft, + child: CountdownTimer( + endTime: midnight.millisecondsSinceEpoch - 2 * 60 * 60 * 1000, + textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + ), + ), + flushbarStyle: FlushbarStyle.FLOATING, + flushbarPosition: FlushbarPosition.BOTTOM, + textDirection: Directionality.of(context), + borderRadius: BorderRadius.circular(1000), + borderWidth: 1, + borderColor: Colors.white.withOpacity(0.04), + duration: const Duration(minutes: 100), + leftBarIndicatorColor: Colors.transparent, + positionOffset: 20, + onTap: (_) {}, + ).show(context).then((value) { + { + setState(() { + isDismissed = !isDismissed; + }); + } + }); + } + } + } + + Future _refresh() async { + print("refresh"); + discoveryFeed = await MyApp.postViewModel.getBestPosts(); + setState(() { + displayFeed = discoveryFeed.reversed.toList(); + }); + } + + void changeFeed(bool choice) { + // Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre + if (choice) { + setState(() { + animationController.reset(); + displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); + animationController.forward(); + print(displayFeed.length); + }); + } else { + setState(() { + animationController.reset(); + displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); + print(displayFeed.length); + animationController.forward(); + }); + } + } + + void openDetailPost(int index) { + showModalBottomSheet( + backgroundColor: bgModal, + elevation: 1, + constraints: const BoxConstraints( + maxWidth: 600, + ), + isScrollControlled: true, + context: context, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))), + builder: ((BuildContext context) { + return ClipRRect( + borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), + child: DetailPostScreen(post: displayFeed[index])); + }), + ); + } + + @override + Widget build(BuildContext context) { + showCapsuleDot(); + return Scaffold( + resizeToAvoidBottomInset: true, + backgroundColor: bgColor, + extendBodyBehindAppBar: true, + body: displayFeed.isEmpty + ? Container( + width: double.infinity, + child: Stack( + fit: StackFit.expand, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/empty_bg.png"), fit: BoxFit.cover, opacity: 0.3), + ), + child: Padding( + padding: EdgeInsets.only(top: 140.h, left: defaultPadding), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Suis tes amis pour voir leurs capsules", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontSize: 23, fontWeight: FontWeight.w800)) + ], + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: IgnorePointer( + child: Container( + height: 240.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + stops: [0.3, 1], + colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 800), + child: TopNavBarComponent(callback: changeFeed), + ), + ), + ], + ), + ) + : Container( + width: double.infinity, + child: Stack( + fit: StackFit.expand, + children: [ + Align( + alignment: Alignment.topCenter, + child: CircularRevealAnimation( + animation: animation, + centerOffset: Offset(30.w, -100), + child: Container( + constraints: BoxConstraints(maxWidth: 600), + padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0), + child: RefreshIndicator( + displacement: 20, + triggerMode: RefreshIndicatorTriggerMode.onEdge, + onRefresh: _refresh, + child: ListView.builder( + physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast), + clipBehavior: Clip.none, + shrinkWrap: true, + itemCount: displayFeed.length, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: const EdgeInsets.only(bottom: 40), + child: + PostComponent(callback: openDetailPost, post: displayFeed[index], index: index), + ); + }, + ), + )), + ), + ), + Align( + alignment: Alignment.topCenter, + child: IgnorePointer( + child: Container( + height: 240.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + stops: [0.3, 1], + colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 800), + child: TopNavBarComponent(callback: changeFeed), + ), + ), + ], + ), + )); + } +} diff --git a/Sources/justMUSIC/lib/services/CommentService.dart b/Sources/justMUSIC/lib/services/CommentService.dart index 633ab78..f139639 100644 --- a/Sources/justMUSIC/lib/services/CommentService.dart +++ b/Sources/justMUSIC/lib/services/CommentService.dart @@ -1,27 +1,27 @@ -import 'package:cloud_firestore/cloud_firestore.dart'; - -import '../main.dart'; - -class CommentService { - createComment(String text, String idPost) async { - var id = MyApp.userViewModel.userCurrent.id; - final comment = { - "user_id": id, - "text": text, - "date": DateTime.now(), - "post_id": idPost - }; - - await MyApp.db.collection("comments").add(comment); - } - - Future>>> getCommentsByPostId( - String id) async { - var response = await FirebaseFirestore.instance - .collection("comments") - .where("post_id", isEqualTo: id) - .get(); - - return response.docs; - } -} +import 'package:cloud_firestore/cloud_firestore.dart'; + +import '../main.dart'; + +class CommentService { + createComment(String text, String idPost) async { + var id = MyApp.userViewModel.userCurrent.id; + final comment = { + "user_id": id, + "text": text, + "date": DateTime.now(), + "post_id": idPost + }; + + await MyApp.db.collection("comments").add(comment); + } + + Future>>> getCommentsByPostId( + String id) async { + var response = await FirebaseFirestore.instance + .collection("comments") + .where("post_id", isEqualTo: id) + .get(); + + return response.docs; + } +} diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart index 9f583b7..512c03b 100644 --- a/Sources/justMUSIC/lib/services/NotificationService.dart +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -1,31 +1,31 @@ -import 'dart:convert'; -import 'package:http/http.dart' as http; - -class NotificationService { - sendPushMessage(String token, String title, String body) async { - try { - await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), - headers: { - 'Content-Type': 'application/json', - 'Authorization': - 'key=AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC' - }, - body: jsonEncode({ - 'priority': 'high', - 'data': { - 'click_action': 'FLUTTER_NOTIFICATION_CLICK', - 'status': 'done', - 'body': body, - 'title': title - }, - "notification": { - "title": title, - "body": body, - }, - "to": token, - })); - } catch (e) { - print("error push notification"); - } - } -} +import 'dart:convert'; +import 'package:http/http.dart' as http; + +class NotificationService { + sendPushMessage(String token, String title, String body) async { + try { + await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), + headers: { + 'Content-Type': 'application/json', + 'Authorization': + 'key=AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC' + }, + body: jsonEncode({ + 'priority': 'high', + 'data': { + 'click_action': 'FLUTTER_NOTIFICATION_CLICK', + 'status': 'done', + 'body': body, + 'title': title + }, + "notification": { + "title": title, + "body": body, + }, + "to": token, + })); + } catch (e) { + print("error push notification"); + } + } +} diff --git a/Sources/justMUSIC/lib/view_model/CommentViewModel.dart b/Sources/justMUSIC/lib/view_model/CommentViewModel.dart index 7c2be7f..b0ca81f 100644 --- a/Sources/justMUSIC/lib/view_model/CommentViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/CommentViewModel.dart @@ -1,37 +1,37 @@ -import 'package:justmusic/model/mapper/CommentMapper.dart'; - -import '../model/Comment.dart'; -import '../services/CommentService.dart'; - -class CommentViewModel { - List _comments = []; - final CommentService _commentService = CommentService(); - - // Constructor - CommentViewModel(); - - // Methods - addComment(String text, String idPost) async { - try { - await _commentService.createComment(text,idPost); - } catch(e) { - print(e); - rethrow; - } - } - - Future> getCommentsByPostId(String id) async { - try { - var responseData = await _commentService.getCommentsByPostId(id); - var commentsFutures = responseData.map((value) async { - return await CommentMapper.toModel(value); - }).toList(); - _comments = await Future.wait(commentsFutures); - return _comments; - } catch(e) { - print(e); - _comments = []; - return []; - } - } -} +import 'package:justmusic/model/mapper/CommentMapper.dart'; + +import '../model/Comment.dart'; +import '../services/CommentService.dart'; + +class CommentViewModel { + List _comments = []; + final CommentService _commentService = CommentService(); + + // Constructor + CommentViewModel(); + + // Methods + addComment(String text, String idPost) async { + try { + await _commentService.createComment(text,idPost); + } catch(e) { + print(e); + rethrow; + } + } + + Future> getCommentsByPostId(String id) async { + try { + var responseData = await _commentService.getCommentsByPostId(id); + var commentsFutures = responseData.map((value) async { + return await CommentMapper.toModel(value); + }).toList(); + _comments = await Future.wait(commentsFutures); + return _comments; + } catch(e) { + print(e); + _comments = []; + return []; + } + } +} diff --git a/Sources/justMUSIC/pubspec.lock b/Sources/justMUSIC/pubspec.lock index 9fc8484..ec336cd 100644 --- a/Sources/justMUSIC/pubspec.lock +++ b/Sources/justMUSIC/pubspec.lock @@ -1,1042 +1,1042 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" - url: "https://pub.dev" - source: hosted - version: "1.3.4" - animated_appear: - dependency: "direct main" - description: - name: animated_appear - sha256: "53097d7bb6d5e4a1a3a74c8f3028c47c87101c6ec8903f2002372d1eb5aee991" - url: "https://pub.dev" - source: hosted - version: "0.0.4" - animations: - dependency: "direct main" - description: - name: animations - sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 - url: "https://pub.dev" - source: hosted - version: "2.0.7" - another_flushbar: - dependency: "direct main" - description: - name: another_flushbar - sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" - url: "https://pub.dev" - source: hosted - version: "1.12.30" - archive: - dependency: transitive - description: - name: archive - sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" - url: "https://pub.dev" - source: hosted - version: "3.3.7" - args: - dependency: transitive - description: - name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" - source: hosted - version: "2.4.2" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - audioplayers: - dependency: "direct main" - description: - name: audioplayers - sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282" - url: "https://pub.dev" - source: hosted - version: "4.1.0" - audioplayers_android: - dependency: transitive - description: - name: audioplayers_android - sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c - url: "https://pub.dev" - source: hosted - version: "3.0.2" - audioplayers_darwin: - dependency: transitive - description: - name: audioplayers_darwin - sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d" - url: "https://pub.dev" - source: hosted - version: "4.1.0" - audioplayers_linux: - dependency: transitive - description: - name: audioplayers_linux - sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - audioplayers_platform_interface: - dependency: transitive - description: - name: audioplayers_platform_interface - sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143 - url: "https://pub.dev" - source: hosted - version: "5.0.1" - audioplayers_web: - dependency: transitive - description: - name: audioplayers_web - sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339 - url: "https://pub.dev" - source: hosted - version: "3.1.0" - audioplayers_windows: - dependency: transitive - description: - name: audioplayers_windows - sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - auto_size_text: - dependency: "direct main" - description: - name: auto_size_text - sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - circular_reveal_animation: - dependency: "direct main" - description: - name: circular_reveal_animation - sha256: "198f5a1fa27384dcf950807e0ae07a0da857c04df6233f7468755ee9db102b0c" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f - url: "https://pub.dev" - source: hosted - version: "4.8.4" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" - url: "https://pub.dev" - source: hosted - version: "5.15.3" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 - url: "https://pub.dev" - source: hosted - version: "3.6.3" - collection: - dependency: transitive - description: - name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" - source: hosted - version: "1.17.1" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" - url: "https://pub.dev" - source: hosted - version: "0.3.3+4" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" - custom_draggable_widget: - dependency: "direct main" - description: - name: custom_draggable_widget - sha256: "15718003ebcebb84acdf0c625831a880d139a284d8de9d943ef0d0a669f10159" - url: "https://pub.dev" - source: hosted - version: "0.0.2" - custom_refresh_indicator: - dependency: "direct main" - description: - name: custom_refresh_indicator - sha256: "65a463f09623f6baf75e45e0c9034e9304810be3f5dfb00a54edde7252f4a524" - url: "https://pub.dev" - source: hosted - version: "2.2.1" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - file_selector_linux: - dependency: transitive - description: - name: file_selector_linux - sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046" - url: "https://pub.dev" - source: hosted - version: "0.9.2" - file_selector_macos: - dependency: transitive - description: - name: file_selector_macos - sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412" - url: "https://pub.dev" - source: hosted - version: "0.9.3+1" - file_selector_platform_interface: - dependency: transitive - description: - name: file_selector_platform_interface - sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c" - url: "https://pub.dev" - source: hosted - version: "2.6.0" - file_selector_windows: - dependency: transitive - description: - name: file_selector_windows - sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26" - url: "https://pub.dev" - source: hosted - version: "0.9.3" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" - url: "https://pub.dev" - source: hosted - version: "4.7.2" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" - url: "https://pub.dev" - source: hosted - version: "6.16.1" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 - url: "https://pub.dev" - source: hosted - version: "5.6.2" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" - url: "https://pub.dev" - source: hosted - version: "2.15.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" - url: "https://pub.dev" - source: hosted - version: "2.6.0" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0" - url: "https://pub.dev" - source: hosted - version: "14.6.5" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a - url: "https://pub.dev" - source: hosted - version: "4.5.4" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7" - url: "https://pub.dev" - source: hosted - version: "3.5.4" - firebase_storage: - dependency: "direct main" - description: - name: firebase_storage - sha256: "4b747005aee0c611242cdd553f58795f51e1567d2dfd4f75692fac3f67c8c336" - url: "https://pub.dev" - source: hosted - version: "11.2.5" - firebase_storage_platform_interface: - dependency: transitive - description: - name: firebase_storage_platform_interface - sha256: c77c7b6b7d283280993c81ea8ac95552b2ae521a7bb46a95181c1482e62d1633 - url: "https://pub.dev" - source: hosted - version: "4.4.4" - firebase_storage_web: - dependency: transitive - description: - name: firebase_storage_web - sha256: "6906245579f1af225e43df0395c9d9631cb3135cbfa3521a839196d3383bb89a" - url: "https://pub.dev" - source: hosted - version: "3.6.5" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_animated_play_button: - dependency: "direct main" - description: - name: flutter_animated_play_button - sha256: dd955a450a4514e935e2f410afbd03b3bcf5f31b933a8f1334199caa3c6a81e2 - url: "https://pub.dev" - source: hosted - version: "0.3.0" - flutter_countdown_timer: - dependency: "direct main" - description: - name: flutter_countdown_timer - sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - flutter_keyboard_visibility: - dependency: "direct main" - description: - name: flutter_keyboard_visibility - sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" - url: "https://pub.dev" - source: hosted - version: "5.4.1" - flutter_keyboard_visibility_linux: - dependency: transitive - description: - name: flutter_keyboard_visibility_linux - sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_keyboard_visibility_macos: - dependency: transitive - description: - name: flutter_keyboard_visibility_macos - sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_windows: - dependency: transitive - description: - name: flutter_keyboard_visibility_windows - sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" - url: "https://pub.dev" - source: hosted - version: "2.0.15" - flutter_screenutil: - dependency: "direct main" - description: - name: flutter_screenutil - sha256: "1b61f8c4cbf965104b6ca7160880ff1af6755aad7fec70b58444245132453745" - url: "https://pub.dev" - source: hosted - version: "5.8.4" - flutter_signin_button: - dependency: "direct main" - description: - name: flutter_signin_button - sha256: a063ecc5d5308377e103c9c3a89084abf15fca4440636233af6a13abacd5dcae - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" - url: "https://pub.dev" - source: hosted - version: "2.0.7" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: transitive - description: - name: font_awesome_flutter - sha256: "1f93e5799f0e6c882819e8393a05c6ca5226010f289190f2242ec19f3f0fdba5" - url: "https://pub.dev" - source: hosted - version: "9.2.0" - geolocator: - dependency: "direct main" - description: - name: geolocator - sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" - url: "https://pub.dev" - source: hosted - version: "9.0.2" - geolocator_android: - dependency: transitive - description: - name: geolocator_android - sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 - url: "https://pub.dev" - source: hosted - version: "4.2.0" - geolocator_apple: - dependency: transitive - description: - name: geolocator_apple - sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" - url: "https://pub.dev" - source: hosted - version: "2.2.7" - geolocator_platform_interface: - dependency: transitive - description: - name: geolocator_platform_interface - sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 - url: "https://pub.dev" - source: hosted - version: "4.0.7" - geolocator_web: - dependency: transitive - description: - name: geolocator_web - sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 - url: "https://pub.dev" - source: hosted - version: "2.1.6" - geolocator_windows: - dependency: transitive - description: - name: geolocator_windows - sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d - url: "https://pub.dev" - source: hosted - version: "0.1.1" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" - url: "https://pub.dev" - source: hosted - version: "4.0.4" - gradiantbutton: - dependency: "direct main" - description: - name: gradiantbutton - sha256: c88ac8567242630cd14231e2a6a861da4e40a02a9a0310af360e05634890d172 - url: "https://pub.dev" - source: hosted - version: "0.0.1" - gradient_borders: - dependency: "direct main" - description: - name: gradient_borders - sha256: "69eeaff519d145a4c6c213ada1abae386bcc8981a4970d923e478ce7ba19e309" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - http: - dependency: "direct main" - description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" - url: "https://pub.dev" - source: hosted - version: "0.13.6" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - image_picker: - dependency: "direct main" - description: - name: image_picker - sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - image_picker_android: - dependency: transitive - description: - name: image_picker_android - sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34" - url: "https://pub.dev" - source: hosted - version: "0.8.7+4" - image_picker_for_web: - dependency: transitive - description: - name: image_picker_for_web - sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - image_picker_ios: - dependency: transitive - description: - name: image_picker_ios - sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b - url: "https://pub.dev" - source: hosted - version: "0.8.8" - image_picker_linux: - dependency: transitive - description: - name: image_picker_linux - sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831" - url: "https://pub.dev" - source: hosted - version: "0.2.1" - image_picker_macos: - dependency: transitive - description: - name: image_picker_macos - sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - image_picker_platform_interface: - dependency: transitive - description: - name: image_picker_platform_interface - sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32 - url: "https://pub.dev" - source: hosted - version: "2.9.0" - image_picker_windows: - dependency: transitive - description: - name: image_picker_windows - sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - insta_image_viewer: - dependency: "direct main" - description: - name: insta_image_viewer - sha256: "9a81432b1ab907ea91c255ec079440afe43f999533422badffaa482dfb7fdfbb" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - intl: - dependency: "direct main" - description: - name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" - url: "https://pub.dev" - source: hosted - version: "0.18.1" - ionicons: - dependency: "direct main" - description: - name: ionicons - sha256: "5496bc65a16115ecf05b15b78f494ee4a8869504357668f0a11d689e970523cf" - url: "https://pub.dev" - source: hosted - version: "0.2.2" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - lottie: - dependency: "direct main" - description: - name: lottie - sha256: "0793a5866062e5cc8a8b24892fa94c3095953ea914a7fdf790f550dd7537fe60" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" - source: hosted - version: "0.12.15" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" - source: hosted - version: "0.2.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" - modal_bottom_sheet: - dependency: "direct main" - description: - name: modal_bottom_sheet - sha256: ef533916a2c3089571c32bd34e410faca77a6849a3f28f748e0794525c5658a0 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" - source: hosted - version: "1.0.1" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" - url: "https://pub.dev" - source: hosted - version: "2.0.15" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" - url: "https://pub.dev" - source: hosted - version: "2.0.27" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" - url: "https://pub.dev" - source: hosted - version: "2.2.4" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 - url: "https://pub.dev" - source: hosted - version: "2.1.11" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" - url: "https://pub.dev" - source: hosted - version: "2.0.6" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" - url: "https://pub.dev" - source: hosted - version: "2.1.7" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" - source: hosted - version: "5.4.0" - pinch_zoom: - dependency: "direct main" - description: - name: pinch_zoom - sha256: ad12872281742726afaf03438d99a4572c584a612630768953beb6dfd6f9389a - url: "https://pub.dev" - source: hosted - version: "1.0.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" - url: "https://pub.dev" - source: hosted - version: "3.7.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - smooth_corner: - dependency: "direct main" - description: - name: smooth_corner - sha256: "1e920cffd9644d6f51f9a99674652f8c00f2e9074b275f3edde0de1441ba78e9" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - smooth_list_view: - dependency: "direct main" - description: - name: smooth_list_view - sha256: d6eb3bed78881c50d4574b0dd466ed3321972477688c1c021178f3132155112a - url: "https://pub.dev" - source: hosted - version: "1.0.4" - source_span: - dependency: transitive - description: - name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" - source: hosted - version: "1.9.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - synchronized: - dependency: transitive - description: - name: synchronized - sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" - source: hosted - version: "0.5.1" - text_scroll: - dependency: "direct main" - description: - name: text_scroll - sha256: "7869d86a6fdd725dee56bdd150216a99f0372b82fbfcac319214dbd5f36e1908" - url: "https://pub.dev" - source: hosted - version: "0.2.0" - top_snackbar_flutter: - dependency: "direct main" - description: - name: top_snackbar_flutter - sha256: "22d14664a13db6ac714934c3382bd8d4daa57fb888a672f922df71981c5a5cb2" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - tuple: - dependency: "direct main" - description: - name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - uuid: - dependency: transitive - description: - name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.dev" - source: hosted - version: "3.0.7" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - win32: - dependency: transitive - description: - name: win32 - sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 - url: "https://pub.dev" - source: hosted - version: "5.0.6" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff - url: "https://pub.dev" - source: hosted - version: "1.0.1" - xml: - dependency: transitive - description: - name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" - source: hosted - version: "6.3.0" - zoom_tap_animation: - dependency: "direct main" - description: - name: zoom_tap_animation - sha256: d9f7a73cab65aa1546ba6886b5e21d3c8ccccb34e4e5f770301c306d4868bee0 - url: "https://pub.dev" - source: hosted - version: "1.1.0" -sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + animated_appear: + dependency: "direct main" + description: + name: animated_appear + sha256: "53097d7bb6d5e4a1a3a74c8f3028c47c87101c6ec8903f2002372d1eb5aee991" + url: "https://pub.dev" + source: hosted + version: "0.0.4" + animations: + dependency: "direct main" + description: + name: animations + sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 + url: "https://pub.dev" + source: hosted + version: "2.0.7" + another_flushbar: + dependency: "direct main" + description: + name: another_flushbar + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + url: "https://pub.dev" + source: hosted + version: "1.12.30" + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + audioplayers: + dependency: "direct main" + description: + name: audioplayers + sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + audioplayers_android: + dependency: transitive + description: + name: audioplayers_android + sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c + url: "https://pub.dev" + source: hosted + version: "3.0.2" + audioplayers_darwin: + dependency: transitive + description: + name: audioplayers_darwin + sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + audioplayers_linux: + dependency: transitive + description: + name: audioplayers_linux + sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + audioplayers_platform_interface: + dependency: transitive + description: + name: audioplayers_platform_interface + sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143 + url: "https://pub.dev" + source: hosted + version: "5.0.1" + audioplayers_web: + dependency: transitive + description: + name: audioplayers_web + sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + audioplayers_windows: + dependency: transitive + description: + name: audioplayers_windows + sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + auto_size_text: + dependency: "direct main" + description: + name: auto_size_text + sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + circular_reveal_animation: + dependency: "direct main" + description: + name: circular_reveal_animation + sha256: "198f5a1fa27384dcf950807e0ae07a0da857c04df6233f7468755ee9db102b0c" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f + url: "https://pub.dev" + source: hosted + version: "4.8.4" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" + url: "https://pub.dev" + source: hosted + version: "5.15.3" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 + url: "https://pub.dev" + source: hosted + version: "3.6.3" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" + url: "https://pub.dev" + source: hosted + version: "0.3.3+4" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + custom_draggable_widget: + dependency: "direct main" + description: + name: custom_draggable_widget + sha256: "15718003ebcebb84acdf0c625831a880d139a284d8de9d943ef0d0a669f10159" + url: "https://pub.dev" + source: hosted + version: "0.0.2" + custom_refresh_indicator: + dependency: "direct main" + description: + name: custom_refresh_indicator + sha256: "65a463f09623f6baf75e45e0c9034e9304810be3f5dfb00a54edde7252f4a524" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046" + url: "https://pub.dev" + source: hosted + version: "0.9.2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412" + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26" + url: "https://pub.dev" + source: hosted + version: "0.9.3" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" + url: "https://pub.dev" + source: hosted + version: "4.7.2" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" + url: "https://pub.dev" + source: hosted + version: "6.16.1" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 + url: "https://pub.dev" + source: hosted + version: "5.6.2" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" + url: "https://pub.dev" + source: hosted + version: "2.15.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0" + url: "https://pub.dev" + source: hosted + version: "14.6.5" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a + url: "https://pub.dev" + source: hosted + version: "4.5.4" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7" + url: "https://pub.dev" + source: hosted + version: "3.5.4" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + sha256: "4b747005aee0c611242cdd553f58795f51e1567d2dfd4f75692fac3f67c8c336" + url: "https://pub.dev" + source: hosted + version: "11.2.5" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + sha256: c77c7b6b7d283280993c81ea8ac95552b2ae521a7bb46a95181c1482e62d1633 + url: "https://pub.dev" + source: hosted + version: "4.4.4" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + sha256: "6906245579f1af225e43df0395c9d9631cb3135cbfa3521a839196d3383bb89a" + url: "https://pub.dev" + source: hosted + version: "3.6.5" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_animated_play_button: + dependency: "direct main" + description: + name: flutter_animated_play_button + sha256: dd955a450a4514e935e2f410afbd03b3bcf5f31b933a8f1334199caa3c6a81e2 + url: "https://pub.dev" + source: hosted + version: "0.3.0" + flutter_countdown_timer: + dependency: "direct main" + description: + name: flutter_countdown_timer + sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 + url: "https://pub.dev" + source: hosted + version: "4.1.0" + flutter_keyboard_visibility: + dependency: "direct main" + description: + name: flutter_keyboard_visibility + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + url: "https://pub.dev" + source: hosted + version: "5.4.1" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "1b61f8c4cbf965104b6ca7160880ff1af6755aad7fec70b58444245132453745" + url: "https://pub.dev" + source: hosted + version: "5.8.4" + flutter_signin_button: + dependency: "direct main" + description: + name: flutter_signin_button + sha256: a063ecc5d5308377e103c9c3a89084abf15fca4440636233af6a13abacd5dcae + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: "1f93e5799f0e6c882819e8393a05c6ca5226010f289190f2242ec19f3f0fdba5" + url: "https://pub.dev" + source: hosted + version: "9.2.0" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + url: "https://pub.dev" + source: hosted + version: "9.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 + url: "https://pub.dev" + source: hosted + version: "4.2.0" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" + url: "https://pub.dev" + source: hosted + version: "2.2.7" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 + url: "https://pub.dev" + source: hosted + version: "4.0.7" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 + url: "https://pub.dev" + source: hosted + version: "2.1.6" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d + url: "https://pub.dev" + source: hosted + version: "0.1.1" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + gradiantbutton: + dependency: "direct main" + description: + name: gradiantbutton + sha256: c88ac8567242630cd14231e2a6a861da4e40a02a9a0310af360e05634890d172 + url: "https://pub.dev" + source: hosted + version: "0.0.1" + gradient_borders: + dependency: "direct main" + description: + name: gradient_borders + sha256: "69eeaff519d145a4c6c213ada1abae386bcc8981a4970d923e478ce7ba19e309" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34" + url: "https://pub.dev" + source: hosted + version: "0.8.7+4" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b + url: "https://pub.dev" + source: hosted + version: "0.8.8" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32 + url: "https://pub.dev" + source: hosted + version: "2.9.0" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + insta_image_viewer: + dependency: "direct main" + description: + name: insta_image_viewer + sha256: "9a81432b1ab907ea91c255ec079440afe43f999533422badffaa482dfb7fdfbb" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" + source: hosted + version: "0.18.1" + ionicons: + dependency: "direct main" + description: + name: ionicons + sha256: "5496bc65a16115ecf05b15b78f494ee4a8869504357668f0a11d689e970523cf" + url: "https://pub.dev" + source: hosted + version: "0.2.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + lottie: + dependency: "direct main" + description: + name: lottie + sha256: "0793a5866062e5cc8a8b24892fa94c3095953ea914a7fdf790f550dd7537fe60" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + modal_bottom_sheet: + dependency: "direct main" + description: + name: modal_bottom_sheet + sha256: ef533916a2c3089571c32bd34e410faca77a6849a3f28f748e0794525c5658a0 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + url: "https://pub.dev" + source: hosted + version: "2.0.27" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + url: "https://pub.dev" + source: hosted + version: "2.1.11" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" + source: hosted + version: "2.0.6" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + url: "https://pub.dev" + source: hosted + version: "2.1.7" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + pinch_zoom: + dependency: "direct main" + description: + name: pinch_zoom + sha256: ad12872281742726afaf03438d99a4572c584a612630768953beb6dfd6f9389a + url: "https://pub.dev" + source: hosted + version: "1.0.0" + platform: + dependency: transitive + description: + name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + smooth_corner: + dependency: "direct main" + description: + name: smooth_corner + sha256: "1e920cffd9644d6f51f9a99674652f8c00f2e9074b275f3edde0de1441ba78e9" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + smooth_list_view: + dependency: "direct main" + description: + name: smooth_list_view + sha256: d6eb3bed78881c50d4574b0dd466ed3321972477688c1c021178f3132155112a + url: "https://pub.dev" + source: hosted + version: "1.0.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + text_scroll: + dependency: "direct main" + description: + name: text_scroll + sha256: "7869d86a6fdd725dee56bdd150216a99f0372b82fbfcac319214dbd5f36e1908" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + top_snackbar_flutter: + dependency: "direct main" + description: + name: top_snackbar_flutter + sha256: "22d14664a13db6ac714934c3382bd8d4daa57fb888a672f922df71981c5a5cb2" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + tuple: + dependency: "direct main" + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + win32: + dependency: transitive + description: + name: win32 + sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 + url: "https://pub.dev" + source: hosted + version: "5.0.6" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff + url: "https://pub.dev" + source: hosted + version: "1.0.1" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + zoom_tap_animation: + dependency: "direct main" + description: + name: zoom_tap_animation + sha256: d9f7a73cab65aa1546ba6886b5e21d3c8ccccb34e4e5f770301c306d4868bee0 + url: "https://pub.dev" + source: hosted + version: "1.1.0" +sdks: + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/Sources/justMUSIC/pubspec.yaml b/Sources/justMUSIC/pubspec.yaml index 98020d4..af7008b 100644 --- a/Sources/justMUSIC/pubspec.yaml +++ b/Sources/justMUSIC/pubspec.yaml @@ -1,129 +1,129 @@ -name: justmusic -description: A new Flutter project. - -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 - -environment: - sdk: '>=2.18.2 <3.0.0' - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - http: ^0.13.5 - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - google_fonts: ^4.0.4 - gradiantbutton: ^0.0.1 - smooth_corner: ^1.1.0 - flutter_signin_button: ^2.0.0 - flutter_screenutil: ^5.7.0 - auto_size_text: ^3.0.0 - gradient_borders: ^1.0.0 - text_scroll: ^0.2.0 - circular_reveal_animation: ^2.0.1 - zoom_tap_animation: ^1.1.0 - custom_draggable_widget: ^0.0.2 - modal_bottom_sheet: ^2.1.2 - flutter_animated_play_button: ^0.3.0 - audioplayers: ^4.1.0 - ionicons: ^0.2.2 - top_snackbar_flutter: ^3.1.0 - firebase_core: ^2.15.0 - firebase_auth: ^4.7.2 - cloud_firestore: ^4.8.4 - image_picker: ^1.0.1 - insta_image_viewer: ^1.0.2 - pinch_zoom: ^1.0.0 - smooth_list_view: ^1.0.4 - animated_appear: ^0.0.4 - geolocator: ^9.0.2 - tuple: ^2.0.2 - firebase_storage: ^11.2.5 - another_flushbar: ^1.12.30 - flutter_countdown_timer: ^4.1.0 - intl: ^0.18.1 - lottie: ^2.5.0 - custom_refresh_indicator: ^2.2.1 - animations: ^2.0.7 - flutter_svg: ^2.0.7 - flutter_keyboard_visibility: ^5.4.1 - firebase_messaging: ^14.6.5 - -dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - assets: - - assets/images/ - - assets/animations/ - - assets/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages +name: justmusic +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=2.18.2 <3.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + http: ^0.13.5 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + google_fonts: ^4.0.4 + gradiantbutton: ^0.0.1 + smooth_corner: ^1.1.0 + flutter_signin_button: ^2.0.0 + flutter_screenutil: ^5.7.0 + auto_size_text: ^3.0.0 + gradient_borders: ^1.0.0 + text_scroll: ^0.2.0 + circular_reveal_animation: ^2.0.1 + zoom_tap_animation: ^1.1.0 + custom_draggable_widget: ^0.0.2 + modal_bottom_sheet: ^2.1.2 + flutter_animated_play_button: ^0.3.0 + audioplayers: ^4.1.0 + ionicons: ^0.2.2 + top_snackbar_flutter: ^3.1.0 + firebase_core: ^2.15.0 + firebase_auth: ^4.7.2 + cloud_firestore: ^4.8.4 + image_picker: ^1.0.1 + insta_image_viewer: ^1.0.2 + pinch_zoom: ^1.0.0 + smooth_list_view: ^1.0.4 + animated_appear: ^0.0.4 + geolocator: ^9.0.2 + tuple: ^2.0.2 + firebase_storage: ^11.2.5 + another_flushbar: ^1.12.30 + flutter_countdown_timer: ^4.1.0 + intl: ^0.18.1 + lottie: ^2.5.0 + custom_refresh_indicator: ^2.2.1 + animations: ^2.0.7 + flutter_svg: ^2.0.7 + flutter_keyboard_visibility: ^5.4.1 + firebase_messaging: ^14.6.5 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/ + - assets/animations/ + - assets/ + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/Sources/justMUSIC/test/Notification_test.dart b/Sources/justMUSIC/test/Notification_test.dart index bf9f23c..458bb1e 100644 --- a/Sources/justMUSIC/test/Notification_test.dart +++ b/Sources/justMUSIC/test/Notification_test.dart @@ -1,6 +1,6 @@ -import 'package:justmusic/services/NotificationService.dart'; - -Future main() async { - var notif = NotificationService(); - await notif.sendPushMessage("cAJAJw_aR7yPQbFTMS-r6H:APA91bEZs34Ab3-xSYeIGykHrxD5pRj-OyODaEcNBPtds1eLzEH0uzFkzCSQY7BvZQHEFPfeHSN7nri4webskXbu1zzgwe9NIdPagsc6IHaouuewWqWd9V7ucTeDeYt1Sbby4-pb6jtA", "Just Music", "Vien voir les nouveautés"); +import 'package:justmusic/services/NotificationService.dart'; + +Future main() async { + var notif = NotificationService(); + await notif.sendPushMessage("cAJAJw_aR7yPQbFTMS-r6H:APA91bEZs34Ab3-xSYeIGykHrxD5pRj-OyODaEcNBPtds1eLzEH0uzFkzCSQY7BvZQHEFPfeHSN7nri4webskXbu1zzgwe9NIdPagsc6IHaouuewWqWd9V7ucTeDeYt1Sbby4-pb6jtA", "Just Music", "Vien voir les nouveautés"); } \ No newline at end of file -- 2.36.3