diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9d532b1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,41 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Web related
+lib/generated_plugin_registrant.dart
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
diff --git a/.metadata b/.metadata
new file mode 100644
index 0000000..182ccca
--- /dev/null
+++ b/.metadata
@@ -0,0 +1,10 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: 78910062997c3a836feee883712c241a5fd22983
+ channel: stable
+
+project_type: app
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a4f5465
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# whatsapp
+
+A new Flutter application.
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
+
+For help getting started with Flutter, view our
+[online documentation](https://flutter.dev/docs), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/android/.gitignore b/android/.gitignore
new file mode 100644
index 0000000..0a741cb
--- /dev/null
+++ b/android/.gitignore
@@ -0,0 +1,11 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+key.properties
diff --git a/android/app/build.gradle b/android/app/build.gradle
new file mode 100644
index 0000000..3c8b992
--- /dev/null
+++ b/android/app/build.gradle
@@ -0,0 +1,61 @@
+def localProperties = new Properties()
+def localPropertiesFile = rootProject.file('local.properties')
+if (localPropertiesFile.exists()) {
+ localPropertiesFile.withReader('UTF-8') { reader ->
+ localProperties.load(reader)
+ }
+}
+
+def flutterRoot = localProperties.getProperty('flutter.sdk')
+if (flutterRoot == null) {
+ throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
+}
+
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+if (flutterVersionCode == null) {
+ flutterVersionCode = '1'
+}
+
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
+if (flutterVersionName == null) {
+ flutterVersionName = '1.0'
+}
+
+apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.google-services'
+apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+
+android {
+ compileSdkVersion 29
+
+ lintOptions {
+ disable 'InvalidPackage'
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId "com.example.whatsapp"
+ minSdkVersion 16
+ targetSdkVersion 29
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ multiDexEnabled true
+ }
+
+ buildTypes {
+ release {
+ // TODO: Add your own signing config for the release build.
+ // Signing with the debug keys for now, so `flutter run --release` works.
+ signingConfig signingConfigs.debug
+ }
+ }
+}
+
+flutter {
+ source '../..'
+}
+dependencies
+{
+ implementation 'androidx.multidex:multidex:2.0.0'
+ implementation platform('com.google.firebase:firebase-bom:26.3.0')
+}
diff --git a/android/app/google-services.json b/android/app/google-services.json
new file mode 100644
index 0000000..a4715eb
--- /dev/null
+++ b/android/app/google-services.json
@@ -0,0 +1,40 @@
+{
+ "project_info": {
+ "project_number": "235751382454",
+ "firebase_url": "https://whatsapp-a435c-default-rtdb.firebaseio.com",
+ "project_id": "whatsapp-a435c",
+ "storage_bucket": "whatsapp-a435c.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:235751382454:android:b8cd3233087776a21db517",
+ "android_client_info": {
+ "package_name": "com.example.whatsapp"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "235751382454-3e0k29n01s789uskt3krfogbcomhjmg6.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyBfMHyTDJDp-xerUzUiM2itXtPjXTCgYow"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "235751382454-3e0k29n01s789uskt3krfogbcomhjmg6.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000..4e50995
--- /dev/null
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b787092
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/java/com/example/whatsapp/MainActivity.java b/android/app/src/main/java/com/example/whatsapp/MainActivity.java
new file mode 100644
index 0000000..4681658
--- /dev/null
+++ b/android/app/src/main/java/com/example/whatsapp/MainActivity.java
@@ -0,0 +1,6 @@
+package com.example.whatsapp;
+
+import io.flutter.embedding.android.FlutterActivity;
+
+public class MainActivity extends FlutterActivity {
+}
diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..304732f
--- /dev/null
+++ b/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..db77bb4
Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..17987b7
Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..09d4391
Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..d5f1c8d
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..4d6372e
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..1f83a33
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..4e50995
--- /dev/null
+++ b/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/android/build.gradle b/android/build.gradle
new file mode 100644
index 0000000..92e0e4a
--- /dev/null
+++ b/android/build.gradle
@@ -0,0 +1,30 @@
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.5.0'
+ classpath 'com.google.gms:google-services:4.3.4'
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+rootProject.buildDir = '../build'
+subprojects {
+ project.buildDir = "${rootProject.buildDir}/${project.name}"
+}
+subprojects {
+ project.evaluationDependsOn(':app')
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 0000000..a673820
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,4 @@
+org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
+android.enableR8=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..296b146
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jun 23 08:50:38 CEST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
diff --git a/android/settings.gradle b/android/settings.gradle
new file mode 100644
index 0000000..44e62bc
--- /dev/null
+++ b/android/settings.gradle
@@ -0,0 +1,11 @@
+include ':app'
+
+def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
+def properties = new Properties()
+
+assert localPropertiesFile.exists()
+localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
+
+def flutterSdkPath = properties.getProperty("flutter.sdk")
+assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
diff --git a/fonts/MavenPro-Black.ttf b/fonts/MavenPro-Black.ttf
new file mode 100644
index 0000000..270ed48
Binary files /dev/null and b/fonts/MavenPro-Black.ttf differ
diff --git a/fonts/MavenPro-Bold.ttf b/fonts/MavenPro-Bold.ttf
new file mode 100644
index 0000000..8316223
Binary files /dev/null and b/fonts/MavenPro-Bold.ttf differ
diff --git a/fonts/MavenPro-ExtraBold.ttf b/fonts/MavenPro-ExtraBold.ttf
new file mode 100644
index 0000000..22bebd5
Binary files /dev/null and b/fonts/MavenPro-ExtraBold.ttf differ
diff --git a/fonts/MavenPro-Medium.ttf b/fonts/MavenPro-Medium.ttf
new file mode 100644
index 0000000..d2f6248
Binary files /dev/null and b/fonts/MavenPro-Medium.ttf differ
diff --git a/fonts/MavenPro-Regular.ttf b/fonts/MavenPro-Regular.ttf
new file mode 100644
index 0000000..98ba850
Binary files /dev/null and b/fonts/MavenPro-Regular.ttf differ
diff --git a/fonts/MavenPro-SemiBold.ttf b/fonts/MavenPro-SemiBold.ttf
new file mode 100644
index 0000000..7b68c69
Binary files /dev/null and b/fonts/MavenPro-SemiBold.ttf differ
diff --git a/images/chat_background.jpg b/images/chat_background.jpg
new file mode 100644
index 0000000..5d1eb1d
Binary files /dev/null and b/images/chat_background.jpg differ
diff --git a/images/chat_background2.jpg b/images/chat_background2.jpg
new file mode 100644
index 0000000..b0e486f
Binary files /dev/null and b/images/chat_background2.jpg differ
diff --git a/images/chat_icon.png b/images/chat_icon.png
new file mode 100644
index 0000000..483fb6b
Binary files /dev/null and b/images/chat_icon.png differ
diff --git a/images/cover_photo.jpeg b/images/cover_photo.jpeg
new file mode 100644
index 0000000..73fc8c5
Binary files /dev/null and b/images/cover_photo.jpeg differ
diff --git a/images/login_user.png b/images/login_user.png
new file mode 100644
index 0000000..7aa7cc6
Binary files /dev/null and b/images/login_user.png differ
diff --git a/ios/.gitignore b/ios/.gitignore
new file mode 100644
index 0000000..e96ef60
--- /dev/null
+++ b/ios/.gitignore
@@ -0,0 +1,32 @@
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
new file mode 100644
index 0000000..6b4c0f7
--- /dev/null
+++ b/ios/Flutter/AppFrameworkInfo.plist
@@ -0,0 +1,26 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ App
+ CFBundleIdentifier
+ io.flutter.flutter.app
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ App
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ MinimumOSVersion
+ 8.0
+
+
diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/ios/Flutter/Debug.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/ios/Flutter/Release.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..89cf9b5
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,495 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 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 */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 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 = ""; };
+ 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 = ""; };
+ 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; };
+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 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 = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 9740EEB11CF90186004384FC /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,
+ );
+ name = Flutter;
+ sourceTree = "";
+ };
+ 97C146E51CF9000F007C117D = {
+ isa = PBXGroup;
+ children = (
+ 9740EEB11CF90186004384FC /* Flutter */,
+ 97C146F01CF9000F007C117D /* Runner */,
+ 97C146EF1CF9000F007C117D /* Products */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 97C146E61CF9000F007C117D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1020;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 97C146E51CF9000F007C117D;
+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 97C146ED1CF9000F007C117D /* Runner */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 97C146EC1CF9000F007C117D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Thin Binary";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ };
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C146FB1CF9000F007C117D /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C147001CF9000F007C117D /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.whatsapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 97C147041CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.whatsapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.whatsapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147031CF9000F007C117D /* Debug */,
+ 97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147061CF9000F007C117D /* Debug */,
+ 97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 97C146E61CF9000F007C117D /* Project object */;
+}
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..1d526a1
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..a28140c
--- /dev/null
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..1d526a1
--- /dev/null
+++ b/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..70693e4
--- /dev/null
+++ b/ios/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import UIKit
+import Flutter
+
+@UIApplicationMain
+@objc class AppDelegate: FlutterAppDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ GeneratedPluginRegistrant.register(with: self)
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d36b1fa
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,122 @@
+{
+ "images" : [
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-83.5x83.5@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "filename" : "Icon-App-1024x1024@1x.png",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 0000000..dc9ada4
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 0000000..28c6bf0
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 0000000..2ccbfd9
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 0000000..f091b6b
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 0000000..4cde121
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 0000000..d0ef06e
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 0000000..dcdc230
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 0000000..2ccbfd9
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 0000000..c8f9ed8
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 0000000..a6d6b86
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 0000000..a6d6b86
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 0000000..75b2d16
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 0000000..c4df70d
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 0000000..6a84f41
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 0000000..d0e1f58
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 0000000..0bedcf2
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 0000000..89c2725
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
@@ -0,0 +1,5 @@
+# Launch Screen Assets
+
+You can customize the launch screen with your own desired assets by replacing the image files in this directory.
+
+You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..f2e259c
--- /dev/null
+++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..f3c2851
--- /dev/null
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
new file mode 100644
index 0000000..c06237c
--- /dev/null
+++ b/ios/Runner/Info.plist
@@ -0,0 +1,45 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ whatsapp
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 0000000..308a2a5
--- /dev/null
+++ b/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/lib/components/animation_widget.dart b/lib/components/animation_widget.dart
new file mode 100644
index 0000000..6a8c684
--- /dev/null
+++ b/lib/components/animation_widget.dart
@@ -0,0 +1,14 @@
+import 'package:flutter/material.dart';
+
+class MyAwesomeAnimation extends StatelessWidget {
+ final Animation animation;
+ final Padding myWidget;
+ MyAwesomeAnimation({this.animation, this.myWidget});
+ @override
+ Widget build(BuildContext context) {
+ return SizeTransition(
+ sizeFactor:
+ CurvedAnimation(parent: animation, curve: Curves.decelerate),
+ child: myWidget);
+ }
+}
diff --git a/lib/components/home_message_chat.dart b/lib/components/home_message_chat.dart
new file mode 100644
index 0000000..3643839
--- /dev/null
+++ b/lib/components/home_message_chat.dart
@@ -0,0 +1,107 @@
+import 'package:firebase_auth/firebase_auth.dart';
+import 'package:firebase_core/firebase_core.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/provider/chat_provider.dart';
+import 'package:whatsapp/provider/home_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class HomeMessageChat extends StatelessWidget {
+ final FirebaseFun firebaseFun = FirebaseFun();
+ final int index;
+ final List listOfMessage;
+ final List profilePhotos;
+ final FirebaseAuth mAuth = FirebaseAuth.instance;
+
+ final String currentUserEmail;
+ HomeMessageChat(
+ {this.currentUserEmail,
+ this.index,
+ this.listOfMessage,
+ this.profilePhotos});
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: () async {
+ String email = listOfMessage[index].sender == mAuth.currentUser.email
+ ? listOfMessage[index].reciver
+ : listOfMessage[index].sender;
+ Account account = await firebaseFun.getOneAccount(email);
+ account.urlProfilePicture =
+ await firebaseFun.downloadProfilePicture(account.username);
+ //await Provider.of(context, listen: false)
+ // .getMessages(mAuth.currentUser.email, account.email);
+ Provider.of(context, listen: false).setId(
+ await firebaseFun.getChatID(
+ mAuth.currentUser.email, account.email));
+ Navigator.pushNamed(context, kChat_screen, arguments: account);
+ },
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
+ child: Row(
+ children: [
+ CircleAvatar(
+ radius: 35.0,
+ backgroundImage: profilePhotos[index] != 'xx'
+ ? NetworkImage(profilePhotos[index])
+ : AssetImage('images/chat_icon.png'),
+ ),
+ SizedBox(
+ width: 20.0,
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ listOfMessage[index].sender == currentUserEmail
+ ? Text(
+ listOfMessage[index].reciverUsername,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.bold,
+ color: Colors.black),
+ )
+ : Text(
+ listOfMessage[index].senderUsername,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.bold,
+ color: Colors.black),
+ ),
+ listOfMessage[index].sender == currentUserEmail
+ ? Text(
+ listOfMessage[index].message ?? 'Photo 📷',
+ style: TextStyle(
+ color: Color(kMainColorApp),
+ fontFamily: 'Maven_Pro',
+ fontSize: 17.0),
+ )
+ : Text(
+ listOfMessage[index].message ?? 'Photo 📷',
+ style: TextStyle(
+ color: Colors.grey,
+ fontFamily: 'Maven_Pro',
+ fontSize: 17.0),
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ SizedBox(
+ child: Divider(
+ thickness: 2.0,
+ color: Colors.grey,
+ ),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/components/person_search.dart b/lib/components/person_search.dart
new file mode 100644
index 0000000..f5a4b73
--- /dev/null
+++ b/lib/components/person_search.dart
@@ -0,0 +1,51 @@
+import 'package:flutter/material.dart';
+import 'package:whatsapp/model/account.dart';
+
+import '../constants.dart';
+
+class PersonSearch extends StatelessWidget {
+ final int index;
+ final List accountsList;
+ PersonSearch({this.accountsList, this.index});
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: () {
+ //print(accountsList[index].username);
+ Navigator.pushNamed(context, kProfile_friend,
+ arguments: accountsList[index]);
+ },
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10.0),
+ margin: EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(30.0), color: Colors.grey[350]),
+ child: Row(
+ children: [
+ CircleAvatar(
+ backgroundImage: accountsList[index].urlProfilePicture != 'xx'
+ ? NetworkImage(
+ accountsList[index].urlProfilePicture,
+ )
+ : AssetImage('images/chat_icon.png'),
+ radius: 50,
+ ),
+ SizedBox(
+ width: 20.0,
+ ),
+ Expanded(
+ child: Text(
+ accountsList[index].username,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/constants.dart b/lib/constants.dart
new file mode 100644
index 0000000..144eb54
--- /dev/null
+++ b/lib/constants.dart
@@ -0,0 +1,96 @@
+import 'package:flutter/material.dart';
+
+const String kLogin_screen = 'login_screen';
+const String kRegister_screen = 'register_screen';
+const String kHome_screen = 'home_screen';
+const String kSearch_screen = 'search_screen';
+const String kProfile_friend = 'profile_friend';
+const String kProfile_screen = 'profile_screen';
+const String kChat_screen = 'chat_screen';
+const kTextFieldPassword = InputDecoration(
+ prefixIcon: Icon(Icons.vpn_key),
+ contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
+ hintText: 'Enter Your Password',
+ hintStyle: TextStyle(color: Colors.grey),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30.0)),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 1.0),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 2.0),
+ ),
+);
+
+const kTextFieldEmail = InputDecoration(
+ prefixIcon: Icon(Icons.email),
+ contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
+ hintText: 'Enter Your Email',
+ hintStyle: TextStyle(color: Colors.grey),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30.0)),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 1.0),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 2.0),
+ ),
+);
+const kTextFieldAge = InputDecoration(
+ prefixIcon: Icon(Icons.paste),
+ contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
+ hintText: 'Enter Your Age',
+ hintStyle: TextStyle(color: Colors.grey),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30.0)),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 1.0),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 2.0),
+ ),
+);
+const kTextFieldUsername = InputDecoration(
+ prefixIcon: Icon(Icons.person),
+ contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
+ hintText: 'Enter Your Username',
+ hintStyle: TextStyle(color: Colors.grey),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30.0)),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 1.0),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(30.0),
+ ),
+ borderSide: BorderSide(color: Colors.blueAccent, width: 2.0),
+ ),
+);
+
+const kMainColorApp = 0xFF0C6C9F;
diff --git a/lib/main.dart b/lib/main.dart
new file mode 100644
index 0000000..8a02e95
--- /dev/null
+++ b/lib/main.dart
@@ -0,0 +1,50 @@
+import 'package:firebase_core/firebase_core.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/provider/account_provider.dart';
+import 'package:whatsapp/provider/chat_provider.dart';
+import 'package:whatsapp/provider/home_provider.dart';
+import 'package:whatsapp/provider/setting_provider.dart';
+import 'package:whatsapp/screens/chat_screen.dart';
+import 'package:whatsapp/screens/home.dart';
+import 'package:whatsapp/screens/login.dart';
+import 'package:whatsapp/screens/profile.dart';
+import 'package:whatsapp/screens/register.dart';
+import 'package:whatsapp/screens/search_profile.dart';
+import 'package:whatsapp/screens/search_screen.dart';
+
+void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+ await Firebase.initializeApp();
+ runApp(
+ MultiProvider(
+ providers: [
+ ChangeNotifierProvider(create: (_) => SettingProvider()),
+ ChangeNotifierProvider(create: (_) => AccountProvider()),
+ ChangeNotifierProvider(create: (_) => ChatProvider()),
+ ChangeNotifierProvider(create: (_) => HomeProvider()),
+ ],
+ child: MyApp(),
+ ),
+ );
+}
+
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ theme: Provider.of(context).themeData,
+ initialRoute: kLogin_screen,
+ routes: {
+ kLogin_screen: (context) => LoginScreen(),
+ kRegister_screen: (context) => RegisterScreen(),
+ kHome_screen: (context) => HomeScreen(),
+ kSearch_screen: (context) => SearchScreen(),
+ kProfile_friend: (context) => SearchProfile(),
+ kProfile_screen: (context) => ProfileScreen(),
+ kChat_screen: (context) => ChatScreen(),
+ },
+ );
+ }
+}
diff --git a/lib/model/account.dart b/lib/model/account.dart
new file mode 100644
index 0000000..0528dcc
--- /dev/null
+++ b/lib/model/account.dart
@@ -0,0 +1,9 @@
+class Account {
+ String email;
+ String password;
+ String username;
+ int age;
+ String gender;
+ String urlProfilePicture;
+ Account({this.email, this.password, this.age, this.gender, this.username});
+}
diff --git a/lib/model/message.dart b/lib/model/message.dart
new file mode 100644
index 0000000..e7c88ee
--- /dev/null
+++ b/lib/model/message.dart
@@ -0,0 +1,22 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
+
+class Message {
+ String sender;
+ String reciver;
+ String message;
+ String filePath;
+ int hour;
+ int minute;
+ String timestamp;
+ String senderUsername;
+ String reciverUsername;
+
+ Message(
+ {this.message,
+ this.reciver,
+ this.sender,
+ this.filePath,
+ this.minute,
+ this.hour,
+ this.timestamp});
+}
diff --git a/lib/provider/account_provider.dart b/lib/provider/account_provider.dart
new file mode 100644
index 0000000..c26ac8d
--- /dev/null
+++ b/lib/provider/account_provider.dart
@@ -0,0 +1,35 @@
+import 'dart:io';
+
+import 'package:flutter/cupertino.dart';
+import 'package:whatsapp/model/account.dart';
+
+class AccountProvider with ChangeNotifier {
+ List accountsList = List();
+ Account searchedProfile = Account();
+ File profilePicture;
+ String profilePic;
+ void switchAccounts(List list, String s) {
+ accountsList.clear();
+ if (s != "") {
+ for (int i = 0; i < list.length; i++) {
+ if (list[i].username.contains(s)) {
+ print(list[i].username);
+ accountsList.add(list[i]);
+ }
+ }
+ notifyListeners();
+ } else {
+ notifyListeners();
+ }
+ }
+
+ void setSearchedProfile(Account account) {
+ searchedProfile = account;
+ notifyListeners();
+ }
+
+ void changeProfile(String url) {
+ profilePic = url;
+ notifyListeners();
+ }
+}
diff --git a/lib/provider/chat_provider.dart b/lib/provider/chat_provider.dart
new file mode 100644
index 0000000..ef068ac
--- /dev/null
+++ b/lib/provider/chat_provider.dart
@@ -0,0 +1,38 @@
+import 'package:flutter/cupertino.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/screens/chat_screen.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class ChatProvider with ChangeNotifier {
+ FirebaseFun firebaseFun = FirebaseFun();
+ List listOfMessages = List();
+ final GlobalKey listKey = GlobalKey();
+ int id;
+
+ void setId(int id) {
+ this.id = id;
+ notifyListeners();
+ }
+
+ // Future getMessages(String senderEmail, String reciverEmail) async {
+ // listOfMessages.clear();
+ // listOfMessages
+ // .addAll(await firebaseFun.getAllMessages(senderEmail, reciverEmail));
+
+ // notifyListeners();
+ // }
+
+ void enableBottomChat() {
+ ChatScreen.controller.animateTo(
+ ChatScreen.controller.position.maxScrollExtent,
+ duration: Duration(milliseconds: 100),
+ curve: Curves.easeOut);
+ }
+
+ void sendMessage(Message message) {
+ listOfMessages.add(message);
+ listKey.currentState.insertItem(listOfMessages.length - 1);
+
+ notifyListeners();
+ }
+}
diff --git a/lib/provider/home_provider.dart b/lib/provider/home_provider.dart
new file mode 100644
index 0000000..dd4b000
--- /dev/null
+++ b/lib/provider/home_provider.dart
@@ -0,0 +1,54 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class HomeProvider with ChangeNotifier {
+ List list = List();
+ List profilePictures = List();
+ FirebaseFun firebaseFun = FirebaseFun();
+ // FirebaseFirestore database = FirebaseFirestore.instance;
+
+ void setHomeChatMessage(List list) {
+ this.list = list;
+ notifyListeners();
+ }
+
+ void setProfilePictures(List profilePictures) {
+ this.profilePictures = profilePictures;
+ notifyListeners();
+ }
+
+ Future getMessages(
+ String currentUserEmail, BuildContext context) async {
+ list.clear();
+ profilePictures.clear();
+ list = await firebaseFun.getHomeChats(currentUserEmail);
+
+ //print('hegzyyyyy ${listOfMessage[0].message}');
+ list.sort((a, b) => a.timestamp.compareTo(b.timestamp));
+ for (int i = 0; i < list.length; i++) {
+ if (currentUserEmail == list[i].sender) {
+ Account account = await firebaseFun.getOneAccount(list[i].reciver);
+ String url = await firebaseFun.downloadProfilePicture(account.username);
+ list[i].reciverUsername = account.username;
+ //if (url == null) url = 'x';
+
+ print('this is ${account.username} and his photo is $url');
+ profilePictures.add(url);
+ } else {
+ Account account = await firebaseFun.getOneAccount(list[i].sender);
+ String url = await firebaseFun.downloadProfilePicture(account.username);
+ list[i].senderUsername = account.username;
+ print(
+ 'this is ${account.username} and his photo is $url and the sender is ${list[i].sender}');
+ // if (url == null) url = 'x';
+ profilePictures.add(url);
+ }
+ }
+ //print(list[0].message);
+ print('wowwwwwwwww!!!!!!');
+ notifyListeners();
+ }
+}
diff --git a/lib/provider/setting_provider.dart b/lib/provider/setting_provider.dart
new file mode 100644
index 0000000..569e837
--- /dev/null
+++ b/lib/provider/setting_provider.dart
@@ -0,0 +1,38 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+
+import '../constants.dart';
+
+class SettingProvider with ChangeNotifier {
+ String selectedGender = 'Male';
+ bool swithProgress = false;
+ ThemeData themeData = ThemeData.light().copyWith(
+ appBarTheme: AppBarTheme(
+ color: Color(kMainColorApp),
+ ));
+
+ void changeSwitch(bool b) {
+ swithProgress = b;
+ notifyListeners();
+ }
+
+ void changeTheme(int themeNum) {
+ if (themeNum == 0)
+ themeData = ThemeData.dark().copyWith(
+ appBarTheme: AppBarTheme(
+ color: Color(kMainColorApp),
+ ));
+ else {
+ themeData = ThemeData.light().copyWith(
+ appBarTheme: AppBarTheme(
+ color: Color(kMainColorApp),
+ ));
+ }
+ notifyListeners();
+ }
+
+ void getGender(String selectedValue) {
+ selectedGender = selectedValue;
+ notifyListeners();
+ }
+}
diff --git a/lib/screens/chat_screen.dart b/lib/screens/chat_screen.dart
new file mode 100644
index 0000000..70a5897
--- /dev/null
+++ b/lib/screens/chat_screen.dart
@@ -0,0 +1,293 @@
+import 'dart:async';
+import 'dart:io';
+
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:firebase_auth/firebase_auth.dart';
+import 'package:flutter/gestures.dart';
+import 'package:flutter/material.dart';
+import 'package:image_picker/image_picker.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/components/animation_widget.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/provider/chat_provider.dart';
+import 'package:whatsapp/provider/home_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class ChatScreen extends StatelessWidget {
+ final FirebaseAuth mAuth = FirebaseAuth.instance;
+ final _picker = ImagePicker();
+ final TextEditingController myController = TextEditingController();
+ static final ScrollController controller = new ScrollController();
+
+ @override
+ Widget build(BuildContext context) {
+ final Account friendProfile = ModalRoute.of(context).settings.arguments;
+ //int chatID;
+ final FirebaseFun firebaseFun = FirebaseFun();
+ //int myIndex;
+ String message;
+ //StreamBuilder(builder: null,)
+ Timer(
+ Duration(milliseconds: 100),
+ () => controller.jumpTo(controller.position.maxScrollExtent),
+ );
+
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(friendProfile.username),
+ leading: GestureDetector(
+ onTap: () async {
+ Navigator.pop(context);
+ await Provider.of(context, listen: false)
+ .getMessages(mAuth.currentUser.email, context);
+ },
+ child: Row(
+ children: [
+ Icon(
+ Icons.arrow_back,
+ size: 15.0,
+ ),
+ CircleAvatar(
+ backgroundImage: friendProfile.urlProfilePicture != 'xx'
+ ? NetworkImage(friendProfile.urlProfilePicture)
+ : AssetImage('images/chat_icon.png'),
+ ),
+ ],
+ ),
+ ),
+ ),
+ body: Container(
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage("images/chat_background2.jpg"),
+ fit: BoxFit.cover,
+ ),
+ ),
+ child: SafeArea(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Expanded(
+ child: StreamBuilder(
+ stream: firebaseFun
+ .getStream(Provider.of(context).id),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return Center(
+ child: CircularProgressIndicator(
+ backgroundColor: Colors.lightBlueAccent,
+ ),
+ );
+ }
+
+ Provider.of(context, listen: false)
+ .listOfMessages
+ .clear();
+ List allMessages =
+ firebaseFun.getMessageSnapShot(snapshot.data.docs);
+
+ return AnimatedList(
+ controller: controller,
+ key: Provider.of(context).listKey,
+ initialItemCount: allMessages.length,
+ itemBuilder: (context, index, animation) {
+ return MyAwesomeAnimation(
+ animation: animation,
+ myWidget: getMessageWidget(
+ allMessages[index], index, context),
+ );
+ },
+ shrinkWrap: true,
+ );
+ }),
+ ),
+ Container(
+ decoration: BoxDecoration(
+ border: Border(
+ top: BorderSide(color: Colors.lightBlueAccent, width: 0.0),
+ ),
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Expanded(
+ child: TextField(
+ controller: myController,
+ style: TextStyle(color: Colors.black),
+ onChanged: (value) {
+ //Do something with the user input.
+ message = value;
+ },
+ decoration: InputDecoration(
+ suffixIcon: InkWell(
+ child: Icon(
+ Icons.camera_alt,
+ color: Colors.grey,
+ ),
+ onTap: () async {
+ PickedFile image = await _picker.getImage(
+ source: ImageSource.gallery);
+ File file = File(image.path);
+
+ Message currentMessage = Message(
+ message: null,
+ reciver: friendProfile.email,
+ sender: mAuth.currentUser.email,
+ filePath:
+ await firebaseFun.uploadChatRoomImage(
+ FirebaseFun.id, file));
+ await firebaseFun.sendMessage(
+ currentMessage, FirebaseFun.id);
+ Provider.of(context, listen: false)
+ .sendMessage(currentMessage);
+ controller.animateTo(
+ controller.position.maxScrollExtent,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeOut);
+ },
+ ),
+ filled: true,
+ fillColor: Colors.white,
+ contentPadding: EdgeInsets.symmetric(
+ vertical: 10.0, horizontal: 20.0),
+ hintText: 'Type your message here...',
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ borderSide: BorderSide.none),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ borderSide: BorderSide.none),
+ disabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ borderSide: BorderSide.none),
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(left: 15.0, right: 15.0),
+ child: GestureDetector(
+ onTap: () async {
+ Message currentMessage = Message(
+ message: message,
+ reciver: friendProfile.email,
+ sender: mAuth.currentUser.email,
+ hour: Timestamp.now().toDate().hour,
+ minute: Timestamp.now().toDate().minute);
+ print(friendProfile.email);
+ print(mAuth.currentUser.email);
+ Provider.of(context, listen: false)
+ .sendMessage(currentMessage);
+
+ myController.clear();
+ await firebaseFun.sendMessage(
+ currentMessage, FirebaseFun.id);
+ controller.animateTo(
+ controller.position.maxScrollExtent,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeOut);
+ },
+ child: Icon(
+ Icons.send,
+ color: Colors.blue[400],
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ Padding getMessageWidget(myMessage, index, context) {
+ // List list = List();
+ Message message = myMessage;
+ Padding padding;
+
+ if (message.message == null) {
+ //File file = File(message.filePath);
+ padding = Padding(
+ padding: const EdgeInsets.all(5.0),
+ child: Container(
+ padding: EdgeInsets.only(left: 14, right: 14, top: 10, bottom: 10),
+ child: Align(
+ alignment: message.sender == mAuth.currentUser.email
+ ? Alignment.topRight
+ : Alignment.topLeft,
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 5.0, vertical: 5.0),
+ decoration: BoxDecoration(
+ borderRadius: message.sender == mAuth.currentUser.email
+ ? BorderRadius.only(
+ bottomLeft: Radius.circular(20.0),
+ topLeft: Radius.circular(20.0),
+ topRight: Radius.circular(20.0),
+ )
+ : BorderRadius.only(
+ bottomRight: Radius.circular(20.0),
+ topLeft: Radius.circular(20.0),
+ topRight: Radius.circular(20.0),
+ ),
+ color: message.sender == mAuth.currentUser.email
+ ? Colors.green[200]
+ : Colors.white),
+ child: Image.network(
+ message.filePath,
+ height: 250,
+ ),
+ ),
+ ),
+ ),
+ );
+ } else {
+ // DateTime current = Timestamp.now().toDate();
+ padding = Padding(
+ padding: const EdgeInsets.all(5.0),
+ child: Container(
+ padding: EdgeInsets.only(left: 14, right: 14, top: 10, bottom: 10),
+ child: Align(
+ alignment: message.sender == mAuth.currentUser.email
+ ? Alignment.topRight
+ : Alignment.topLeft,
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
+ child: Text(
+ '${message.message} ${message.hour}:${message.minute}',
+ style: TextStyle(fontSize: 14, fontFamily: 'Maven_Pro'),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: message.sender == mAuth.currentUser.email
+ ? BorderRadius.only(
+ bottomLeft: Radius.circular(20.0),
+ topLeft: Radius.circular(20.0),
+ topRight: Radius.circular(20.0),
+ )
+ : BorderRadius.only(
+ bottomRight: Radius.circular(20.0),
+ topLeft: Radius.circular(20.0),
+ topRight: Radius.circular(20.0),
+ ),
+ color: message.sender == mAuth.currentUser.email
+ ? Colors.green[200]
+ : Colors.white),
+ ),
+ ),
+ ),
+ );
+ }
+
+ //Provider.of(context, listen: false).enableBottomChat();
+
+ // list.add(padding);
+ //controller.jumpTo(controller.position.maxScrollExtent);
+ return padding;
+
+ // return list;
+ }
+}
diff --git a/lib/screens/home.dart b/lib/screens/home.dart
new file mode 100644
index 0000000..e9d0feb
--- /dev/null
+++ b/lib/screens/home.dart
@@ -0,0 +1,109 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/components/home_message_chat.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/provider/home_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class HomeScreen extends StatelessWidget {
+ final FirebaseFun firebaseFun = FirebaseFun();
+ final List homeMessages = List();
+
+ @override
+ Widget build(BuildContext context) {
+ final Account currentProfile = ModalRoute.of(context).settings.arguments;
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(
+ 'Chat App',
+ style: TextStyle(fontFamily: 'Maven_Pro'),
+ ),
+ actions: [
+ IconButton(
+ icon: Icon(Icons.search),
+ onPressed: () {
+ Navigator.pushNamed(context, kSearch_screen);
+ })
+ ],
+ ),
+ drawer: Drawer(
+ child: ListView(
+ children: [
+ DrawerHeader(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(bottom: 15.0),
+ child: CircleAvatar(
+ backgroundImage: currentProfile.urlProfilePicture != 'xx'
+ ? NetworkImage(currentProfile.urlProfilePicture)
+ : AssetImage('images/chat_icon.png'),
+ radius: 30,
+ ),
+ ),
+ Text(
+ '${currentProfile.username}',
+ style: TextStyle(
+ fontSize: 20.0,
+ fontFamily: 'Maven_Pro',
+ color: Colors.white),
+ ),
+ Text(
+ '${currentProfile.email}',
+ style: TextStyle(
+ fontSize: 12.0,
+ fontFamily: 'Maven_Pro',
+ color: Colors.white),
+ ),
+ ],
+ ),
+ decoration: BoxDecoration(
+ color: Color(kMainColorApp),
+ ),
+ ),
+ ListTile(
+ title: Text('Profile'),
+ onTap: () {
+ // Update the state of the app
+ // ...
+ // Then close the drawer
+ Navigator.pushNamed(context, kProfile_screen,
+ arguments: currentProfile);
+ },
+ leading: Icon(Icons.person),
+ ),
+ ListTile(
+ title: Text('Sign Out'),
+ onTap: () async {
+ // Update the state of the app
+ // ...
+ // Then close the drawer
+ await firebaseFun.signoutAccount();
+ Navigator.popUntil(context, ModalRoute.withName(kLogin_screen));
+ },
+ leading: Icon(Icons.exit_to_app),
+ ),
+ ],
+ ),
+ ),
+ body: ListView.builder(
+ itemCount: Provider.of(context).list.length,
+ itemBuilder: (context, index) {
+ return HomeMessageChat(
+ currentUserEmail: currentProfile.email,
+ index: index,
+ listOfMessage:
+ Provider.of(context, listen: true).list,
+ profilePhotos: Provider.of(context, listen: true)
+ .profilePictures,
+ );
+ },
+ ),
+ );
+ }
+
+ Future getChatsHome(String email) async {}
+}
diff --git a/lib/screens/login.dart b/lib/screens/login.dart
new file mode 100644
index 0000000..a09474a
--- /dev/null
+++ b/lib/screens/login.dart
@@ -0,0 +1,164 @@
+import 'package:flutter/material.dart';
+import 'package:modal_progress_hud/modal_progress_hud.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/provider/home_provider.dart';
+import 'package:whatsapp/provider/setting_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class LoginScreen extends StatefulWidget {
+ @override
+ _LoginScreenState createState() => _LoginScreenState();
+}
+
+class _LoginScreenState extends State {
+ String email;
+ String password;
+ FirebaseFun firebaseFun = FirebaseFun();
+ List listOfMessage;
+ List profilePhotos = List();
+
+ @override
+ void initState() {
+ // TODO: implement initState
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ModalProgressHUD(
+ inAsyncCall: Provider.of(context).swithProgress,
+ child: Scaffold(
+ backgroundColor: Colors.white,
+ body: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Flexible(
+ child: Hero(
+ tag: 'logo',
+ child: Container(
+ height: 150.0,
+ child: Image(
+ image: AssetImage('images/chat_icon.png'),
+ ),
+ ),
+ ),
+ ),
+ SizedBox(
+ height: 45.0,
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.symmetric(vertical: 5.0, horizontal: 25.0),
+ child: TextField(
+ style: TextStyle(color: Colors.black),
+ textAlign: TextAlign.center,
+ keyboardType: TextInputType.emailAddress,
+ decoration: kTextFieldEmail,
+ onChanged: (value) {
+ email = value;
+ },
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 20.0, horizontal: 25.0),
+ child: TextField(
+ obscureText: true,
+ style: TextStyle(color: Colors.black),
+ textAlign: TextAlign.center,
+ keyboardType: TextInputType.emailAddress,
+ decoration: kTextFieldPassword,
+ onChanged: (value) {
+ password = value;
+ },
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 20.0, horizontal: 25.0),
+ child: Material(
+ elevation: 5.0,
+ color: Color(kMainColorApp),
+ borderRadius: BorderRadius.circular(30),
+ child: MaterialButton(
+ onPressed: () async {
+ Provider.of(context, listen: false)
+ .changeSwitch(true);
+ Account acc = await firebaseFun.loginAccount(
+ context, email, password);
+
+ if (acc.email != null) {
+ await Provider.of(context, listen: false)
+ .getMessages(acc.email, context);
+ print('hello');
+ acc.urlProfilePicture = await firebaseFun
+ .downloadProfilePicture(acc.username);
+
+ Provider.of(context, listen: false)
+ .changeSwitch(false);
+ Navigator.pushNamed(context, kHome_screen,
+ arguments: acc);
+ }
+ Provider.of(context, listen: false)
+ .changeSwitch(false);
+ },
+ child: Text(
+ 'Login',
+ style: TextStyle(color: Colors.white),
+ ),
+ ),
+ ),
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 25.0, right: 25.0, top: 20.0),
+ child: Text(
+ 'Forget your password?',
+ style: TextStyle(
+ fontSize: 14,
+ color: Colors.black,
+ fontFamily: 'Maven_Pro',
+ fontWeight: FontWeight.w400),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 10.0, horizontal: 25.0),
+ child: Row(
+ children: [
+ Text(
+ 'Don\'t have an account?',
+ style: TextStyle(
+ fontSize: 14,
+ color: Colors.black,
+ fontFamily: 'Maven_Pro',
+ fontWeight: FontWeight.w400),
+ ),
+ SizedBox(
+ width: 5.0,
+ ),
+ GestureDetector(
+ onTap: () {
+ Navigator.pushNamed(context, kRegister_screen);
+ },
+ child: Text(
+ 'Sign Up',
+ style: TextStyle(
+ color: Colors.blue[300],
+ fontSize: 14.0,
+ fontFamily: 'Maven_Pro',
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ]),
+ ),
+ );
+ }
+}
diff --git a/lib/screens/profile.dart b/lib/screens/profile.dart
new file mode 100644
index 0000000..471b814
--- /dev/null
+++ b/lib/screens/profile.dart
@@ -0,0 +1,211 @@
+import 'dart:io';
+
+import 'package:flutter/material.dart';
+import 'package:image_picker/image_picker.dart';
+import 'package:modal_progress_hud/modal_progress_hud.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/provider/account_provider.dart';
+import 'package:whatsapp/provider/setting_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+import '../constants.dart';
+
+class ProfileScreen extends StatefulWidget {
+ @override
+ _ProfileState createState() => _ProfileState();
+}
+
+class _ProfileState extends State {
+ final _picker = ImagePicker();
+ File file;
+ FirebaseFun firebaseFun = FirebaseFun();
+ final userNameController = TextEditingController();
+ final emailController = TextEditingController();
+ final ageController = TextEditingController();
+ final genderController = TextEditingController();
+ @override
+ Widget build(BuildContext context) {
+ final Account currentProfile = ModalRoute.of(context).settings.arguments;
+ print(currentProfile.email);
+ userNameController.text = currentProfile.username;
+ emailController.text = currentProfile.email;
+ ageController.text = currentProfile.age.toString();
+ genderController.text = currentProfile.gender;
+
+ return ModalProgressHUD(
+ inAsyncCall: Provider.of(context).swithProgress,
+ child: Scaffold(
+ appBar: AppBar(
+ title: Text(
+ 'Profile',
+ style: TextStyle(fontFamily: 'Maven_Pro'),
+ ),
+ centerTitle: true,
+ leading: IconButton(
+ icon: Icon(Icons.close),
+ onPressed: () {
+ Navigator.pop(context);
+ }),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.check,
+ ),
+ onPressed: () async {
+ Provider.of(context, listen: false)
+ .changeSwitch(true);
+ await firebaseFun.editAccount(currentProfile);
+ Provider.of(context, listen: false)
+ .changeSwitch(false);
+
+ //TODO:save data;
+ })
+ ],
+ ),
+ body: SingleChildScrollView(
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(top: 5.0),
+ child: CircleAvatar(
+ backgroundImage: currentProfile.urlProfilePicture == null
+ ? AssetImage('images/chat_icon.png')
+ : NetworkImage(
+ currentProfile.urlProfilePicture,
+ ),
+ radius: 75.0,
+ ),
+ ),
+ FlatButton(
+ onPressed: () async {
+ //TODO: add picture from device
+ Provider.of(context, listen: false)
+ .changeSwitch(true);
+ PickedFile image =
+ await _picker.getImage(source: ImageSource.gallery);
+ file = File(image.path);
+ await firebaseFun.uploadProfilePicture(
+ currentProfile.username, file);
+ // setState(() {
+ // currentProfile.urlProfilePicture = file.path;
+ // });
+ currentProfile.urlProfilePicture = await firebaseFun
+ .downloadProfilePicture(currentProfile.username);
+ Provider.of(context, listen: false)
+ .changeSwitch(true);
+ setState(() {});
+ },
+ child: Text(
+ 'Change Profile Photo',
+ style: TextStyle(
+ color: Color(kMainColorApp),
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 15.0, vertical: 20.0),
+ child: TextField(
+ onChanged: (value) {
+ currentProfile.username = value;
+ },
+ controller: userNameController,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ color: Color(kMainColorApp),
+ ),
+ decoration: InputDecoration(
+ hintText: 'username',
+ hintStyle: TextStyle(fontFamily: 'Maven_Pro'),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 15.0, vertical: 20.0),
+ child: TextField(
+ onChanged: (value) {
+ currentProfile.email = value;
+ },
+ enabled: false,
+ controller: emailController,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w200,
+ color: Colors.black,
+ ),
+ decoration: InputDecoration(
+ hintText: 'email',
+ hintStyle: TextStyle(fontFamily: 'Maven_Pro'),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ disabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 15.0, vertical: 20.0),
+ child: TextField(
+ onChanged: (value) {
+ currentProfile.gender = value;
+ },
+ controller: genderController,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ color: Color(kMainColorApp),
+ ),
+ decoration: InputDecoration(
+ hintText: 'gender',
+ hintStyle: TextStyle(fontFamily: 'Maven_Pro'),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 15.0, vertical: 20.0),
+ child: TextField(
+ onChanged: (value) {
+ currentProfile.age = int.parse(value);
+ },
+ keyboardType: TextInputType.number,
+ controller: ageController,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ color: Color(kMainColorApp),
+ ),
+ decoration: InputDecoration(
+ hintText: 'age',
+ hintStyle: TextStyle(fontFamily: 'Maven_Pro'),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/screens/register.dart b/lib/screens/register.dart
new file mode 100644
index 0000000..9452486
--- /dev/null
+++ b/lib/screens/register.dart
@@ -0,0 +1,177 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/provider/setting_provider.dart';
+import 'package:modal_progress_hud/modal_progress_hud.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class RegisterScreen extends StatelessWidget {
+ final List genderList = ['Male', 'Female'];
+ final int group = 1;
+ final Account newAccount = Account();
+ final FirebaseFun firebaseFun = new FirebaseFun();
+ @override
+ Widget build(BuildContext context) {
+ newAccount.gender = 'Male';
+ return ModalProgressHUD(
+ inAsyncCall: Provider.of(context).swithProgress,
+ child: Scaffold(
+ appBar: AppBar(
+ title: Text('Chat App'),
+ ),
+ backgroundColor: Colors.white,
+ body: SingleChildScrollView(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Flexible(
+ child: Hero(
+ tag: 'logo',
+ child: Container(
+ height: 100.0,
+ child: Image(
+ image: AssetImage('images/chat_icon.png'),
+ ),
+ ),
+ ),
+ ),
+ Expanded(
+ child: SizedBox(
+ width: 80,
+ ),
+ ),
+ Text(
+ 'Sign Up',
+ style: TextStyle(
+ color: Color(kMainColorApp),
+ fontFamily: 'Maven_Pro',
+ fontSize: 30.0,
+ fontWeight: FontWeight.bold),
+ )
+ ],
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25.0),
+ child: TextField(
+ textAlign: TextAlign.center,
+ onChanged: (value) {
+ newAccount.username = value;
+ },
+ decoration: kTextFieldUsername,
+ style: TextStyle(color: Colors.black),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25.0),
+ child: TextField(
+ textAlign: TextAlign.center,
+ onChanged: (value) {
+ newAccount.email = value;
+ },
+ decoration: kTextFieldEmail,
+ style: TextStyle(color: Colors.black),
+ keyboardType: TextInputType.emailAddress,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25.0),
+ child: TextField(
+ textAlign: TextAlign.center,
+ onChanged: (value) {
+ newAccount.password = value;
+ },
+ decoration: kTextFieldPassword,
+ style: TextStyle(color: Colors.black),
+ obscureText: true,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25.0),
+ child: TextField(
+ textAlign: TextAlign.center,
+ onChanged: (value) {
+ newAccount.age = int.parse(value);
+ },
+ decoration: kTextFieldAge,
+ style: TextStyle(color: Colors.black),
+ keyboardType: TextInputType.number,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25),
+ child: Container(
+ padding: EdgeInsets.only(
+ left: 20.0,
+ right: 20.0,
+ ),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.grey,
+ width: 1,
+ ),
+ borderRadius: BorderRadius.circular(15),
+ ),
+ child: DropdownButton(
+ isExpanded: true,
+ iconEnabledColor: Color(kMainColorApp),
+ elevation: 5,
+ icon: Icon(Icons.arrow_drop_down),
+ iconSize: 36,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ color: Colors.black,
+ ),
+ dropdownColor: Color(kMainColorApp),
+ value: Provider.of(context, listen: true)
+ .selectedGender,
+ items: genderList.map((e) {
+ return DropdownMenuItem(
+ child: Text(e), value: e);
+ }).toList(),
+ onChanged: (value) {
+ newAccount.gender = value;
+ Provider.of(context, listen: false)
+ .getGender(value);
+ },
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ vertical: 15.0, horizontal: 25.0),
+ child: Material(
+ elevation: 5.0,
+ color: Color(kMainColorApp),
+ borderRadius: BorderRadius.circular(30),
+ child: MaterialButton(
+ onPressed: () async {
+ Provider.of(context, listen: false)
+ .changeSwitch(true);
+ await firebaseFun.registerAccount(context, newAccount);
+ Provider.of(context, listen: false)
+ .changeSwitch(false);
+ },
+ child: Text(
+ 'Register',
+ style: TextStyle(color: Colors.white),
+ ),
+ ),
+ ),
+ ),
+ ]),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/screens/search_profile.dart b/lib/screens/search_profile.dart
new file mode 100644
index 0000000..706572e
--- /dev/null
+++ b/lib/screens/search_profile.dart
@@ -0,0 +1,120 @@
+import 'dart:convert';
+
+import 'package:firebase_auth/firebase_auth.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/model/message.dart';
+import 'package:whatsapp/provider/chat_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class SearchProfile extends StatelessWidget {
+ FirebaseAuth mAuth = FirebaseAuth.instance;
+ FirebaseFun firebaseFun = FirebaseFun();
+ @override
+ Widget build(BuildContext context) {
+ final Account friendProfile = ModalRoute.of(context).settings.arguments;
+ print(friendProfile.email);
+
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(
+ 'Profile',
+ style: TextStyle(fontFamily: 'Maven_Pro'),
+ ),
+ centerTitle: true,
+ ),
+ body: SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
+ GestureDetector(
+ onTap: () {
+ //Upload photo
+ },
+ child: CircleAvatar(
+ backgroundImage: friendProfile.urlProfilePicture != 'xx'
+ ? NetworkImage(
+ friendProfile.urlProfilePicture,
+ )
+ : AssetImage('images/chat_icon.png'),
+ radius: 75.0,
+ ),
+ ),
+ SizedBox(
+ width: 30.0,
+ ),
+ Expanded(
+ child: Text(
+ friendProfile.username,
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 30.0,
+ fontWeight: FontWeight.w600,
+ color: Color(kMainColorApp)),
+ ),
+ ),
+ IconButton(
+ icon: Icon(Icons.message),
+ onPressed: () async {
+ Provider.of(context, listen: false).setId(
+ await firebaseFun.getChatID(
+ mAuth.currentUser.email, friendProfile.email));
+
+ Navigator.pushNamed(context, kChat_screen,
+ arguments: friendProfile);
+ })
+ ]),
+ SizedBox(
+ child: Divider(
+ thickness: 3.0,
+ color: Colors.grey[350],
+ ),
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0),
+ child: Text(
+ 'Email: ${friendProfile.email}',
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ fontStyle: FontStyle.italic,
+ color: Color(kMainColorApp)),
+ ),
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0),
+ child: Text(
+ 'Age: ${friendProfile.age}',
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ fontStyle: FontStyle.italic,
+ color: Color(kMainColorApp)),
+ ),
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0),
+ child: Text(
+ 'Gender: ${friendProfile.gender}',
+ style: TextStyle(
+ fontFamily: 'Maven_Pro',
+ fontSize: 20.0,
+ fontWeight: FontWeight.w600,
+ fontStyle: FontStyle.italic,
+ color: Color(kMainColorApp)),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/screens/search_screen.dart b/lib/screens/search_screen.dart
new file mode 100644
index 0000000..60cd6c2
--- /dev/null
+++ b/lib/screens/search_screen.dart
@@ -0,0 +1,117 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:whatsapp/components/person_search.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:whatsapp/provider/account_provider.dart';
+import 'package:whatsapp/services/firebase.dart';
+
+class SearchScreen extends StatefulWidget {
+ @override
+ _SearchScreenState createState() => _SearchScreenState();
+}
+
+class _SearchScreenState extends State {
+ final FirebaseFun firebaseFun = FirebaseFun();
+ List accountsList = List();
+ @override
+ void initState() {
+ // TODO: implement initState
+ super.initState();
+ retriveAccounts();
+ }
+
+ void retriveAccounts() async {
+ accountsList = await firebaseFun.getAccounts();
+ print('hello');
+ }
+
+ // List accountsWidget(List accountsList) {
+ // List finalWidgets = List();
+ // for (int i = 0; i < accountsList.length; i++) {
+ // Container container = Container(
+ // padding: EdgeInsets.symmetric(horizontal: 10.0),
+ // margin: EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
+ // decoration: BoxDecoration(
+ // borderRadius: BorderRadius.circular(30.0), color: Colors.grey[350]),
+ // child: Row(
+ // children: [
+ // Image.asset(
+ // 'images/chat_icon.png',
+ // height: 75.0,
+ // ),
+ // SizedBox(
+ // width: 20.0,
+ // ),
+ // Expanded(
+ // child: Text(
+ // accountsList[i].username,
+ // style: TextStyle(
+ // fontFamily: 'Maven_Pro',
+ // fontSize: 20.0,
+ // fontWeight: FontWeight.bold),
+ // ),
+ // ),
+ // ],
+ // ),
+ // );
+
+ // finalWidgets.add(container);
+ // }
+ // return finalWidgets;
+ // }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ leading: Image.asset(
+ 'images/chat_icon.png',
+ ),
+ title: Text(
+ 'ChatApp',
+ style: TextStyle(fontFamily: 'Maven_Pro'),
+ ),
+ centerTitle: true,
+ ),
+ body: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.all(15.0),
+ child: TextField(
+ onChanged: (value) {
+ Provider.of(context, listen: false)
+ .switchAccounts(accountsList, value);
+ },
+ style: TextStyle(fontFamily: 'Maven_Pro'),
+ decoration: InputDecoration(
+ hintText: 'Search for people',
+ hintStyle: TextStyle(fontFamily: 'Maven_Pro'),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ ),
+ ),
+ ),
+ Expanded(
+ child: ListView.builder(
+ // children: accountsWidget(
+ // Provider.of(context).accountsList),
+
+ itemCount:
+ Provider.of(context).accountsList.length,
+ itemBuilder: (context, index) {
+ return PersonSearch(
+ accountsList:
+ Provider.of(context).accountsList,
+ index: index,
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/services/firebase.dart b/lib/services/firebase.dart
new file mode 100644
index 0000000..bf369fc
--- /dev/null
+++ b/lib/services/firebase.dart
@@ -0,0 +1,395 @@
+import 'dart:io';
+
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:firebase_auth/firebase_auth.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:rflutter_alert/rflutter_alert.dart';
+import 'package:whatsapp/constants.dart';
+import 'package:whatsapp/model/account.dart';
+import 'package:firebase_storage/firebase_storage.dart';
+import 'package:whatsapp/model/message.dart';
+
+class FirebaseFun {
+ FirebaseAuth mAuth = FirebaseAuth.instance;
+ FirebaseFirestore database = FirebaseFirestore.instance;
+ static int id;
+
+ Future signoutAccount() async {
+ await mAuth.signOut();
+ }
+
+ Future registerAccount(BuildContext context, Account newAccount) async {
+ try {
+ UserCredential user = await mAuth.createUserWithEmailAndPassword(
+ email: newAccount.email, password: newAccount.password);
+
+ if (user != null) {
+ Map map = {
+ "username": newAccount.username,
+ "email": newAccount.email,
+ "password": newAccount.password,
+ "age": newAccount.age,
+ "gender": newAccount.gender
+ };
+ await database.collection('users').doc(newAccount.email).set(map);
+ Navigator.pushReplacementNamed(context, kLogin_screen);
+ }
+ } catch (e) {
+ Alert(
+ context: context,
+ title: "ERROR",
+ desc: "Your Information Not correct")
+ .show();
+ }
+ }
+
+ Future loginAccount(
+ BuildContext context, String email, String password) async {
+ Account loginAccount = Account();
+ try {
+ await mAuth.signInWithEmailAndPassword(email: email, password: password);
+ DocumentSnapshot documentSnapshot =
+ await database.collection('users').doc(email).get();
+ loginAccount.username = documentSnapshot.get('username');
+ loginAccount.password = documentSnapshot.get('password');
+ loginAccount.age = documentSnapshot.get('age');
+ loginAccount.gender = documentSnapshot.get('gender');
+ loginAccount.email = documentSnapshot.get('email');
+ } catch (e) {
+ Alert(
+ context: context,
+ title: "ERROR",
+ desc: "Your Username/Password Incorrect,Please Try Again")
+ .show();
+ }
+ return loginAccount;
+ }
+
+ Future> getAccounts() async {
+ List allAccounts = List();
+ QuerySnapshot querySnapshot = await database.collection('users').get();
+ for (QueryDocumentSnapshot documentSnapshot in querySnapshot.docs) {
+ final Map map = documentSnapshot.data();
+ final Account account = Account();
+ print(map['email']);
+ account.age = map['age'];
+ account.email = map['email'];
+ account.gender = map['gender'];
+ account.username = map['username'];
+ account.password = map['password'];
+ try {
+ account.urlProfilePicture =
+ await downloadProfilePicture(account.username);
+ } catch (e) {
+ print('he dont have');
+ }
+ allAccounts.add(account);
+ }
+
+ return allAccounts;
+ }
+
+ Future uploadProfilePicture(String username, File file) async {
+ Reference ref = FirebaseStorage.instance.ref().child('$username.jpg');
+
+ UploadTask task = ref.putFile(file);
+ }
+
+ Future uploadChatRoomImage(int chatID, File file) async {
+ String imageTimestamp = DateTime.now().microsecondsSinceEpoch.toString();
+ String filePath = 'chatrooms/$chatID/$imageTimestamp';
+ Reference ref = FirebaseStorage.instance.ref().child(filePath);
+ await ref.putFile(file);
+ String s = await ref.getDownloadURL();
+ print('medaaa $s');
+ return s;
+ }
+
+ Future downloadProfilePicture(String username) async {
+ String url;
+ try {
+ Reference ref = FirebaseStorage.instance.ref().child('$username.jpg');
+ url = await ref.getDownloadURL();
+ } catch (e) {
+ url = 'xx';
+ }
+
+ return url;
+ }
+
+ Future editAccount(Account account) async {
+ Map map = {
+ "email": account.email,
+ "username": account.username,
+ "password": account.password,
+ "gender": account.gender,
+ "age": account.age
+ };
+
+ try {
+ await database.collection('users').doc(account.email).set(map);
+ } catch (e) {
+ print('Error');
+ }
+ }
+
+ Future sendMessage(Message message, int chatID) async {
+ Map map = {
+ "message": message.message,
+ "sender": message.sender,
+ "reciver": message.reciver,
+ "timestamp": Timestamp.now().toString(),
+ "filepath": message.filePath,
+ "hour": message.hour,
+ "minute": message.minute
+ };
+
+ // await database
+ // .collection('chats')
+ // .doc(message.sender)
+ // .collection(message.reciver)
+ // .doc()
+ // .set(map);
+ // await database
+ // .collection('chats')
+ // .doc(message.reciver)
+ // .collection(message.sender)
+ // .doc()
+ // .set(map);
+ Map firstMap = {
+ "first": message.sender,
+ "second": message.reciver
+ };
+ //print('abdooooo${message.filePath}');
+ await database.collection('chats').doc(chatID.toString()).set(firstMap);
+ await database
+ .collection('chats')
+ .doc(chatID.toString())
+ .collection('messages')
+ .doc()
+ .set(map);
+ }
+
+ Future getChatID(String senderEmail, String reciverEmail) async {
+ int id;
+ QuerySnapshot querySnapShot = await database.collection('chats').get();
+ for (QueryDocumentSnapshot queryDocumentSnapshot in querySnapShot.docs) {
+ if (queryDocumentSnapshot.get('first') == senderEmail &&
+ queryDocumentSnapshot.get('second') == reciverEmail) {
+ id = int.parse(queryDocumentSnapshot.id);
+ break;
+ } else if (queryDocumentSnapshot.get('second') == senderEmail &&
+ queryDocumentSnapshot.get('first') == reciverEmail) {
+ id = int.parse(queryDocumentSnapshot.id);
+ break;
+ }
+ }
+ return id;
+ }
+
+ Stream getStream(int chatID) {
+ return database
+ .collection('chats')
+ .doc(chatID.toString())
+ .collection('messages')
+ .orderBy('timestamp')
+ .snapshots();
+ }
+
+ List getMessageSnapShot(messages) {
+ print('xo');
+ List allMessages = List();
+ for (var message in messages) {
+ Message message2 = Message();
+ print('what!!!!!!!!!!!!!!!!!!!!');
+ print(message.get('message'));
+ message2.sender = message.get('sender');
+ message2.reciver = message.get('reciver');
+ message2.message = message.get('message');
+ message2.filePath = message.get('filepath');
+ message2.hour = message.get('hour');
+ message2.minute = message.get('minute');
+ allMessages.add(message2);
+ }
+
+ return allMessages;
+ }
+
+ Future> messageStream(
+ String senderEmail, String reciverEmail) async {
+ bool flag = false;
+ List listofMessages = List();
+ QuerySnapshot querySnapShot = await database.collection('chats').get();
+ for (QueryDocumentSnapshot queryDocumentSnapshot in querySnapShot.docs) {
+ print('${queryDocumentSnapshot.get('first')}this is the first de7k');
+ id = int.parse(queryDocumentSnapshot.id);
+ if (queryDocumentSnapshot.get('first') == senderEmail &&
+ queryDocumentSnapshot.get('second') == reciverEmail) {
+ flag = true;
+ await for (var snapshot in database
+ .collection('chats')
+ .doc(id.toString())
+ .collection('messages')
+ .orderBy('timestamp')
+ .snapshots()) {
+ for (QueryDocumentSnapshot queryDocumentSnapshot2 in snapshot.docs) {
+ Message message = Message();
+ message.sender = queryDocumentSnapshot2.get('sender');
+ message.reciver = queryDocumentSnapshot2.get('reciver');
+ message.message = queryDocumentSnapshot2.get('message');
+ message.filePath = queryDocumentSnapshot2.get('filepath');
+ message.hour = queryDocumentSnapshot2.get('hour');
+ message.minute = queryDocumentSnapshot2.get('minute');
+ listofMessages.add(message);
+ }
+ }
+
+ break;
+ } else if (queryDocumentSnapshot.get('first') == reciverEmail &&
+ queryDocumentSnapshot.get('second') == senderEmail) {
+ flag = true;
+ await for (var snapshot in database
+ .collection('chats')
+ .doc(id.toString())
+ .collection('messages')
+ .orderBy('timestamp')
+ .snapshots()) {
+ for (QueryDocumentSnapshot queryDocumentSnapshot2 in snapshot.docs) {
+ Message message = Message();
+ message.sender = queryDocumentSnapshot2.get('sender');
+ message.reciver = queryDocumentSnapshot2.get('reciver');
+ message.message = queryDocumentSnapshot2.get('message');
+ message.filePath = queryDocumentSnapshot2.get('filepath');
+ message.hour = queryDocumentSnapshot2.get('hour');
+ message.minute = queryDocumentSnapshot2.get('minute');
+ listofMessages.add(message);
+ }
+ }
+ break;
+ }
+ }
+ if (!flag) {
+ DocumentSnapshot documentSnapshot =
+ await database.collection('lastChatID').doc('chat').get();
+ id = documentSnapshot.get('chatID');
+ print('here');
+ print(id);
+ id = id + 1;
+ Map mp = {'chatID': id};
+ await database.collection('lastChatID').doc('chat').set(mp);
+ }
+ return listofMessages;
+ }
+
+ // Future> getAllMessages(
+ // String senderEmail, String reciverEmail) async {
+ // List listofMessages = List();
+
+ // bool flag = false;
+ // QuerySnapshot querySnapShot = await database.collection('chats').get();
+ // print('this is the length ${querySnapShot.docs.length}');
+ // for (QueryDocumentSnapshot queryDocumentSnapshot in querySnapShot.docs) {
+ // print('${queryDocumentSnapshot.get('first')}this is the first de7k');
+ // id = int.parse(queryDocumentSnapshot.id);
+ // if (queryDocumentSnapshot.get('first') == senderEmail &&
+ // queryDocumentSnapshot.get('second') == reciverEmail) {
+ // flag = true;
+ // QuerySnapshot querySnapShot2 = await database
+ // .collection('chats')
+ // .doc(id.toString())
+ // .collection('messages')
+ // .orderBy('timestamp')
+ // .get();
+
+ // for (QueryDocumentSnapshot queryDocumentSnapshot2
+ // in querySnapShot2.docs) {
+ // Message message = Message();
+ // message.sender = queryDocumentSnapshot2.get('sender');
+ // message.reciver = queryDocumentSnapshot2.get('reciver');
+ // message.message = queryDocumentSnapshot2.get('message');
+ // message.filePath = queryDocumentSnapshot2.get('filepath');
+ // message.hour = queryDocumentSnapshot2.get('hour');
+ // message.minute = queryDocumentSnapshot2.get('minute');
+ // listofMessages.add(message);
+ // }
+ // break;
+ // } else if (queryDocumentSnapshot.get('first') == reciverEmail &&
+ // queryDocumentSnapshot.get('second') == senderEmail) {
+ // flag = true;
+ // QuerySnapshot querySnapShot2 = await database
+ // .collection('chats')
+ // .doc(id.toString())
+ // .collection('messages')
+ // .orderBy('timestamp')
+ // .get();
+
+ // for (QueryDocumentSnapshot queryDocumentSnapshot2
+ // in querySnapShot2.docs) {
+ // Message message = Message();
+ // message.sender = queryDocumentSnapshot2.get('sender');
+ // message.reciver = queryDocumentSnapshot2.get('reciver');
+ // message.message = queryDocumentSnapshot2.get('message');
+ // message.filePath = queryDocumentSnapshot2.get('filepath');
+ // message.hour = queryDocumentSnapshot2.get('hour');
+ // message.minute = queryDocumentSnapshot2.get('minute');
+ // listofMessages.add(message);
+ // }
+ // break;
+ // }
+ // }
+ // if (!flag) {
+ // DocumentSnapshot documentSnapshot =
+ // await database.collection('lastChatID').doc('chat').get();
+ // id = documentSnapshot.get('chatID');
+ // print('here');
+ // print(id);
+ // id = id + 1;
+ // Map mp = {'chatID': id};
+ // await database.collection('lastChatID').doc('chat').set(mp);
+ // }
+ // return listofMessages;
+ // }
+
+ Future> getHomeChats(String email) async {
+ List list = List();
+ QuerySnapshot querySnapShot = await database.collection('chats').get();
+ for (QueryDocumentSnapshot queryDocumentSnapshot in querySnapShot.docs) {
+ if (queryDocumentSnapshot.get('first') == email ||
+ queryDocumentSnapshot.get('second') == email) {
+ QuerySnapshot querySnapShot2 = await database
+ .collection('chats')
+ .doc(queryDocumentSnapshot.id)
+ .collection('messages')
+ .orderBy('timestamp', descending: true)
+ .get();
+ Message message = Message();
+
+ print('debughahaha ${querySnapShot2.docs.last.get('message')}');
+ message.sender = querySnapShot2.docs.first.get('sender');
+ message.reciver = querySnapShot2.docs.first.get('reciver');
+ message.message = querySnapShot2.docs.first.get('message');
+ message.filePath = querySnapShot2.docs.first.get('filepath');
+ message.hour = querySnapShot2.docs.first.get('hour');
+ message.minute = querySnapShot2.docs.first.get('minute');
+ message.timestamp = querySnapShot2.docs.first.get('timestamp');
+
+ list.add(message);
+ }
+ }
+ return list;
+ }
+
+ Future getOneAccount(String email) async {
+ DocumentSnapshot documentSnapshot =
+ await database.collection('users').doc(email).get();
+ Account account = Account();
+ print('email is $email');
+ account.username = documentSnapshot.get('username');
+ account.age = documentSnapshot.get('age');
+ account.email = documentSnapshot.get('email');
+ account.password = documentSnapshot.get('password');
+ account.gender = documentSnapshot.get('gender');
+ return account;
+ }
+}
diff --git a/pubspec.lock b/pubspec.lock
new file mode 100644
index 0000000..dba6aa4
--- /dev/null
+++ b/pubspec.lock
@@ -0,0 +1,355 @@
+# Generated by pub
+# See https://dart.dev/tools/pub/glossary#lockfile
+packages:
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.5.0-nullsafety.1"
+ boolean_selector:
+ dependency: transitive
+ description:
+ name: boolean_selector
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0-nullsafety.1"
+ characters:
+ dependency: transitive
+ description:
+ name: characters
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0-nullsafety.3"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0-nullsafety.1"
+ clock:
+ dependency: transitive
+ description:
+ name: clock
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0-nullsafety.1"
+ cloud_firestore:
+ dependency: "direct main"
+ description:
+ name: cloud_firestore
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.16.0"
+ cloud_firestore_platform_interface:
+ dependency: transitive
+ description:
+ name: cloud_firestore_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.0.1"
+ cloud_firestore_web:
+ dependency: transitive
+ description:
+ name: cloud_firestore_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.0+1"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.15.0-nullsafety.3"
+ convert:
+ dependency: transitive
+ description:
+ name: convert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.1"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.5"
+ cupertino_icons:
+ dependency: "direct main"
+ description:
+ name: cupertino_icons
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.0"
+ fake_async:
+ dependency: transitive
+ description:
+ name: fake_async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0-nullsafety.1"
+ firebase_auth:
+ dependency: "direct main"
+ description:
+ name: firebase_auth
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.20.0+1"
+ firebase_auth_platform_interface:
+ dependency: transitive
+ description:
+ name: firebase_auth_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.0.1"
+ firebase_auth_web:
+ dependency: transitive
+ description:
+ name: firebase_auth_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.2+6"
+ firebase_core:
+ dependency: "direct main"
+ description:
+ name: firebase_core
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.7.0"
+ firebase_core_platform_interface:
+ dependency: transitive
+ description:
+ name: firebase_core_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.0.1"
+ firebase_core_web:
+ dependency: transitive
+ description:
+ name: firebase_core_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.1+3"
+ firebase_storage:
+ dependency: "direct main"
+ description:
+ name: firebase_storage
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "7.0.0"
+ firebase_storage_platform_interface:
+ dependency: transitive
+ description:
+ name: firebase_storage_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ firebase_storage_web:
+ dependency: transitive
+ description:
+ name: firebase_storage_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.1+3"
+ flutter:
+ dependency: "direct main"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_plugin_android_lifecycle:
+ dependency: transitive
+ description:
+ name: flutter_plugin_android_lifecycle
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.11"
+ flutter_test:
+ dependency: "direct dev"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ http:
+ dependency: transitive
+ description:
+ name: http
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.2"
+ http_parser:
+ dependency: transitive
+ description:
+ name: http_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.1.4"
+ image_picker:
+ dependency: "direct main"
+ description:
+ name: image_picker
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.7+21"
+ image_picker_platform_interface:
+ dependency: transitive
+ description:
+ name: image_picker_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.1"
+ intl:
+ dependency: transitive
+ description:
+ name: intl
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.16.1"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.2"
+ matcher:
+ dependency: transitive
+ description:
+ name: matcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.10-nullsafety.1"
+ meta:
+ dependency: transitive
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.0-nullsafety.3"
+ modal_progress_hud:
+ dependency: "direct main"
+ description:
+ name: modal_progress_hud
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.3"
+ nested:
+ dependency: transitive
+ description:
+ name: nested
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.0.4"
+ path:
+ dependency: transitive
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.0-nullsafety.1"
+ pedantic:
+ dependency: transitive
+ description:
+ name: pedantic
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.9.2"
+ plugin_platform_interface:
+ dependency: transitive
+ description:
+ name: plugin_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.3"
+ provider:
+ dependency: "direct main"
+ description:
+ name: provider
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "4.3.3"
+ quiver:
+ dependency: transitive
+ description:
+ name: quiver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.5"
+ rflutter_alert:
+ dependency: "direct main"
+ description:
+ name: rflutter_alert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ sky_engine:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.99"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.0-nullsafety.2"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.10.0-nullsafety.1"
+ stream_channel:
+ dependency: transitive
+ description:
+ name: stream_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0-nullsafety.1"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0-nullsafety.1"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0-nullsafety.1"
+ test_api:
+ dependency: transitive
+ description:
+ name: test_api
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.19-nullsafety.2"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.0-nullsafety.3"
+ vector_math:
+ dependency: transitive
+ description:
+ name: vector_math
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0-nullsafety.3"
+sdks:
+ dart: ">=2.10.0-110 <2.11.0"
+ flutter: ">=1.20.0 <2.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
new file mode 100644
index 0000000..6c24cbc
--- /dev/null
+++ b/pubspec.yaml
@@ -0,0 +1,46 @@
+name: whatsapp
+description: A new Flutter application.
+
+publish_to: 'none'
+
+version: 1.0.0+1
+
+environment:
+ sdk: ">=2.7.0 <3.0.0"
+
+dependencies:
+ flutter:
+ sdk: flutter
+
+ cupertino_icons: ^1.0.0
+ provider: ^4.3.3
+ firebase_core: ^0.7.0
+ firebase_auth: ^0.20.0+1
+ cloud_firestore: ^0.16.0
+ firebase_storage: ^7.0.0
+ rflutter_alert: ^1.1.0
+ modal_progress_hud: ^0.1.3
+ image_picker:
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
+
+flutter:
+
+ uses-material-design: true
+
+
+ assets:
+ - images/
+ fonts:
+ - family: Maven_Pro
+ fonts:
+ - asset: fonts/MavenPro-Black.ttf
+ - asset: fonts/MavenPro-Bold.ttf
+ - asset: fonts/MavenPro-ExtraBold.ttf
+ - asset: fonts/MavenPro-Medium.ttf
+ - asset: fonts/MavenPro-Regular.ttf
+ - asset: fonts/MavenPro-SemiBold.ttf
+
+
\ No newline at end of file
diff --git a/test/widget_test.dart b/test/widget_test.dart
new file mode 100644
index 0000000..9cbd5ee
--- /dev/null
+++ b/test/widget_test.dart
@@ -0,0 +1,30 @@
+// This is a basic Flutter widget test.
+//
+// To perform an interaction with a widget in your test, use the WidgetTester
+// utility that Flutter provides. For example, you can send tap and scroll
+// gestures. You can also use WidgetTester to find child widgets in the widget
+// tree, read text, and verify that the values of widget properties are correct.
+
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+
+import 'package:whatsapp/main.dart';
+
+void main() {
+ testWidgets('Counter increments smoke test', (WidgetTester tester) async {
+ // Build our app and trigger a frame.
+ await tester.pumpWidget(MyApp());
+
+ // Verify that our counter starts at 0.
+ expect(find.text('0'), findsOneWidget);
+ expect(find.text('1'), findsNothing);
+
+ // Tap the '+' icon and trigger a frame.
+ await tester.tap(find.byIcon(Icons.add));
+ await tester.pump();
+
+ // Verify that our counter has incremented.
+ expect(find.text('0'), findsNothing);
+ expect(find.text('1'), findsOneWidget);
+ });
+}