diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..f77a5ea Binary files /dev/null and b/.DS_Store differ diff --git a/.drone.yml b/.drone.yml index 6a35e64..d3cf9a5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,14 +7,28 @@ trigger: - push steps: -# - name: app-build -# image: cirrusci/flutter:stable -# commands: -# - cd ./Sources/justMUSIC/ -# - flutter build apk + - name: app-build + image: ghcr.io/cirruslabs/flutter:3.13.9 + commands: + - cd ./Sources/justMUSIC/ + - flutter build apk + + - name: build-web + image: ghcr.io/cirruslabs/flutter:3.13.9 + environment: + FIREBASE_TOKEN: + from_secret: FIREBASE_TOKEN + commands: + - cd ./Sources/justMUSIC/ + - flutter build web --web-renderer canvaskit + - curl -sL https://firebase.tools | bash + - firebase deploy --token $${FIREBASE_TOKEN} + when: + branch: + - PROD-WEB - name: code-analysis - image: cirrusci/flutter:stable + image: ghcr.io/cirruslabs/flutter:3.13.9 environment: SONAR_TOKEN: from_secret: SONAR_TOKEN @@ -25,4 +39,5 @@ steps: - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export SONAR_SCANNER_OPTS="-server" - - sonar-scanner -D sonar.projectKey=JustMusic -D sonar.sources=./Sources/justMUSIC -D sonar.host.url=https://codefirst.iut.uca.fr/sonar \ No newline at end of file + - sonar-scanner -D sonar.projectKey=JustMusic -D sonar.sources=./Sources/justMUSIC -D sonar.host.url=https://codefirst.iut.uca.fr/sonar + ddepends_on: [app-build] \ No newline at end of file diff --git a/.idea/Project_JustMusic.iml b/.idea/Project_JustMusic.iml index 6d1b1bf..3182939 100644 --- a/.idea/Project_JustMusic.iml +++ b/.idea/Project_JustMusic.iml @@ -81,6 +81,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml index 2e5400f..7144452 100644 --- a/.idea/libraries/Dart_Packages.xml +++ b/.idea/libraries/Dart_Packages.xml @@ -180,7 +180,7 @@ - @@ -362,7 +362,7 @@ - @@ -474,14 +474,14 @@ - - @@ -726,7 +726,7 @@ - @@ -859,7 +859,7 @@ - @@ -901,14 +901,14 @@ - - @@ -936,7 +936,7 @@ - @@ -1013,7 +1013,7 @@ - @@ -1073,7 +1073,7 @@ - + @@ -1148,7 +1148,7 @@ - + @@ -1172,12 +1172,12 @@ - - + + - + @@ -1188,15 +1188,15 @@ - + - - - - + + + + diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index df2867e..5e61716 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,26 +1,27 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/Diagrammes/JMClasses.png b/Documentation/Diagrammes/JMClasses.png new file mode 100644 index 0000000..29ec18d Binary files /dev/null and b/Documentation/Diagrammes/JMClasses.png differ diff --git a/Documentation/Images/Overview.png b/Documentation/Images/Overview.png new file mode 100644 index 0000000..a5d312a Binary files /dev/null and b/Documentation/Images/Overview.png differ diff --git a/README.md b/README.md index 6fc3186..b5889cb 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ JustMusic est un projet collaboratif à but lucratif pour Android/IOS utilisant C'est un réseau social donc l'utilisateur pourra publier et commenter des posts. Il pourra s'abonner à d'autre utilisateurs pour voir leurs post sur son fil d'actualité. +**Lien pour tester la version web:** [Just Music](https://justmusic-435d5.web.app) 🎶 + ## Répartition du Gitlab La racine de notre gitlab est composé de deux dossier essentielles au projet: @@ -47,10 +49,33 @@ La racine de notre gitlab est composé de deux dossier essentielles au projet: ## Fonctionnement +
+ + + +
+ +### Feeds + +Une fois authentifié vous aurez la possibilité de voir les posts capsules de vos amis, de voir les musiques qu'ils mettent en avant accompagner éventuellement d'une image, d'une description, de leurs localisations... (Vous n'avez pas d'amis, pas de soucis, cliquer seulement sur l'icon en haut a gauche de la page pour suivre nimporte quel personne que vous voulez), Mais aussi juste d'un simple mouvement du doigt swiper pour vous retrouvez sur la page Discovery où vous verrais les posts récents en tendance dans le monde 🌎 + +Amuser vous à cliquer sur les posts pour ecouter la music mais aussi connaître les détails et savoir qui a commenter 💬 et liker ❤️. Si la musique vous plaît enregistrer la et vous la retrouverez lorsque vous aurez envie de poster. + +### Post + +Pour participer à cette aventure musicale avec des gens du monde entier, cliquez simplement sur l'icône JustMusic. Gardez à l'esprit que vous ne pourrez poster qu'une fois par jour, donc réfléchissez bien à la musique que vous souhaitez mettre en avant. N'hésitez pas à ajouter une photo et une description pour rendre votre publication plus chaleureuse 😃. + +### Profil + +Consultez l'aperçu de votre profil pour savoir combien de personnes vous suivent et que vous suivez. Vous pouvez également voir le nombre de capsules que vous avez publiées, personnaliser les paramètres de votre compte selon vos préférences, et explorez votre historique de capsules pour vous remémorer vos précédentes publications 🎧. + +#### Bonne aventure musicale 🎵🌟 + ## Deploiement - [x]   ![IOS](https://img.shields.io/badge/IOS-000?style=for-the-badge&logo=apple&logoColor=black&color=white) - [x]   ![Android](https://img.shields.io/badge/Android-000?style=for-the-badge&logo=android&logoColor=white&color=green) +- [x]   ![Safari](https://img.shields.io/badge/Safari-000000.svg?style=for-the-badge&logo=Safari&logoColor=white) ## Techniciens diff --git a/Sources/.DS_Store b/Sources/.DS_Store new file mode 100644 index 0000000..957a0f5 Binary files /dev/null and b/Sources/.DS_Store differ diff --git a/Sources/justMUSIC/.firebaserc b/Sources/justMUSIC/.firebaserc new file mode 100644 index 0000000..3e57bea --- /dev/null +++ b/Sources/justMUSIC/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "justmusic-435d5" + } +} diff --git a/Sources/justMUSIC/.metadata b/Sources/justMUSIC/.metadata index 45aa6a7..d22992e 100644 --- a/Sources/justMUSIC/.metadata +++ b/Sources/justMUSIC/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "2524052335ec76bb03e04ede244b071f1b86d190" + revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" channel: "stable" project_type: app @@ -13,11 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 2524052335ec76bb03e04ede244b071f1b86d190 - base_revision: 2524052335ec76bb03e04ede244b071f1b86d190 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: android + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: ios - create_revision: 2524052335ec76bb03e04ede244b071f1b86d190 - base_revision: 2524052335ec76bb03e04ede244b071f1b86d190 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: linux + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: macos + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: web + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: windows + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a # User provided section diff --git a/Sources/justMUSIC/assets/images/logo-JustMusic.png b/Sources/justMUSIC/assets/images/logo-JustMusic.png new file mode 100644 index 0000000..661cb4f Binary files /dev/null and b/Sources/justMUSIC/assets/images/logo-JustMusic.png differ diff --git a/Sources/justMUSIC/firebase.json b/Sources/justMUSIC/firebase.json new file mode 100644 index 0000000..60df67a --- /dev/null +++ b/Sources/justMUSIC/firebase.json @@ -0,0 +1,17 @@ +{ + "hosting": { + "site": "justmusic-435d5", + "public": "build/web", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} diff --git a/Sources/justMUSIC/ios/Podfile b/Sources/justMUSIC/ios/Podfile index fdcc671..2c6a9b8 100644 --- a/Sources/justMUSIC/ios/Podfile +++ b/Sources/justMUSIC/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/Sources/justMUSIC/ios/Podfile.lock b/Sources/justMUSIC/ios/Podfile.lock index 879088f..5315664 100644 --- a/Sources/justMUSIC/ios/Podfile.lock +++ b/Sources/justMUSIC/ios/Podfile.lock @@ -953,6 +953,6 @@ SPEC CHECKSUMS: PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a -PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 +PODFILE CHECKSUM: 6b9eb94e9f98a329f2ef624b852a6e42d090af2b -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/Sources/justMUSIC/ios/Runner.xcodeproj/project.pbxproj b/Sources/justMUSIC/ios/Runner.xcodeproj/project.pbxproj index 74017c1..8154f33 100644 --- a/Sources/justMUSIC/ios/Runner.xcodeproj/project.pbxproj +++ b/Sources/justMUSIC/ios/Runner.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + C95EC3D52B114F7D00A316A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C95EC3D42B114F7D00A316A2 /* GoogleService-Info.plist */; }; DE887488687930BD9A821E09 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 895D1BE06AED43E6E7367693 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -64,6 +65,7 @@ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C7930A860EC8743E6A941D8D /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C95EC3D42B114F7D00A316A2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; F782B307897A4B77B59D0897 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -130,6 +132,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + C95EC3D42B114F7D00A316A2 /* GoogleService-Info.plist */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -263,6 +266,7 @@ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + C95EC3D52B114F7D00A316A2 /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -434,6 +438,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -444,6 +449,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -452,7 +458,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -467,16 +473,21 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; + ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.justdev.justmusic; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -556,6 +567,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -566,6 +578,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -580,7 +593,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -611,6 +624,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -621,6 +635,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -629,7 +644,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -646,16 +661,21 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; + ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.justdev.justmusic; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -669,16 +689,21 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; + ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.justdev.justmusic; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..383bdc5 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 7353c41..cafa7dd 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 797d452..34f7675 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index 6ed2d93..18b3a56 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cd7b00..33224da 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index fe73094..a528cc2 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index 321773c..53a0d73 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 797d452..34f7675 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 502f463..8241dc1 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index 0ec3034..319eeba 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 0ec3034..319eeba 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index e9f5fea..8011b7f 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 84ac32a..58eedb4 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 8953cba..daad22d 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index 0467bf1..18e0bd2 100644 Binary files a/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/Sources/justMUSIC/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/Sources/justMUSIC/ios/Runner/GoogleService-Info.plist b/Sources/justMUSIC/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..661063e --- /dev/null +++ b/Sources/justMUSIC/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 994903990520-n6jd98ena56kb1tvtrd67tvb5et3nfbf.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.994903990520-n6jd98ena56kb1tvtrd67tvb5et3nfbf + ANDROID_CLIENT_ID + 994903990520-073l30b0afj0uq7apsvc8p8ukantpu6q.apps.googleusercontent.com + API_KEY + AIzaSyBbYqsR6t7JTi8_XFNEHd43IRuKlYGeI3U + GCM_SENDER_ID + 994903990520 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.justmusic + PROJECT_ID + justmusic-435d5 + STORAGE_BUCKET + justmusic-435d5.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:994903990520:ios:93188f32e320babe0a9b0d + + \ No newline at end of file diff --git a/Sources/justMUSIC/ios/Runner/Info.plist b/Sources/justMUSIC/ios/Runner/Info.plist index 64cb62f..6139f47 100644 --- a/Sources/justMUSIC/ios/Runner/Info.plist +++ b/Sources/justMUSIC/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -20,10 +22,31 @@ $(FLUTTER_BUILD_NAME) CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + com.googleusercontent.apps.994903990520-n6jd98ena56kb1tvtrd67tvb5et3nfbf + + + CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCameraUsageDescription + To capture profile photo please grant camera access + NSLocationAlwaysUsageDescription + Votre message d'autorisation pour une utilisation continue de la localisation + NSLocationWhenInUseUsageDescription + Votre message d'autorisation lorsque l'application est en cours d'utilisation + NSPhotoLibraryUsageDescription + App needs access to photo lib for profile images + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,15 +64,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - NSPhotoLibraryUsageDescription - App needs access to photo lib for profile images - - NSCameraUsageDescription - To capture profile photo please grant camera access - diff --git a/Sources/justMUSIC/lib/components/back_button.dart b/Sources/justMUSIC/lib/components/back_button.dart index 5e771fa..9baf5bd 100644 --- a/Sources/justMUSIC/lib/components/back_button.dart +++ b/Sources/justMUSIC/lib/components/back_button.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import '../values/constants.dart'; diff --git a/Sources/justMUSIC/lib/components/buttonPostComponent.dart b/Sources/justMUSIC/lib/components/buttonPostComponent.dart index 28c4587..52be309 100644 --- a/Sources/justMUSIC/lib/components/buttonPostComponent.dart +++ b/Sources/justMUSIC/lib/components/buttonPostComponent.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:ionicons/ionicons.dart'; import 'package:tuple/tuple.dart'; diff --git a/Sources/justMUSIC/lib/components/button_play_component.dart b/Sources/justMUSIC/lib/components/button_play_component.dart index a8b45bb..0afc61c 100644 --- a/Sources/justMUSIC/lib/components/button_play_component.dart +++ b/Sources/justMUSIC/lib/components/button_play_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import '../main.dart'; import '../model/Music.dart'; diff --git a/Sources/justMUSIC/lib/components/city_list_component.dart b/Sources/justMUSIC/lib/components/city_list_component.dart index 59a2100..cfcaa24 100644 --- a/Sources/justMUSIC/lib/components/city_list_component.dart +++ b/Sources/justMUSIC/lib/components/city_list_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/values/constants.dart'; import 'package:tuple/tuple.dart'; diff --git a/Sources/justMUSIC/lib/components/comment_component.dart b/Sources/justMUSIC/lib/components/comment_component.dart index a2c8965..23512d4 100644 --- a/Sources/justMUSIC/lib/components/comment_component.dart +++ b/Sources/justMUSIC/lib/components/comment_component.dart @@ -10,11 +10,21 @@ class CommentComponent extends StatelessWidget { final Comment comment; const CommentComponent({Key? key, required this.comment}) : super(key: key); + String calculateTimeDifference(DateTime startDate) { + Duration difference = DateTime.now().difference(startDate); + if (difference.inDays > 0) { + return '${difference.inDays} jours'; + } else if (difference.inHours > 0) { + return '${difference.inHours} heures'; + } else if (difference.inMinutes > 0) { + return '${difference.inMinutes} minutes'; + } else { + return '${difference.inSeconds} secondes'; + } + } @override Widget build(BuildContext context) { - final now = DateTime.now(); - final difference = now.difference(comment.date); return Container( width: double.infinity, @@ -56,7 +66,7 @@ class CommentComponent extends StatelessWidget { Padding( padding: EdgeInsets.only(top: 6, left: 10), child: Text( - "il y a ${difference.inHours > 0 ? difference.inHours : difference.inMinutes}${difference.inHours > 0 ? "h" : "m"}", + "il y a ${calculateTimeDifference(comment.date)}", style: GoogleFonts.plusJakartaSans( color: Colors.white.withOpacity(0.6), fontWeight: FontWeight.w400, fontSize: 10), ), diff --git a/Sources/justMUSIC/lib/components/editable_post_component.dart b/Sources/justMUSIC/lib/components/editable_post_component.dart index 635ebf5..cec93db 100644 --- a/Sources/justMUSIC/lib/components/editable_post_component.dart +++ b/Sources/justMUSIC/lib/components/editable_post_component.dart @@ -1,7 +1,9 @@ import 'dart:io'; import 'package:animated_appear/animated_appear.dart'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/Material.dart'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -60,17 +62,19 @@ class _EditablePostComponentState extends State with Tick } Future pickImage(ImageSource source) async { - try { - final image = await ImagePicker().pickImage(source: source, imageQuality: 20); - if (image == null) return; - final imageTemp = File(image.path); - setState(() { - this.image = imageTemp; - widget.callBackImage(imageTemp); - }); - } on PlatformException catch (e) { - print('Failed to pick image: $e'); - } + + try { + final image = await ImagePicker().pickImage(source: source, imageQuality: 20); + if (image == null) return; + final imageTemp = File(image.path); + setState(() { + this.image = imageTemp; + widget.callBackImage(imageTemp); + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } void _updateDescription(String text) { @@ -181,7 +185,10 @@ class _EditablePostComponentState extends State with Tick borderRadius: BorderRadius.circular(20), child: InstaImageViewer( backgroundIsTransparent: true, - child: Image( + child: kIsWeb?InstaImageViewer( + backgroundIsTransparent: true, + child: Image.network(image!.path) + ):Image( image: FileImage(image!), fit: BoxFit.cover, ), @@ -249,8 +256,8 @@ class _EditablePostComponentState extends State with Tick width: double.infinity, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( + children: [ kIsWeb?Container() + :Expanded( flex: 5, child: GestureDetector( onTap: () { @@ -261,7 +268,7 @@ class _EditablePostComponentState extends State with Tick ), ), ), - SizedBox( + kIsWeb?Container():SizedBox( width: 15, ), Expanded( @@ -284,6 +291,7 @@ class _EditablePostComponentState extends State with Tick child: SizedBox( width: double.infinity, child: TextFormField( + keyboardType: TextInputType.text, onChanged: (value) { _updateDescription(value); }, diff --git a/Sources/justMUSIC/lib/components/historic_component.dart b/Sources/justMUSIC/lib/components/historic_component.dart index db18e71..a5d7146 100644 --- a/Sources/justMUSIC/lib/components/historic_component.dart +++ b/Sources/justMUSIC/lib/components/historic_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/main.dart'; @@ -34,59 +34,68 @@ class _HistoricComponentState extends State { .getHistoryCapsulesMonthWhitIdUser(MyApp.userViewModel.userCurrent.id, widget.month, widget.year), builder: (context, snapshot) { if (snapshot.hasData) { - return Wrap( - spacing: 14, - runSpacing: 14, - children: List.generate(getNumberOfDaysInMonth(widget.year, widget.month), (index) { - Tuple2? checkCapsule; - if (snapshot.data != null) { - for (var element in snapshot.data!) { - if (element.item1 == index + 1) { - checkCapsule = element; + return Container( + constraints: const BoxConstraints( maxWidth: 600), + child: Wrap( + spacing: 14, + runSpacing: 14, + children: List.generate(getNumberOfDaysInMonth(widget.year, widget.month), (index) { + Tuple2? checkCapsule; + if (snapshot.data != null) { + for (var element in snapshot.data!) { + if (element.item1 == index + 1) { + checkCapsule = element; + } } } - } - if ((widget.year > DateTime.now().year || widget.month > DateTime.now().month) || - (widget.year == DateTime.now().year && - widget.month == DateTime.now().month && - index > DateTime.now().day)) { - return Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Color(0xFF1E1E1E).withOpacity(0.7), - Color(0xFF1E1E1E).withOpacity(0), - ], begin: Alignment.topCenter, end: Alignment.bottomCenter), - borderRadius: BorderRadius.circular(5)), - height: 60, - width: 60, - ); - } - if (checkCapsule != null) { - return Container( - decoration: BoxDecoration( - image: DecorationImage(image: NetworkImage((checkCapsule.item2.cover)!)), - borderRadius: BorderRadius.circular(5)), - height: 60, - width: 60, - ); - } else { - return Container( - color: bgColor, - height: 60, - width: 60, - child: Center( - child: Text( - (index + 1).toString(), - style: - GoogleFonts.plusJakartaSans(color: Colors.white, fontSize: 22, fontWeight: FontWeight.w800), + if ((widget.year > DateTime.now().year || widget.month > DateTime.now().month) || + (widget.year == DateTime.now().year && + widget.month == DateTime.now().month && + index > DateTime.now().day)) { + return Container( + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Color(0xFF1E1E1E).withOpacity(0.7), + Color(0xFF1E1E1E).withOpacity(0), + ], begin: Alignment.topCenter, end: Alignment.bottomCenter), + borderRadius: BorderRadius.circular(5)), + height: 60, + width: 60, + ); + } + if (checkCapsule != null) { + return Tooltip( + message: "${checkCapsule.item2.artists.first.name} - ${checkCapsule.item2.title}".length < 30? "${checkCapsule.item2.artists.first.name} - ${checkCapsule.item2.title}": "${checkCapsule.item2.artists.first.name} - ${checkCapsule.item2.title}".substring(0,30)+"...", + decoration: const BoxDecoration( + border: Border.fromBorderSide(BorderSide(color: Color(0xFF3A3A3A), width: 1)), + color: tooltipBackground, borderRadius: BorderRadius.all(Radius.circular(20)) + ), + child: Container( + decoration: BoxDecoration( + image: DecorationImage(image: NetworkImage((checkCapsule.item2.cover)!)), + borderRadius: BorderRadius.circular(5)), + height: 60, + width: 60, + )); + } else { + return Container( + color: bgColor, + height: 60, + width: 60, + child: Center( + child: Text( + (index + 1).toString(), + style: + GoogleFonts.plusJakartaSans(color: Colors.white, fontSize: 22, fontWeight: FontWeight.w800), + ), ), - ), - ); - } + ); + } - // Generate widgets - }), + // Generate widgets + }), + ), ); } else { return CupertinoActivityIndicator(); diff --git a/Sources/justMUSIC/lib/components/little_post_recap_component.dart b/Sources/justMUSIC/lib/components/little_post_recap_component.dart index 2134adc..95c5ab4 100644 --- a/Sources/justMUSIC/lib/components/little_post_recap_component.dart +++ b/Sources/justMUSIC/lib/components/little_post_recap_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../values/constants.dart'; diff --git a/Sources/justMUSIC/lib/components/music_list_component.dart b/Sources/justMUSIC/lib/components/music_list_component.dart index e4b6b2d..966a729 100644 --- a/Sources/justMUSIC/lib/components/music_list_component.dart +++ b/Sources/justMUSIC/lib/components/music_list_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/components/play_button_component.dart'; import 'package:text_scroll/text_scroll.dart'; diff --git a/Sources/justMUSIC/lib/components/play_button_component.dart b/Sources/justMUSIC/lib/components/play_button_component.dart index 9f4b21d..4aaff75 100644 --- a/Sources/justMUSIC/lib/components/play_button_component.dart +++ b/Sources/justMUSIC/lib/components/play_button_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_animated_play_button/flutter_animated_play_button.dart'; import 'package:ionicons/ionicons.dart'; diff --git a/Sources/justMUSIC/lib/components/post_button_component.dart b/Sources/justMUSIC/lib/components/post_button_component.dart index a82dd98..a6ea2ce 100644 --- a/Sources/justMUSIC/lib/components/post_button_component.dart +++ b/Sources/justMUSIC/lib/components/post_button_component.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; class PostButtonComponent extends StatefulWidget { diff --git a/Sources/justMUSIC/lib/components/post_component.dart b/Sources/justMUSIC/lib/components/post_component.dart index e80649d..e8ead7f 100644 --- a/Sources/justMUSIC/lib/components/post_component.dart +++ b/Sources/justMUSIC/lib/components/post_component.dart @@ -29,21 +29,29 @@ class _PostComponentState extends State with TickerProviderStateM choice = !choice; }); } + String formatPostDate(DateTime postDate) { + DateTime now = DateTime.now(); + DateTime yesterday = DateTime(now.year, now.month, now.day - 1); - final List frenchMonths = [ - 'Janvier', - 'Février', - 'Mars', - 'Avril', - 'Mai', - 'Juin', - 'Juillet', - 'Août', - 'Septembre', - 'Octobre', - 'Novembre', - 'Décembre' - ]; + if (postDate.year == now.year && postDate.month == now.month && postDate.day == now.day) { + // Aujourd'hui + return "Aujourd'hui, ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}"; + } else if (postDate.year == yesterday.year && postDate.month == yesterday.month && postDate.day == yesterday.day) { + // Hier + return 'hier, ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}'; + } else { + // Autre date + return '${postDate.day} ${_getMonthAbbreviation(postDate.month)} ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}'; + } + } + + String _getMonthAbbreviation(int month) { + const List monthsAbbreviation = [ + 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', + ]; + + return monthsAbbreviation[month - 1]; + } @override void initState() { @@ -101,18 +109,11 @@ class _PostComponentState extends State with TickerProviderStateM ), ), ), - 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}:$mins", + Text( + formatPostDate(widget.post.date), style: GoogleFonts.plusJakartaSans( color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), ) - : Text( - '${widget.post.date.day} ${frenchMonths[widget.post.date.month - 1]}, ${widget.post.date.hour}:$mins', - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ), ], ), SizedBox(height: 10), @@ -151,10 +152,8 @@ class _PostComponentState extends State with TickerProviderStateM children: [ SizedBox( width: double.infinity, - child: FadeInImage.assetNetwork( - image: widget.post.music.cover!, - fadeInDuration: const Duration(milliseconds: 100), - placeholder: "assets/images/loadingPlaceholder.gif", + child: Image.network( + widget.post.music.cover!, ), ), Image( @@ -195,11 +194,9 @@ class _PostComponentState extends State with TickerProviderStateM child: ClipRRect( borderRadius: BorderRadius.circular(13), // implement image - child: FadeInImage.assetNetwork( - image: widget.post.selfie!, + child: Image.network( + widget.post.selfie!, fit: BoxFit.cover, - fadeInDuration: const Duration(milliseconds: 100), - placeholder: "assets/images/loadingPlaceholder.gif", ), ), ), diff --git a/Sources/justMUSIC/lib/components/profil_picture_component.dart b/Sources/justMUSIC/lib/components/profil_picture_component.dart index 48b734a..d35a8d8 100644 --- a/Sources/justMUSIC/lib/components/profil_picture_component.dart +++ b/Sources/justMUSIC/lib/components/profil_picture_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import '../config/routes.dart'; import '../model/User.dart'; diff --git a/Sources/justMUSIC/lib/components/profile_list_component.dart b/Sources/justMUSIC/lib/components/profile_list_component.dart index 9201a0c..1dd56e9 100644 --- a/Sources/justMUSIC/lib/components/profile_list_component.dart +++ b/Sources/justMUSIC/lib/components/profile_list_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/components/profil_picture_component.dart'; diff --git a/Sources/justMUSIC/lib/components/recap_component.dart b/Sources/justMUSIC/lib/components/recap_component.dart index d7ce67e..386484b 100644 --- a/Sources/justMUSIC/lib/components/recap_component.dart +++ b/Sources/justMUSIC/lib/components/recap_component.dart @@ -1,5 +1,4 @@ -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../main.dart'; import '../model/User.dart' as justMusic; diff --git a/Sources/justMUSIC/lib/components/search_bar_component.dart b/Sources/justMUSIC/lib/components/search_bar_component.dart index ca7cf9b..cca7594 100644 --- a/Sources/justMUSIC/lib/components/search_bar_component.dart +++ b/Sources/justMUSIC/lib/components/search_bar_component.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../values/constants.dart'; diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index 6d26dd1..488ff0e 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -135,10 +135,8 @@ class _TopNavBarComponentState extends State with TickerProv @override Widget build(BuildContext context) { choice = widget.choice; - return Padding( - padding: const EdgeInsets.only(top: defaultPadding), - child: Container( - padding: EdgeInsets.symmetric(horizontal: defaultPadding), + return SafeArea(top:true,child: Container( + padding: EdgeInsets.symmetric(horizontal: defaultPadding, vertical: 20), width: double.infinity, height: 100, child: Row( diff --git a/Sources/justMUSIC/lib/config/routes.dart b/Sources/justMUSIC/lib/config/routes.dart index 4b36efa..a553584 100644 --- a/Sources/justMUSIC/lib/config/routes.dart +++ b/Sources/justMUSIC/lib/config/routes.dart @@ -1,10 +1,11 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:justmusic/screens/add_friend_screen.dart'; import 'package:justmusic/screens/capsule_historic_screen.dart'; import 'package:justmusic/screens/change_password_screen.dart'; import 'package:justmusic/screens/feed_screen.dart'; import 'package:justmusic/screens/profile_screen.dart'; import 'package:justmusic/screens/user_screen.dart'; +import 'package:justmusic/screens/welcome_screen.dart'; import '../model/User.dart'; @@ -109,3 +110,15 @@ Route routeHistoric() { }, ); } + +Route routeWelcome() { + return PageRouteBuilder( + pageBuilder: (context, animation, secondaryAnimation) => const WellcomeScreen(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return FadeTransition( + opacity: animation, + child: child, + ); + }, + ); +} diff --git a/Sources/justMUSIC/lib/main.dart b/Sources/justMUSIC/lib/main.dart index a371898..bd974fd 100644 --- a/Sources/justMUSIC/lib/main.dart +++ b/Sources/justMUSIC/lib/main.dart @@ -5,6 +5,7 @@ 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/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -19,6 +20,7 @@ import 'package:justmusic/screens/profile_screen.dart'; import 'package:justmusic/screens/registration_screen.dart'; import 'package:justmusic/screens/verify_email_screen.dart'; import 'package:justmusic/screens/welcome_screen.dart'; +import 'package:justmusic/values/constants.dart'; import 'package:justmusic/view_model/CommentViewModel.dart'; import 'package:justmusic/view_model/MusicViewModel.dart'; import 'package:justmusic/view_model/PostViewModel.dart'; @@ -26,9 +28,8 @@ import 'package:justmusic/view_model/UserViewModel.dart'; import 'package:justmusic/model/User.dart' as userJustMusic; import 'firebase_options.dart'; import 'package:timezone/data/latest.dart' as tz; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; import 'package:intl/date_symbol_data_local.dart'; +import 'package:fullscreen_window/fullscreen_window.dart'; Future main() async { tz.initializeTimeZones(); @@ -39,7 +40,9 @@ Future main() async { options: DefaultFirebaseOptions.currentPlatform, ); await initializeDateFormatting('fr_FR', null); - await FirebaseMessaging.instance.requestPermission(sound: true); + if (!kIsWeb) { + await FirebaseMessaging.instance.requestPermission(sound: true); + } runApp(const MyApp()); } @@ -63,6 +66,7 @@ class _MyAppState extends State { @override void initState() { + FullScreenWindow.setFullScreen(true); // enter fullscreen super.initState(); } @@ -76,12 +80,13 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); - Paint.enableDithering = true; + Paint.enableDithering = true; // enter fullscreen return ScreenUtilInit( useInheritedMediaQuery: true, builder: (context, child) { return MaterialApp( + color: bgColor, routes: { '/welcome': (context) => const WellcomeScreen(), '/feed': (context) => const FeedScreen(), @@ -116,7 +121,7 @@ class _MyAppState extends State { MyApp.userViewModel.userCurrent = userSnapshot.data!; return FeedScreen(); } else { - return const Text('User data not found'); + return WellcomeScreen(); } } }, diff --git a/Sources/justMUSIC/lib/model/Capsule.dart b/Sources/justMUSIC/lib/model/Capsule.dart new file mode 100644 index 0000000..0b4cc31 --- /dev/null +++ b/Sources/justMUSIC/lib/model/Capsule.dart @@ -0,0 +1,34 @@ +import 'package:tuple/tuple.dart'; + +import 'Music.dart'; + +class Capsule { + final String _id; + late Music _music; + Tuple2 _location; + DateTime _date; + + // Constructor + Capsule(this._id, this._location, this._date); + + //Getters and setters + String get id => _id; + + Music get music => _music; + + set music(Music value) { + _music = value; + } + + Tuple2 get location => _location; + + set location(Tuple2 value) { + _location = value; + } + + DateTime get date => _date; + + set date(DateTime value) { + _date = value; + } +} diff --git a/Sources/justMUSIC/lib/screens/add_friend_screen.dart b/Sources/justMUSIC/lib/screens/add_friend_screen.dart index 246e514..e5973de 100644 --- a/Sources/justMUSIC/lib/screens/add_friend_screen.dart +++ b/Sources/justMUSIC/lib/screens/add_friend_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/values/constants.dart'; diff --git a/Sources/justMUSIC/lib/screens/capsule_historic_screen.dart b/Sources/justMUSIC/lib/screens/capsule_historic_screen.dart index f1f7646..b50f908 100644 --- a/Sources/justMUSIC/lib/screens/capsule_historic_screen.dart +++ b/Sources/justMUSIC/lib/screens/capsule_historic_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../components/historic_component.dart'; @@ -77,8 +77,9 @@ class _CapsuleHistoricScreenState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( - padding: const EdgeInsets.only(top: 80, left: 60, right: 60), + Container( + padding: const EdgeInsets.only(top: 80, left: 30, right: 30), + constraints: const BoxConstraints( maxWidth: 700), child: Align( alignment: Alignment.center, child: Row( @@ -130,8 +131,6 @@ class _CapsuleHistoricScreenState extends State { child: SizedBox( width: double.infinity, child: Container( - padding: EdgeInsets.symmetric(horizontal: 15), - constraints: BoxConstraints(maxWidth: 600), child: Column( children: [ HistoricComponent( diff --git a/Sources/justMUSIC/lib/screens/change_password_screen.dart b/Sources/justMUSIC/lib/screens/change_password_screen.dart index d9d8beb..8a89fca 100644 --- a/Sources/justMUSIC/lib/screens/change_password_screen.dart +++ b/Sources/justMUSIC/lib/screens/change_password_screen.dart @@ -1,6 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/Sources/justMUSIC/lib/screens/detail_post_screen.dart b/Sources/justMUSIC/lib/screens/detail_post_screen.dart index f1b8227..a2e378f 100644 --- a/Sources/justMUSIC/lib/screens/detail_post_screen.dart +++ b/Sources/justMUSIC/lib/screens/detail_post_screen.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -67,15 +67,45 @@ class _DetailPostScreenState extends State { } final ScrollController _scrollController = ScrollController(); + String formatPostDate(DateTime postDate) { + DateTime now = DateTime.now(); + DateTime yesterday = DateTime(now.year, now.month, now.day - 1); - @override - Widget build(BuildContext context) { - var mins = "0"; - if (widget.post.date.minute < 10) { - mins = "0${widget.post.date.minute}"; + if (postDate.year == now.year && postDate.month == now.month && postDate.day == now.day) { + // Aujourd'hui + return "Aujourd'hui, ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}"; + } else if (postDate.year == yesterday.year && postDate.month == yesterday.month && postDate.day == yesterday.day) { + // Hier + return 'hier, ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}'; } else { - mins = widget.post.date.minute.toString(); + // Autre date + return '${postDate.day} ${_getMonthAbbreviation(postDate.month)} ${postDate.hour}:${postDate.minute.toString().padLeft(2, '0')}'; } + } + + + String _getMonthAbbreviation(int month) { + const List monthsAbbreviation = [ + 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', + ]; + + return monthsAbbreviation[month - 1]; + } + +// Exemple d'utilisation : + void main() { + DateTime postDate = DateTime(2023, 11, 17, 17, 55); // Remplacez par votre date + + String formattedDate = formatPostDate(postDate); + print(formattedDate); // Affichera "17 nov. 17:55" ou "hier, 17:55" selon la date + } + + + @override + Widget build(BuildContext context) { + _scrollController.addListener(() { + if (_scrollController.position.pixels < 0) _scrollController.jumpTo(0); + }); return GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -86,6 +116,7 @@ class _DetailPostScreenState extends State { }, child: Container( height: 760.h, + color: bgAppBar, child: Column( children: [ Expanded( @@ -118,156 +149,140 @@ class _DetailPostScreenState extends State { Column( children: [ Container( - height: 200, - margin: EdgeInsets.only(top: 230), - width: double.infinity, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - bgModal.withOpacity(0.5), - bgModal.withOpacity(0.75), - bgModal - ], - stops: [0, 0.2, 0.4, 0.8], + height: 200, + margin: EdgeInsets.only(top: 230), + width: double.infinity, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Colors.transparent, + bgModal.withOpacity(0.5), + bgModal.withOpacity(0.75), + bgModal + ], + stops: [0, 0.2, 0.4, 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: ProfilPictureComponent(user: widget.post.user), - ), - ), - ) - : 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, + 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: ProfilPictureComponent(user: widget.post.user), + ), + ), + ) + : 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)), ), - 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}:$mins", - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, - fontSize: 18, - ), - ) - : Text( - "hier, ${widget.post.date.hour}:$mins", - 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}", + Padding( + padding: const EdgeInsets.only(left: 20.0), + child: choice + ? Text( + formatPostDate(widget.post.date), style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.5), - fontWeight: FontWeight.w400, - fontSize: 15, + height: 1, + color: Colors.white, + fontWeight: FontWeight.w900, + fontSize: 18, ), ) - : Text( - "", + : Text( + widget.post.music.date.toString(), style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13, + height: 1, + color: Colors.white, + fontWeight: FontWeight.w900, + fontSize: 18, ), - ) - : 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)), ), + ], + ), + ), + 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( + widget.post.description != null ? Align( alignment: Alignment.bottomLeft, - child: Padding( + child: Container( padding: const EdgeInsets.fromLTRB(50, 35, 50, 35), + color: bgModal, + width: double.infinity, child: Text( widget.post.description!, textAlign: TextAlign.left, @@ -281,7 +296,7 @@ class _DetailPostScreenState extends State { ), ) : Container( - height: 30, + height: 0, ), Container( width: double.infinity, @@ -594,6 +609,7 @@ class _DetailPostScreenState extends State { Expanded( child: TextField( keyboardAppearance: Brightness.dark, + keyboardType: TextInputType.text, controller: _textController, focusNode: myFocusNode, onSubmitted: (value) async { @@ -608,7 +624,6 @@ class _DetailPostScreenState extends State { setState(() {}); }, cursorColor: primaryColor, - keyboardType: TextInputType.emailAddress, style: GoogleFonts.plusJakartaSans(color: Colors.white), decoration: InputDecoration( suffixIcon: _textController.text.isEmpty @@ -627,12 +642,12 @@ class _DetailPostScreenState extends State { _textController.clear(); }); }, - icon: Icon( + icon: const Icon( Icons.send, color: primaryColor, size: 20, )), - focusedBorder: OutlineInputBorder( + focusedBorder: const OutlineInputBorder( borderSide: BorderSide(width: 1, color: grayText), borderRadius: BorderRadius.all(Radius.circular(100)), ), @@ -640,7 +655,7 @@ class _DetailPostScreenState extends State { fillColor: bgModal, filled: true, focusColor: Color.fromRGBO(255, 255, 255, 0.30), - enabledBorder: OutlineInputBorder( + enabledBorder: const OutlineInputBorder( borderSide: BorderSide(width: 1, color: grayText), borderRadius: BorderRadius.all(Radius.circular(100)), ), diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index 4ad8120..1a38fbd 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -25,13 +25,15 @@ class _FeedScreenState extends State with SingleTickerProviderStateM late Animation animation; late List friendFeed; Timer? timer; - + var pageFriend = 0; late List discoveryFeed; late Tuple2, List> displayFeed; bool isDismissed = true; bool choiceFeed = true; PageController controller = PageController(); + + @override void initState() { super.initState(); @@ -124,9 +126,26 @@ class _FeedScreenState extends State with SingleTickerProviderStateM @override Widget build(BuildContext context) { displayFeed = - Tuple2(MyApp.postViewModel.postsFriends.reversed.toList(), MyApp.postViewModel.bestPosts.reversed.toList()); + Tuple2(MyApp.postViewModel.postsFriends.toList(), MyApp.postViewModel.bestPosts.toList()); bool empty = (choiceFeed == true && displayFeed.item1.isEmpty) || (choiceFeed == false && displayFeed.item2.isEmpty); + ScrollController _scrollController = ScrollController(); + _scrollController.addListener(() { + if (_scrollController.position.maxScrollExtent == + _scrollController.position.pixels) { + print("fin"); + if (choiceFeed) { + setState(() { + MyApp.postViewModel.getMorePostsFriends(); + }); + } else { + setState(() { + MyApp.postViewModel.getMoreBestPosts(); + }); + } + } + }); + return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: bgColor, @@ -185,6 +204,7 @@ class _FeedScreenState extends State with SingleTickerProviderStateM physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), clipBehavior: Clip.none, shrinkWrap: false, + controller: _scrollController, itemCount: displayFeed.item1.length, itemBuilder: (BuildContext context, int index) { return Padding( @@ -193,6 +213,7 @@ class _FeedScreenState extends State with SingleTickerProviderStateM PostComponent(callback: openDetailPost, post: displayFeed.item1[index], index: index), ); }, + ), ), ), @@ -212,6 +233,7 @@ class _FeedScreenState extends State with SingleTickerProviderStateM triggerMode: RefreshIndicatorTriggerMode.onEdge, onRefresh: _refresh, child: ListView.builder( + controller: _scrollController, physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), clipBehavior: Clip.none, shrinkWrap: false, diff --git a/Sources/justMUSIC/lib/screens/forget_password_screen.dart b/Sources/justMUSIC/lib/screens/forget_password_screen.dart index f43c889..49fbd36 100644 --- a/Sources/justMUSIC/lib/screens/forget_password_screen.dart +++ b/Sources/justMUSIC/lib/screens/forget_password_screen.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -52,9 +52,9 @@ class _ForgetPasswordScreenState extends State { setState(() => canResendEmail = true); } on FirebaseAuthException catch (e) { if (e.code == "invalid-email") { - error = "Mail incorrect"; - } else if (e.code == "user-not-found") { error = "Format de mail incorrect"; + } else if (e.code == "user-not-found") { + error = "Mail incorrect"; } else if (e.code == "too-many-requests") { error = "Trop de tentatives. Veuillez réessayer plus tard"; diff --git a/Sources/justMUSIC/lib/screens/launching_rocker_screen.dart b/Sources/justMUSIC/lib/screens/launching_rocker_screen.dart index 2195c80..fa45c7e 100644 --- a/Sources/justMUSIC/lib/screens/launching_rocker_screen.dart +++ b/Sources/justMUSIC/lib/screens/launching_rocker_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:justmusic/config/routes.dart'; import 'package:lottie/lottie.dart'; diff --git a/Sources/justMUSIC/lib/screens/loading_screen.dart b/Sources/justMUSIC/lib/screens/loading_screen.dart index e9bb106..777fbd6 100644 --- a/Sources/justMUSIC/lib/screens/loading_screen.dart +++ b/Sources/justMUSIC/lib/screens/loading_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import '../values/constants.dart'; diff --git a/Sources/justMUSIC/lib/screens/post_screen.dart b/Sources/justMUSIC/lib/screens/post_screen.dart index fb6dbed..a256406 100644 --- a/Sources/justMUSIC/lib/screens/post_screen.dart +++ b/Sources/justMUSIC/lib/screens/post_screen.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'dart:ui'; import 'package:animations/animations.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:justmusic/components/back_button.dart'; import 'package:justmusic/screens/launching_rocker_screen.dart'; diff --git a/Sources/justMUSIC/lib/screens/profile_screen.dart b/Sources/justMUSIC/lib/screens/profile_screen.dart index e0f484c..a25176b 100644 --- a/Sources/justMUSIC/lib/screens/profile_screen.dart +++ b/Sources/justMUSIC/lib/screens/profile_screen.dart @@ -19,9 +19,9 @@ class ProfileScreen extends StatefulWidget { class _ProfileScreenState extends State { @override Widget build(BuildContext context) { - Future logout() async { - await MyApp.userViewModel.logout(); - Navigator.pushNamed(context, '/welcome'); + void logout() { + MyApp.userViewModel.logout(); + Navigator.of(context).push(routeWelcome()); } void _openHistoric() { @@ -32,7 +32,40 @@ class _ProfileScreenState extends State { Navigator.of(context).push(routeUser(MyApp.userViewModel.userCurrent)); } - void _openPassword() { + void openConfirmationDelete() { + showCupertinoModalPopup( + context: context, + barrierColor: Colors.black.withOpacity(0.7), + builder: (BuildContext context) => Container( + child: CupertinoActionSheet( + title: Text( + 'Supprimer mon compte', + style: GoogleFonts.plusJakartaSans(fontWeight: FontWeight.bold), + ), + actions: [ + CupertinoActionSheetAction( + onPressed: () { + MyApp.userViewModel.delete(); + Navigator.pop(context); + Navigator.of(context).push(routeWelcome()); + + }, + child: Text('Confirmer', style: TextStyle(color: Colors.blue),), + ), + ], + cancelButton: CupertinoActionSheetAction( + isDestructiveAction: true, + onPressed: () { + Navigator.pop(context); + }, + child: const Text('Annuler'), + ), + ), + ), + ); + } + + void openPassword() { Navigator.of(context).push(routePassword()); } @@ -117,7 +150,7 @@ class _ProfileScreenState extends State { SettingPartComponent( icon: JustMusicIcon.password, label: 'Modifier mon mot de passe', - action: _openPassword, + action: openPassword, ), SettingPartComponent( icon: JustMusicIcon.cross, diff --git a/Sources/justMUSIC/lib/screens/search_location_screen.dart b/Sources/justMUSIC/lib/screens/search_location_screen.dart index 82d8261..080dcc2 100644 --- a/Sources/justMUSIC/lib/screens/search_location_screen.dart +++ b/Sources/justMUSIC/lib/screens/search_location_screen.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import '../components/city_list_component.dart'; diff --git a/Sources/justMUSIC/lib/screens/search_song_screen.dart b/Sources/justMUSIC/lib/screens/search_song_screen.dart index a20355c..3813a43 100644 --- a/Sources/justMUSIC/lib/screens/search_song_screen.dart +++ b/Sources/justMUSIC/lib/screens/search_song_screen.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:ui'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/Sources/justMUSIC/lib/screens/user_screen.dart b/Sources/justMUSIC/lib/screens/user_screen.dart index 30eb974..9d5efb2 100644 --- a/Sources/justMUSIC/lib/screens/user_screen.dart +++ b/Sources/justMUSIC/lib/screens/user_screen.dart @@ -1,8 +1,5 @@ import 'dart:io'; - -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -146,10 +143,11 @@ class _UserScreenState extends State { padding: const EdgeInsets.symmetric(horizontal: settingPadding), child: Column( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( + Container( padding: EdgeInsets.only(top: 68.h, bottom: 40), + constraints: const BoxConstraints( maxWidth: 500), child: Stack( alignment: Alignment.center, children: [ @@ -252,7 +250,11 @@ class _UserScreenState extends State { SizedBox( height: 40, ), - RecapComponent(user: widget.user) + Container( + constraints: const BoxConstraints( maxWidth: 500), + child: RecapComponent(user: widget.user), + ) + ], ), ), diff --git a/Sources/justMUSIC/lib/screens/verify_email_screen.dart b/Sources/justMUSIC/lib/screens/verify_email_screen.dart index 63b0e16..23d2438 100644 --- a/Sources/justMUSIC/lib/screens/verify_email_screen.dart +++ b/Sources/justMUSIC/lib/screens/verify_email_screen.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flutter/Material.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:justmusic/main.dart'; diff --git a/Sources/justMUSIC/lib/services/CapsuleService.dart b/Sources/justMUSIC/lib/services/CapsuleService.dart new file mode 100644 index 0000000..95ff4e8 --- /dev/null +++ b/Sources/justMUSIC/lib/services/CapsuleService.dart @@ -0,0 +1,33 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; + +class CapsuleService { + Future> recapSevenDays(String id) async { + List recapList = []; + + DateTime sevenDaysAgo = DateTime.now().subtract(Duration(days: 6)); + + QuerySnapshot> response = await FirebaseFirestore + .instance + .collection("capsules") + .where("user_id", isEqualTo: id) + .get(); + + List?> capsuleList = response.docs + .map((DocumentSnapshot> doc) => doc.data()) + .toList(); + + for (int i = 0; i < 7; i++) { + DateTime date = sevenDaysAgo.add(Duration(days: i)); + bool capsuleExists = capsuleList.any((post) => + post?["date"] != null && + post?["date"].toDate().year == date.year && + post?["date"].toDate().month == date.month && + post?["date"].toDate().day == date.day); + + recapList.add(capsuleExists); + } + + return recapList; + } + +} diff --git a/Sources/justMUSIC/lib/services/GeoApi.dart b/Sources/justMUSIC/lib/services/GeoApi.dart index 1f5e55e..b911ba1 100644 --- a/Sources/justMUSIC/lib/services/GeoApi.dart +++ b/Sources/justMUSIC/lib/services/GeoApi.dart @@ -38,7 +38,7 @@ class GeoApi { Position position = await Geolocator.getCurrentPosition( desiredAccuracy: LocationAccuracy.high); String apiUrl = - 'http://api.openweathermap.org/data/2.5/find?lat=${position.latitude}&lon=${position.longitude}&cnt=10&appid=$apiKey'; + 'https://api.openweathermap.org/data/2.5/find?lat=${position.latitude}&lon=${position.longitude}&cnt=10&appid=$apiKey'; var response = await http.get(Uri.parse(apiUrl)); if (response.statusCode == 200) { var data = json.decode(response.body); diff --git a/Sources/justMUSIC/lib/services/MusicService.dart b/Sources/justMUSIC/lib/services/MusicService.dart index 09d1cf9..684571e 100644 --- a/Sources/justMUSIC/lib/services/MusicService.dart +++ b/Sources/justMUSIC/lib/services/MusicService.dart @@ -37,7 +37,7 @@ class MusicService { List> capsules = []; var querySnapshot = await FirebaseFirestore.instance - .collection('posts') + .collection('capsules') .where('user_id', isEqualTo: idUser) .where('date', isGreaterThanOrEqualTo: DateTime(year, month)) .where('date', isLessThan: DateTime(year, month + 1)) diff --git a/Sources/justMUSIC/lib/services/PostService.dart b/Sources/justMUSIC/lib/services/PostService.dart index 28557a8..cb1b7f0 100644 --- a/Sources/justMUSIC/lib/services/PostService.dart +++ b/Sources/justMUSIC/lib/services/PostService.dart @@ -23,6 +23,15 @@ class PostService { var userRef = MyApp.db.collection("users").doc(id); + var capsule = { + "user_id": id, + "date": DateTime.now(), + "place": [location?.item1, location?.item2], + "song_id": idMusic, + }; + + await MyApp.db.collection("capsules").doc(postAdd.id).set(capsule); + await MyApp.db.runTransaction((transaction) async { var userSnapshot = await transaction.get(userRef); if (userSnapshot.exists) { @@ -42,16 +51,41 @@ class PostService { deletePost() {} - Future>>> getPopularPosts( - {int limit = 10, - QueryDocumentSnapshot>? offset}) async { + Future>>> getPopularPosts(int limit) async { + DateTime twentyFourHoursAgo = DateTime.now().subtract(Duration(hours: 24)); + var response = await FirebaseFirestore.instance + .collection("posts") + .where("date", isGreaterThan: twentyFourHoursAgo) + .orderBy("date", descending: true) + .limit(limit) + .get(); + + MyApp.postViewModel.lastPostDiscovery = response.docs.isNotEmpty + ? response.docs.last + : MyApp.postViewModel.lastPostDiscovery; + + var filteredPosts = response.docs.where((doc) { + String user = doc["user_id"]; + return user != MyApp.userViewModel.userCurrent.id; + }).toList(); + return filteredPosts; + } + + Future>>> getMorePopularPosts(int limit) async { + DateTime twentyFourHoursAgo = DateTime.now().subtract(Duration(hours: 24)); QuerySnapshot> response; response = await FirebaseFirestore.instance .collection("posts") - .orderBy("date") + .where("date", isGreaterThan: twentyFourHoursAgo) + .orderBy("date", descending: true) .limit(limit) + .startAfterDocument(MyApp.postViewModel.lastPostDiscovery) .get(); + MyApp.postViewModel.lastPostDiscovery = response.docs.isNotEmpty + ? response.docs.last + : MyApp.postViewModel.lastPostDiscovery; + var filteredPosts = response.docs.where((doc) { String user = doc["user_id"]; return user != MyApp.userViewModel.userCurrent.id; @@ -59,18 +93,41 @@ class PostService { return filteredPosts; } - Future>>> getPostsFriends( - {int limit = 10, int offset = 0}) async { + Future>>> getPostsFriends(int limit) async { + var response = await FirebaseFirestore.instance + .collection("posts") + .where("user_id", whereIn: [ + MyApp.userViewModel.userCurrent.id, + ...MyApp.userViewModel.userCurrent.followed + ]) + .where("") + .orderBy("date", descending: true) + .limit(limit) + .get(); + + MyApp.postViewModel.lastPostFriend = response.docs.isNotEmpty + ? response.docs.last + : MyApp.postViewModel.lastPostFriend; + + return response.docs; + } + + Future>>> getMorePostsFriends(int limit) async { var response = await FirebaseFirestore.instance .collection("posts") .where("user_id", whereIn: [ MyApp.userViewModel.userCurrent.id, ...MyApp.userViewModel.userCurrent.followed ]) - .orderBy("date") + .orderBy("date", descending: true) .limit(limit) + .startAfterDocument(MyApp.postViewModel.lastPostFriend) .get(); + MyApp.postViewModel.lastPostFriend = response.docs.isNotEmpty + ? response.docs.last + : MyApp.postViewModel.lastPostFriend; + return response.docs; } @@ -93,35 +150,6 @@ class PostService { return !isTodayAvailable; } - Future> recapSevenDays(String id) async { - List recapList = []; - - DateTime sevenDaysAgo = DateTime.now().subtract(Duration(days: 6)); - - QuerySnapshot> response = await FirebaseFirestore - .instance - .collection("posts") - .where("user_id", isEqualTo: id) - .get(); - - List?> postList = response.docs - .map((DocumentSnapshot> doc) => doc.data()) - .toList(); - - for (int i = 0; i < 7; i++) { - DateTime date = sevenDaysAgo.add(Duration(days: i)); - bool postExists = postList.any((post) => - post?["date"] != null && - post?["date"].toDate().year == date.year && - post?["date"].toDate().month == date.month && - post?["date"].toDate().day == date.day); - - recapList.add(postExists); - } - - return recapList; - } - Future> getLikesByPostId(String id) async { var response = await FirebaseFirestore.instance.collection("posts").doc(id).get(); diff --git a/Sources/justMUSIC/lib/values/constants.dart b/Sources/justMUSIC/lib/values/constants.dart index 8b3b4c4..68a68b1 100644 --- a/Sources/justMUSIC/lib/values/constants.dart +++ b/Sources/justMUSIC/lib/values/constants.dart @@ -13,7 +13,7 @@ const bgTextField = Color(0xFF1C1B23); const strokeTextField = Color(0xFF373546); const unactiveFeed = Color(0xFF848484); const gradiantPost = Color(0xFF0D0D0D); -const bgModal = Color(0xFF1E1E1E); +const bgModal = Color(0xFF222222); const textFieldMessage = Color(0xFF232323); const bgComment = Color(0xFF222222); const bgAppBar = Color(0xFF181818); @@ -24,6 +24,7 @@ const searchBarColor = Color(0xFF161616); const postbutton = Color(0xFF1B1B1B); const fillButton = Color(0xFF633AF4); const selectedButton = Color(0xFF1F1B2E); +const tooltipBackground = Color(0xFF2D2D2D); // All constants important too us const defaultPadding = 30.0; diff --git a/Sources/justMUSIC/lib/values/keys.dart b/Sources/justMUSIC/lib/values/keys.dart new file mode 100644 index 0000000..637b126 --- /dev/null +++ b/Sources/justMUSIC/lib/values/keys.dart @@ -0,0 +1,5 @@ +const geoKey = "85a2724ad38b3994c2b7ebe1d239bbff"; +const clientId = "d9b82921bbdf43efa15d0c34c28c6f93"; +const clientSecret = "ba01687f59ea4ab7ad00c769e89e44d8"; +const keyApiFirebase = + "AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC"; \ No newline at end of file diff --git a/Sources/justMUSIC/lib/view_model/MusicViewModel.dart b/Sources/justMUSIC/lib/view_model/MusicViewModel.dart index c3a1618..2d9db58 100644 --- a/Sources/justMUSIC/lib/view_model/MusicViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/MusicViewModel.dart @@ -242,7 +242,6 @@ class MusicViewModel { for (var capsule in capsulesData) { var music = musics.firstWhere((music) => music.id == capsule.item2); - print(capsule.item1); capsules.add(Tuple2(capsule.item1, music)); } return capsules; diff --git a/Sources/justMUSIC/lib/view_model/PostViewModel.dart b/Sources/justMUSIC/lib/view_model/PostViewModel.dart index 1c2a361..b49fa38 100644 --- a/Sources/justMUSIC/lib/view_model/PostViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/PostViewModel.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:justmusic/model/Post.dart'; +import 'package:justmusic/services/CapsuleService.dart'; import 'package:justmusic/services/PostService.dart'; import 'package:tuple/tuple.dart'; @@ -11,7 +12,10 @@ import '../model/mapper/PostMapper.dart'; class PostViewModel { List _postsFriends = []; List _bestPosts = []; + var lastPostFriend; + var lastPostDiscovery; final PostService _postService = PostService(); + final CapsuleService _capsuleService = CapsuleService(); // Constructor PostViewModel(); @@ -26,10 +30,10 @@ class PostViewModel { await _postService.createPost(description, idMusic, image, location); } - Future> getPostsFriends() async { + Future> getPostsFriends({int limit = 10}) async { try { _postsFriends = []; - var responseData = await _postService.getPostsFriends(); + var responseData = await _postService.getPostsFriends(limit); List ids = []; var postsFutures = responseData.map((value) { ids.add(value.data()["song_id"]); @@ -40,7 +44,7 @@ class PostViewModel { for (int i = 0; i < posts.length; i++) { posts[i].music = musics[i]; } - _postsFriends = posts; + _postsFriends.addAll(posts); return _postsFriends; } catch (e) { print(e); @@ -49,13 +53,29 @@ class PostViewModel { } } - List getMorePostsFriends() { - throw new Error(); + void getMorePostsFriends({int limit = 10}) async { + try { + var responseData = await _postService.getMorePostsFriends(limit); + List ids = []; + var postsFutures = responseData.map((value) { + ids.add(value.data()["song_id"]); + return PostMapper.toModel(value); + }).toList(); + var posts = await Future.wait(postsFutures); + List musics = await MyApp.musicViewModel.getMusicsWithIds(ids); + for (int i = 0; i < posts.length; i++) { + posts[i].music = musics[i]; + } + _postsFriends.addAll(posts); + } catch (e) { + print(e); + } } - Future> getBestPosts() async { + Future> getBestPosts({int limit = 10}) async { try { - var responseData = await _postService.getPopularPosts(); + _bestPosts = []; + var responseData = await _postService.getPopularPosts(limit); List ids = []; var postsFutures = responseData.map((value) async { ids.add(value.data()["song_id"]); @@ -66,7 +86,7 @@ class PostViewModel { for (int i = 0; i < posts.length; i++) { posts[i].music = musics[i]; } - _bestPosts = posts; + _bestPosts.addAll(posts); return _bestPosts; } catch (e) { print(e); @@ -75,13 +95,28 @@ class PostViewModel { } } - List getMoreBestPosts() { - throw new Error(); + void getMoreBestPosts({int limit = 10}) async { + try { + var responseData = await _postService.getMorePopularPosts(limit); + List ids = []; + var postsFutures = responseData.map((value) async { + ids.add(value.data()["song_id"]); + return await PostMapper.toModel(value); + }).toList(); + var posts = await Future.wait(postsFutures); + List musics = await MyApp.musicViewModel.getMusicsWithIds(ids); + for (int i = 0; i < posts.length; i++) { + posts[i].music = musics[i]; + } + _bestPosts.addAll(posts); + } catch (e) { + print(e); + } } Future> recapSevenDays(String id) async { try { - return await _postService.recapSevenDays(id); + return await _capsuleService.recapSevenDays(id); } catch (e) { print(e); rethrow; @@ -112,7 +147,6 @@ class PostViewModel { print(bool); return bool; } catch (e) { - print("haaaaaaaaa"); rethrow; } } diff --git a/Sources/justMUSIC/pubspec.lock b/Sources/justMUSIC/pubspec.lock index 89568be..079d274 100644 --- a/Sources/justMUSIC/pubspec.lock +++ b/Sources/justMUSIC/pubspec.lock @@ -61,58 +61,58 @@ packages: dependency: "direct main" description: name: audioplayers - sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282" + sha256: c05c6147124cd63e725e861335a8b4d57300b80e6e92cea7c145c739223bbaef url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "5.2.1" audioplayers_android: dependency: transitive description: name: audioplayers_android - sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c + sha256: b00e1a0e11365d88576320ec2d8c192bc21f1afb6c0e5995d1c57ae63156acb5 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.0.3" audioplayers_darwin: dependency: transitive description: name: audioplayers_darwin - sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d" + sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "5.0.2" audioplayers_linux: dependency: transitive description: name: audioplayers_linux - sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338" + sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.1.0" audioplayers_platform_interface: dependency: transitive description: name: audioplayers_platform_interface - sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143 + sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb" url: "https://pub.dev" source: hosted - version: "5.0.1" + version: "6.1.0" audioplayers_web: dependency: transitive description: name: audioplayers_web - sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339 + sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.1.0" audioplayers_windows: dependency: transitive description: name: audioplayers_windows - sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3" + sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.1.0" auto_size_text: dependency: "direct main" description: @@ -161,6 +161,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" circular_reveal_animation: dependency: "direct main" description: @@ -169,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 + url: "https://pub.dev" + source: hosted + version: "0.4.0" clock: dependency: transitive description: @@ -205,10 +221,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" convert: dependency: transitive description: @@ -494,6 +510,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + flutter_launcher_icons: + dependency: "direct main" + description: + name: flutter_launcher_icons + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" + source: hosted + version: "0.13.1" flutter_lints: dependency: "direct dev" description: @@ -552,6 +576,14 @@ packages: url: "https://pub.dev" source: hosted version: "9.2.0" + fullscreen_window: + dependency: "direct main" + description: + name: fullscreen_window + sha256: fe3014f91bff16a82d142ba9d834980b8a84b4bb03347a92588d389ad92bd1d3 + url: "https://pub.dev" + source: hosted + version: "1.0.4" geolocator: dependency: "direct main" description: @@ -604,10 +636,10 @@ packages: dependency: "direct main" description: name: google_fonts - sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8 url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "6.1.0" google_identity_services_web: dependency: transitive description: @@ -676,10 +708,10 @@ packages: dependency: "direct main" description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.1.0" http_parser: dependency: transitive description: @@ -688,14 +720,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + url: "https://pub.dev" + source: hosted + version: "4.0.17" image_picker: dependency: "direct main" description: name: image_picker - sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" + sha256: "7d7f2768df2a8b0a3cefa5ef4f84636121987d403130e70b17ef7e2cf650ba84" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" image_picker_android: dependency: transitive description: @@ -708,10 +748,10 @@ packages: dependency: transitive description: name: image_picker_for_web - sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + sha256: "50bc9ae6a77eea3a8b11af5eb6c661eeb858fdd2f734c2a4fd17086922347ef7" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "3.0.1" image_picker_ios: dependency: transitive description: @@ -784,6 +824,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" lints: dependency: transitive description: @@ -804,26 +852,26 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -993,10 +1041,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: @@ -1017,18 +1065,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -1057,10 +1105,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" text_scroll: dependency: "direct main" description: @@ -1141,6 +1189,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" win32: dependency: transitive description: @@ -1165,6 +1221,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" zoom_tap_animation: dependency: "direct main" description: @@ -1174,5 +1238,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.10.0" diff --git a/Sources/justMUSIC/pubspec.yaml b/Sources/justMUSIC/pubspec.yaml index 402d414..a98decc 100644 --- a/Sources/justMUSIC/pubspec.yaml +++ b/Sources/justMUSIC/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.2+12 environment: - sdk: '>=2.18.2 <3.0.0' + sdk: '>=3.1.4 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,13 +31,13 @@ environment: dependencies: flutter: sdk: flutter - http: ^0.13.5 + http: ^1.1.0 # 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 + google_fonts: ^6.1.0 gradiantbutton: ^0.0.1 smooth_corner: ^1.1.0 flutter_signin_button: ^2.0.0 @@ -50,7 +50,7 @@ dependencies: custom_draggable_widget: ^0.0.2 modal_bottom_sheet: ^2.1.2 flutter_animated_play_button: ^0.3.0 - audioplayers: ^4.1.0 + audioplayers: ^5.2.1 ionicons: ^0.2.2 top_snackbar_flutter: ^3.1.0 firebase_core: ^2.15.0 @@ -76,6 +76,8 @@ dependencies: firebase_messaging: ^14.6.5 cached_network_image: ^3.2.3 google_sign_in: ^6.1.4 + flutter_launcher_icons: ^0.13.1 + fullscreen_window: ^1.0.3 dev_dependencies: flutter_test: @@ -88,6 +90,14 @@ dev_dependencies: # rules and activating additional ones. flutter_lints: ^2.0.0 + +flutter_launcher_icons: + android: "launcher_icon" + ios: true + image_path: "assets/images/logo-JustMusic.png" + remove_alpha_ios: true + min_sdk_android: 21 # android min sdk min:16, default 21 + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/Sources/justMUSIC/web/favicon.png b/Sources/justMUSIC/web/favicon.png new file mode 100644 index 0000000..a8f23fb Binary files /dev/null and b/Sources/justMUSIC/web/favicon.png differ diff --git a/Sources/justMUSIC/web/icons/icon-192.png b/Sources/justMUSIC/web/icons/icon-192.png new file mode 100644 index 0000000..54a99c6 Binary files /dev/null and b/Sources/justMUSIC/web/icons/icon-192.png differ diff --git a/Sources/justMUSIC/web/icons/icon-512.png b/Sources/justMUSIC/web/icons/icon-512.png new file mode 100644 index 0000000..3317d90 Binary files /dev/null and b/Sources/justMUSIC/web/icons/icon-512.png differ diff --git a/Sources/justMUSIC/web/icons/icon-maskable-192.png b/Sources/justMUSIC/web/icons/icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/Sources/justMUSIC/web/icons/icon-maskable-192.png differ diff --git a/Sources/justMUSIC/web/icons/icon-maskable-512.png b/Sources/justMUSIC/web/icons/icon-maskable-512.png new file mode 100644 index 0000000..3317d90 Binary files /dev/null and b/Sources/justMUSIC/web/icons/icon-maskable-512.png differ diff --git a/Sources/justMUSIC/web/index.html b/Sources/justMUSIC/web/index.html new file mode 100644 index 0000000..102f4a1 --- /dev/null +++ b/Sources/justMUSIC/web/index.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + justmusic + + + + + + + + + + + diff --git a/Sources/justMUSIC/web/manifest.json b/Sources/justMUSIC/web/manifest.json new file mode 100644 index 0000000..6c4b61e --- /dev/null +++ b/Sources/justMUSIC/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "justmusic", + "short_name": "justmusic", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +}