├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ ├── chatchat │ │ │ │ └── app │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── example │ │ │ │ └── chatchat │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── android12splash.png │ │ │ └── splash.png │ │ │ ├── drawable-mdpi │ │ │ ├── android12splash.png │ │ │ └── splash.png │ │ │ ├── drawable-night-hdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-mdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-xhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-xxhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-xxxhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── android12splash.png │ │ │ └── splash.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── android12splash.png │ │ │ └── splash.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── android12splash.png │ │ │ └── splash.png │ │ │ ├── drawable │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night-v31 │ │ │ └── styles.xml │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ ├── values-v31 │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── images │ ├── chat_backgrond.png │ ├── loading.gif │ ├── logo-512.png │ ├── logoSplash.png │ ├── logoSplashAndroid12.png │ ├── no-internet.png │ └── user.png ├── lottie │ ├── soon.json │ └── update.json ├── svgs │ └── google.svg └── translations │ ├── ar.json │ └── en.json ├── flutter_launcher_icons.yaml ├── flutter_native_splash.yaml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ ├── LaunchBackground.imageset │ │ │ ├── Contents.json │ │ │ └── background.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h └── RunnerTests │ └── RunnerTests.swift ├── lib ├── chatchat.dart ├── core │ ├── networking │ │ └── dio_factory.dart │ └── widgets │ │ ├── already_have_account_text.dart │ │ ├── app_button.dart │ │ ├── app_text_form_field.dart │ │ ├── login_and_signup_form.dart │ │ ├── modal_fit.dart │ │ ├── no_internet.dart │ │ ├── or_sign_in_with_text.dart │ │ ├── password_validations.dart │ │ └── terms_and_conditions_text.dart ├── features │ ├── chat │ │ ├── data │ │ │ └── model │ │ │ │ └── message.dart │ │ └── ui │ │ │ ├── chat_page.dart │ │ │ └── widgets │ │ │ ├── message_bar.dart │ │ │ └── url_preview.dart │ ├── create_password │ │ └── ui │ │ │ └── create_password.dart │ ├── display_picture │ │ └── ui │ │ │ └── display_picture_screen.dart │ ├── forget_password │ │ └── ui │ │ │ ├── forget_screen.dart │ │ │ └── widgets │ │ │ └── password_reset.dart │ ├── home │ │ └── ui │ │ │ └── home_screen.dart │ ├── local_auth │ │ └── auth.dart │ ├── login │ │ └── ui │ │ │ ├── login_screen.dart │ │ │ └── widgets │ │ │ └── do_not_have_account.dart │ ├── newgroup │ │ └── ui │ │ │ └── new_group_screen.dart │ ├── settings │ │ └── ui │ │ │ └── settings_screen.dart │ ├── signup │ │ └── ui │ │ │ └── sign_up_sceen.dart │ ├── tabs │ │ ├── calls_tab.dart │ │ ├── chat_tab.dart │ │ └── updates_tab.dart │ └── update │ │ └── ui │ │ └── update.dart ├── helpers │ ├── access_token.dart │ ├── app_regex.dart │ ├── build_divider.dart │ ├── extensions.dart │ └── notifications.dart ├── main.dart ├── router │ ├── app_routes.dart │ └── routes.dart ├── services │ ├── database.dart │ ├── google_sign_in.dart │ └── notification_service.dart └── themes │ ├── colors.dart │ └── styles.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── packages ├── chat_bubbles │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── images │ │ ├── logo │ │ │ └── logo.png │ │ ├── messages │ │ │ └── img1.png │ │ └── screenshots │ │ │ ├── 2022_12_29_main1.jpg │ │ │ ├── 2022_12_29_main2.jpg │ │ │ ├── 2022_2_4_main1.png │ │ │ ├── 2022_2_4_main2.png │ │ │ ├── 2022_7_3_main1.png │ │ │ ├── 2022_7_3_main2.png │ │ │ ├── audio_bubble.png │ │ │ ├── datechip.png │ │ │ ├── image_bubble.jpg │ │ │ ├── imsg.png │ │ │ ├── imsg1.png │ │ │ ├── messagebar.jpeg │ │ │ ├── screenshot_1.png │ │ │ ├── screenshot_1_old.png │ │ │ ├── screenshot_2.png │ │ │ ├── screenshot_2_old.png │ │ │ ├── screenshot_3_old.png │ │ │ ├── screenshot_4_old.png │ │ │ └── single_bubble.png │ ├── lib │ │ ├── algo │ │ │ ├── algo.dart │ │ │ └── date_chip_text.dart │ │ ├── bubbles │ │ │ ├── bubble_normal_image.dart │ │ │ └── bubble_special_three.dart │ │ ├── chat_bubbles.dart │ │ ├── date_chips │ │ │ └── date_chip.dart │ │ └── message_bars │ │ │ └── message_bar.dart │ ├── pubspec.lock │ ├── pubspec.yaml │ └── test │ │ └── chatbubbles_test.dart └── flutter_link_previewer │ ├── .github │ └── workflows │ │ └── build.yaml │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── lib │ ├── flutter_link_previewer.dart │ └── src │ │ ├── types.dart │ │ ├── url_linkifier.dart │ │ ├── utils.dart │ │ └── widgets │ │ └── link_preview.dart │ └── pubspec.yaml ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html ├── manifest.json └── splash │ └── img │ ├── dark-1x.png │ ├── dark-2x.png │ ├── dark-3x.png │ ├── dark-4x.png │ ├── light-1x.png │ ├── light-2x.png │ ├── light-3x.png │ └── light-4x.png └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | android/app/google-services.json 45 | ios/firebase_app_id_file.json 46 | ios/Runner/GoogleService-Info.plist 47 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "54e66469a933b60ddf175f858f82eaeb97e48c8d" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 17 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 18 | - platform: android 19 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 20 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 21 | - platform: ios 22 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 23 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 24 | - platform: linux 25 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 26 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 27 | - platform: macos 28 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 29 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 30 | - platform: web 31 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 32 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 33 | - platform: windows 34 | create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 35 | base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 16 | if (flutterVersionCode == null) { 17 | flutterVersionCode = '1' 18 | } 19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 21 | if (flutterVersionName == null) { 22 | flutterVersionName = '1.0' 23 | } 24 | 25 | android { 26 | namespace "com.chatchat.app" 27 | compileSdk 34 28 | ndkVersion "25.1.8937393" 29 | 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | } 38 | 39 | sourceSets { 40 | main.java.srcDirs += 'src/main/kotlin' 41 | } 42 | 43 | defaultConfig { 44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 45 | applicationId "com.chatchat.app" 46 | // You can update the following values to match your application needs. 47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 48 | minSdkVersion 23 49 | targetSdkVersion flutter.targetSdkVersion 50 | versionCode flutterVersionCode.toInteger() 51 | versionName flutterVersionName 52 | multiDexEnabled true 53 | } 54 | 55 | buildTypes { 56 | release { 57 | // TODO: Add your own signing config for the release build. 58 | // Signing with the debug keys for now, so `flutter run --release` works. 59 | signingConfig signingConfigs.debug 60 | } 61 | } 62 | } 63 | 64 | flutter { 65 | source '../..' 66 | } 67 | 68 | dependencies { 69 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2' 70 | implementation 'androidx.window:window:1.0.0' 71 | implementation 'androidx.window:window-java:1.0.0' 72 | } 73 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/chatchat/app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.chatchat.app 2 | 3 | import io.flutter.embedding.android.FlutterFragmentActivity 4 | 5 | class MainActivity: FlutterFragmentActivity() -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/chatchat/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.chatchat 2 | 3 | import io.flutter.embedding.android.FlutterFragmentActivity 4 | 5 | class MainActivity: FlutterFragmentActivity() 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-hdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-mdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-hdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-night-hdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-mdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-night-mdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-night-xhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xxxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(':app') 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | repositories { 14 | google() 15 | mavenCentral() 16 | gradlePluginPortal() 17 | } 18 | } 19 | 20 | plugins { 21 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 22 | id "com.android.application" version "7.3.0" apply false 23 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false 24 | } 25 | 26 | include ":app" 27 | -------------------------------------------------------------------------------- /assets/images/chat_backgrond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/chat_backgrond.png -------------------------------------------------------------------------------- /assets/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/loading.gif -------------------------------------------------------------------------------- /assets/images/logo-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/logo-512.png -------------------------------------------------------------------------------- /assets/images/logoSplash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/logoSplash.png -------------------------------------------------------------------------------- /assets/images/logoSplashAndroid12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/logoSplashAndroid12.png -------------------------------------------------------------------------------- /assets/images/no-internet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/no-internet.png -------------------------------------------------------------------------------- /assets/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/assets/images/user.png -------------------------------------------------------------------------------- /assets/svgs/google.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/translations/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "شات شات", 3 | "createAccount": "إنشاء حساب", 4 | "createPassword": "إنشاء كلمة مرور", 5 | "login": "تسجيل الدخول", 6 | "signUp": "سجل", 7 | "signOut": "تسجيل خروج", 8 | "language": "اللغة", 9 | "changeLanguage": "تغيير @:language", 10 | "enterEmailToResetPassword": "أدخل @:email لإعادة تعيين @:password", 11 | "app": "التطبيق", 12 | "loginToContinue": "@:login للمتابعة في استخدام @:app", 13 | "settings": "الإعدادات", 14 | "unlockApp": "قفل @:app", 15 | "unlockAppDesc": "عند التمكين، ستحتاج إلى استخدام\nبصمة الإصبع أو التعرف على الوجه لفتح @:title.", 16 | "warning": "تحذير", 17 | "name": "الاسم", 18 | "authNotSupported": "لا يدعم هذا الجهاز شاشة مقفلة. يرجى تمكين بصمة الإصبع أو التعرف على الوجه لتعزيز الأمان.", 19 | "alreadyHaveAccount": "هل لديك حساب بالفعل؟ ", 20 | "email": "البريد الإلكتروني", 21 | "password": "كلمة المرور", 22 | "pleaseEnterValid": "الرجاء إدخال {} صالح", 23 | "forgetPassword": "هل نسيت @:password؟", 24 | "emailNotVerified": "البريد الإلكتروني غير مفعل", 25 | "emailNotVerifiedDesc": "يرجى التحقق من بريدك الإلكتروني وتفعيل بريدك الإلكتروني.", 26 | "error": "خطأ", 27 | "user": "المستخدم", 28 | "userNotFound": "لم يتم العثور على @:user بهذا @:email.", 29 | "wrongPassword": "كلمة المرور @:password المقدمة غير صحيحة لهذا @:user.", 30 | "success": "تم التسجيل بنجاح", 31 | "accountCreated": "لقد سجلت بنجاح.", 32 | "emailAlreadyExists": "هذا الحساب موجود بالفعل لهذا @:email. يرجى الانتقال و @:login.", 33 | "confirmPassword": "تأكيد @:password", 34 | "passwordsDontMatch": "أدخل كلمات مرور متطابقة", 35 | "verifyYourEmail": "لا تنسَ التحقق من بريدك الإلكتروني. يرجى التحقق من البريد الوارد.", 36 | "orSignInWith": "أو تسجيل الدخول باستخدام", 37 | "passwordValidation": "على الأقل ٦ أحرف", 38 | "terms1": "من خلال تسجيل الدخول، فإنك توافق على", 39 | "terms2": "الشروط والأحكام", 40 | "terms3": "و", 41 | "terms4": "سياسة الخصوصية.", 42 | "displayPicture": "عرض الصورة", 43 | "takePicture": "التقاط صورة", 44 | "message": "رسالة", 45 | "reset": "إعادة تعيين", 46 | "emailNotFound": "@:email غير موجود", 47 | "resetPassword": "@:reset @:password", 48 | "checkYourEmail": "تم إرسال رابط إعادة تعيين كلمة المرور إلى @:email الخاص بك، يرجى التحقق من رسائل البريد الواردة.", 49 | "newGroup": "مجموعة جديدة", 50 | "chats": "محادثات", 51 | "updates": "التحديثات", 52 | "calls": "المكالمات", 53 | "doNotHaveAccount": "ليس لديك حساب بعد؟", 54 | "createAccountDesc": "@:signUp الآن وابدأ في استكشاف كل ما يقدمه تطبيقنا. نحن متحمسون لترحيبك في مجتمعنا!", 55 | "somethingWentWrong": "حدث خطأ ما", 56 | "update": "تحديث", 57 | "updateDesc": "التحديث متوفر. قم بتنزيله وتثبيته", 58 | "exit": "خروج", 59 | "tooManyAttempts": "عدد محاولات خاطئة كثيرة. حاول مرة أخرى بعد {} ثوانٍ.", 60 | "enterFingerprint": "مسح بصمة الإصبع (أو التعرف على الوجه أو أي شيء آخر) للمصادقة", 61 | "disableFingerprint": "إذا لم يكن مستشعر بصمة الإصبع يعمل، قم بتعطيله في إعدادات جهازك.", 62 | "appLocked": "@:title مغلق", 63 | "photoGallery": "اختيار من المعرض", 64 | "camera": "التقاط صورة", 65 | "offline": "غير متصل", 66 | "online": "متصل" 67 | } -------------------------------------------------------------------------------- /assets/translations/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Chat Chat", 3 | "createAccount": "Create Account", 4 | "createPassword": "Create @:password", 5 | "login": "Login", 6 | "signUp": "Sign Up", 7 | "signOut": "Sign Out", 8 | "language": "Language", 9 | "changeLanguage": "Change @:language", 10 | "enterEmailToResetPassword": "Enter @:email to @:reset @:password", 11 | "app": "App", 12 | "loginToContinue": "@:login To Continue Using The @:app", 13 | "settings": "Settings", 14 | "unlockApp": "Lock @:app", 15 | "unlockAppDesc": "When enabled, you'll need to use\nfingerprint or face ID to open @:title.", 16 | "warning": "Warning", 17 | "name": "Name", 18 | "authNotSupported": "This device does not have a locked screen. Please enable a fingerprint, or face ID for added security.", 19 | "alreadyHaveAccount": "Already have an account? ", 20 | "email": "Email", 21 | "password": "Password", 22 | "pleaseEnterValid": "Please enter a valid {}", 23 | "forgetPassword": "forget @:password?", 24 | "emailNotVerified": "@:email Not Verified", 25 | "emailNotVerifiedDesc": "Please check your @:email and verify your @:email.", 26 | "error": "Error", 27 | "user": "User", 28 | "userNotFound": "No @:user found for that @:email.", 29 | "wrongPassword": "Wrong @:password provided for that @:user.", 30 | "success": "@:signUp Success", 31 | "accountCreated": "You have successfully signed up.", 32 | "emailAlreadyExists": "This account already exists for that @:email. Please go and @:login.", 33 | "confirmPassword": "@:password Confirmation", 34 | "passwordsDontMatch": "Enter a matched passwords", 35 | "verifyYourEmail": "Don't forget to verify your @:email. Please check inbox.", 36 | "orSignInWith": "or Sign in with", 37 | "passwordValidation": "At least 6 characters", 38 | "terms1": "By logging, you agree to our", 39 | "terms2": "Terms & Conditions", 40 | "terms3": "and", 41 | "terms4": "PrivacyPolicy.", 42 | "displayPicture": "Display the Picture", 43 | "takePicture": "Take a picture", 44 | "message": "Message", 45 | "reset": "Reset", 46 | "emailNotFound": "@:email not found", 47 | "resetPassword": "@:reset @:password", 48 | "checkYourEmail": "Link to @:resetPassword send to your @:email, please check inbox messages.", 49 | "newGroup": "New group", 50 | "chats": "Chats", 51 | "updates": "Updates", 52 | "calls": "Calls", 53 | "doNotHaveAccount": "Don't have an account yet?", 54 | "createAccountDesc": "@:signUp now and start exploring all that our\napp has to offer. We're excited to welcome\nyou to our community!", 55 | "somethingWentWrong": "Something went wrong", 56 | "update": "Update", 57 | "updateDesc": "Update Available. Download and Install", 58 | "exit": "Exit", 59 | "tooManyAttempts": "Too many wrong attempts. Try again after {} seconds.", 60 | "enterFingerprint": "Scan your fingerprint (or face ID or whatever) to authenticate", 61 | "appLocked": "@:title Locked", 62 | "disableFingerprint": "If the fingerprint sensor isn't working, disable it in\nyour device's settings.", 63 | "photoGallery": "Photo Gallery", 64 | "camera": "Camera", 65 | "offline": "Offline", 66 | "online": "Online" 67 | } -------------------------------------------------------------------------------- /flutter_launcher_icons.yaml: -------------------------------------------------------------------------------- 1 | flutter_launcher_icons: 2 | image_path: "assets/images/logo-512.png" 3 | android: true # can specify file name here e.g. "ic_launcher" 4 | ios: true # can specify file name here e.g. "My-Launcher-Icon" 5 | min_sdk_android: 21 6 | remove_alpha_ios: true 7 | background_color_ios: "#00a884" 8 | web: 9 | generate: false 10 | windows: 11 | generate: false 12 | macos: 13 | generate: false 14 | -------------------------------------------------------------------------------- /flutter_native_splash.yaml: -------------------------------------------------------------------------------- 1 | flutter_native_splash: 2 | image: assets/images/logoSplash.png 3 | color: "#111b21" 4 | 5 | android_12: 6 | image: assets/images/logoSplashAndroid12.png 7 | color: "#111b21" 8 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import flutter_local_notifications 4 | 5 | @UIApplicationMain 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | 12 | FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in 13 | GeneratedPluginRegistrant.register(with: registry) 14 | } 15 | 16 | if #available(iOS 10.0, *) { 17 | UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate 18 | } 19 | 20 | GeneratedPluginRegistrant.register(with: self) 21 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleLocalizations 6 | 7 | en 8 | ar 9 | 10 | CFBundleURLTypes 11 | 12 | 13 | CFBundleTypeRole 14 | Editor 15 | CFBundleURLName 16 | com.chatchat.app 17 | CFBundleURLSchemes 18 | 19 | Chat Chat 20 | 21 | 22 | 23 | NSCameraUsageDescription 24 | Allow access to camera 25 | NSMicrophoneUsageDescription 26 | Allow access to microphone for video recording 27 | NSPhotoLibraryUsageDescription 28 | Allow access to photo library 29 | NSFaceIDUsageDescription 30 | Why is my app authenticating using face id? 31 | CFBundleDevelopmentRegion 32 | $(DEVELOPMENT_LANGUAGE) 33 | CFBundleDisplayName 34 | Chat Chat 35 | CFBundleExecutable 36 | $(EXECUTABLE_NAME) 37 | CFBundleIdentifier 38 | $(PRODUCT_BUNDLE_IDENTIFIER) 39 | CFBundleInfoDictionaryVersion 40 | 6.0 41 | CFBundleName 42 | chatchat 43 | CFBundlePackageType 44 | APPL 45 | CFBundleShortVersionString 46 | $(FLUTTER_BUILD_NAME) 47 | CFBundleSignature 48 | ???? 49 | CFBundleVersion 50 | $(FLUTTER_BUILD_NUMBER) 51 | LSRequiresIPhoneOS 52 | 53 | UILaunchStoryboardName 54 | LaunchScreen 55 | UIMainStoryboardFile 56 | Main 57 | UISupportedInterfaceOrientations 58 | 59 | UIInterfaceOrientationPortrait 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | UISupportedInterfaceOrientations~ipad 64 | 65 | UIInterfaceOrientationPortrait 66 | UIInterfaceOrientationPortraitUpsideDown 67 | UIInterfaceOrientationLandscapeLeft 68 | UIInterfaceOrientationLandscapeRight 69 | 70 | CADisableMinimumFrameDurationOnPhone 71 | 72 | UIApplicationSupportsIndirectInputEvents 73 | 74 | UIStatusBarHidden 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/chatchat.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_native_splash/flutter_native_splash.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | 6 | import 'main.dart'; 7 | import 'router/app_routes.dart'; 8 | import 'themes/colors.dart'; 9 | 10 | class ChatChat extends StatefulWidget { 11 | final AppRoute appRoute; 12 | const ChatChat({ 13 | super.key, 14 | required this.appRoute, 15 | }); 16 | 17 | @override 18 | State createState() => _ChatChatState(); 19 | } 20 | 21 | class _ChatChatState extends State { 22 | @override 23 | Widget build(BuildContext context) { 24 | return ScreenUtilInit( 25 | designSize: const Size(375, 812), 26 | minTextAdapt: true, 27 | splitScreenMode: true, 28 | child: MaterialApp( 29 | title: 'Chat Chat', 30 | localizationsDelegates: context.localizationDelegates, 31 | supportedLocales: context.supportedLocales, 32 | locale: context.locale, 33 | theme: ThemeData( 34 | useMaterial3: true, 35 | primaryColor: ColorsManager.greenPrimary, 36 | textSelectionTheme: const TextSelectionThemeData( 37 | cursorColor: ColorsManager.greenPrimary, 38 | selectionHandleColor: ColorsManager.greenPrimary, 39 | selectionColor: Color.fromARGB(209, 0, 168, 132), 40 | ), 41 | progressIndicatorTheme: const ProgressIndicatorThemeData( 42 | color: ColorsManager.greenPrimary, 43 | ), 44 | floatingActionButtonTheme: const FloatingActionButtonThemeData( 45 | backgroundColor: ColorsManager.greenPrimary, 46 | ), 47 | scaffoldBackgroundColor: ColorsManager.backgroundDefaultColor, 48 | appBarTheme: const AppBarTheme( 49 | foregroundColor: Colors.white, 50 | backgroundColor: ColorsManager.appBarBackgroundColor, 51 | ), 52 | ), 53 | onGenerateRoute: widget.appRoute.onGenerateRoute, 54 | initialRoute: initialRoute, 55 | debugShowCheckedModeBanner: false, 56 | ), 57 | ); 58 | } 59 | 60 | @override 61 | void initState() { 62 | super.initState(); 63 | FlutterNativeSplash.remove(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/core/networking/dio_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:pretty_dio_logger/pretty_dio_logger.dart'; 3 | 4 | class DioFactory { 5 | static Dio? dio; 6 | 7 | DioFactory._(); 8 | 9 | static void addDioInterceptor() { 10 | dio?.interceptors.add( 11 | PrettyDioLogger( 12 | requestBody: true, 13 | requestHeader: true, 14 | responseHeader: true, 15 | ), 16 | ); 17 | } 18 | 19 | static Dio getDio() { 20 | Duration timeOut = const Duration(seconds: 30); 21 | 22 | if (dio == null) { 23 | dio = Dio(); 24 | dio! 25 | ..options.connectTimeout = timeOut 26 | ..options.receiveTimeout = timeOut; 27 | addDioInterceptor(); 28 | return dio!; 29 | } else { 30 | return dio!; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/core/widgets/already_have_account_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../helpers/extensions.dart'; 5 | import '../../router/routes.dart'; 6 | import '../../themes/styles.dart'; 7 | 8 | class AlreadyHaveAccountText extends StatelessWidget { 9 | const AlreadyHaveAccountText({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return GestureDetector( 14 | onTap: () { 15 | context.pushNamedAndRemoveUntil( 16 | Routes.loginScreen, 17 | predicate: (route) => false, 18 | ); 19 | }, 20 | child: RichText( 21 | textAlign: TextAlign.center, 22 | text: TextSpan( 23 | children: [ 24 | TextSpan( 25 | text: context.tr('alreadyHaveAccount'), 26 | style: TextStyles.font11MediumLightShadeOfGray400Weight, 27 | ), 28 | TextSpan( 29 | text: context.tr('login'), 30 | style: TextStyles.font11Green500Weight, 31 | ), 32 | ], 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/core/widgets/app_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | import '../../themes/colors.dart'; 5 | 6 | class AppButton extends StatelessWidget { 7 | final double? borderRadius; 8 | final Color? backgroundColor; 9 | final double? horizontalPadding; 10 | final double? verticalPadding; 11 | final double? buttonWidth; 12 | final double? buttonHeight; 13 | final String buttonText; 14 | final TextStyle textStyle; 15 | final VoidCallback onPressed; 16 | 17 | const AppButton( 18 | {super.key, 19 | this.borderRadius, 20 | this.backgroundColor, 21 | this.horizontalPadding, 22 | this.verticalPadding, 23 | this.buttonWidth, 24 | this.buttonHeight, 25 | required this.buttonText, 26 | required this.textStyle, 27 | required this.onPressed}); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return TextButton( 32 | onPressed: onPressed, 33 | style: ButtonStyle( 34 | shape: WidgetStateProperty.all( 35 | RoundedRectangleBorder( 36 | borderRadius: BorderRadius.circular( 37 | borderRadius ?? 30, 38 | ), 39 | ), 40 | ), 41 | backgroundColor: WidgetStatePropertyAll( 42 | backgroundColor ?? ColorsManager.greenPrimary, 43 | ), 44 | padding: WidgetStateProperty.all( 45 | EdgeInsets.symmetric( 46 | horizontal: horizontalPadding?.w ?? 12.w, 47 | vertical: verticalPadding?.h ?? 14.h, 48 | ), 49 | ), 50 | fixedSize: WidgetStateProperty.all( 51 | Size(buttonWidth?.w ?? double.maxFinite, buttonHeight?.h ?? 52.h), 52 | ), 53 | ), 54 | child: Text( 55 | buttonText, 56 | style: textStyle, 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/core/widgets/app_text_form_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | import '../../themes/colors.dart'; 5 | import '../../themes/styles.dart'; 6 | 7 | class AppTextFormField extends StatelessWidget { 8 | final String hint; 9 | final Widget? suffixIcon; 10 | final FocusNode? focusNode; 11 | final Function(String)? onChanged; 12 | final bool? isObscureText; 13 | final bool? isDense; 14 | final TextEditingController? controller; 15 | final Function(String?) validator; 16 | const AppTextFormField({ 17 | super.key, 18 | required this.hint, 19 | this.suffixIcon, 20 | this.isObscureText, 21 | this.isDense, 22 | this.controller, 23 | this.onChanged, 24 | this.focusNode, 25 | required this.validator, 26 | }); 27 | @override 28 | Widget build(BuildContext context) { 29 | return TextFormField( 30 | focusNode: focusNode, 31 | validator: (value) { 32 | return validator(value); 33 | }, 34 | onChanged: onChanged, 35 | controller: controller, 36 | decoration: InputDecoration( 37 | hintText: hint, 38 | hintFadeDuration: const Duration(milliseconds: 500), 39 | hintStyle: TextStyles.font14Grey400Weight, 40 | isDense: isDense ?? true, 41 | filled: true, 42 | fillColor: const Color(0xff273443), 43 | contentPadding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 17.h), 44 | enabledBorder: OutlineInputBorder( 45 | borderSide: const BorderSide( 46 | color: Colors.transparent, 47 | ), 48 | borderRadius: BorderRadius.circular(30), 49 | ), 50 | focusedBorder: OutlineInputBorder( 51 | borderSide: const BorderSide( 52 | color: Colors.transparent, 53 | ), 54 | borderRadius: BorderRadius.circular(30), 55 | ), 56 | errorBorder: OutlineInputBorder( 57 | borderSide: BorderSide( 58 | color: ColorsManager.coralRed, 59 | width: 1.3.w, 60 | ), 61 | borderRadius: BorderRadius.circular(30), 62 | ), 63 | focusedErrorBorder: OutlineInputBorder( 64 | borderSide: BorderSide( 65 | color: ColorsManager.coralRed, 66 | width: 1.3.w, 67 | ), 68 | borderRadius: BorderRadius.circular(30), 69 | ), 70 | suffixIcon: suffixIcon, 71 | ), 72 | obscureText: isObscureText ?? false, 73 | style: TextStyles.font18White500Weight, 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/core/widgets/modal_fit.dart: -------------------------------------------------------------------------------- 1 | import 'package:awesome_dialog/awesome_dialog.dart'; 2 | import 'package:easy_localization/easy_localization.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:restart_app/restart_app.dart'; 6 | 7 | import '../../helpers/extensions.dart'; 8 | import '../../themes/colors.dart'; 9 | import '../../themes/styles.dart'; 10 | 11 | class ModalFit extends StatefulWidget { 12 | const ModalFit({super.key}); 13 | 14 | @override 15 | State createState() => _ModalFitState(); 16 | } 17 | 18 | class _ModalFitState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Material( 22 | child: Column( 23 | mainAxisSize: MainAxisSize.min, 24 | children: [ 25 | ListTile( 26 | title: const Text('عربي'), 27 | titleTextStyle: TextStyles.font16White600Weight, 28 | leading: const Icon( 29 | Icons.language_rounded, 30 | color: Colors.white, 31 | ), 32 | tileColor: ColorsManager.appBarBackgroundColor, 33 | onTap: () async { 34 | await AwesomeDialog( 35 | dismissOnBackKeyPress: true, 36 | dismissOnTouchOutside: true, 37 | context: context, 38 | dialogType: DialogType.info, 39 | animType: AnimType.scale, 40 | title: 'اعادة التشغيل مطلوبة', 41 | desc: 42 | 'لتطبيق تغيير اللغة إلى العربية، يحتاج التطبيق إلى إعادة التشغيل. يرجى إعادة تشغيل التطبيق الآن.', 43 | btnCancelText: 'الغاء', 44 | btnCancelOnPress: () => context.pop(), 45 | btnOkText: 'إعادة التشغيل', 46 | btnOkOnPress: () async { 47 | await context.setLocale(const Locale("ar")); 48 | await Restart.restartApp(); 49 | }, 50 | ).show(); 51 | }, 52 | ), 53 | Container( 54 | color: ColorsManager.gray400, 55 | height: 0.5.h, 56 | width: double.infinity, 57 | ), 58 | ListTile( 59 | title: const Text('English'), 60 | titleTextStyle: TextStyles.font16White600Weight, 61 | tileColor: ColorsManager.appBarBackgroundColor, 62 | leading: const Icon( 63 | Icons.language_rounded, 64 | color: Colors.white, 65 | ), 66 | onTap: () async { 67 | await AwesomeDialog( 68 | dismissOnBackKeyPress: true, 69 | dismissOnTouchOutside: true, 70 | context: context, 71 | dialogType: DialogType.info, 72 | animType: AnimType.scale, 73 | title: 'Restart Required', 74 | desc: 75 | 'To apply the language change to English, the app needs to restart. Please restart the app now.', 76 | btnCancelText: 'Cancel', 77 | btnCancelOnPress: () => context.pop(), 78 | btnOkText: 'Restart', 79 | btnOkOnPress: () async { 80 | await context.setLocale(const Locale("en")); 81 | Restart.restartApp(); 82 | }, 83 | ).show(); 84 | }, 85 | ), 86 | ], 87 | ), 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/core/widgets/no_internet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BuildNoInternet extends StatelessWidget { 4 | const BuildNoInternet({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Center( 9 | child: Image.asset( 10 | 'assets/images/no-internet.png', 11 | ), 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/core/widgets/or_sign_in_with_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:gap/gap.dart'; 5 | 6 | import '../../helpers/build_divider.dart'; 7 | import '../../themes/styles.dart'; 8 | 9 | class SigninWithGoogleText extends StatelessWidget { 10 | const SigninWithGoogleText({ 11 | super.key, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Row( 17 | mainAxisAlignment: MainAxisAlignment.center, 18 | mainAxisSize: MainAxisSize.max, 19 | children: [ 20 | BuildDivider.buildDivider(), 21 | Gap(5.w), 22 | Text( 23 | context.tr('orSignInWith'), 24 | style: TextStyles.font13MediumLightShadeOfGray400Weight, 25 | ), 26 | Gap(5.w), 27 | BuildDivider.buildDivider(), 28 | ], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/core/widgets/password_validations.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:gap/gap.dart'; 5 | 6 | import '../../themes/colors.dart'; 7 | import '../../themes/styles.dart'; 8 | 9 | class PasswordValidations extends StatelessWidget { 10 | final bool hasMinLength; 11 | const PasswordValidations({super.key, required this.hasMinLength}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Row( 16 | children: [ 17 | const CircleAvatar( 18 | radius: 2.5, 19 | backgroundColor: ColorsManager.gray, 20 | ), 21 | Gap(6.w), 22 | Text( 23 | context.tr('passwordValidation'), 24 | style: TextStyles.font14DarkBlue500Weight.copyWith( 25 | decoration: hasMinLength ? TextDecoration.lineThrough : null, 26 | decorationColor: ColorsManager.greenPrimary, 27 | decorationThickness: 2, 28 | color: hasMinLength 29 | ? ColorsManager.mediumLightShadeOfGray 30 | : ColorsManager.lightShadeOfGray, 31 | ), 32 | ) 33 | ], 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/core/widgets/terms_and_conditions_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | 5 | import '../../themes/styles.dart'; 6 | 7 | class TermsAndConditionsText extends StatelessWidget { 8 | const TermsAndConditionsText({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return RichText( 13 | textAlign: TextAlign.center, 14 | text: TextSpan( 15 | children: [ 16 | TextSpan( 17 | text: context.tr('terms1'), 18 | style: TextStyles.font11MediumLightShadeOfGray400Weight, 19 | ), 20 | TextSpan( 21 | text: ' ${context.tr('terms2')}', 22 | style: TextStyles.font11Green500Weight, 23 | ), 24 | TextSpan( 25 | text: ' ${context.tr('terms3')}', 26 | style: TextStyles.font11MediumLightShadeOfGray400Weight 27 | .copyWith(height: 4.h), 28 | ), 29 | TextSpan( 30 | text: ' ${context.tr('terms4')}', 31 | style: TextStyles.font11Green500Weight, 32 | ), 33 | ], 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/features/chat/data/model/message.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | 3 | class Message { 4 | final String senderID; 5 | final String senderName; 6 | final String message; 7 | final String receiverID; 8 | final Timestamp timestamp; 9 | 10 | Message( 11 | {required this.senderID, 12 | required this.senderName, 13 | required this.message, 14 | required this.receiverID, 15 | required this.timestamp}); 16 | // convert to a map 17 | Map toMap() { 18 | return { 19 | 'senderID': senderID, 20 | 'senderName': senderName, 21 | 'message': message, 22 | 'receiverID': receiverID, 23 | 'timestamp': timestamp 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/features/chat/ui/widgets/message_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_bubbles/message_bars/message_bar.dart'; 2 | import 'package:easy_localization/easy_localization.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | 6 | import '../../../../themes/colors.dart'; 7 | import '../../../../themes/styles.dart'; 8 | 9 | class CustomMessageBar extends StatelessWidget { 10 | final Function(String) onSend; 11 | final VoidCallback onShowOptions; 12 | const CustomMessageBar( 13 | {super.key, required this.onSend, required this.onShowOptions}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return MessageBar( 18 | messageBarHitText: context.tr('message'), 19 | messageBarHintStyle: TextStyles.font14Grey400Weight, 20 | messageBarTextStyle: TextStyles.font18White500Weight.copyWith( 21 | fontSize: 16.sp, 22 | fontWeight: FontWeight.w400, 23 | ), 24 | messageBarColor: Colors.transparent, 25 | contentPadding: EdgeInsets.symmetric( 26 | horizontal: 10.w, 27 | vertical: 7.h, 28 | ), 29 | paddingTextAndSendButton: context.locale.toString() == 'en' 30 | ? EdgeInsets.only(left: 4.w) 31 | : EdgeInsets.only(right: 4.w), 32 | onSend: (message) async { 33 | await onSend(message); 34 | }, 35 | sendButtonColor: ColorsManager.greenPrimary, 36 | actions: [ 37 | Padding( 38 | padding: context.locale.toString() == 'ar' 39 | ? EdgeInsets.only(left: 4.w) 40 | : EdgeInsets.only(right: 4.w), 41 | child: Container( 42 | decoration: const BoxDecoration( 43 | color: Color(0xff00a884), 44 | shape: BoxShape.circle, 45 | ), 46 | child: IconButton( 47 | icon: const Icon( 48 | Icons.camera_alt, 49 | color: Colors.black, 50 | size: 28, 51 | ), 52 | onPressed: onShowOptions, 53 | ), 54 | ), 55 | ) 56 | ], 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/features/chat/ui/widgets/url_preview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_chat_types/flutter_chat_types.dart' show PreviewData; 3 | import 'package:flutter_link_previewer/flutter_link_previewer.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | 6 | class LinkPreviewWidget extends StatefulWidget { 7 | final String message; 8 | final Function(String) onLinkPressed; 9 | 10 | const LinkPreviewWidget({ 11 | super.key, 12 | required this.message, 13 | required this.onLinkPressed, 14 | }); 15 | @override 16 | State createState() => _LinkPreviewWidgetState(); 17 | } 18 | 19 | class _LinkPreviewWidgetState extends State { 20 | Map datas = {}; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return LinkPreview( 25 | imageWidth: double.infinity, 26 | width: MediaQuery.of(context).size.width * 0.7, 27 | padding: EdgeInsets.only(bottom: 16.h, left: 10.w, right: 10.w, top: 8.h), 28 | onLinkPressed: widget.onLinkPressed, 29 | enableAnimation: true, 30 | textStyle: TextStyle( 31 | color: Colors.white, 32 | fontSize: 16.sp, 33 | ), 34 | openOnPreviewImageTap: true, 35 | openOnPreviewTitleTap: true, 36 | onPreviewDataFetched: (previewData) { 37 | setState(() { 38 | datas = { 39 | ...datas, 40 | widget.message: previewData, 41 | }; 42 | }); 43 | }, 44 | metadataTitleStyle: TextStyle( 45 | color: Colors.white, 46 | fontWeight: FontWeight.bold, 47 | fontSize: 16.sp, 48 | ), 49 | metadataTextStyle: TextStyle( 50 | color: Colors.white, 51 | fontSize: 13.sp, 52 | ), 53 | previewData: datas[widget.message], 54 | text: widget.message, 55 | linkStyle: const TextStyle( 56 | decoration: TextDecoration.none, 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/features/create_password/ui/create_password.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: must_be_immutable 2 | 3 | import 'package:easy_localization/easy_localization.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_offline/flutter_offline.dart'; 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 8 | import 'package:gap/gap.dart'; 9 | import 'package:google_sign_in/google_sign_in.dart'; 10 | 11 | import '../../../core/widgets/login_and_signup_form.dart'; 12 | import '../../../core/widgets/no_internet.dart'; 13 | import '../../../core/widgets/terms_and_conditions_text.dart'; 14 | import '../../../themes/styles.dart'; 15 | 16 | class BuildCreatePasswordScreen extends StatelessWidget { 17 | final GoogleSignInAccount googleUser; 18 | 19 | final OAuthCredential credential; 20 | const BuildCreatePasswordScreen({ 21 | super.key, 22 | required this.googleUser, 23 | required this.credential, 24 | }); 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return SafeArea( 29 | child: Padding( 30 | padding: 31 | EdgeInsets.only(left: 30.w, right: 30.w, bottom: 15.h, top: 5.h), 32 | child: Column( 33 | children: [ 34 | Expanded( 35 | child: SingleChildScrollView( 36 | child: Column( 37 | crossAxisAlignment: CrossAxisAlignment.start, 38 | children: [ 39 | Text( 40 | context.tr('createPassword'), 41 | style: TextStyles.font24White600Weight, 42 | ), 43 | Gap(10.h), 44 | EmailAndPassword( 45 | isPasswordPage: true, 46 | googleUser: googleUser, 47 | credential: credential, 48 | ), 49 | ], 50 | ), 51 | ), 52 | ), 53 | const TermsAndConditionsText(), 54 | ], 55 | ), 56 | ), 57 | ); 58 | } 59 | } 60 | 61 | class CreatePassword extends StatelessWidget { 62 | late GoogleSignInAccount googleUser; 63 | late OAuthCredential credential; 64 | CreatePassword({ 65 | super.key, 66 | required this.googleUser, 67 | required this.credential, 68 | }); 69 | @override 70 | Widget build(BuildContext context) { 71 | return Scaffold( 72 | body: OfflineBuilder( 73 | connectivityBuilder: ( 74 | BuildContext context, 75 | List connectivity, 76 | Widget child, 77 | ) { 78 | final bool connected = 79 | !connectivity.contains(ConnectivityResult.none); 80 | return connected 81 | ? BuildCreatePasswordScreen( 82 | googleUser: googleUser, credential: credential) 83 | : const BuildNoInternet(); 84 | }, 85 | child: const Center( 86 | child: CircularProgressIndicator(), 87 | ), 88 | ), 89 | ); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/features/forget_password/ui/forget_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_offline/flutter_offline.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:gap/gap.dart'; 6 | 7 | import '../../../core/widgets/already_have_account_text.dart'; 8 | import '../../../core/widgets/no_internet.dart'; 9 | import '../../../core/widgets/terms_and_conditions_text.dart'; 10 | import '../../../themes/styles.dart'; 11 | import 'widgets/password_reset.dart'; 12 | 13 | class BuildForgetScreen extends StatelessWidget { 14 | const BuildForgetScreen({ 15 | super.key, 16 | }); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return SafeArea( 21 | child: Padding( 22 | padding: 23 | EdgeInsets.only(left: 30.w, right: 30.w, bottom: 15.h, top: 5.h), 24 | child: Column( 25 | children: [ 26 | Expanded( 27 | child: SingleChildScrollView( 28 | child: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | Text( 32 | context.tr('reset'), 33 | style: TextStyles.font24White600Weight, 34 | ), 35 | Gap(10.h), 36 | Text( 37 | context.tr('enterEmailToResetPassword'), 38 | style: TextStyles.font14Grey400Weight, 39 | ), 40 | Gap(20.h), 41 | const PasswordReset(), 42 | ], 43 | ), 44 | ), 45 | ), 46 | Align( 47 | alignment: Alignment.bottomCenter, 48 | child: Column( 49 | mainAxisSize: MainAxisSize.min, // Ensure minimum height 50 | children: [ 51 | const TermsAndConditionsText(), 52 | Gap(24.h), 53 | const AlreadyHaveAccountText(), 54 | ], 55 | ), 56 | ), 57 | ], 58 | ), 59 | ), 60 | ); 61 | } 62 | } 63 | 64 | class ForgetScreen extends StatelessWidget { 65 | const ForgetScreen({super.key}); 66 | 67 | @override 68 | Widget build(BuildContext context) { 69 | return Scaffold( 70 | body: OfflineBuilder( 71 | connectivityBuilder: ( 72 | BuildContext context, 73 | List connectivity, 74 | Widget child, 75 | ) { 76 | final bool connected = 77 | !connectivity.contains(ConnectivityResult.none); 78 | return connected 79 | ? const BuildForgetScreen() 80 | : const BuildNoInternet(); 81 | }, 82 | child: const Center( 83 | child: CircularProgressIndicator(), 84 | ), 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/features/forget_password/ui/widgets/password_reset.dart: -------------------------------------------------------------------------------- 1 | import 'package:awesome_dialog/awesome_dialog.dart'; 2 | import 'package:easy_localization/easy_localization.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 6 | import 'package:gap/gap.dart'; 7 | 8 | import '../../../../../helpers/app_regex.dart'; 9 | import '../../../../../themes/styles.dart'; 10 | import '../../../../core/widgets/app_button.dart'; 11 | import '../../../../core/widgets/app_text_form_field.dart'; 12 | 13 | class PasswordReset extends StatefulWidget { 14 | const PasswordReset({super.key}); 15 | 16 | @override 17 | State createState() => _PasswordResetState(); 18 | } 19 | 20 | class _PasswordResetState extends State { 21 | TextEditingController emailController = TextEditingController(); 22 | final formKey = GlobalKey(); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Form( 27 | key: formKey, 28 | child: Column( 29 | children: [ 30 | emailField(), 31 | Gap(30.h), 32 | resetButton(context), 33 | ], 34 | ), 35 | ); 36 | } 37 | 38 | @override 39 | void dispose() { 40 | emailController.dispose(); 41 | super.dispose(); 42 | } 43 | 44 | AppTextFormField emailField() { 45 | return AppTextFormField( 46 | hint: context.tr('email'), 47 | validator: (value) { 48 | if (value == null || value.isEmpty || !AppRegex.isEmailValid(value)) { 49 | return context.tr('pleaseEnterValid', args: ['Email']); 50 | } 51 | }, 52 | controller: emailController, 53 | ); 54 | } 55 | 56 | AppButton resetButton(BuildContext context) { 57 | return AppButton( 58 | buttonText: context.tr('reset'), 59 | textStyle: TextStyles.font15DarkBlue500Weight, 60 | onPressed: () async { 61 | if (formKey.currentState!.validate()) { 62 | try { 63 | await FirebaseAuth.instance 64 | .sendPasswordResetEmail(email: emailController.text); 65 | if (!context.mounted) return; 66 | 67 | AwesomeDialog( 68 | context: context, 69 | dialogType: DialogType.info, 70 | animType: AnimType.rightSlide, 71 | title: context.tr('resetPassword'), 72 | desc: context.tr('checkYourEmail'), 73 | ).show(); 74 | } on FirebaseAuthException catch (e) { 75 | if (e.code == 'user-not-found') { 76 | AwesomeDialog( 77 | context: context, 78 | dialogType: DialogType.error, 79 | animType: AnimType.rightSlide, 80 | title: context.tr('error'), 81 | desc: context.tr('emailNotFound'), 82 | ).show(); 83 | } else { 84 | AwesomeDialog( 85 | context: context, 86 | dialogType: DialogType.error, 87 | animType: AnimType.rightSlide, 88 | title: context.tr('error'), 89 | desc: e.message, 90 | ).show(); 91 | } 92 | } 93 | } 94 | }, 95 | ); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/features/login/ui/widgets/do_not_have_account.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../../helpers/extensions.dart'; 5 | import '../../../../router/routes.dart'; 6 | import '../../../../themes/styles.dart'; 7 | 8 | class DoNotHaveAccountText extends StatelessWidget { 9 | const DoNotHaveAccountText({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return GestureDetector( 14 | onTap: () { 15 | context.pushNamed(Routes.signupScreen); 16 | }, 17 | child: RichText( 18 | textAlign: TextAlign.center, 19 | text: TextSpan( 20 | children: [ 21 | TextSpan( 22 | text: context.tr('doNotHaveAccount'), 23 | style: TextStyles.font11MediumLightShadeOfGray400Weight, 24 | ), 25 | TextSpan( 26 | text: ' ${context.tr('signUp')}', 27 | style: TextStyles.font11Green500Weight, 28 | ), 29 | ], 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/features/newgroup/ui/new_group_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:lottie/lottie.dart'; 4 | 5 | class NewGroupScreen extends StatelessWidget { 6 | const NewGroupScreen({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: Text(context.tr('newGroup')), 13 | ), 14 | body: Center( 15 | child: Lottie.asset('assets/lottie/soon.json'), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/features/tabs/calls_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | 4 | class CallsTab extends StatelessWidget { 5 | const CallsTab({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center(child: Lottie.asset('assets/lottie/soon.json')); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/features/tabs/updates_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | 4 | class UpdatesTab extends StatelessWidget { 5 | const UpdatesTab({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center(child: Lottie.asset('assets/lottie/soon.json')); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/features/update/ui/update.dart: -------------------------------------------------------------------------------- 1 | import 'package:awesome_dialog/awesome_dialog.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:easy_localization/easy_localization.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:lottie/lottie.dart'; 7 | import 'package:url_launcher/url_launcher.dart'; 8 | 9 | class UpdateScreen extends StatefulWidget { 10 | const UpdateScreen({super.key}); 11 | 12 | @override 13 | State createState() => _UpdateScreenState(); 14 | } 15 | 16 | class _UpdateScreenState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | body: Center( 21 | child: Lottie.asset('assets/lottie/update.json'), 22 | ), 23 | ); 24 | } 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | WidgetsBinding.instance.addPostFrameCallback((_) async { 30 | await showDialog(); 31 | }); 32 | } 33 | 34 | Future showDialog() async { 35 | AwesomeDialog( 36 | dismissOnBackKeyPress: false, 37 | dismissOnTouchOutside: false, 38 | context: context, 39 | dialogType: DialogType.warning, 40 | animType: AnimType.scale, 41 | title: context.tr('update'), 42 | desc: context.tr('updateDesc'), 43 | btnCancelText: context.tr('exit'), 44 | btnCancelOnPress: () => SystemNavigator.pop(), 45 | btnOkText: context.tr('update'), 46 | btnOkOnPress: () async { 47 | DocumentSnapshot documentSnapshot = await FirebaseFirestore.instance 48 | .collection('version') 49 | .doc('newest') 50 | .get(); 51 | _launchURL(documentSnapshot['link']); 52 | }, 53 | ).show(); 54 | } 55 | 56 | Future _launchURL(String myUrl) async { 57 | final Uri url = Uri.parse(myUrl); 58 | if (!await launchUrl(url)) { 59 | throw Exception('Could not launch $url'); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/helpers/access_token.dart: -------------------------------------------------------------------------------- 1 | import 'package:googleapis_auth/auth_io.dart'; 2 | 3 | class AccessToken { 4 | 5 | final String firebaseMessagingScope = 6 | "https://www.googleapis.com/auth/firebase.messaging"; 7 | 8 | Future getAccessToken() async { 9 | 10 | // In the Firebase console, open Settings > Service Accounts. 11 | // Click Generate New Private Key, then confirm by clicking Generate Key. 12 | // set data from downloaded file here 13 | final accountCredentials = ServiceAccountCredentials.fromJson({}); 14 | 15 | final client = await clientViaServiceAccount( 16 | accountCredentials, 17 | [firebaseMessagingScope], 18 | ); 19 | 20 | return client.credentials.accessToken.data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/helpers/app_regex.dart: -------------------------------------------------------------------------------- 1 | class AppRegex { 2 | static bool isEmailValid(String email) { 3 | return RegExp(r'^.+@[a-zA-Z]+\.{1}[a-zA-Z]+(\.{0,1}[a-zA-Z]+)$') 4 | .hasMatch(email); 5 | } 6 | 7 | static bool isPasswordValid(String password) { 8 | return RegExp(r'^(?=.{6,})').hasMatch(password); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/helpers/build_divider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | import '../themes/colors.dart'; 5 | 6 | class BuildDivider { 7 | static Widget buildDivider() { 8 | return Expanded( 9 | child: Container( 10 | width: double.infinity, 11 | height: 2.h, 12 | decoration: ShapeDecoration( 13 | color: ColorsManager.gray, 14 | shape: RoundedRectangleBorder( 15 | borderRadius: BorderRadius.circular(100), 16 | ), 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/helpers/extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | extension Navigation on BuildContext { 4 | pop() => Navigator.of(this).pop(); 5 | 6 | pushNamed(String routeName, {Object? arguments}) { 7 | return Navigator.of(this).pushNamed(routeName, arguments: arguments); 8 | } 9 | 10 | pushNamedAndRemoveUntil(String routeName, 11 | {Object? arguments, required RoutePredicate predicate}) { 12 | return Navigator.of(this) 13 | .pushNamedAndRemoveUntil(routeName, predicate, arguments: arguments); 14 | } 15 | 16 | pushReplacementNamed(String routeName, {Object? arguments}) { 17 | return Navigator.of(this) 18 | .pushReplacementNamed(routeName, arguments: arguments); 19 | } 20 | } 21 | 22 | extension StringExtension on String? { 23 | RegExp get isContainsLink { 24 | return RegExp( 25 | r'((http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})(:[0-9]{1,5})?(\/\S*)?)', 26 | caseSensitive: false, 27 | multiLine: true, 28 | ); 29 | } 30 | 31 | bool isNullOrEmpty() => this == null || this!.isEmpty || this == ''; 32 | } 33 | -------------------------------------------------------------------------------- /lib/helpers/notifications.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_messaging/firebase_messaging.dart'; 2 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 3 | 4 | class HelperNotification { 5 | static Future initialize( 6 | FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async { 7 | const initializationSettingsAndroid = 8 | AndroidInitializationSettings('@mipmap/ic_launcher'); 9 | const initializationSettingsDarwin = DarwinInitializationSettings(); 10 | 11 | const InitializationSettings initializationSettings = 12 | InitializationSettings( 13 | android: initializationSettingsAndroid, 14 | iOS: initializationSettingsDarwin, 15 | ); 16 | await flutterLocalNotificationsPlugin.initialize(initializationSettings); 17 | await FirebaseMessaging.instance 18 | .setForegroundNotificationPresentationOptions( 19 | alert: true, 20 | badge: true, 21 | sound: true, 22 | ); 23 | } 24 | 25 | static Future showNotification(String title, String body, 26 | FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async { 27 | const AndroidNotificationDetails androidNotificationDetails = 28 | AndroidNotificationDetails( 29 | 'chatchatappid', 30 | 'chatchatappname', 31 | importance: Importance.max, 32 | priority: Priority.high, 33 | ); 34 | const NotificationDetails notificationDetails = NotificationDetails( 35 | android: androidNotificationDetails, 36 | iOS: DarwinNotificationDetails(), 37 | ); 38 | return await flutterLocalNotificationsPlugin.show( 39 | 0, 40 | title, 41 | body, 42 | notificationDetails, 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:easy_localization/easy_localization.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:firebase_core/firebase_core.dart'; 5 | import 'package:firebase_messaging/firebase_messaging.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_native_splash/flutter_native_splash.dart'; 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 9 | import 'package:package_info_plus/package_info_plus.dart'; 10 | import 'package:pub_semver/pub_semver.dart'; 11 | import 'package:shared_preferences/shared_preferences.dart'; 12 | 13 | import 'chatchat.dart'; 14 | import 'firebase_options.dart'; 15 | import 'router/app_routes.dart'; 16 | import 'router/routes.dart'; 17 | import 'services/database.dart'; 18 | 19 | Future main() async { 20 | WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); 21 | FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); 22 | 23 | // Initialize EasyLocalization 24 | await EasyLocalization.ensureInitialized(); 25 | 26 | // Initialize Firebase 27 | await Firebase.initializeApp( 28 | options: DefaultFirebaseOptions.currentPlatform, 29 | ); 30 | 31 | // Initialize App 32 | await initApp(); 33 | 34 | // Initialize ScreenUtil 35 | await ScreenUtil.ensureScreenSize(); 36 | 37 | // Run App 38 | runApp( 39 | EasyLocalization( 40 | supportedLocales: const [Locale('ar'), Locale('en')], 41 | path: 'assets/translations', 42 | startLocale: const Locale('ar'), 43 | child: ChatChat( 44 | appRoute: AppRoute(), 45 | ), 46 | ), 47 | ); 48 | } 49 | 50 | late String? initialRoute; 51 | 52 | Future initApp() async { 53 | // Compare Versions 54 | PackageInfo packageInfo = await PackageInfo.fromPlatform(); 55 | DocumentSnapshot newestVersionDetails = await FirebaseFirestore.instance 56 | .collection('version') 57 | .doc('newest') 58 | .get(); 59 | Version newestVersion = Version.parse(newestVersionDetails['version']); 60 | Version currentVersion = Version.parse(packageInfo.version); 61 | int compareResult = newestVersion.compareTo(currentVersion); 62 | 63 | // handle initial route 64 | FirebaseAuth.instance.authStateChanges().listen( 65 | (user) async { 66 | if (compareResult == 0) { 67 | if (user == null || !user.emailVerified) { 68 | initialRoute = Routes.loginScreen; 69 | } else { 70 | SharedPreferences prefs = await SharedPreferences.getInstance(); 71 | bool? localAuth = prefs.getBool('auth_screen_enabled') ?? false; 72 | if (localAuth == true) { 73 | initialRoute = Routes.authScreen; 74 | } 75 | if (localAuth == false) { 76 | initialRoute = Routes.homeScreen; 77 | } 78 | } 79 | } else { 80 | initialRoute = Routes.updateScreen; 81 | } 82 | }, 83 | ); 84 | 85 | //Request notification permission 86 | late final message = FirebaseMessaging.instance; 87 | await message.requestPermission(); 88 | 89 | // listen for messages when the app is in the background or terminated 90 | FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); 91 | 92 | message.onTokenRefresh.listen((fcmToken) async { 93 | await DatabaseMethods.updateUserDetails({'mtoken': fcmToken}); 94 | }); 95 | } 96 | 97 | @pragma('vm:entry-point') 98 | Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async {} 99 | -------------------------------------------------------------------------------- /lib/router/app_routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:image_picker/image_picker.dart'; 3 | 4 | import '../features/chat/ui/chat_page.dart'; 5 | import '../features/create_password/ui/create_password.dart'; 6 | import '../features/display_picture/ui/display_picture_screen.dart'; 7 | import '../features/forget_password/ui/forget_screen.dart'; 8 | import '../features/home/ui/home_screen.dart'; 9 | import '../features/local_auth/auth.dart'; 10 | import '../features/login/ui/login_screen.dart'; 11 | import '../features/newgroup/ui/new_group_screen.dart'; 12 | import '../features/settings/ui/settings_screen.dart'; 13 | import '../features/signup/ui/sign_up_sceen.dart'; 14 | import '../features/update/ui/update.dart'; 15 | import 'routes.dart'; 16 | 17 | class AppRoute { 18 | Route? onGenerateRoute(RouteSettings routeSettings) { 19 | switch (routeSettings.name) { 20 | case Routes.authScreen: 21 | return MaterialPageRoute( 22 | builder: (context) => const Auth(), 23 | ); 24 | 25 | case Routes.updateScreen: 26 | return MaterialPageRoute( 27 | builder: (context) => const UpdateScreen(), 28 | ); 29 | 30 | case Routes.chatScreen: 31 | final arguments = routeSettings.arguments; 32 | if (arguments is Map) { 33 | return MaterialPageRoute( 34 | builder: (_) => ChatScreen( 35 | receivedUserName: arguments['name'], 36 | receivedUserID: arguments['uid'], 37 | receivedMToken: arguments['mtoken'], 38 | active: arguments['isOnline'], 39 | receivedUserProfilePic: arguments['profilePic'], 40 | ), 41 | ); 42 | } 43 | 44 | case Routes.forgetScreen: 45 | return MaterialPageRoute( 46 | builder: (context) => const ForgetScreen(), 47 | ); 48 | 49 | case Routes.loginScreen: 50 | return MaterialPageRoute( 51 | builder: (context) => const LoginScreen(), 52 | ); 53 | 54 | case Routes.signupScreen: 55 | return MaterialPageRoute( 56 | builder: (context) => const SignUpScreen(), 57 | ); 58 | 59 | case Routes.createPassword: 60 | final arguments = routeSettings.arguments; 61 | if (arguments is List) { 62 | return MaterialPageRoute( 63 | builder: (_) => CreatePassword( 64 | googleUser: arguments[0], 65 | credential: arguments[1], 66 | ), 67 | ); 68 | } 69 | 70 | case Routes.settingsScreen: 71 | return MaterialPageRoute( 72 | builder: (context) => const SettingsScreen(), 73 | ); 74 | 75 | case Routes.newGroupScreen: 76 | return MaterialPageRoute( 77 | builder: (context) => const NewGroupScreen(), 78 | ); 79 | 80 | case Routes.displayPictureScreen: 81 | final arguments = routeSettings.arguments; 82 | if (arguments is List) { 83 | return MaterialPageRoute( 84 | builder: (context) => DisplayPictureScreen( 85 | image: arguments[0] as XFile, 86 | token: arguments[1] as String, 87 | receivedMToken: arguments[2] as String, 88 | receivedUserID: arguments[3] as String, 89 | ), 90 | ); 91 | } 92 | 93 | case Routes.homeScreen: 94 | return MaterialPageRoute( 95 | builder: (context) => const HomeScreen(), 96 | ); 97 | 98 | } 99 | return null; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/router/routes.dart: -------------------------------------------------------------------------------- 1 | class Routes { 2 | static const homeScreen = '/homeScreen'; 3 | static const settingsScreen = '/settingsScreen'; 4 | static const newGroupScreen = '/newGroupScreen'; 5 | static const authScreen = '/authScreen'; 6 | static const loginScreen = '/loginScreen'; 7 | static const signupScreen = '/signupScreen'; 8 | static const forgetScreen = '/forgetScreen'; 9 | static const createPassword = '/createPassword'; 10 | static const chatScreen = '/chatScreen'; 11 | static const displayPictureScreen = '/displayPictureScreen'; 12 | static const updateScreen = '/updateScreen'; 13 | } 14 | -------------------------------------------------------------------------------- /lib/services/database.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | import '../features/chat/data/model/message.dart'; 5 | 6 | class DatabaseMethods { 7 | static final _auth = FirebaseAuth.instance; 8 | static final _fireStore = FirebaseFirestore.instance; 9 | 10 | static Future addUserDetails(Map data, 11 | [SetOptions? options]) async { 12 | await _fireStore 13 | .collection('users') 14 | .doc(_auth.currentUser!.uid) 15 | .set(data, options); 16 | } 17 | 18 | // Get Messages from firestore 19 | static Stream getMessages(String userID, String otherUserID) { 20 | List sortedIDs = [userID, otherUserID]; 21 | sortedIDs.sort(); 22 | String chatRoomID = sortedIDs.join('_'); 23 | return _fireStore 24 | .collection('chats') 25 | .doc(chatRoomID) 26 | .collection('messages') 27 | .orderBy('timestamp', descending: true) 28 | .snapshots(); 29 | } 30 | 31 | // SEND MESSAGE 32 | static Future sendMessage(String message, String receiverID) async { 33 | // get current user info 34 | final currentUserID = _auth.currentUser!.uid; 35 | final currentUserName = _auth.currentUser!.displayName; 36 | final timestamp = Timestamp.now(); 37 | // create a new message 38 | Message newMessage = Message( 39 | senderID: currentUserID, 40 | senderName: currentUserName!, 41 | message: message, 42 | receiverID: receiverID, 43 | timestamp: timestamp, 44 | ); 45 | // construct chat room id from current user id and recvier id (Sorted to ensure uniqueness) 46 | List sortedIDs = [currentUserID, receiverID]; 47 | sortedIDs.sort(); 48 | String chatRoomID = sortedIDs.join('_'); 49 | 50 | // add message to database 51 | await _fireStore 52 | .collection('chats') 53 | .doc(chatRoomID) 54 | .collection('messages') 55 | .add( 56 | newMessage.toMap(), 57 | ); 58 | } 59 | 60 | static Future updateUserDetails(Map data, 61 | [SetOptions? options]) async { 62 | await _fireStore 63 | .collection('users') 64 | .doc(_auth.currentUser!.uid) 65 | .update(data); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/services/google_sign_in.dart: -------------------------------------------------------------------------------- 1 | import 'package:awesome_dialog/awesome_dialog.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:easy_localization/easy_localization.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:firebase_messaging/firebase_messaging.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:google_sign_in/google_sign_in.dart'; 8 | 9 | import '../helpers/extensions.dart'; 10 | import '../router/routes.dart'; 11 | import 'database.dart'; 12 | 13 | class GoogleSignin { 14 | static final _auth = FirebaseAuth.instance; 15 | late final notificationSettings = FirebaseMessaging.instance; 16 | static Future getToken() async { 17 | final fcmToken = await FirebaseMessaging.instance.getToken(); 18 | return fcmToken!; 19 | } 20 | 21 | static Future signInWithGoogle(BuildContext context) async { 22 | try { 23 | // Trigger the authentication flow 24 | final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); 25 | if (googleUser == null) { 26 | return; 27 | } 28 | 29 | // Obtain the auth details from the request 30 | final GoogleSignInAuthentication googleAuth = 31 | await googleUser.authentication; 32 | 33 | // Create a new credential 34 | final credential = GoogleAuthProvider.credential( 35 | accessToken: googleAuth.accessToken, 36 | idToken: googleAuth.idToken, 37 | ); 38 | 39 | final UserCredential authResult = 40 | await _auth.signInWithCredential(credential); 41 | 42 | if (authResult.additionalUserInfo!.isNewUser) { 43 | await _auth.currentUser!.delete(); 44 | if (!context.mounted) return; 45 | context.pushNamedAndRemoveUntil( 46 | Routes.createPassword, 47 | predicate: (route) => false, 48 | arguments: [googleUser, credential], 49 | ); 50 | } else { 51 | await DatabaseMethods.addUserDetails( 52 | { 53 | 'name': _auth.currentUser!.displayName, 54 | 'email': _auth.currentUser!.email, 55 | 'profilePic': _auth.currentUser!.photoURL, 56 | 'uid': _auth.currentUser!.uid, 57 | 'mtoken': await getToken(), 58 | 'isOnline': 'true', 59 | }, 60 | SetOptions(merge: true), 61 | ); 62 | 63 | if (!context.mounted) return; 64 | context.pushNamedAndRemoveUntil( 65 | Routes.homeScreen, 66 | predicate: (route) => false, 67 | ); 68 | } 69 | } catch (e) { 70 | await AwesomeDialog( 71 | context: context, 72 | dialogType: DialogType.info, 73 | animType: AnimType.rightSlide, 74 | title: context.tr('somethingWentWrong'), 75 | desc: e.toString(), 76 | ).show(); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/services/notification_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import '../core/networking/dio_factory.dart'; 7 | import '../helpers/access_token.dart'; 8 | 9 | class NotificationService extends ChangeNotifier { 10 | Future sendPushMessage( 11 | String receiverMToken, 12 | String senderMToken, 13 | String message, 14 | String senderName, 15 | String senderID, 16 | String? senderUserProfilePic, 17 | ) async { 18 | AccessToken accessToken = AccessToken(); 19 | String token = await accessToken.getAccessToken(); 20 | 21 | var headers = { 22 | 'Content-Type': 'application/json', 23 | 'Authorization': 'Bearer $token' 24 | }; 25 | var data = json.encode({ 26 | "message": { 27 | "token": receiverMToken, 28 | "notification": {"body": message, "title": senderName}, 29 | 'data': { 30 | 'name': senderName, 31 | 'type': 'chat', 32 | 'uid': senderID, 33 | 'mtoken': senderMToken, 34 | 'isOnline': 'true', 35 | 'profilePic': senderUserProfilePic 36 | } 37 | } 38 | }); 39 | 40 | Dio dio = DioFactory.getDio(); 41 | await dio.request( 42 | 'https://fcm.googleapis.com/v1/projects/chatappmoaz/messages:send', 43 | options: Options( 44 | method: 'POST', 45 | headers: headers, 46 | ), 47 | data: data, 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/themes/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ColorsManager { 4 | static const Color gray = Color(0xFF757575); 5 | static Color gray400 = Colors.grey.shade400; 6 | static const Color darkBlue = Color(0xFF242424); 7 | static const Color lightShadeOfGray = Color(0xFFFDFDFF); 8 | static const Color mediumLightShadeOfGray = Color(0xFF9E9E9E); 9 | static const Color coralRed = Color(0xFFFF4C5E); 10 | static const Color backgroundDefaultColor = Color(0xff111b21); 11 | static const Color greenPrimary = Color(0xff00a884); 12 | static const Color appBarBackgroundColor = Color(0xff202c33); 13 | } 14 | -------------------------------------------------------------------------------- /lib/themes/styles.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | import 'colors.dart'; 5 | 6 | class TextStyles { 7 | static TextStyle font16Grey400Weight = TextStyle( 8 | fontWeight: FontWeight.w400, 9 | color: ColorsManager.gray400, 10 | fontSize: 16.sp, 11 | ); 12 | 13 | static TextStyle font16White600Weight = TextStyle( 14 | fontSize: 16.sp, 15 | fontWeight: FontWeight.w600, 16 | color: Colors.white, 17 | ); 18 | static TextStyle font24White600Weight = TextStyle( 19 | fontSize: 24.sp, 20 | fontWeight: FontWeight.w600, 21 | color: Colors.white, 22 | ); 23 | static TextStyle font15Green500Weight = TextStyle( 24 | fontSize: 15.sp, 25 | fontWeight: FontWeight.w500, 26 | color: ColorsManager.greenPrimary, 27 | ); 28 | static TextStyle font18White500Weight = TextStyle( 29 | fontSize: 18.sp, 30 | fontWeight: FontWeight.w500, 31 | color: Colors.white, 32 | ); 33 | 34 | static TextStyle font14Grey400Weight = TextStyle( 35 | fontSize: 14.sp, 36 | fontWeight: FontWeight.w400, 37 | color: const Color.fromARGB(255, 163, 163, 163), 38 | ); 39 | 40 | static TextStyle font14DarkBlue500Weight = TextStyle( 41 | fontSize: 14.sp, 42 | fontWeight: FontWeight.w500, 43 | color: ColorsManager.darkBlue, 44 | ); 45 | 46 | static TextStyle font15DarkBlue500Weight = TextStyle( 47 | fontSize: 15.sp, 48 | fontWeight: FontWeight.w500, 49 | color: ColorsManager.darkBlue, 50 | ); 51 | 52 | static TextStyle font11Green500Weight = TextStyle( 53 | fontSize: 11.sp, 54 | fontWeight: FontWeight.w500, 55 | color: ColorsManager.greenPrimary, 56 | ); 57 | 58 | static TextStyle font11MediumLightShadeOfGray400Weight = TextStyle( 59 | fontSize: 11.sp, 60 | fontWeight: FontWeight.w400, 61 | color: ColorsManager.mediumLightShadeOfGray, 62 | ); 63 | 64 | static TextStyle font13MediumLightShadeOfGray400Weight = TextStyle( 65 | fontSize: 13.sp, 66 | fontWeight: FontWeight.w400, 67 | color: ColorsManager.mediumLightShadeOfGray, 68 | ); 69 | } 70 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); 16 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) rive_common_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "RivePlugin"); 19 | rive_plugin_register_with_registrar(rive_common_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | file_selector_linux 7 | rive_common 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import cloud_firestore 9 | import connectivity_plus 10 | import file_selector_macos 11 | import firebase_auth 12 | import firebase_core 13 | import firebase_messaging 14 | import firebase_storage 15 | import flutter_local_notifications 16 | import google_sign_in_ios 17 | import local_auth_darwin 18 | import network_info_plus 19 | import package_info_plus 20 | import path_provider_foundation 21 | import rive_common 22 | import shared_preferences_foundation 23 | import sqflite 24 | import url_launcher_macos 25 | 26 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 27 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 28 | ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) 29 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 30 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 31 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 32 | FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) 33 | FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) 34 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 35 | FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) 36 | FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) 37 | NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin")) 38 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) 39 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 40 | RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin")) 41 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 42 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 43 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 44 | } 45 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = chatchat 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatchat 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /packages/chat_bubbles/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | .fvm/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | build/ 33 | 34 | 35 | 36 | # Android related 37 | **/android/**/gradle-wrapper.jar 38 | **/android/.gradle 39 | **/android/captures/ 40 | **/android/gradlew 41 | **/android/gradlew.bat 42 | **/android/local.properties 43 | **/android/**/GeneratedPluginRegistrant.java 44 | 45 | # iOS/XCode related 46 | **/ios/**/*.mode1v3 47 | **/ios/**/*.mode2v3 48 | **/ios/**/*.moved-aside 49 | **/ios/**/*.pbxuser 50 | **/ios/**/*.perspectivev3 51 | **/ios/**/*sync/ 52 | **/ios/**/.sconsign.dblite 53 | **/ios/**/.tags* 54 | **/ios/**/.vagrant/ 55 | **/ios/**/DerivedData/ 56 | **/ios/**/Icon? 57 | **/ios/**/Pods/ 58 | **/ios/**/.symlinks/ 59 | **/ios/**/profile 60 | **/ios/**/xcuserdata 61 | **/ios/.generated/ 62 | **/ios/Flutter/App.framework 63 | **/ios/Flutter/Flutter.framework 64 | **/ios/Flutter/Flutter.podspec 65 | **/ios/Flutter/Generated.xcconfig 66 | **/ios/Flutter/app.flx 67 | **/ios/Flutter/app.zip 68 | **/ios/Flutter/flutter_assets/ 69 | **/ios/Flutter/flutter_export_environment.sh 70 | **/ios/ServiceDefinitions.json 71 | **/ios/Runner/GeneratedPluginRegistrant.* 72 | 73 | # Exceptions to above rules. 74 | !**/ios/**/default.mode1v3 75 | !**/ios/**/default.mode2v3 76 | !**/ios/**/default.pbxuser 77 | !**/ios/**/default.perspectivev3 78 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 79 | -------------------------------------------------------------------------------- /packages/chat_bubbles/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 0b8abb4724aa590dd0f429683339b1e045a1594d 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/chat_bubbles/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.6.0] - 20/01/2024 2 | 3 | ### For Message Bar 4 | * Customizable text style for message bar text 5 | 6 | ### For BubbleNormal Widget 7 | 8 | * Added optional [leading] widget for _non senders_ 9 | * Added optional [trailing] widget for _sender_ 10 | * Added [margin] and [padding] properties 11 | * Added tap callbacks such as [onTap], [onDoubleTap] and [onLongPress]. 12 | * Changes the texts to selectable texts 13 | 14 | ### For BubbleNormalImage Widget 15 | 16 | BubbleNormalImage Widget- 17 | * Added optional [leading] widget for _non senders_ 18 | * Added optional [trailing] widget for _sender_ 19 | * Added [margin] and [padding] parameters 20 | * Added Tap Callbacks such as [onTap] and [onLongPress]. 21 | 22 | ### For DateChip Widget 23 | * Fixes [DateChip] taking full width 24 | 25 | ### Other 26 | * Updated the environment to allow support for latest dart sdks 27 | * Updated the documentation within code to be easier to read 28 | 29 | ## [1.5.0] - 11/08/2023 30 | 31 | * Customizable constrains for bubbles 32 | * Customizable message bar hint text 33 | * Customizable message bar hint style 34 | * Update the example 35 | 36 | ## [1.4.1] - 26/01/2023 37 | 38 | * Support up-to-date dependencies 39 | 40 | ## [1.4.0] - 29/12/2022 41 | 42 | * Add `BubbleNormalImage` image chat bubble widget 43 | 44 | ## [1.3.1] - 16/08/2022 45 | 46 | * Support up-to-date dependencies 47 | 48 | ## [1.3.0] - 03/07/2022 49 | 50 | * Add `MessageBar` widget 51 | 52 | ## [1.2.0] - 04/02/2022 53 | 54 | * Add iMessage's chat bubble shape bubble widget (`BubbleSpecialThree`). 55 | 56 | ## [1.1.0] - 27/06/2021 57 | 58 | * Audio chat bubble widget(`BubbleNormalAudio`) for the bubble normal widget set. 59 | 60 | ## [1.0.0+3] - 16/05/2021 61 | 62 | * Update `README` main example code. 63 | 64 | ## [1.0.0+2] - 15/05/2021 65 | 66 | * dartfmt formatting. 67 | 68 | ## [1.0.0+1] - 15/05/2021 69 | 70 | * dartfmt formatting. 71 | 72 | ## [1.0.0] - 15/05/2021 73 | 74 | * Add `DateChip` widget 75 | 76 | ## [0.8.1] - 26/04/2021 77 | 78 | * set priority for message status tick (seen > delivered > sent) 79 | 80 | ## [0.8.0+1] - 22/03/2021 81 | 82 | * Update README.md example. 83 | 84 | ## [0.8.0] - 15/03/2021 85 | 86 | * Add the option to customize the chat bubble text styles by changing `textStyle` parameter 87 | 88 | ## [0.7.9+3] - 10/03/2021 89 | 90 | * null-safety. 91 | 92 | ## [0.7.8+2] - 21/10/2020 93 | 94 | * dartfmt formatting. 95 | 96 | ## [0.7.8+1] - 20/07/2020 97 | 98 | * Update README.md example. 99 | 100 | ## [0.7.8] - 20/07/2020 101 | 102 | * Add message states(sent, delivered, seen) flag for BubbleSpecialOne and BubbleSpecialTwo. 103 | * Update the example. 104 | 105 | ## [0.7.5+1] - 18/07/2020 106 | 107 | * Add some dartdoc comments. 108 | 109 | ## [0.7.5] - 21/06/2020 110 | 111 | * Add message states(sent, delivered, seen) flag for BubbleNormal. 112 | * Update the example. 113 | 114 | ## [0.7.1+6] - 17/05/2020 115 | 116 | * Update the example. 117 | 118 | ## [0.7.1+5] - 10/05/2020 119 | 120 | * Update README.md file. 121 | 122 | ## [0.7.1+4] - 10/05/2020 123 | 124 | * Update package description. 125 | 126 | ## [0.7.1+3] - 09/05/2020 127 | 128 | * Update package description. 129 | 130 | ## [0.7.1+2] - 09/05/2020 131 | 132 | * Update package description. 133 | 134 | ## [0.7.1+1] - 09/05/2020 135 | 136 | * Update package description. 137 | 138 | ## [0.7.1] - 09/05/2020 139 | 140 | * Update package description. 141 | 142 | ## [0.7.0] - 09/05/2020 143 | 144 | * First release with an example. 145 | -------------------------------------------------------------------------------- /packages/chat_bubbles/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributor Guidelines 2 | 3 | Thank you for your interest in contributing to our Flutter plugin! We welcome all contributions, whether it's filing an issue, creating a pull request, or helping other community members with their questions. To ensure a positive and productive experience for everyone, please review the following guidelines before contributing. 4 | 5 | ## Issues 6 | 7 | If you find a bug or have a feature request, please create an issue in the GitHub repository. Before creating an issue, please search for existing issues to avoid creating duplicates. When creating a new issue, please provide the following information: 8 | 9 | - A clear and descriptive title 10 | - A detailed description of the issue, including any error messages or stack traces 11 | - Steps to reproduce the issue 12 | - Expected behavior 13 | - Any additional information or screenshots that can help us understand the issue better 14 | 15 | ## Pull Requests 16 | 17 | We welcome pull requests from contributors of all skill levels. Before creating a pull request, please make sure that: 18 | 19 | - The code follows our [coding standards](#coding-standards). 20 | - All tests pass locally. 21 | - The pull request has a clear and descriptive title. 22 | - The pull request includes a detailed description of the changes made. 23 | - The pull request includes any necessary documentation changes. 24 | 25 | ## Coding Standards 26 | 27 | To maintain consistency and readability, we follow the [Flutter Style Guide](https://flutter.dev/docs/development/style-guide). Please make sure that your code follows these guidelines before submitting a pull request. 28 | 29 | ## License 30 | 31 | By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE). 32 | 33 | ## Attribution 34 | 35 | This contributor guidelines document is adapted from the [Atom Contributor Guidelines](https://github.com/atom/atom/blob/master/CONTRIBUTING.md). 36 | 37 | ## Conclusion 38 | 39 | We value your contributions and look forward to working with you! If you have any questions, please do not hesitate to reach out to the project team or community members for help. 40 | -------------------------------------------------------------------------------- /packages/chat_bubbles/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Prabhanu Gunaweera 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/chat_bubbles/images/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/logo/logo.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/messages/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/messages/img1.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_12_29_main1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_12_29_main1.jpg -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_12_29_main2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_12_29_main2.jpg -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_2_4_main1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_2_4_main1.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_2_4_main2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_2_4_main2.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_7_3_main1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_7_3_main1.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/2022_7_3_main2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_7_3_main2.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/audio_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/audio_bubble.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/datechip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/datechip.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/image_bubble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/image_bubble.jpg -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/imsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/imsg.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/imsg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/imsg1.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/messagebar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/messagebar.jpeg -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_1.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_1_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_1_old.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_2.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_2_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_2_old.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_3_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_3_old.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/screenshot_4_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_4_old.png -------------------------------------------------------------------------------- /packages/chat_bubbles/images/screenshots/single_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/single_bubble.png -------------------------------------------------------------------------------- /packages/chat_bubbles/lib/algo/algo.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_bubbles/date_chips/date_chip.dart'; 2 | 3 | import './date_chip_text.dart'; 4 | 5 | ///all the algorithms of the plugin 6 | ///[dateChipText] to get the text which is need to show on the [DateChip] 7 | abstract class Algo { 8 | Algo._(); 9 | 10 | static String dateChipText(final DateTime date) { 11 | final dateChipText = DateChipText(date); 12 | return dateChipText.getText(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/chat_bubbles/lib/algo/date_chip_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | ///initial formatter to find the date txt 4 | final DateFormat _formatter = DateFormat('yyyy-MM-dd'); 5 | 6 | ///[DateChipText] class included with algorithms which are need to implement [DateChip] 7 | ///[date] parameter is required 8 | /// 9 | class DateChipText { 10 | final DateTime date; 11 | 12 | DateChipText(this.date); 13 | 14 | ///generate and return [DateChip] string 15 | /// 16 | /// 17 | String getText() { 18 | final now = DateTime.now(); 19 | if (_formatter.format(now) == _formatter.format(date)) { 20 | return 'Today'; 21 | } else if (_formatter.format(DateTime(now.year, now.month, now.day - 1)) == 22 | _formatter.format(date)) { 23 | return 'Yesterday'; 24 | } else { 25 | return '${DateFormat('d').format(date)} ${DateFormat('MMMM').format(date)} ${DateFormat('y').format(date)}'; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/chat_bubbles/lib/chat_bubbles.dart: -------------------------------------------------------------------------------- 1 | library chat_bubbles; 2 | 3 | /// 4 | /// all the widgets of the package export here 5 | /// CHAT BUBBLES 6 | /// [BubbleNormal] 7 | /// [BubbleSpecialOne] 8 | /// [BubbleSpecialTwo] 9 | /// [BubbleNormalAudio] 10 | /// [BubbleSpecialThree] 11 | /// [BubbleNormalImage] 12 | /// 13 | /// DATE CHIPS 14 | /// [DateChip] 15 | /// 16 | /// MESSAGE BARS 17 | /// [MessageBar] 18 | /// widgets UI components are currently available 19 | /// 20 | /// 21 | /// 22 | export 'bubbles/bubble_special_three.dart'; 23 | export 'date_chips/date_chip.dart'; 24 | export 'message_bars/message_bar.dart'; 25 | export 'bubbles/bubble_normal_image.dart'; 26 | -------------------------------------------------------------------------------- /packages/chat_bubbles/lib/date_chips/date_chip.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_bubbles/algo/algo.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | ///[DateChip] use to show the date breakers on the chat view 5 | ///[date] parameter is required 6 | ///[color] parameter is optional default color code `8AD3D5` 7 | /// 8 | /// 9 | class DateChip extends StatelessWidget { 10 | final DateTime date; 11 | final Color color; 12 | final Color dateColor; 13 | 14 | /// 15 | /// 16 | /// 17 | const DateChip({ 18 | Key? key, 19 | required this.date, 20 | this.color = const Color(0x558AD3D5), 21 | this.dateColor = const Color(0x558AD3D5), 22 | }) : super(key: key); 23 | @override 24 | Widget build(BuildContext context) { 25 | return Center( 26 | child: Padding( 27 | padding: const EdgeInsets.only( 28 | top: 7, 29 | bottom: 7, 30 | ), 31 | child: Container( 32 | decoration: BoxDecoration( 33 | borderRadius: const BorderRadius.all(Radius.circular(6)), 34 | color: color, 35 | ), 36 | child: Padding( 37 | padding: const EdgeInsets.all(5.0), 38 | child: Text( 39 | Algo.dateChipText(date), 40 | style: TextStyle( 41 | color: dateColor, 42 | ), 43 | ), 44 | ), 45 | ), 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/chat_bubbles/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_bubbles 2 | description: Flutter chat bubble widgets, similar to Whatsapp and more shapes. Easy to use and implement 3 | chat bubbles. 4 | version: 1.6.0 5 | homepage: https://github.com/prahack/chat_bubbles 6 | 7 | environment: 8 | sdk: ">=2.12.0 <4.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | intl: ^0.19.0 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | screenshots: 20 | - description: The Flutter chat_bubbles package logo. 21 | path: images/logo/logo.png 22 | 23 | flutter: 24 | 25 | -------------------------------------------------------------------------------- /packages/chat_bubbles/test/chatbubbles_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | build-and-test: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Setup Flutter environment 17 | uses: subosito/flutter-action@v2 18 | with: 19 | channel: 'stable' 20 | 21 | - name: Install dependencies 22 | run: flutter pub get 23 | 24 | - run: dart format . --set-exit-if-changed 25 | - run: flutter analyze --no-pub 26 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .classpath 21 | .project 22 | .settings/ 23 | .vscode/ 24 | 25 | # Flutter repo-specific 26 | /bin/cache/ 27 | /bin/internal/bootstrap.bat 28 | /bin/internal/bootstrap.sh 29 | /bin/mingit/ 30 | /dev/benchmarks/mega_gallery/ 31 | /dev/bots/.recipe_deps 32 | /dev/bots/android_tools/ 33 | /dev/devicelab/ABresults*.json 34 | /dev/docs/doc/ 35 | /dev/docs/flutter.docs.zip 36 | /dev/docs/lib/ 37 | /dev/docs/pubspec.yaml 38 | /dev/integration_tests/**/xcuserdata 39 | /dev/integration_tests/**/Pods 40 | /packages/flutter/coverage/ 41 | version 42 | analysis_benchmark.json 43 | 44 | # packages file containing multi-root paths 45 | .packages.generated 46 | 47 | # Flutter/Dart/Pub related 48 | **/doc/api/ 49 | .dart_tool/ 50 | .flutter-plugins 51 | .flutter-plugins-dependencies 52 | **/generated_plugin_registrant.dart 53 | .packages 54 | .pub-cache/ 55 | .pub/ 56 | build/ 57 | flutter_*.png 58 | linked_*.ds 59 | unlinked.ds 60 | unlinked_spec.ds 61 | 62 | # Android related 63 | **/android/**/gradle-wrapper.jar 64 | **/android/.gradle 65 | **/android/captures/ 66 | **/android/gradlew 67 | **/android/gradlew.bat 68 | **/android/local.properties 69 | **/android/**/GeneratedPluginRegistrant.java 70 | **/android/key.properties 71 | *.jks 72 | 73 | # iOS/XCode related 74 | **/ios/**/*.mode1v3 75 | **/ios/**/*.mode2v3 76 | **/ios/**/*.moved-aside 77 | **/ios/**/*.pbxuser 78 | **/ios/**/*.perspectivev3 79 | **/ios/**/*sync/ 80 | **/ios/**/.sconsign.dblite 81 | **/ios/**/.tags* 82 | **/ios/**/.vagrant/ 83 | **/ios/**/DerivedData/ 84 | **/ios/**/Icon? 85 | **/ios/**/Pods/ 86 | **/ios/**/.symlinks/ 87 | **/ios/**/profile 88 | **/ios/**/xcuserdata 89 | **/ios/.generated/ 90 | **/ios/Flutter/.last_build_id 91 | **/ios/Flutter/App.framework 92 | **/ios/Flutter/Flutter.framework 93 | **/ios/Flutter/Flutter.podspec 94 | **/ios/Flutter/Generated.xcconfig 95 | **/ios/Flutter/ephemeral 96 | **/ios/Flutter/app.flx 97 | **/ios/Flutter/app.zip 98 | **/ios/Flutter/flutter_assets/ 99 | **/ios/Flutter/flutter_export_environment.sh 100 | **/ios/ServiceDefinitions.json 101 | **/ios/Runner/GeneratedPluginRegistrant.* 102 | 103 | # macOS 104 | **/macos/Flutter/GeneratedPluginRegistrant.swift 105 | 106 | # Coverage 107 | coverage/ 108 | 109 | # Symbols 110 | app.*.symbols 111 | 112 | # Exceptions to above rules. 113 | !**/ios/**/default.mode1v3 114 | !**/ios/**/default.mode2v3 115 | !**/ios/**/default.pbxuser 116 | !**/ios/**/default.perspectivev3 117 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 118 | !/dev/ci/**/Gemfile.lock 119 | !**/ios/**/Podfile.lock 120 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Oleksandr Demchenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/README.md: -------------------------------------------------------------------------------- 1 | # Flutter Link Previewer 2 | 3 | [![Pub](https://img.shields.io/pub/v/flutter_link_previewer)](https://pub.dartlang.org/packages/flutter_link_previewer) 4 | [![build](https://github.com/flyerhq/flutter_link_previewer/workflows/build/badge.svg)](https://github.com/flyerhq/flutter_link_previewer/actions?query=workflow%3Abuild) 5 | [![CodeFactor](https://www.codefactor.io/repository/github/flyerhq/flutter_link_previewer/badge)](https://www.codefactor.io/repository/github/flyerhq/flutter_link_previewer) 6 | 7 | Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications. 8 | 9 |
10 | 11 |

12 | 🇺🇦🇺🇦 We are Ukrainians. If you enjoy our work, please consider donating to help save our country. 🇺🇦🇺🇦 13 |

14 | 15 |
16 | 17 | 18 | 19 | ## Getting Started 20 | 21 | ```dart 22 | import 'package:flutter_link_previewer/flutter_link_previewer.dart'; 23 | 24 | LinkPreview( 25 | enableAnimation: true, 26 | onPreviewDataFetched: (data) { 27 | setState(() { 28 | // Save preview data to the state 29 | }); 30 | }, 31 | previewData: _previewData, // Pass the preview data from the state 32 | text: 'https://flyer.chat', 33 | width: MediaQuery.of(context).size.width, 34 | ) 35 | ``` 36 | 37 | ## Customization 38 | 39 | ```dart 40 | final style = TextStyle( 41 | color: Colors.red, 42 | fontSize: 16, 43 | fontWeight: FontWeight.w500, 44 | height: 1.375, 45 | ); 46 | 47 | 48 | LinkPreview( 49 | linkStyle: style, 50 | metadataTextStyle: style.copyWith( 51 | fontSize: 14, 52 | fontWeight: FontWeight.w400, 53 | ), 54 | metadataTitleStyle: style.copyWith( 55 | fontWeight: FontWeight.w800, 56 | ), 57 | padding: EdgeInsets.symmetric( 58 | horizontal: 24, 59 | vertical: 16, 60 | ), 61 | onPreviewDataFetched: _onPreviewDataFetched, 62 | previewData: _previewData, 63 | text: 'https://flyer.chat', 64 | textStyle: style, 65 | width: width, 66 | ); 67 | ``` 68 | 69 | ## License 70 | 71 | [MIT](LICENSE) 72 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | plugins: 3 | - dart_code_metrics 4 | 5 | # This file configures the analyzer, which statically analyzes Dart code to 6 | # check for errors, warnings, and lints. 7 | # 8 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 9 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 10 | # invoked from the command line by running `flutter analyze`. 11 | 12 | # The following line activates a set of recommended lints for Flutter apps, 13 | # packages, and plugins designed to encourage good coding practices. 14 | include: package:flutter_lints/flutter.yaml 15 | 16 | linter: 17 | # The lint rules applied to this project can be customized in the 18 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 19 | # included above or to enable additional rules. A list of all available lints 20 | # and their documentation is published at 21 | # https://dart-lang.github.io/linter/lints/index.html. 22 | # 23 | # Instead of disabling a lint rule for the entire project in the 24 | # section below, it can also be suppressed for a single line of code 25 | # or a specific dart file by using the `// ignore: name_of_lint` and 26 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 27 | # producing the lint. 28 | rules: 29 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 30 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 31 | - always_declare_return_types 32 | - avoid_unused_constructor_parameters 33 | - directives_ordering 34 | - omit_local_variable_types 35 | - prefer_expression_function_bodies 36 | - prefer_final_fields 37 | - prefer_final_locals 38 | - prefer_relative_imports 39 | - prefer_single_quotes 40 | - sized_box_for_whitespace 41 | - sort_child_properties_last 42 | - sort_pub_dependencies 43 | - type_annotate_public_apis 44 | - unawaited_futures 45 | - use_named_constants 46 | - use_super_parameters 47 | 48 | # Additional information about this file can be found at 49 | # https://dart.dev/guides/language/analysis-options 50 | 51 | dart_code_metrics: 52 | rules: 53 | - always-remove-listener 54 | - avoid-unused-parameters 55 | - format-comment 56 | - member-ordering: 57 | alphabetize: false 58 | order: 59 | - constructors 60 | - public-fields 61 | - public-getters 62 | - public-setters 63 | - private-fields 64 | - private-getters 65 | - private-setters 66 | - public-methods 67 | - private-methods 68 | - no-boolean-literal-compare 69 | - prefer-trailing-comma 70 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/lib/flutter_link_previewer.dart: -------------------------------------------------------------------------------- 1 | library flutter_link_previewer; 2 | 3 | export 'src/types.dart'; 4 | export 'src/utils.dart' show getPreviewData, regexEmail, regexLink; 5 | export 'src/widgets/link_preview.dart'; 6 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/lib/src/types.dart: -------------------------------------------------------------------------------- 1 | import 'package:meta/meta.dart'; 2 | 3 | /// Represents the size object. 4 | @immutable 5 | class Size { 6 | /// Creates [Size] from width and height. 7 | const Size({ 8 | required this.height, 9 | required this.width, 10 | }); 11 | 12 | /// Height. 13 | final double height; 14 | 15 | /// Width. 16 | final double width; 17 | } 18 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/lib/src/url_linkifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:linkify/linkify.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | final _urlRegex = RegExp( 5 | r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].[^\s]*)', 6 | caseSensitive: false, 7 | dotAll: true, 8 | ); 9 | 10 | final _looseUrlRegex = RegExp( 11 | r'^(.*?)((https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))', 12 | caseSensitive: false, 13 | dotAll: true, 14 | ); 15 | 16 | final _protocolIdentifierRegex = RegExp( 17 | r'^(https?:\/\/)', 18 | caseSensitive: false, 19 | ); 20 | 21 | /// Utility class that implements [Linkifier.parse] method. 22 | /// Used to find links in the text. 23 | class UrlLinkifier extends Linkifier { 24 | /// Default constructor. 25 | const UrlLinkifier(); 26 | 27 | /// Parses text to find all links inside it. 28 | @override 29 | List parse( 30 | List elements, 31 | LinkifyOptions options, 32 | ) { 33 | final list = []; 34 | 35 | for (final element in elements) { 36 | if (element is TextElement) { 37 | var loose = false; 38 | var match = _urlRegex.firstMatch(element.text); 39 | 40 | if (match?.group(1)?.isNotEmpty == true) { 41 | final looseMatch = _looseUrlRegex.firstMatch(match!.group(1)!); 42 | if (looseMatch != null) { 43 | match = looseMatch; 44 | loose = true; 45 | } 46 | } 47 | 48 | if (match == null && options.looseUrl) { 49 | match = _looseUrlRegex.firstMatch(element.text); 50 | loose = true; 51 | } 52 | 53 | if (match == null) { 54 | list.add(element); 55 | } else { 56 | final text = element.text.replaceFirst(match.group(0)!, ''); 57 | 58 | if (match.group(1)?.isNotEmpty == true) { 59 | list.add(TextElement(match.group(1)!)); 60 | } 61 | 62 | if (match.group(2)?.isNotEmpty == true) { 63 | var originalUrl = match.group(2)!; 64 | String? end; 65 | 66 | if (options.excludeLastPeriod && 67 | originalUrl[originalUrl.length - 1] == '.') { 68 | end = '.'; 69 | originalUrl = originalUrl.substring(0, originalUrl.length - 1); 70 | } 71 | 72 | final url = originalUrl; 73 | 74 | if (loose || !originalUrl.startsWith(_protocolIdentifierRegex)) { 75 | originalUrl = (options.defaultToHttps ? 'https://' : 'http://') + 76 | originalUrl; 77 | } 78 | 79 | list.add( 80 | UrlElement( 81 | originalUrl, 82 | url, 83 | ), 84 | ); 85 | 86 | if (end != null) { 87 | list.add(TextElement(end)); 88 | } 89 | } 90 | 91 | if (text.isNotEmpty) { 92 | list.addAll(parse([TextElement(text)], options)); 93 | } 94 | } 95 | } else { 96 | list.add(element); 97 | } 98 | } 99 | 100 | return list; 101 | } 102 | } 103 | 104 | /// Represents an element containing a link. 105 | @immutable 106 | class UrlElement extends LinkableElement { 107 | /// Creates [UrlElement]. 108 | UrlElement(String url, [String? text]) : super(text, url); 109 | 110 | @override 111 | // ignore: unnecessary_overrides 112 | int get hashCode => super.hashCode; 113 | 114 | @override 115 | bool operator ==(Object other) => equals(other); 116 | 117 | @override 118 | // ignore: type_annotate_public_apis 119 | bool equals(other) => other is UrlElement && super.equals(other); 120 | 121 | @override 122 | String toString() => "LinkElement: '$url' ($text)"; 123 | } 124 | -------------------------------------------------------------------------------- /packages/flutter_link_previewer/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_link_previewer 2 | description: > 3 | Customizable link and URL preview extracted from the 4 | provided text with the ability to render from the cache. Ideal 5 | for chat applications. 6 | version: 3.2.2 7 | homepage: https://flyer.chat 8 | repository: https://github.com/flyerhq/flutter_link_previewer 9 | 10 | environment: 11 | sdk: '>=2.19.0 <4.0.0' 12 | flutter: '>=3.0.0' 13 | 14 | dependencies: 15 | flutter: 16 | sdk: flutter 17 | flutter_chat_types: ^3.6.2 18 | flutter_linkify: ^6.0.0 19 | html: ^0.15.4 20 | http: '>=0.13.6 <2.0.0' 21 | linkify: ^5.0.0 22 | meta: '>=1.8.0 <2.0.0' 23 | url_launcher: ^6.1.12 24 | 25 | dev_dependencies: 26 | dart_code_metrics: ^5.7.5 27 | flutter_lints: ^2.0.2 28 | flutter_test: 29 | sdk: flutter 30 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chatchat 2 | description: "A new Flutter project." 3 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 4 | 5 | version: 1.5.6+1 6 | 7 | environment: 8 | sdk: ^3.5.1 9 | 10 | dependencies: 11 | awesome_dialog: ^3.2.1 12 | cached_network_image: ^3.3.1 13 | chat_bubbles: 14 | path: packages/chat_bubbles/ 15 | cloud_firestore: ^5.2.1 16 | cupertino_icons: ^1.0.8 17 | dio: ^5.6.0 18 | easy_localization: ^3.0.7 19 | firebase_auth: ^5.1.4 20 | firebase_core: ^3.3.0 21 | firebase_messaging: ^15.0.4 22 | firebase_storage: ^12.1.3 23 | flutter: 24 | sdk: flutter 25 | flutter_chat_types: ^3.6.2 26 | flutter_link_previewer: 27 | path: packages/flutter_link_previewer/ 28 | flutter_local_notifications: ^17.2.2 29 | flutter_native_splash: ^2.4.1 30 | flutter_offline: ^4.0.0 31 | flutter_screenutil: ^5.9.3 32 | flutter_speed_dial: ^7.0.0 33 | flutter_svg: ^2.0.10+1 34 | gallery_saver: ^2.3.2 35 | gap: ^3.0.1 36 | google_sign_in: ^6.2.1 37 | googleapis_auth: ^1.6.0 38 | image_picker: ^1.1.2 39 | intl: ^0.19.0 40 | local_auth: ^2.3.0 41 | lottie: ^3.1.2 42 | modal_bottom_sheet: ^3.0.0 43 | package_info_plus: ^8.0.2 44 | path_provider: ^2.1.4 45 | pretty_dio_logger: ^1.4.0 46 | pub_semver: ^2.1.4 47 | restart_app: ^1.2.1 48 | shared_preferences: ^2.3.2 49 | url_launcher: ^6.3.0 50 | 51 | dev_dependencies: 52 | flutter_lints: ^3.0.2 53 | flutter_test: 54 | sdk: flutter 55 | 56 | dependency_overrides: 57 | http: ^0.13.3 58 | 59 | flutter: 60 | uses-material-design: true 61 | 62 | assets: 63 | - assets/images/ 64 | - assets/lottie/ 65 | - assets/translations/ 66 | - assets/svgs/ 67 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:chatchat/chatchat.dart'; 9 | import 'package:chatchat/router/app_routes.dart'; 10 | import 'package:flutter/material.dart'; 11 | import 'package:flutter_test/flutter_test.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget( 17 | ChatChat( 18 | appRoute: AppRoute(), 19 | ), 20 | ); 21 | 22 | // Verify that our counter starts at 0. 23 | expect(find.text('0'), findsOneWidget); 24 | expect(find.text('1'), findsNothing); 25 | 26 | // Tap the '+' icon and trigger a frame. 27 | await tester.tap(find.byIcon(Icons.add)); 28 | await tester.pump(); 29 | 30 | // Verify that our counter has incremented. 31 | expect(find.text('0'), findsNothing); 32 | expect(find.text('1'), findsOneWidget); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatchat", 3 | "short_name": "chatchat", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /web/splash/img/dark-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-1x.png -------------------------------------------------------------------------------- /web/splash/img/dark-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-2x.png -------------------------------------------------------------------------------- /web/splash/img/dark-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-3x.png -------------------------------------------------------------------------------- /web/splash/img/dark-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-4x.png -------------------------------------------------------------------------------- /web/splash/img/light-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-1x.png -------------------------------------------------------------------------------- /web/splash/img/light-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-2x.png -------------------------------------------------------------------------------- /web/splash/img/light-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-3x.png -------------------------------------------------------------------------------- /web/splash/img/light-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-4x.png -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | void RegisterPlugins(flutter::PluginRegistry* registry) { 20 | CloudFirestorePluginCApiRegisterWithRegistrar( 21 | registry->GetRegistrarForPlugin("CloudFirestorePluginCApi")); 22 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 23 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 24 | FileSelectorWindowsRegisterWithRegistrar( 25 | registry->GetRegistrarForPlugin("FileSelectorWindows")); 26 | FirebaseAuthPluginCApiRegisterWithRegistrar( 27 | registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); 28 | FirebaseCorePluginCApiRegisterWithRegistrar( 29 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 30 | FirebaseStoragePluginCApiRegisterWithRegistrar( 31 | registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi")); 32 | LocalAuthPluginRegisterWithRegistrar( 33 | registry->GetRegistrarForPlugin("LocalAuthPlugin")); 34 | RivePluginRegisterWithRegistrar( 35 | registry->GetRegistrarForPlugin("RivePlugin")); 36 | UrlLauncherWindowsRegisterWithRegistrar( 37 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 38 | } 39 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | cloud_firestore 7 | connectivity_plus 8 | file_selector_windows 9 | firebase_auth 10 | firebase_core 11 | firebase_storage 12 | local_auth_windows 13 | rive_common 14 | url_launcher_windows 15 | ) 16 | 17 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 18 | ) 19 | 20 | set(PLUGIN_BUNDLED_LIBRARIES) 21 | 22 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 24 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 26 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 27 | endforeach(plugin) 28 | 29 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 30 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 31 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 32 | endforeach(ffi_plugin) 33 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "chatchat" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "chatchat" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "chatchat.exe" "\0" 98 | VALUE "ProductName", "chatchat" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"chatchat", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------