diff --git a/.idea/Daflv4.iml b/.idea/Daflv4.iml index 23209a3..8422991 100644 --- a/.idea/Daflv4.iml +++ b/.idea/Daflv4.iml @@ -6,6 +6,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml deleted file mode 100644 index 0fa6055..0000000 --- a/.idea/libraries/Dart_Packages.xml +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index 6ae284f..b6e6985 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/Sources/dafl_project_flutter/assets/images/EmptyDiscovery-Hint.png b/Sources/dafl_project_flutter/assets/images/EmptyDiscovery-Hint.png new file mode 100644 index 0000000..4cf47a2 Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/EmptyDiscovery-Hint.png differ diff --git a/Sources/dafl_project_flutter/assets/images/backgroundNotify.png b/Sources/dafl_project_flutter/assets/images/backgroundNotify.png new file mode 100644 index 0000000..40afbec Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/backgroundNotify.png differ diff --git a/Sources/dafl_project_flutter/assets/images/errorNotify.png b/Sources/dafl_project_flutter/assets/images/errorNotify.png new file mode 100644 index 0000000..b8d9a71 Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/errorNotify.png differ diff --git a/Sources/dafl_project_flutter/assets/images/error_animation.riv b/Sources/dafl_project_flutter/assets/images/error_animation.riv new file mode 100644 index 0000000..8e33a84 Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/error_animation.riv differ diff --git a/Sources/dafl_project_flutter/assets/images/error_icon.riv b/Sources/dafl_project_flutter/assets/images/error_icon.riv new file mode 100644 index 0000000..3339560 Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/error_icon.riv differ diff --git a/Sources/dafl_project_flutter/ios/Flutter/Debug.xcconfig b/Sources/dafl_project_flutter/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/Sources/dafl_project_flutter/ios/Flutter/Debug.xcconfig +++ b/Sources/dafl_project_flutter/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/Sources/dafl_project_flutter/ios/Flutter/Release.xcconfig b/Sources/dafl_project_flutter/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/Sources/dafl_project_flutter/ios/Flutter/Release.xcconfig +++ b/Sources/dafl_project_flutter/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/Sources/dafl_project_flutter/ios/Runner.xcodeproj/project.pbxproj b/Sources/dafl_project_flutter/ios/Runner.xcodeproj/project.pbxproj index 15a0b3c..f5ff825 100644 --- a/Sources/dafl_project_flutter/ios/Runner.xcodeproj/project.pbxproj +++ b/Sources/dafl_project_flutter/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,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 */; }; + E76CD34C5058671CA86DADD2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 518E0579778547E1FFDB1D6F /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,9 +33,12 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 50D28B6D8131FC6CC457D174 /* 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 = ""; }; + 518E0579778547E1FFDB1D6F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8AA25F503D0EEE87458D8122 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 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 = ""; }; + EA8989C98BEFB8932D52D9AC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,31 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E76CD34C5058671CA86DADD2 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 348100E718184A617AD38880 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 518E0579778547E1FFDB1D6F /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 75FDCE1EC97DCE6250DBCAB6 /* Pods */ = { + isa = PBXGroup; + children = ( + 8AA25F503D0EEE87458D8122 /* Pods-Runner.debug.xcconfig */, + 50D28B6D8131FC6CC457D174 /* Pods-Runner.release.xcconfig */, + EA8989C98BEFB8932D52D9AC /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +96,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 75FDCE1EC97DCE6250DBCAB6 /* Pods */, + 348100E718184A617AD38880 /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +131,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 6110DAA42AFFA96E9F11FA03 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 17980C60C8E127E41666ABD8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -169,6 +197,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 17980C60C8E127E41666ABD8 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -183,6 +228,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 6110DAA42AFFA96E9F11FA03 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -288,6 +355,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -416,6 +484,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -438,6 +507,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -478,4 +548,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} \ No newline at end of file +} diff --git a/Sources/dafl_project_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata b/Sources/dafl_project_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/Sources/dafl_project_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/Sources/dafl_project_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/Sources/dafl_project_flutter/ios/Runner/Base.lproj/Main.storyboard b/Sources/dafl_project_flutter/ios/Runner/Base.lproj/Main.storyboard index f3c2851..9d4e2ec 100644 --- a/Sources/dafl_project_flutter/ios/Runner/Base.lproj/Main.storyboard +++ b/Sources/dafl_project_flutter/ios/Runner/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,13 +16,14 @@ - + - + + diff --git a/Sources/dafl_project_flutter/lib/main.dart b/Sources/dafl_project_flutter/lib/main.dart index 28acecc..5a473e3 100644 --- a/Sources/dafl_project_flutter/lib/main.dart +++ b/Sources/dafl_project_flutter/lib/main.dart @@ -8,7 +8,7 @@ import './views/pages/main/p_main.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; -import 'package:rive/rive.dart'; +import 'package:rive/rive.dart' as riv; import '../controller/controller.dart'; import '../model/music.dart'; import 'model/music.dart'; @@ -41,7 +41,7 @@ class MyApp extends StatelessWidget { enum CardStatus { like, disLike, discovery, message} class CardProvider extends ChangeNotifier{ - List _spotsList = []; + List _spotsList = MyApp().controller.currentUser.Spots; bool _isDragging = false; double _angle = 0; Offset _position = Offset.zero; @@ -52,15 +52,8 @@ class CardProvider extends ChangeNotifier{ Offset get position => _position; double get angle => _angle; - CardProvider() { - resetUsers(); - } - void resetUsers() { - _spotsList = MyApp().controller.currentUser.Spots; - notifyListeners(); - } void setScreenSize(Size screenSize) => _screenSize = screenSize; @@ -152,7 +145,6 @@ class CardProvider extends ChangeNotifier{ } } void dislike() { - Vibration.vibrate(duration: 20, amplitude: 60); print("dislike"); _angle = -20; _position -= Offset(2 * _screenSize.width, 0); @@ -162,13 +154,12 @@ class CardProvider extends ChangeNotifier{ } void discovery() { - Vibration.vibrate(duration: 20, amplitude: 60); _angle = 0; _position -= Offset(0, -_screenSize.height); _discovery_card(); print("discovery"); - if(MyApp().controller.currentUser.Discovery.contains(MyApp().controller.currentUser.Spots.last)){ - MyApp().controller.currentUser.Discovery.remove(MyApp().controller.currentUser.Spots.last); + if(MyApp().controller.currentUser.Discovery.contains(MyApp().controller.currentUser.Spots?.last)){ + MyApp().controller.currentUser.Discovery.remove(MyApp().controller.currentUser.Spots?.last); Fluttertoast.showToast( msg: 'Supprimer', toastLength: Toast.LENGTH_SHORT, @@ -179,22 +170,24 @@ class CardProvider extends ChangeNotifier{ ); } else{ - MyApp().controller.currentUser.addDiscovery(MyApp().controller.currentUser.Spots.last); - Fluttertoast.showToast( - msg: 'Ajouté', - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.TOP, - timeInSecForIosWeb: 2, - backgroundColor: Colors.deepPurple, - textColor: Colors.white - ); - notifyListeners(); + if(MyApp().controller.currentUser.Spots?.last != null){ + MyApp().controller.currentUser.addDiscovery(MyApp().controller.currentUser.Spots.last); + Fluttertoast.showToast( + msg: 'Ajouté', + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.TOP, + timeInSecForIosWeb: 2, + backgroundColor: Colors.deepPurple, + textColor: Colors.white + ); + notifyListeners(); + } + } } void message(context) { - Vibration.vibrate(duration: 20, amplitude: 60); print("message"); _angle = 0; _position -= Offset(0, _screenSize.height); @@ -311,7 +304,6 @@ class CardProvider extends ChangeNotifier{ void like(context) { - Vibration.vibrate(duration: 20, amplitude: 60); print("like"); _angle = 20; _position += Offset(2 * _screenSize.width, 0); @@ -321,11 +313,17 @@ class CardProvider extends ChangeNotifier{ } Future _nextCard() async { - if ( _spotsList.isEmpty) return; - - await Future.delayed(Duration(milliseconds: 200)); - _spotsList.removeLast(); - resetPosition(); + print(_spotsList.length); + if (_spotsList.isEmpty) { + print('dernier'); + return; + } + else { + await Future.delayed(Duration(milliseconds: 200)); + print(_spotsList.last.name); + _spotsList.removeLast(); + resetPosition(); + } } Future _discovery_card() async { @@ -378,7 +376,7 @@ class _SplashState extends State { Container( height: 300, width: 300, - child: RiveAnimation.asset('assets/images/new_file (2).riv'), + child: riv.RiveAnimation.asset('assets/images/new_file (2).riv'), ), SizedBox(height: 50), ], @@ -387,3 +385,91 @@ class _SplashState extends State { ); } } + +Object errorNotify(int index, context){ + String message; + switch(index){ + case 0: { + message = "Ce nom d'utilisateur existe déjà ! Veuillez réessayer."; + break; + } + case 1: { + message = "Mots de passe différents ! Veuillez réessayer."; + break; + } + case 2: { + message = "Identifiant incorrect ! Veuillez réessayer."; + break; + } + case 3: { + message = "Mot de passe incorrect ! Votre mot de passe doit contenir 8 caractères minimum."; + break; + } + case 4: { + message = "Mot de passe incorrect ! Veuillez réessayer."; + break; + } + default: + message = "Une erreur est survenue pendant l'inscription. Veuillez réessayer."; + break; + + } + return ScaffoldMessenger.of(context).showSnackBar( SnackBar( + dismissDirection: DismissDirection.down, + behavior: SnackBarBehavior.floating, + backgroundColor: Colors.transparent, + elevation: 0, + content: Stack( + clipBehavior: Clip.none, + children: [ + + Container( + padding: EdgeInsets.all(16), + height: 90, + child: Row( + children: [ + Container( + height: 48, + width: 48, + ), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Oh oh !", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),), + Text(message,style: TextStyle( + ), + overflow: TextOverflow.ellipsis, + maxLines: 2,), + ], + ),), + ], + ), + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/backgroundNotify.png"), + fit: BoxFit.cover), + gradient: LinearGradient(colors: [Color(0xFF81052a),Color(0xFF810548)],begin: Alignment.topLeft, end: Alignment.bottomRight), + borderRadius: BorderRadius.all(Radius.circular(20)), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.3), + blurRadius: 10, + offset: Offset(4, 8), // Shadow position + ), + ], + ), + ), + Positioned( + top: -50, + left: -20, + child: Container( + color: Colors.transparent, + height: 110, + width: 110, + child: riv.RiveAnimation.asset("assets/images/error_icon.riv"),)), + ], + ) + )); +} + + diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart index 8009b40..165cea2 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_card.dart @@ -3,17 +3,6 @@ import 'package:flutter/material.dart'; import '../../../main.dart'; import 'package:provider/provider.dart'; -class User{ - final String chanteur; - final String titre; - final String urlImage; - - const User({ - required this.chanteur, - required this.titre, - required this.urlImage, - }); -} @@ -58,7 +47,7 @@ class _CardWidgetState extends State{ height: double.infinity, width: double.infinity, fit: BoxFit.cover, - placeholder: "assets/images/loadingPlaceholder.gif", image: widget.urlImage), + placeholder: "assets/images/loadingPlaceholder.gif", image: widget.urlImage ), ), ); @@ -152,7 +141,7 @@ class _CardWidgetState extends State{ onPanEnd: (details) { final provider = Provider.of(context, listen: false); - provider.endPosition(this.context); + provider.endPosition(context); }, diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart index 3a08e32..0028281 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart @@ -43,8 +43,11 @@ class _DiscoveryWidgetState extends State { ), ), Expanded( - child: DiscoveryList(), - ) + child: MyApp().controller.currentUser.Discovery.isEmpty? + Center(child: Image.asset('assets/images/EmptyDiscovery-Hint.png',scale: 1.8,)): + DiscoveryList(), + ), + ], ),), ); @@ -62,7 +65,6 @@ class _DiscoveryListState extends State { late GlobalKey refreshKey; @override void initState() { - print('testttt'); refreshKey = GlobalKey(); refreshList(); super.initState(); @@ -72,7 +74,6 @@ class _DiscoveryListState extends State { await Future.delayed(Duration(seconds: 1)); setState(() { MyApp().controller.currentUser.Discovery; - print('test'); }); return null; } @@ -110,7 +111,7 @@ class _DiscoveryListState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text(MyApp().controller.currentUser.Discovery[reversedIndex].name ?? '',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),), - Text('Laylow',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),), + Text(MyApp().controller.currentUser.Discovery[reversedIndex].artist ?? '',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),), ], ),), diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart index 92cebf1..fcfcdd0 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart @@ -20,11 +20,6 @@ class SpotsWidget extends StatefulWidget { class _SpotsWidgetState extends State { - final user = User( - chanteur: 'Khali', - titre: 'COULEURS', - urlImage: 'https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg', - ); @override Widget build(BuildContext context) { double height = MediaQuery.of(context).size.height; @@ -41,9 +36,7 @@ class _SpotsWidgetState extends State { child: Container( decoration: BoxDecoration( image: DecorationImage( - image: NetworkImage(provider.spotsList.isEmpty != true - ?provider.spotsList.last.linkCover - :"https://i.imgur.com/Uovh293.png"), + image: NetworkImage(MyApp().controller.currentUser.Spots.isEmpty? "https://i.imgur.com/Uovh293.png":MyApp().controller.currentUser.Spots.last.linkCover), fit: BoxFit.cover, ), @@ -55,7 +48,7 @@ class _SpotsWidgetState extends State { ),), Align( alignment: FractionalOffset.bottomCenter, - child: OpenContainer( + child: MyApp().controller.currentUser.Spots.isEmpty? Container():OpenContainer( closedColor: Colors.transparent, closedElevation: 0, @@ -78,7 +71,7 @@ class _SpotsWidgetState extends State { Positioned( top: height*0.68, width: width, - child: Row( + child: MyApp().controller.currentUser.Spots.isEmpty? Container():Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ GestureDetector( @@ -158,8 +151,9 @@ class _SpotsWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(MyApp().controller.currentUser.Spots.last.name ?? '',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),), - Text(MyApp().controller.currentUser.Spots.last.artist ?? '',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),), + Text(MyApp().controller.currentUser.Spots.isEmpty? '': + MyApp().controller.currentUser.Spots.last.name,style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),), + Text(MyApp().controller.currentUser.Spots.isEmpty? '': MyApp().controller.currentUser.Spots.last.artist,style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),), ], ),), ], diff --git a/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart b/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart index 152a11b..4c53ccf 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart @@ -1,6 +1,7 @@ import 'package:dafl_project_flutter/main.dart'; import 'package:flutter/material.dart'; import 'package:page_transition/page_transition.dart'; +import 'package:rive/rive.dart' as riv; import '../home/p_home.dart'; import '../sign_in/p_sign_in.dart'; import '../../../controller/controller.dart'; @@ -237,19 +238,7 @@ class _SignUpPageState extends State { highlightColor: Colors.grey.shade100, splashColor: Color(0xFF406DE1), onTap: (){ - if(passwordConfirmTextField.text == passwordTextField.text && userNameTextField.text != null){ - MyApp().controller.createUser(userNameTextField.text, passwordConfirmTextField.text); - Navigator.of(context).push( - PageTransition( - duration: Duration(milliseconds: 300), - reverseDuration: Duration(milliseconds: 300), - type: PageTransitionType.leftToRightJoined, - childCurrent: widget, - child: HomePage()),); - } - else{ - print('Null'); - } + checkInformations(userNameTextField.text, passwordTextField.text, passwordConfirmTextField.text); }, child:Ink( @@ -307,4 +296,32 @@ class _SignUpPageState extends State { ), ); } + + void checkInformations(String username,String password, String confirmPassword){ + if(username ==""){ + errorNotify(2, context); + } + else if(password =="" || confirmPassword == ""){ + errorNotify(4, context); + } + else if(password.length <8){ + errorNotify(2, context); + } + else if(password != confirmPassword){ + errorNotify(1, context); + } + else{ + MyApp().controller.createUser(userNameTextField.text, passwordConfirmTextField.text); + Navigator.of(context).push( + PageTransition( + duration: Duration(milliseconds: 300), + reverseDuration: Duration(milliseconds: 300), + type: PageTransitionType.leftToRightJoined, + childCurrent: widget, + child: HomePage()),); + + } + + } + }