diff --git a/.idea/Daflv4.iml b/.idea/Daflv4.iml
index 23209a3..508dab8 100644
--- a/.idea/Daflv4.iml
+++ b/.idea/Daflv4.iml
@@ -6,6 +6,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
new file mode 100644
index 0000000..86b1c24
--- /dev/null
+++ b/.idea/libraries/Dart_Packages.xml
@@ -0,0 +1,588 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
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..8fd7351
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/delete_background.png b/Sources/dafl_project_flutter/assets/images/delete_background.png
new file mode 100644
index 0000000..0034184
Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/delete_background.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/assets/images/valid_background.png b/Sources/dafl_project_flutter/assets/images/valid_background.png
new file mode 100644
index 0000000..f1fdf26
Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/valid_background.png differ
diff --git a/Sources/dafl_project_flutter/assets/images/valid_icon.riv b/Sources/dafl_project_flutter/assets/images/valid_icon.riv
new file mode 100644
index 0000000..b41eb2c
Binary files /dev/null and b/Sources/dafl_project_flutter/assets/images/valid_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/Podfile b/Sources/dafl_project_flutter/ios/Podfile
new file mode 100644
index 0000000..88359b2
--- /dev/null
+++ b/Sources/dafl_project_flutter/ios/Podfile
@@ -0,0 +1,41 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, '11.0'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+ 'Debug' => :debug,
+ 'Profile' => :release,
+ 'Release' => :release,
+}
+
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+ end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
+ end
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
+target 'Runner' do
+ use_frameworks!
+ use_modular_headers!
+
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ flutter_additional_ios_build_settings(target)
+ end
+end
diff --git a/Sources/dafl_project_flutter/ios/Podfile.lock b/Sources/dafl_project_flutter/ios/Podfile.lock
new file mode 100644
index 0000000..6d41903
--- /dev/null
+++ b/Sources/dafl_project_flutter/ios/Podfile.lock
@@ -0,0 +1,47 @@
+PODS:
+ - Flutter (1.0.0)
+ - flutter_native_splash (0.0.1):
+ - Flutter
+ - fluttertoast (0.0.2):
+ - Flutter
+ - Toast
+ - path_provider_ios (0.0.1):
+ - Flutter
+ - Toast (4.0.0)
+ - vibration (1.7.5):
+ - Flutter
+
+DEPENDENCIES:
+ - Flutter (from `Flutter`)
+ - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
+ - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
+ - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
+ - vibration (from `.symlinks/plugins/vibration/ios`)
+
+SPEC REPOS:
+ trunk:
+ - Toast
+
+EXTERNAL SOURCES:
+ Flutter:
+ :path: Flutter
+ flutter_native_splash:
+ :path: ".symlinks/plugins/flutter_native_splash/ios"
+ fluttertoast:
+ :path: ".symlinks/plugins/fluttertoast/ios"
+ path_provider_ios:
+ :path: ".symlinks/plugins/path_provider_ios/ios"
+ vibration:
+ :path: ".symlinks/plugins/vibration/ios"
+
+SPEC CHECKSUMS:
+ Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
+ flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
+ fluttertoast: 74526702fea2c060ea55dde75895b7e1bde1c86b
+ path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
+ Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
+ vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
+
+PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
+
+COCOAPODS: 1.11.3
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/controller/controller.dart b/Sources/dafl_project_flutter/lib/controller/controller.dart
index f3e632f..053e331 100644
--- a/Sources/dafl_project_flutter/lib/controller/controller.dart
+++ b/Sources/dafl_project_flutter/lib/controller/controller.dart
@@ -1,6 +1,6 @@
-import 'package:dafl_project_flutter/persistence/database_loader.dart';
-import 'package:dafl_project_flutter/persistence/database_saver.dart';
-import 'package:dafl_project_flutter/persistence/loader.dart';
+import '../persistence/database_loader.dart';
+import '../persistence/database_saver.dart';
+import '../persistence/loader.dart';
import '../persistence/saver.dart';
import '../persistence/loader.dart';
@@ -13,7 +13,7 @@ class Controller{
static Saver? saver = DatabaseSaver();
static Loader? loader = DatabaseLoader();
- Future? currentUser;
+ User currentUser = User(null, null);
factory Controller(){
if (_this == null) _this = Controller._();
@@ -27,9 +27,25 @@ class Controller{
}
void load(String username, String password) async{
- currentUser = loader?.load(username, password);
+ currentUser = await loader?.load(username, password) as User;
}
-}
+ User createUser(String username, String password){
+ return User(username, password);
+ }
+ void changeCurrentUser(User user){
+ this.currentUser = user;
+ }
+ void changeUsernameCourant(String newName){
+ if(newName !=null){
+ this.currentUser?.usernameDafl = newName;
+ }
+ }
+ void changePasswordCourant(String newPass){
+ if(newPass !=null){
+ this.currentUser?.passwDafl = newPass;
+ }
+ }
+}
diff --git a/Sources/dafl_project_flutter/lib/main.dart b/Sources/dafl_project_flutter/lib/main.dart
index 0aea77e..76bda2a 100644
--- a/Sources/dafl_project_flutter/lib/main.dart
+++ b/Sources/dafl_project_flutter/lib/main.dart
@@ -1,31 +1,31 @@
import 'dart:async';
-import 'package:dafl_project_flutter/persistence/database_saver.dart';
+import 'package:dafl_project_flutter/views/pages/main/w_bottomsheet.dart';
import 'package:fluttertoast/fluttertoast.dart';
-import 'package:path_provider/path_provider.dart';
+import 'package:vibration/vibration.dart';
import 'dart:math';
import './views/pages/home/p_home.dart';
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:dafl_project_flutter/controller/controller.dart';
-
-
+import 'package:rive/rive.dart' as riv;
+import '../controller/controller.dart';
+import '../model/music.dart';
+import 'model/music.dart';
void main() {
MyApp mainApp = MyApp();
-
- runApp(mainApp);
+ runApp(MyApp());
}
-
class MyApp extends StatelessWidget {
+ Controller controller = Controller();
+
// This widget is the root of your application.
@override
Widget build(BuildContext context){
+ Paint.enableDithering = true;
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
return ChangeNotifierProvider(
create: (context) => CardProvider(),
@@ -38,38 +38,22 @@ class MyApp extends StatelessWidget {
}
}
-enum CardStatus { like, disLike, discovery}
+enum CardStatus { like, disLike, discovery, message}
class CardProvider extends ChangeNotifier{
- List _urlImages = [];
+ List _spotsList = MyApp().controller.currentUser.Spots;
bool _isDragging = false;
double _angle = 0;
Offset _position = Offset.zero;
Size _screenSize = Size.zero;
- List get urlImages => _urlImages;
+ List get spotsList => _spotsList;
bool get isDragging => _isDragging;
Offset get position => _position;
double get angle => _angle;
- CardProvider() {
- resetUsers();
- }
- void resetUsers() {
- _urlImages = [
- 'https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg',
- 'https://m.media-amazon.com/images/I/61aUOMzwS8L._SL1440_.jpg',
- 'https://pbs.twimg.com/media/ExJ-My-XMAE3Ko2.jpg',
- 'https://cdns-images.dzcdn.net/images/cover/2818a661c6d533155ce6dffc256b1f51/500x500.jpg',
- 'https://cdns-images.dzcdn.net/images/cover/b351f0e935c9c3901f8d893b92ab952a/500x500.jpg',
- 'https://cdns-images.dzcdn.net/images/cover/65147b581f2ace9e0f0723ee76e70fda/500x500.jpg',
- 'https://cdns-images.dzcdn.net/images/cover/173b96be8ac025fb9578b0139010bc80/500x500.jpg',
- 'https://cdns-images.dzcdn.net/images/cover/17a9747927ac3e5ea56f92f635d9180c/500x500.jpg',
- ].reversed.toList();
- notifyListeners();
- }
void setScreenSize(Size screenSize) => _screenSize = screenSize;
@@ -88,7 +72,7 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
- void endPosition() {
+ void endPosition(context) {
_isDragging = false;
notifyListeners();
@@ -97,7 +81,7 @@ class CardProvider extends ChangeNotifier{
switch (status) {
case CardStatus.like:
- like();
+ like(context);
break;
case CardStatus.disLike:
dislike();
@@ -105,6 +89,9 @@ class CardProvider extends ChangeNotifier{
case CardStatus.discovery:
discovery();
break;
+ case CardStatus.message:
+ message(context);
+ break;
default:
resetPosition();
}
@@ -128,7 +115,8 @@ class CardProvider extends ChangeNotifier{
CardStatus? getStatus({bool force = false}) {
final x = _position.dx;
final y = _position.dy;
- final forceDiscovery = x.abs() < 20;
+ final forceDiscovery = x.abs() < 80;
+ final forceMessage = x.abs() < 100;
if(force) {
final delta = 100;
@@ -137,15 +125,19 @@ class CardProvider extends ChangeNotifier{
return CardStatus.like;
} else if ( x <= -delta){
return CardStatus.disLike;
- } else if ( y <= -delta / 2 && forceDiscovery){
+ } else if ( y <= -delta/2 && forceDiscovery){
+ return CardStatus.message;
+ } else if (y >= delta * 2 && x.abs() < 100) {
return CardStatus.discovery;
}
} else{
final delta = 20;
if(y <= -delta * 2 && forceDiscovery) {
+ return CardStatus.message;
+ } else if (y >= delta *2 && x.abs() < 80) {
return CardStatus.discovery;
- } else if ( x >= delta) {
+ }else if ( x >= delta) {
return CardStatus.like;
} else if ( x <= -delta) {
return CardStatus.disLike;
@@ -162,43 +154,188 @@ class CardProvider extends ChangeNotifier{
}
void discovery() {
- print("discovery");
_angle = 0;
- _position -= Offset(0, _screenSize.height);
+ _position -= Offset(0, -_screenSize.height);
_discovery_card();
- Fluttertoast.showToast(
- msg: 'Ajouté',
- toastLength: Toast.LENGTH_SHORT,
- gravity: ToastGravity.TOP,
- timeInSecForIosWeb: 2,
- backgroundColor: Colors.deepPurple,
- textColor: Colors.white
- );
+ print("discovery");
+ 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,
+ gravity: ToastGravity.TOP,
+ timeInSecForIosWeb: 2,
+ backgroundColor: Colors.red,
+ textColor: Colors.white
+ );
+ }
+ else{
+ 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) {
+ print("message");
+ _angle = 0;
+ _position -= Offset(0, _screenSize.height);
+ _message_card();
+ showModalBottomSheet(
+ isDismissible: false,
+ useRootNavigator: true,
+ isScrollControlled: true,
+ backgroundColor: Colors.transparent,
+ context: context,
+ constraints: BoxConstraints(
+ maxWidth: 600,
+ maxHeight: double.infinity,
+ ),
+ builder: (context) => buildSheet(),);
notifyListeners();
}
+ Widget buildSheet() => Container(
+ height: 550,
+ width: 350,
+ decoration: BoxDecoration(
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.4),
+ offset: const Offset(
+ 0,
+ 0,
+ ),
+ blurRadius: 10.0,
+ spreadRadius: 2.0,
+ ),
+ BoxShadow(
+ color: Colors.white.withOpacity(0.3),
+ offset: const Offset(0.0, 0.0),
+ blurRadius: 0.0,
+ spreadRadius: 0.0,
+ ),//BoxShadow//BoxShadow
+ ],
+ color: Color(0xFF232123),
+ borderRadius: BorderRadius.only(
+ topRight: Radius.circular(30),
+ topLeft: Radius.circular(30),
+ ),
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
+ child: Column(
+ children: [
+
+ Container(
+ height: 5,
+ width: 130,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(20),
+ color: Color(0xFF8A8A8A),
+ ),
+ ),
+ SizedBox(height: 30,),
+ Container(
+ width: double.infinity,
+ height: 300,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(20),
+ color: Color(0xFF302C30),
+ ),
+ child: Padding(
+ padding: EdgeInsets.all(20),
+ child: TextField(
+ maxLength: 300,
+ style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),
+ expands: true,
+ maxLines: null,
+ keyboardType: TextInputType.multiline,
+ decoration: InputDecoration(
+ hintStyle: TextStyle(
+ color: Colors.white,
+ ),
+ border: InputBorder.none,
+ hintText: "Mon message",
+ ),
+ ),
+ ),
+ ),
+ SizedBox(height: 20,),
+ SizedBox(
+ width: double.infinity,
+ height: 70,
+ child: ElevatedButton(
+ onPressed: () {},
+ style: ElevatedButton.styleFrom(
+ primary: Color(0xFF3F1DC3),
+ textStyle: TextStyle(
+ fontSize: 20,
+ fontWeight: FontWeight.bold),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(17)
+ ),
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Text("Envoyer"),
+ Opacity(opacity: 0.2,
+ child: Image.asset("assets/images/send_logo.png",),)
+ ],
+ ),
+ ),
+ )
+ ],
+ ),
+ ),
+
+ );
+
- void like() {
+ void like(context) {
print("like");
_angle = 20;
_position += Offset(2 * _screenSize.width, 0);
_nextCard();
-
notifyListeners();
+
}
Future _nextCard() async {
- if ( _urlImages.isEmpty) return;
+ 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 {
await Future.delayed(Duration(milliseconds: 200));
- _urlImages.removeLast();
resetPosition();
}
- Future _discovery_card() async {
+ Future _message_card() async {
await Future.delayed(Duration(milliseconds: 200));
resetPosition();
}
+
}
@@ -239,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),
],
@@ -248,3 +385,166 @@ class _SplashState extends State {
);
}
}
+Object Notify(int index, context, {bool isError = true}){
+ String message;
+ if(isError == true){
+ 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"),)),
+ ],
+ )
+ ));
+ }
+ else{
+ switch(index){
+ case 0: {
+ message = "Vous avez changer votre identifiant avec succès";
+ break;
+ }
+ case 1: {
+ message = "Vous avez changer votre mot de passe avec succès";
+ break;
+ }
+ default:
+ message = "L'opération a bien été éxécutée";
+ 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("Super !", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
+ Text(message,style: TextStyle(
+ ),
+ overflow: TextOverflow.ellipsis,
+ maxLines: 2,),
+ ],
+ ),),
+ ],
+ ),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage("assets/images/valid_background.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/valid_icon.riv"),)),
+ ],
+ )
+ ));
+
+ }
+
+}
+
+
diff --git a/Sources/dafl_project_flutter/lib/model/music.dart b/Sources/dafl_project_flutter/lib/model/music.dart
new file mode 100644
index 0000000..74bb1ab
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/model/music.dart
@@ -0,0 +1,19 @@
+class Music{
+ String name;
+ String artist;
+ String linkCover;
+
+ Music(this.name, this.artist, this.linkCover);
+
+
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ other is Music &&
+ runtimeType == other.runtimeType &&
+ name == other.name &&
+ artist == other.artist;
+
+ @override
+ int get hashCode => name.hashCode ^ artist.hashCode;
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/model/user.dart b/Sources/dafl_project_flutter/lib/model/user.dart
index c23a3e2..f1063a4 100644
--- a/Sources/dafl_project_flutter/lib/model/user.dart
+++ b/Sources/dafl_project_flutter/lib/model/user.dart
@@ -1,4 +1,8 @@
+import 'package:dafl_project_flutter/main.dart';
+import 'package:dafl_project_flutter/model/message.dart';
+
import 'conversation.dart';
+import 'music.dart';
class User{
//attributes from DAFL
@@ -16,11 +20,34 @@ class User{
User.fromDatabase(this.idDafl, this.usernameDafl);
-
//lists
Set likedUsers={};
+ List Discovery=[];
+ List waitingConv=[];
+ List confirmConv=[];
+
+ Music currentSong = Music('Couleurs','Khali','https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg');
+
+ List Spots=[
+ Music('Couleurs','Khali','https://khaligidilit.com/assets/images/cover-LAI%CC%88LA-Khali.jpeg'),
+ Music("J'suis PNL",'PNL','https://m.media-amazon.com/images/I/61aUOMzwS8L._SL1440_.jpg'),
+ Music('Sundance','Nepal','https://pbs.twimg.com/media/ExJ-My-XMAE3Ko2.jpg'),
+ Music('Eternelle 2','So La Lune','https://cdns-images.dzcdn.net/images/cover/2818a661c6d533155ce6dffc256b1f51/500x500.jpg'),
+ Music('M.I.L.S 3','Ninho','https://cdns-images.dzcdn.net/images/cover/b351f0e935c9c3901f8d893b92ab952a/500x500.jpg'),
+ Music('Deux frères','PNL','https://cdns-images.dzcdn.net/images/cover/65147b581f2ace9e0f0723ee76e70fda/500x500.jpg'),
+ Music('Paradis','Sopico','https://cdns-images.dzcdn.net/images/cover/17a9747927ac3e5ea56f92f635d9180c/500x500.jpg')].reversed.toList();
Map conversations={};
+ void addDiscovery(Music newmusic){
+ if(MyApp().controller?.currentUser?.Discovery == null){
+
+ }
+ else{
+ MyApp().controller.currentUser?.Discovery.add(newmusic);
+ }
+
+
+ }
void like(User liked){
likedUsers.add(liked);
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart b/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart
index 2288fbc..7635688 100644
--- a/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart
+++ b/Sources/dafl_project_flutter/lib/persistence/database_connexion.dart
@@ -36,7 +36,7 @@ class DatabaseConnexion{
//Initialise connexion to the database
- Future initConnexion() async{
+ Future initConnexion() async{
await _loadLogs();
var uri = 'postgres://$_psqlUser:$_psqlPswd@$_psqlHost:5442/$_psqlDataBase';
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_loader.dart b/Sources/dafl_project_flutter/lib/persistence/database_loader.dart
index ae4bebc..a632976 100644
--- a/Sources/dafl_project_flutter/lib/persistence/database_loader.dart
+++ b/Sources/dafl_project_flutter/lib/persistence/database_loader.dart
@@ -1,4 +1,6 @@
-import '../persistence/loader.dart';
+import 'dart:async';
+
+import 'loader.dart';
import '../model/user.dart';
import 'database_connexion.dart';
@@ -14,7 +16,6 @@ class DatabaseLoader extends Loader{
{'username': username,
'password': password}).toList()
.then((result) {
- print(result); });
+ print(result); });
}
}
-
diff --git a/Sources/dafl_project_flutter/lib/persistence/database_saver.dart b/Sources/dafl_project_flutter/lib/persistence/database_saver.dart
index 3019a57..53d70fe 100644
--- a/Sources/dafl_project_flutter/lib/persistence/database_saver.dart
+++ b/Sources/dafl_project_flutter/lib/persistence/database_saver.dart
@@ -16,4 +16,4 @@ class DatabaseSaver extends Saver{
'username': userToSave.usernameDafl,
'password' : userToSave.passwDafl}).then((_) {});
}
-}
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/persistence/loader.dart b/Sources/dafl_project_flutter/lib/persistence/loader.dart
index 9133993..cf64cee 100644
--- a/Sources/dafl_project_flutter/lib/persistence/loader.dart
+++ b/Sources/dafl_project_flutter/lib/persistence/loader.dart
@@ -1,3 +1,5 @@
+import 'dart:async';
+
import '../model/user.dart';
abstract class Loader{
diff --git a/Sources/dafl_project_flutter/lib/persistence/search.dart b/Sources/dafl_project_flutter/lib/persistence/search.dart
new file mode 100644
index 0000000..76bb714
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/persistence/search.dart
@@ -0,0 +1,6 @@
+import '../model/user.dart';
+
+abstract class Search{
+ bool searchUser(String? username, String? password);
+ bool searchUsername(String? username);
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart
new file mode 100644
index 0000000..30580f7
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart
@@ -0,0 +1,161 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:fluttericon/font_awesome5_icons.dart';
+
+class ConversationPage extends StatefulWidget {
+ const ConversationPage({Key? key}) : super(key: key);
+
+ @override
+ State createState() => _ConversationPageState();
+}
+
+class _ConversationPageState extends State {
+ @override
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
+ return Scaffold(
+ extendBodyBehindAppBar: true,
+ resizeToAvoidBottomInset: true,
+ appBar: AppBar(
+ backgroundColor: Color(0xFF141414),
+ toolbarHeight: 70,
+ title: Container(
+ child: Row(
+ children: [
+ Container(
+ padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ height: 40,
+ width: 40,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(40),
+ color: Colors.blue,
+ ),
+ ),
+ SizedBox(width: 20,),
+ Text("Max"),
+
+ ],
+ ),
+ ),
+
+ elevation: 0,
+ ),
+ body: SingleChildScrollView(
+ child:
+ Container(
+ color: Color(0xFF141414),
+ height: height*0.92,
+ width: double.infinity,
+ child: ListView(
+ reverse: true,
+ scrollDirection: Axis.vertical,
+ children: [
+ Message('Adolescebat autem obstinatum propositum erga haec et similia multa scrutanda, stimulos admovente regina, quae abrupte mariti fortunas trudebat in exitium praeceps, cum eum potius lenitate feminea ad veritatis humanitatisque viam reducere utilia suadendo deberet, ut in Gordianorum actibus factitasse Maximini truculenti illius imperatoris rettulimus coniugem.', 0),
+ Message('Claudiopolis olim Seleucia Caesar potens quidem olim interneciva enim et.', 1),
+ Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
+ Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
+ Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
+ Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
+ ],
+ ),
+
+ ),
+ ),
+ bottomSheet: BottomAppBar(
+ color: Color(0xFF141414),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ crossAxisAlignment: CrossAxisAlignment.center,
+
+ children: [
+ Container(
+ height: height*0.08,
+ color: Colors.transparent,
+ width: width*0.8,
+ child: Container(
+ margin: EdgeInsets.fromLTRB(20, 10, 0, 10),
+ decoration: BoxDecoration(
+ border: Border.all(
+ width: 1,
+ color: Color(0xFF2F2F2F),
+ ),
+ borderRadius: BorderRadius.circular(100),
+ color: Color(0xFF141414),
+
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ child: TextField(
+ style: TextStyle(color: Colors.white),
+ decoration: InputDecoration(
+ hintStyle: TextStyle(color: Colors.white),
+ border: InputBorder.none,
+ hintText: "Envoyer un message...",
+ ),
+ cursorColor: Colors.purple,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ ),
+ ),
+ Container(
+ width: 40,
+ height: 40,
+ margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(100),
+ color: Colors.blue,
+ ),
+ child: Icon(Icons.send, size: 20, color: Colors.white,),
+ )
+ ],
+ ),
+ ),
+
+ );
+ }
+
+ Widget Message(String message, int user) {
+ if(user == 0){
+ return Container(
+ margin: EdgeInsets.fromLTRB(40, 7, 80, 7),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.only(
+ bottomRight: Radius.circular(20),
+ topLeft: Radius.circular(20),
+ topRight: Radius.circular(20),
+ bottomLeft: Radius.circular(20),
+ ),
+ border: Border.all(width: 1.5,
+ color: Color(0xFF9C9C9C).withOpacity(0.3)),
+ color: Color(0xFF191919),
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(15, 15, 15, 15),
+ child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 15, fontWeight: FontWeight.w400),
+ )),
+ );
+ }
+ else{
+ return Container(
+ margin: EdgeInsets.fromLTRB(80, 7, 40, 7),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.only(
+ bottomRight: Radius.circular(20),
+ bottomLeft: Radius.circular(20),
+ topLeft: Radius.circular(20),
+ topRight: Radius.circular(20),
+ ),
+ color: Color(0xFF2F2F2F),
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(15, 15, 15, 15),
+ child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 15, fontWeight: FontWeight.w400),
+ )),
+ );
+ }
+
+
+ }
+}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
index bbdb13e..dbfae1d 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart
@@ -18,7 +18,7 @@ class _MainPageState extends State {
int get index => _index;
final screens = [
ProfilWidget(),
- DiscoveryWidget(),
+ new DiscoveryWidget(),
SpotsWidget(),
Center(child: Text('Tops'),),
Center(child: Text('Messages'),),
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 6eef2c1..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,
-});
-}
@@ -44,21 +33,21 @@ class _CardWidgetState extends State{
}
@override
Widget build(BuildContext context) => SizedBox.expand(
- child: widget.isFront ? buildFrontCard() : buildCard(),
- );
+ child: widget.isFront ? buildFrontCard() : buildCard(),
+ );
Widget buildCard() => ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage(widget.urlImage),
- fit: BoxFit.cover,
- alignment: Alignment(0,0),
- ),
borderRadius: BorderRadius.all(Radius.circular(20))
),
+ child: FadeInImage.assetNetwork(
+ height: double.infinity,
+ width: double.infinity,
+ fit: BoxFit.cover,
+ placeholder: "assets/images/loadingPlaceholder.gif", image: widget.urlImage ),
),
);
@@ -77,6 +66,9 @@ class _CardWidgetState extends State{
case CardStatus.discovery:
final child = buildStamp(image: 'assets/images/icon_discovery.png', opacity: opacity);
return child;
+ case CardStatus.message:
+ final child = buildStamp(image: 'assets/images/icon_messages.png', opacity: opacity);
+ return child;
default:
return Container();
@@ -84,29 +76,29 @@ class _CardWidgetState extends State{
}
Widget buildStamp({
- double angle = 0,
+ double angle = 0,
required String image,
required double opacity,
-}) {
+ }) {
return Opacity(opacity: opacity,
- child: ClipRRect(
- borderRadius: BorderRadius.circular(20),
- child: Container(
- decoration: BoxDecoration(
- color: Colors.black.withOpacity(0.75),
- border: Border.all(color: Color(0xFF3F1DC3), width: 6),
-
- borderRadius: BorderRadius.all(Radius.circular(20))
- ),
- child: Center(
- child: Image.asset(
- image,
- width: 100,
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(20),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Colors.black.withOpacity(0.75),
+ border: Border.all(color: Color(0xFF3F1DC3), width: 6),
+
+ borderRadius: BorderRadius.all(Radius.circular(20))
),
+ child: Center(
+ child: Image.asset(
+ image,
+ width: 100,
+ ),
+ ),
),
- ),
- ),);
+ ),);
}
Widget buildFrontCard() => GestureDetector(
@@ -124,7 +116,7 @@ class _CardWidgetState extends State{
..translate(-center.dx, -center.dy);
return AnimatedContainer(
- curve: Curves.easeInOut,
+ curve: Curves.easeOut,
duration: Duration(milliseconds: milliseconds),
transform: rotatedMatrix..translate(position.dx, position.dy),
child: Stack(
@@ -149,7 +141,7 @@ class _CardWidgetState extends State{
onPanEnd: (details) {
final provider = Provider.of(context, listen: false);
- provider.endPosition();
+ 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 0939e2b..cb1fc71 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
@@ -1,6 +1,11 @@
+import 'dart:math';
+
+import 'package:dafl_project_flutter/main.dart';
import 'package:fluttericon/font_awesome5_icons.dart';
import 'package:flutter/material.dart';
+import '../../../model/music.dart';
+
class DiscoveryWidget extends StatefulWidget {
const DiscoveryWidget({Key? key}) : super(key: key);
@@ -13,162 +18,124 @@ class _DiscoveryWidgetState extends State {
@override
Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Color(0xFF141414),
- resizeToAvoidBottomInset: false,
-
- body: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Text('Playlist découverte', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25),),
- Spacer(),
- Icon(FontAwesome5.sort_amount_down, size: 30, color: Colors.white,),
- ]
- ),
- Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
- Text('Retrouvez ici vos nouvelles découvertes.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
- ],
- ),
+ return Container(
+ color: Color(0xFF141414),
+
+ child: Padding(padding: EdgeInsets.fromLTRB(0, 50, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text('Playlist découverte', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25),),
+ Spacer(),
+ Icon(FontAwesome5.sort_amount_down, size: 30, color: Colors.white,),
+ ]
+ ),
+ Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
+ Text('Retrouvez ici vos nouvelles découvertes.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
+ ],
),
- Expanded(
- child: ListView(
-
- children: [
- SizedBox(height: 40,),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
-
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',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),),
-
- ],
- ),),
- ],
- ),
- ),
-
-
- ],
- )
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
-
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',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),),
-
- ],
- ),),
- ],
- ),
- ),
-
-
- ],
- )
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- child: Column(
- children: [
-
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
- width: double.infinity,
- child: Row(
- children: [
- Container(
- height: 60,
- width: 60,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('IVERSON',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),),
-
- ],
- ),),
- ],
- ),
- ),
-
-
- ],
- )
- ),
+ ),
+ Expanded(
+ child: MyApp().controller.currentUser.Discovery.isEmpty?
+ Center(child: Image.asset('assets/images/EmptyDiscovery-Hint.png',scale: 1.8,)):
+ DiscoveryList(),
+ ),
+
+ ],
+ ),),
+ );
+ }
+}
+class DiscoveryList extends StatefulWidget {
+ const DiscoveryList({Key? key}) : super(key: key);
- ],
- ),
- ),
- ],
- ),),
- );
+ @override
+ State createState() => _DiscoveryListState();
+}
+
+class _DiscoveryListState extends State {
+ late GlobalKey refreshKey;
+ @override
+ void initState() {
+ refreshKey = GlobalKey();
+ refreshList();
+ super.initState();
+ }
+
+ Future refreshList() async {
+ await Future.delayed(Duration(seconds: 1));
+ setState(() {
+ MyApp().controller.currentUser.Discovery;
+ });
+ return null;
+ }
+ Widget build(BuildContext context) {
+ return RefreshIndicator(child: ListView.builder(
+ itemCount: MyApp().controller.currentUser.Discovery.length ?? 0,
+ itemBuilder: (context, index){
+ int itemCount = MyApp().controller.currentUser.Discovery.length ?? 0;
+ int reversedIndex = itemCount - 1 - index;
+ return Dismissible(
+ key: Key(MyApp().controller.currentUser.Discovery[reversedIndex].name),
+ direction: DismissDirection.startToEnd,
+ child: Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
+ child: Column(
+ children: [
+
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
+ width: double.infinity,
+ child: Row(
+ children: [
+ Container(
+ height: 60,
+ width: 60,
+ decoration: BoxDecoration(
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(10)),
+ ),
+ child: Container(
+ child: FadeInImage.assetNetwork(placeholder: "assets/images/loadingPlaceholder.gif", image: MyApp().controller.currentUser.Discovery[reversedIndex].linkCover),
+ ),),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ 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(MyApp().controller.currentUser?.Discovery[reversedIndex].artist ?? '',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),
+ ),
+
+
+ ],
+ )
+
+ ), onDismissed: (direction) {
+ if(direction == DismissDirection.startToEnd)
+ MyApp().controller.currentUser?.Discovery.removeAt(reversedIndex);
+ },
+ background: Container(decoration: BoxDecoration(
+ image: DecorationImage(image: AssetImage("assets/images/delete_background.png"), fit: BoxFit.cover),
+ )),);
+ }
+ ), onRefresh: () async {
+ refreshList();
+ }, key: refreshKey,);
}
}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart
new file mode 100644
index 0000000..6b9e4ea
--- /dev/null
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart
@@ -0,0 +1,228 @@
+import 'package:dafl_project_flutter/views/pages/main/p_conversation.dart';
+import 'package:dafl_project_flutter/views/pages/main/p_main.dart';
+import 'package:flutter/material.dart';
+import 'package:fluttericon/font_awesome5_icons.dart';
+import 'package:page_transition/page_transition.dart';
+
+class MessagesWidget extends StatefulWidget {
+ const MessagesWidget({Key? key}) : super(key: key);
+
+ @override
+ State createState() => _MessagesWidgetState();
+}
+
+class _MessagesWidgetState extends State {
+ int indexSectedButton = 0;
+ Widget listeActuelle = ListConfirmedWidget();
+
+
+ var colorConfirm = Color(0xFFFFFFFF);
+ var colorWaiting = Color(0xFFA8A8A8);
+ void changeSelected(int num){
+ if(indexSectedButton == num){
+ return;
+ }
+ else{
+ if(num == 0){
+ setState((){
+ colorConfirm = Color(0xFFFFFFFF);
+ colorWaiting = Color(0xFFA8A8A8);
+ listeActuelle = ListConfirmedWidget();
+ indexSectedButton = num;
+ });
+
+
+ }
+ else{
+ setState((){
+ colorConfirm = Color(0xFFA8A8A8);
+ colorWaiting = Color(0xFFFFFFFF);
+ listeActuelle = ListWaitingWidget();
+ indexSectedButton = num;
+ });
+ }
+
+ }
+ }
+
+ @override
+
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
+ return Container(
+ color: Color(0xFF141414),
+
+ child: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('Messages', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25)),
+ Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
+ Text('Retrouvez ici vos discussions.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, height*0.01, 0, 0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
+ children: [
+ SizedBox(
+ height: 35,
+ width: width*0.35,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: colorConfirm,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(15.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ changeSelected(0);
+ },
+ child: Text("Validées",
+ style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
+ textAlign: TextAlign.center,
+ ),
+ ),),
+ SizedBox(
+ height: 35,
+ width: width*0.35,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: colorWaiting,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(15.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ changeSelected(1);
+ },
+ child: Text("En attente",
+ style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
+ textAlign: TextAlign.center,
+ ),
+ ),),
+ ],
+ ),),
+ ],
+ ),
+ ),
+ Expanded(
+ child:
+ listeActuelle,
+
+
+ ),
+ ],
+ ),),
+ );
+ }
+}
+
+class MessagesButtonWidget extends StatelessWidget{
+ @override
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
+ return Container(
+ margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
+ child: Column(
+ children: [
+
+ Container(
+ color: Colors.transparent,
+ margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Row(
+ children: [
+ Container(
+ height: 60,
+ width: 60,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(30)),
+ ),),
+ Container(
+ width: width-160,
+ margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text('Max',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('1 jour(s)',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.8) ,fontSize: 15, fontWeight: FontWeight.w400),),
+ ],
+ ),
+ Text('A envoyé un musique.',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
+
+ ],
+ ),),
+ ],
+ ),
+ ),
+
+
+ ],
+ )
+ );
+
+ }
+}
+
+class ListConfirmedWidget extends StatelessWidget{
+ @override
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
+ return ListView(
+
+ children: [
+ SizedBox(height: 40,),
+ MessagesButtonWidget(),
+ MessagesButtonWidget(),
+ MessagesButtonWidget(),
+ MessagesButtonWidget(),
+
+
+ ],
+ );
+
+ }
+}
+
+class ListWaitingWidget extends StatelessWidget{
+ @override
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
+ return ListView(
+
+ children: [
+ SizedBox(height: 40,),
+ GestureDetector(
+ onTap: () {
+ Navigator.of(context).push(PageTransition(
+ duration: Duration(milliseconds: 200),
+ reverseDuration: Duration(milliseconds: 200),
+ type: PageTransitionType.rightToLeftWithFade,
+ childCurrent: context.widget,
+ child: ConversationPage()));
+ },
+ child: MessagesButtonWidget(),
+ ),
+
+ ],
+ );
+
+ }
+}
\ No newline at end of file
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
index b38784c..50fc84e 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_profile.dart
@@ -1,3 +1,7 @@
+import 'package:dafl_project_flutter/main.dart';
+
+import '../../../main.dart';
+import '../../../main.dart';
import './w_settings.dart';
import './w_spot.dart';
import 'package:flutter/material.dart';
@@ -16,198 +20,228 @@ class _ProfilWidgetState extends State {
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
+ return MainPageProfil();
+ }
+}
+
+class MainPageProfil extends StatelessWidget {
+ const MainPageProfil({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ double height = MediaQuery.of(context).size.height;
+ double width = MediaQuery.of(context).size.width;
return Container(
color: Color(0xFF141414),
- child: Container(
- width: double.infinity,
- height: double.infinity,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- width: double.infinity,
- margin: EdgeInsets.fromLTRB(30, 50, 0, 0),
- child: Text(
- "Profil",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white),),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 40),
- height: height*0.14,
- width: height*0.14,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(100.0),
- color: Colors.blue,border: Border.all(width: 6.0, color: Colors.white),
+ child: Container(
+ width: double.infinity,
+ height: double.infinity,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ width: double.infinity,
+ margin: EdgeInsets.fromLTRB(30, 50, 0, 0),
+ child: Text(
+ "Profil",
+ style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white),),
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 10),
+ height: height*0.14,
+ width: height*0.14,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(100.0),
+ color: Colors.blue,border: Border.all(width: 6.0, color: Colors.white),
+ boxShadow: [
+ BoxShadow(
+ offset: Offset(0, 0),
+ spreadRadius: 5,
+ blurRadius:10,
+ color: Color.fromRGBO(0, 0, 0, 1),
+ ),
+ ],
+ ),
+ child: Center(
+ child: Text(MyApp().controller.currentUser.usernameDafl![0] ?? '',
+ style: TextStyle(color: Colors.white ,fontSize: 60, fontWeight: FontWeight.w500),
+ textAlign: TextAlign.center,
+ ),
+ ),
),
- ),
- Container(
- height: 55,
- width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
+ Text(MyApp().controller.currentUser.usernameDafl ?? '',
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
),
- margin: EdgeInsets.fromLTRB(30, 0, 30, 0),
- child: SizedBox(
+ Container(
height: 55,
width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- },
- child: Row(
- children: [
- Image.asset('assets/images/fav_logo.png', height: 25,),
- SizedBox(width: 12,),
- Text("Préférences musicales",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
- ],
- )
- ),),
- ),
- Container(
- height: 55,
- width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
+ ),
+ margin: EdgeInsets.fromLTRB(30, 40, 30, 0),
+ child: SizedBox(
+ height: 55,
+ width: double.infinity,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ },
+ child: Row(
+ children: [
+ Image.asset('assets/images/fav_logo.png', height: 25,),
+ SizedBox(width: 12,),
+ Text("Préférences musicales",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
+ ],
+ )
+ ),),
),
- margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
- child: SizedBox(
+ Container(
height: 55,
width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- Navigator.push(context,MaterialPageRoute(builder: (context)=> DisplayInfoWidget()));
- },
- child: Row(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
+ ),
+ margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
+ child: SizedBox(
+ height: 55,
+ width: double.infinity,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ Navigator.push(context,MaterialPageRoute(builder: (context)=> DisplayInfoWidget()));
+ },
+ child: Row(
+ children: [
+ Icon(Icons.remove_red_eye, color: Colors.white,size: 30,),
+ SizedBox(width: 12,),
+ Text("Aperçu de mon profil",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
+ ],
+ )
+ ),),
+ ),
+ Container(
+ height: height*0.27,
+ width: double.infinity,
+ margin: EdgeInsets.fromLTRB(30, 15, 30, 0),
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Icon(Icons.remove_red_eye, color: Colors.white,size: 30,),
- SizedBox(width: 12,),
- Text("Aperçu de mon profil",
+ Icon(Icons.wifi_tethering, color: Colors.white, size: 35,),
+ SizedBox(width: 10,),
+ Text("En cours d'écoute...",
style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
textAlign: TextAlign.center,
),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
],
- )
- ),),
- ),
- Container(
- height: height*0.27,
- width: double.infinity,
- margin: EdgeInsets.fromLTRB(30, 15, 30, 0),
- child: Column(
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Icon(Icons.wifi_tethering, color: Colors.white, size: 35,),
- SizedBox(width: 10,),
- Text("En cours d'écoute...",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- ],
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- height: height*0.14,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15.0),
- color: Color(0xFFD9D9D9).withOpacity(0.08),
),
- child:
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(15),
- child: Image(
- height: 90,
- width: 90,
- image: NetworkImage('https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'),
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ height: height*0.14,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(15.0),
+ color: Color(0xFFD9D9D9).withOpacity(0.08),
+ ),
+ child:
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(15),
+ child: FadeInImage.assetNetwork(
+ height: 90,
+ width: 90,
+ placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'),
),
),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(12, 20, 0, 0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('BAMBINA', style: TextStyle(fontSize:18, fontWeight: FontWeight.w500, color: Colors.white),),
- Text('PNL', style: TextStyle(fontSize:16, fontWeight: FontWeight.w400, color: Colors.grey),),
- ],
- ),
- )
+ Container(
+ margin: EdgeInsets.fromLTRB(12, 20, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('BAMBINA', style: TextStyle(fontSize:18, fontWeight: FontWeight.w500, color: Colors.white),),
+ Text('PNL', style: TextStyle(fontSize:16, fontWeight: FontWeight.w400, color: Colors.grey),),
+ ],
+ ),
+ )
- ],
+ ],
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- Spacer(),
- Container(
- height: 55,
- width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- color: Colors.transparent,
- ),
- margin: EdgeInsets.fromLTRB(30, 0, 30, height*0.04),
- child: SizedBox(
+ Spacer(),
+ Container(
height: 55,
width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),// background// foreground
- ),
- onPressed: () {
- Navigator.push(context,MaterialPageRoute(builder: (context)=> SettingsWidget()));
- },
- child: Row(
- children: [
- Icon(Icons.settings, color: Colors.white,size: 30,),
- SizedBox(width: 12,),
- Text("Paramètres",
- style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
- textAlign: TextAlign.center,
- ),
- Spacer(),
- Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
- ],
- )
- ),),
- ),
- ],
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.transparent,
+ ),
+ margin: EdgeInsets.fromLTRB(30, 0, 30,0),
+ child: SizedBox(
+ height: 55,
+ width: double.infinity,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFD9D9D9).withOpacity(0.08),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),// background// foreground
+ ),
+ onPressed: () {
+ Navigator.push(context,MaterialPageRoute(builder: (context)=> SettingsWidget()));
+ },
+ child: Row(
+ children: [
+ Icon(Icons.settings, color: Colors.white,size: 30,),
+ SizedBox(width: 12,),
+ Text("Paramètres",
+ style: TextStyle(color: Colors.white ,fontSize: 17, fontWeight: FontWeight.w400),
+ textAlign: TextAlign.center,
+ ),
+ Spacer(),
+ Icon(Icons.arrow_forward_ios, color: Colors.white.withOpacity(0.3),),
+ ],
+ )
+ ),),
+ ),
+ Spacer(),
+ ],
+ ),
),
- ),
);
+
}
}
diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
index 19db674..ab0daa5 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_settings.dart
@@ -1,4 +1,6 @@
+import 'package:dafl_project_flutter/main.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
class SettingsWidget extends StatefulWidget {
const SettingsWidget({Key? key}) : super(key: key);
@@ -8,6 +10,8 @@ class SettingsWidget extends StatefulWidget {
}
class _SettingsWidgetState extends State {
+ final userNameTextField = TextEditingController(text: MyApp().controller.currentUser?.usernameDafl);
+ final passwordTextField = TextEditingController(text: MyApp().controller.currentUser?.passwDafl);
@override
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
@@ -30,21 +34,21 @@ class _SettingsWidgetState extends State {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
- margin: EdgeInsets.fromLTRB(30, height*0.07, 30, 0),
- width: double.infinity,
- height: 30,
- alignment: Alignment.centerLeft,
- decoration: BoxDecoration(
- color: Color(0xFFD9D9D9).withOpacity(0.16),
- borderRadius: BorderRadius.circular(7.0),
- ),
- child: Padding(
- padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Text('Pseudo',
- style: TextStyle(
- color: Color(0xFFAEAEAE)
- ),),
- )
+ margin: EdgeInsets.fromLTRB(30, height*0.07, 30, 0),
+ width: double.infinity,
+ height: 30,
+ alignment: Alignment.centerLeft,
+ decoration: BoxDecoration(
+ color: Color(0xFFD9D9D9).withOpacity(0.16),
+ borderRadius: BorderRadius.circular(7.0),
+ ),
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Text('Pseudo',
+ style: TextStyle(
+ color: Color(0xFFAEAEAE)
+ ),),
+ )
),
Padding(padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
child: SizedBox(
@@ -54,6 +58,7 @@ class _SettingsWidgetState extends State {
SizedBox(
width: 230,
child: TextField(
+ controller: userNameTextField,
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
hintStyle: Theme.of(context).textTheme.caption?.copyWith(
@@ -67,9 +72,15 @@ class _SettingsWidgetState extends State {
),
),
Spacer(),
- Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
- child: Text('modifier',
- style: TextStyle( color: Colors.blue, fontSize: 17),),),
+ GestureDetector(
+ onTap: () {
+ MyApp().controller.changeUsernameCourant(userNameTextField.text);
+ Notify(0,context,isError: false);
+ },
+ child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
+ child: Text('modifier',
+ style: TextStyle( color: Colors.blue, fontSize: 17),),),)
+
],
),
@@ -100,6 +111,7 @@ class _SettingsWidgetState extends State {
SizedBox(
width: 230,
child: TextField(
+ controller: passwordTextField,
obscureText: true,
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
@@ -114,9 +126,15 @@ class _SettingsWidgetState extends State {
),
),
Spacer(),
- Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
- child: Text('modifier',
- style: TextStyle( color: Colors.blue, fontSize: 17),),),
+ GestureDetector(
+ onTap: () {
+ MyApp().controller.changePasswordCourant(passwordTextField.text);
+ Notify(1,context,isError: false);
+ },
+ child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
+ child: Text('modifier',
+ style: TextStyle( color: Colors.blue, fontSize: 17),),),
+ ),
],
),
@@ -129,3 +147,4 @@ class _SettingsWidgetState extends State {
);
}
}
+
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 bca1061..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
@@ -1,4 +1,7 @@
import 'dart:ui';
+import 'package:dafl_project_flutter/views/pages/main/w_discovery.dart';
+
+import '../../../model/music.dart';
import './w_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/painting/gradient.dart' as gradiant;
@@ -6,6 +9,7 @@ import 'package:provider/provider.dart';
import '../../../main.dart';
import 'package:rive/rive.dart';
import 'package:animations/animations.dart';
+import 'package:vibration/vibration.dart';
class SpotsWidget extends StatefulWidget {
const SpotsWidget({Key? key}) : super(key: key);
@@ -16,45 +20,35 @@ 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;
double width = MediaQuery.of(context).size.width;
final provider = Provider.of(context);
- return Scaffold(
-
- resizeToAvoidBottomInset: false,
- backgroundColor: Color(0xFF141414),
- body: Container(
- height: double.maxFinite,
- child: Stack(
- children: [
- Transform.scale(scale: 1.1,
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage(provider.urlImages.isEmpty != true
- ?provider.urlImages.last
- :"https://i.imgur.com/Uovh293.png"),
- fit: BoxFit.cover,
+ return Container(
- ),
- ),
- child: BackdropFilter(filter: ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0),
+ color: Color(0xFF141414),
+ child: Container(
+ height: double.maxFinite,
+ child: Stack(
+ children: [
+ Transform.scale(scale: 1.1,
child: Container(
- decoration: BoxDecoration(color: Colors.black.withOpacity(0.4)),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage(MyApp().controller.currentUser.Spots.isEmpty? "https://i.imgur.com/Uovh293.png":MyApp().controller.currentUser.Spots.last.linkCover),
+ fit: BoxFit.cover,
+
+ ),
+ ),
+ child: BackdropFilter(filter: ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0),
+ child: Container(
+ decoration: BoxDecoration(color: Colors.black.withOpacity(0.4)),
+ ),),
),),
- ),),
- Padding(
- padding: EdgeInsets.fromLTRB(0, 0, 0,height*0.03),
- child: Align(
+ Align(
alignment: FractionalOffset.bottomCenter,
- child: OpenContainer(
+ child: MyApp().controller.currentUser.Spots.isEmpty? Container():OpenContainer(
closedColor: Colors.transparent,
closedElevation: 0,
@@ -67,68 +61,74 @@ class _SpotsWidgetState extends State {
},
),
),
- ),
- Center(
- child: Container(
- width: 300,
- height: 300,
- child: RiveAnimation.asset('assets/images/search_spot_animation.riv'),
+ Center(
+ child: Container(
+ width: 300,
+ height: 300,
+ child: RiveAnimation.asset('assets/images/search_spot_animation.riv'),
+ ),
),
- ),
- Positioned(
- top: height*0.68,
- width: width,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.dislike();
-
- },
- child: Image.asset(
- 'assets/images/bouton_dislike.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
+ Positioned(
+ top: height*0.68,
+ width: width,
+ child: MyApp().controller.currentUser.Spots.isEmpty? Container():Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.dislike();
+
+
+ },
+ child: Image.asset(
+ 'assets/images/bouton_dislike.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
+ ),
),
- ),
- SizedBox(
- width: width*0.1,
- ),
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.discovery();
- },
- child: Image.asset(
- 'assets/images/bouton_discovery.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.discovery();
+ },
+ child: Image.asset(
+ 'assets/images/bouton_discovery.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
+ ),
),
- ),
- SizedBox(
- width: width*0.1,
- ),
- GestureDetector(
- onTap: () {
- final provider = Provider.of(context, listen: false);
- provider.like();
- },
- child: Image.asset(
- 'assets/images/bouton_like.png',
- height: 70,
- width: 70,
- fit: BoxFit.cover,
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.message(this.context);
+ },
+ child: Image.asset(
+ 'assets/images/bouton_messages.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
+ ),
),
- ),
- ],
+ GestureDetector(
+ onTap: () {
+ final provider = Provider.of(context, listen: false);
+ provider.like(this.context);
+ },
+ child: Image.asset(
+ 'assets/images/bouton_like.png',
+ height: 70,
+ width: 70,
+ fit: BoxFit.cover,
+ ),
+ ),
+ ],
+ ),
),
- ),
- Align(
- child:Container(
+ Align(
+ child:Container(
width: 400,
height: height*0.8,
margin: EdgeInsets.fromLTRB(width*0.09,height/5,width*0.09,height/3.7),
@@ -136,45 +136,48 @@ class _SpotsWidgetState extends State {
child: Container(
child: buildCards(),
)
- ) ,
- ),
- IgnorePointer(child: Container(height: 200,
- decoration: BoxDecoration(
- gradient: gradiant.LinearGradient(
- colors: [Colors.black, Colors.transparent],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- )
+ ) ,
+ ),
+ IgnorePointer(child: Container(height: 200,
+ decoration: BoxDecoration(
+ gradient: gradiant.LinearGradient(
+ colors: [Colors.black.withOpacity(0.95),Colors.black.withOpacity(0.84),Colors.black.withOpacity(0.66),Colors.black.withOpacity(0.41),Colors.black.withOpacity(0)],
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ )
),),),
- Padding(padding: EdgeInsets.fromLTRB(20, 60, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('COULEURS',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Khali',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),),
- ],
- ),),
- ],
- ),
- )
+ Padding(padding: EdgeInsets.fromLTRB(20, 60, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ 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),),
+ ],
+ ),),
+ ],
+ ),
+ )
);
}
Widget buildCards() {
final provider = Provider.of(context);
- final urlImages = provider.urlImages;
+ final urlImages = provider.spotsList;
return Stack(
children: urlImages
.map((urlImage) => CardWidget(
- urlImage: urlImage,
- isFront: urlImages.last == urlImage,
+ urlImage: urlImage.linkCover,
+ isFront: urlImages.last == urlImage,
))
.toList(),
);
}
+
+
}
@@ -192,61 +195,61 @@ class DisplayInfoWidget extends StatelessWidget{
body: ListView(
children: [
Container(
- margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
- child: Column(
- children: [
- Text('Pour mon mariage',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
+ child: Column(
+ children: [
+ Text('Pour mon mariage',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Container(
- margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
- decoration: BoxDecoration(
- color: Color(0xFF2E2C2E),
- border: Border.all(width: 1, color: Colors.grey.withOpacity(0.05)),
- borderRadius: BorderRadius.all(Radius.circular(20)),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withOpacity(0.2),
- blurRadius: 5,
- spreadRadius: 1,
- offset: Offset(2.0, 2.0), // shadow direction: bottom right
- )
- ],
+ Container(
+ margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
+ decoration: BoxDecoration(
+ color: Color(0xFF2E2C2E),
+ border: Border.all(width: 1, color: Colors.grey.withOpacity(0.05)),
+ borderRadius: BorderRadius.all(Radius.circular(20)),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.2),
+ blurRadius: 5,
+ spreadRadius: 1,
+ offset: Offset(2.0, 2.0), // shadow direction: bottom right
+ )
+ ],
- ),
- width: double.infinity,
- height: 100,
- child: Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),child: Row(
- children: [
- Container(
- height: 75,
- width: 75,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage("assets/images/dadju-cover-poison.png"),
- fit: BoxFit.cover,
- ),
- border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(15)),
- ),),
- SizedBox(
),
- Container(
- margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Ma vie',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
- Text('Dadju',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
-
- ],
- ),),
- ],
- ),),
- ),
+ width: double.infinity,
+ height: 100,
+ child: Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10),child: Row(
+ children: [
+ Container(
+ height: 75,
+ width: 75,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage("assets/images/dadju-cover-poison.png"),
+ fit: BoxFit.cover,
+ ),
+ border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
+ borderRadius: BorderRadius.all(Radius.circular(15)),
+ ),),
+ SizedBox(
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('Ma vie',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
+ Text('Dadju',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
- ],
- )
+ ],
+ ),),
+ ],
+ ),),
+ ),
+
+ ],
+ )
),
Container(
margin: EdgeInsets.fromLTRB(30, 10, 30, 0),
@@ -666,13 +669,16 @@ class PreviewInfoWidget extends StatelessWidget{
decoration: BoxDecoration(
color: Color(0xFF24243A).withOpacity(0.40),
border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
- borderRadius: BorderRadius.all(Radius.circular(15)),
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(20),
+ topRight: Radius.circular(20),
+ ),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Me découvrir...',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w800),),
- ],
+ children: [
+ Text('Me découvrir...',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w800),),
+ ],
),
);
diff --git a/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart b/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
index 3e401d1..7b29836 100644
--- a/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
+++ b/Sources/dafl_project_flutter/lib/views/pages/sign_in/p_sign_in.dart
@@ -1,9 +1,8 @@
-
import 'dart:ui';
-import 'package:dafl_project_flutter/persistence/database_saver.dart';
+import 'package:dafl_project_flutter/model/user.dart';
+import 'package:dafl_project_flutter/views/pages/main/p_main.dart';
import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart';
-import '../../../controller/controller.dart';
import '../../../main.dart';
import '../sign_up/p_sign_up.dart';
@@ -16,13 +15,11 @@ class SignInPage extends StatefulWidget {
class _SignInPageState extends State {
var boxColor = Colors.white;
- Controller ctrl = Controller();
-
- TextEditingController password = new TextEditingController();
- TextEditingController username = new TextEditingController();
@override
bool isChecked = false;
+ final userNameTextField = TextEditingController();
+ final passwordTextField = TextEditingController();
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
@@ -75,7 +72,7 @@ class _SignInPageState extends State {
),
Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- controller: username,
+ controller: userNameTextField,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -119,7 +116,8 @@ class _SignInPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- controller: password,
+ controller: passwordTextField,
+ obscureText: true,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -173,23 +171,15 @@ class _SignInPageState extends State {
highlightColor: Colors.grey.shade100,
splashColor: Color(0xFF406DE1),
onTap: (){
-
- ctrl.load(username.text, password.text);
-
-
- Navigator.of(context).push(
- PageTransition(
- type: PageTransitionType.fade,
- childCurrent: widget,
- child: Splash()),
- );
+ checkInformations(userNameTextField.text, passwordTextField.text);
},
child:Ink(
child: Align(
alignment: Alignment.center,
- child: Image.asset(
- 'assets/images/valid_logo.png',
- width: 40,
+ child: Icon(
+ Icons.check,
+ color: Color(0xFF406DE1),
+ size: 60.0,
),
),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
@@ -215,7 +205,7 @@ class _SignInPageState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Text('Tu n’as pas de compte?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
+ Text('Tu n’as pas de compte ?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
GestureDetector(
onTap: () {
Navigator.of(context).push(
@@ -233,18 +223,29 @@ class _SignInPageState extends State {
SizedBox(height: 60,),
],
),
- Align(
- alignment: Alignment.topRight,
- child: Container(
- padding: EdgeInsets.fromLTRB(0, 20, 20, 0),
- child: Text("v1.0",
- style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.5) ,fontSize: 17, fontWeight: FontWeight.w700),
- ),
- )
- ),
],
),
);
}
+
+ void checkInformations(String username,String password){
+ if(username ==""){
+ Notify(2, context);
+ }
+ else if(password ==""){
+ Notify(4, context);
+ }
+ else{
+ //MyApp().controller.load(userNameTextField.text, passwordTextField.text);
+ MyApp().controller.currentUser = User(userNameTextField.text, passwordTextField.text);
+ Navigator.of(context).push(
+ PageTransition(
+ type: PageTransitionType.fade,
+ childCurrent: widget,
+ child: Splash()),
+ );
+
+ }
+ }
}
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 3a9eba0..e09ee2a 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,16 +1,11 @@
-import 'package:dafl_project_flutter/controller/controller.dart';
-import 'package:dafl_project_flutter/persistence/loader.dart';
+import 'package:dafl_project_flutter/main.dart';
import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart';
-import '../../../persistence/saver.dart';
+import 'package:rive/rive.dart' as riv;
+import '../../../model/user.dart';
import '../home/p_home.dart';
import '../sign_in/p_sign_in.dart';
-import '../../../persistence/database_saver.dart';
-import '../../../persistence/database_loader.dart';
import '../../../controller/controller.dart';
-import '../../../model/user.dart';
-
-
class SignUpPage extends StatefulWidget {
const SignUpPage({Key? key}) : super(key: key);
@@ -20,18 +15,14 @@ class SignUpPage extends StatefulWidget {
}
class _SignUpPageState extends State {
- final Controller ctrl = Controller();
Color boxColor = Colors.white;
bool isHovering = false;
@override
- TextEditingController passwordconfirm = new TextEditingController();
-
- //Text field that entered the username of the user
- TextEditingController username = new TextEditingController();
-
-
bool isChecked = false;
+ final userNameTextField = TextEditingController();
+ final passwordTextField = TextEditingController();
+ final passwordConfirmTextField = TextEditingController();
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
@@ -84,7 +75,7 @@ class _SignUpPageState extends State {
),
Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- controller: username,
+ controller: userNameTextField,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -128,6 +119,8 @@ class _SignUpPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
+ controller: passwordTextField,
+ obscureText: true,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -171,7 +164,8 @@ class _SignUpPageState extends State {
),Padding(padding: EdgeInsets.fromLTRB(50, 0, 20, 0),
child: TextField(
- controller: passwordconfirm,
+ obscureText: true,
+ controller: passwordConfirmTextField,
decoration: InputDecoration(
border: InputBorder.none,
),
@@ -245,26 +239,16 @@ class _SignUpPageState extends State {
highlightColor: Colors.grey.shade100,
splashColor: Color(0xFF406DE1),
onTap: (){
- ctrl.save(User(username.text, passwordconfirm.text));
+ checkInformations(userNameTextField.text, passwordTextField.text, passwordConfirmTextField.text);
- setState(() {
- boxColor = Colors.blue;
- });
- Navigator.of(context).push(
- PageTransition(
- duration: Duration(milliseconds: 300),
- reverseDuration: Duration(milliseconds: 300),
- type: PageTransitionType.leftToRightJoined,
- childCurrent: widget,
- child: HomePage()),
- );
},
child:Ink(
child: Align(
alignment: Alignment.center,
- child: Image.asset(
- 'assets/images/valid_logo.png',
- width: 47,
+ child: Icon(
+ Icons.check,
+ color: Color(0xFF406DE1),
+ size: 60.0,
),
),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
@@ -290,7 +274,7 @@ class _SignUpPageState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Text('Tu n’as déjà un compte?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
+ Text('Tu as déjà un compte ?', style: TextStyle(color: Colors.white, fontWeight: FontWeight.normal, fontSize: 17)),
GestureDetector(
onTap: () {
Navigator.of(context).push(
@@ -308,18 +292,40 @@ class _SignUpPageState extends State {
SizedBox(height: 60,),
],
),
- Align(
- alignment: Alignment.topRight,
- child: Container(
- padding: EdgeInsets.fromLTRB(0, 20, 20, 0),
- child: Text("v1.0",
- style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.5) ,fontSize: 17, fontWeight: FontWeight.w700),
- ),
- )
- ),
],
),
);
}
+
+ void checkInformations(String username,String password, String confirmPassword){
+ if(username ==""){
+ Notify(2, context);
+ }
+ else if(password =="" || confirmPassword == ""){
+ Notify(4, context);
+ }
+ else if(password.length <8){
+ Notify(3, context);
+ }
+ else if(password != confirmPassword){
+ Notify(1, context);
+ }
+ else if(password != confirmPassword){
+ Notify(1, context);
+ }
+ else{
+ MyApp().controller.save(User(userNameTextField.text, passwordConfirmTextField.text));
+ Navigator.of(context).push(
+ PageTransition(
+ duration: Duration(milliseconds: 300),
+ reverseDuration: Duration(milliseconds: 300),
+ type: PageTransitionType.leftToRightJoined,
+ childCurrent: widget,
+ child: HomePage()),);
+
+ }
+
+ }
+
}
diff --git a/Sources/dafl_project_flutter/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/Sources/dafl_project_flutter/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
new file mode 100644
index 0000000..63108e6
--- /dev/null
+++ b/Sources/dafl_project_flutter/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
@@ -0,0 +1,11 @@
+// This is a generated file; do not edit or check into version control.
+FLUTTER_ROOT=C:\src\flutter
+FLUTTER_APPLICATION_PATH=C:\Users\delan\AndroidStudioProjects\dafl_musicv3\Sources\dafl_project_flutter
+COCOAPODS_PARALLEL_CODE_SIGN=true
+FLUTTER_BUILD_DIR=build
+FLUTTER_BUILD_NAME=1.0.0
+FLUTTER_BUILD_NUMBER=1
+DART_OBFUSCATION=false
+TRACK_WIDGET_CREATION=true
+TREE_SHAKE_ICONS=false
+PACKAGE_CONFIG=.dart_tool/package_config.json
diff --git a/Sources/dafl_project_flutter/macos/Flutter/ephemeral/flutter_export_environment.sh b/Sources/dafl_project_flutter/macos/Flutter/ephemeral/flutter_export_environment.sh
new file mode 100644
index 0000000..97f8606
--- /dev/null
+++ b/Sources/dafl_project_flutter/macos/Flutter/ephemeral/flutter_export_environment.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This is a generated file; do not edit or check into version control.
+export "FLUTTER_ROOT=C:\src\flutter"
+export "FLUTTER_APPLICATION_PATH=C:\Users\delan\AndroidStudioProjects\dafl_musicv3\Sources\dafl_project_flutter"
+export "COCOAPODS_PARALLEL_CODE_SIGN=true"
+export "FLUTTER_BUILD_DIR=build"
+export "FLUTTER_BUILD_NAME=1.0.0"
+export "FLUTTER_BUILD_NUMBER=1"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=true"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.dart_tool/package_config.json"
diff --git a/Sources/dafl_project_flutter/pubspec.lock b/Sources/dafl_project_flutter/pubspec.lock
index 7ed6371..96388e7 100644
--- a/Sources/dafl_project_flutter/pubspec.lock
+++ b/Sources/dafl_project_flutter/pubspec.lock
@@ -152,7 +152,7 @@ packages:
name: flutter_native_splash
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.13"
+ version: "2.2.11"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -183,7 +183,7 @@ packages:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.0"
+ version: "2.1.0"
html:
dependency: transitive
description:
@@ -232,7 +232,7 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.1"
+ version: "2.0.0"
logging:
dependency: transitive
description:
@@ -344,7 +344,7 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
- version: "5.1.0"
+ version: "5.0.0"
platform:
dependency: transitive
description:
diff --git a/Sources/dafl_project_flutter/pubspec.yaml b/Sources/dafl_project_flutter/pubspec.yaml
index acd3aa7..e41b996 100644
--- a/Sources/dafl_project_flutter/pubspec.yaml
+++ b/Sources/dafl_project_flutter/pubspec.yaml
@@ -87,7 +87,9 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- - assets/
+ - assets/images/
+ - assets/fonts/
+ - assets/logs.txt
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware