├── todo.txt ├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt ├── my_application.h ├── my_application.cc └── CMakeLists.txt ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── _ │ │ │ │ ├── 16.png │ │ │ │ ├── 20.png │ │ │ │ ├── 29.png │ │ │ │ ├── 32.png │ │ │ │ ├── 40.png │ │ │ │ ├── 48.png │ │ │ │ ├── 50.png │ │ │ │ ├── 55.png │ │ │ │ ├── 57.png │ │ │ │ ├── 58.png │ │ │ │ ├── 60.png │ │ │ │ ├── 64.png │ │ │ │ ├── 66.png │ │ │ │ ├── 72.png │ │ │ │ ├── 76.png │ │ │ │ ├── 80.png │ │ │ │ ├── 87.png │ │ │ │ ├── 88.png │ │ │ │ ├── 92.png │ │ │ │ ├── 100.png │ │ │ │ ├── 102.png │ │ │ │ ├── 1024.png │ │ │ │ ├── 114.png │ │ │ │ ├── 120.png │ │ │ │ ├── 128.png │ │ │ │ ├── 144.png │ │ │ │ ├── 152.png │ │ │ │ ├── 167.png │ │ │ │ ├── 172.png │ │ │ │ ├── 180.png │ │ │ │ ├── 196.png │ │ │ │ ├── 216.png │ │ │ │ ├── 256.png │ │ │ │ └── 512.png │ │ │ └── Contents.json │ │ └── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── thumbnail.png ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner.xcodeproj │ ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── Runner.xcscheme ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── assets ├── images │ ├── send.png │ ├── preview.png │ └── search_white.png └── fonts │ └── overpass_regular.otf ├── lib ├── services │ ├── modal │ │ └── user.dart │ ├── auth_service.dart │ └── database_service.dart ├── helper │ └── helper_functions.dart ├── widgets │ ├── group_tile.dart │ ├── widgets.dart │ └── message_tile.dart ├── main.dart └── views │ ├── chat_screen.dart │ ├── profile_screen.dart │ ├── search_screen.dart │ ├── sing_in.dart │ ├── sing_up.dart │ ├── group_info.dart │ └── home.dart ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── 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 │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── quiz │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── google-services.json │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ ├── win32_window.h │ └── win32_window.cpp ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt ├── .gitignore └── CMakeLists.txt ├── README.md ├── .gitignore ├── test └── widget_test.dart ├── analysis_options.yaml ├── .metadata ├── pubspec.yaml └── pubspec.lock /todo.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/thumbnail.png -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/web/favicon.png -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /assets/images/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/assets/images/send.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /assets/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/assets/images/preview.png -------------------------------------------------------------------------------- /lib/services/modal/user.dart: -------------------------------------------------------------------------------- 1 | class User { 2 | String userId; 3 | User({required this.userId}); 4 | } 5 | -------------------------------------------------------------------------------- /assets/images/search_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/assets/images/search_white.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /assets/fonts/overpass_regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/assets/fonts/overpass_regular.otf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/66.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/66.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/88.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/92.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/92.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/102.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/_/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdelhai1/Chat-App/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/quiz/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.quiz 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /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.4-all.zip 6 | -------------------------------------------------------------------------------- /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 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /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/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.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/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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/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 = chat_app 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatApp 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 firebase_auth 10 | import firebase_core 11 | import shared_preferences_foundation 12 | 13 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 14 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 15 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 16 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 17 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 18 | } 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chat app : 2 | 3 | Application of the g chat, developed using Flutter & Dart. 4 | 5 | 6 | 7 | ![Flutter ChatApp with firebase](thumbnail.png) 8 | 9 | 10 | ## 🎯 Main Features 11 | ✅ Create new account (name and email and password or with Gmail) 12 | 13 | ✅ Works online 14 | 15 | ✅ search for groups by the name 16 | 17 | ✅ Profile page 18 | 19 | ✅ Groups page 20 | 21 | ✅ Chat page with Grouo info contains the admin and group members 22 | 23 | ✅ Can create your own group 24 | 25 | 🔜 Profile photo (comming soon) 26 | 27 | 28 | 29 | 30 | ## ⚙ Installation steps 31 | 32 | You can copy anything from the code source. 33 | 34 | 35 | ## 🧑 Author 36 | 37 | __Guir md Abdelhai__ 38 | 39 | If you liked the repo then kindly support it by giving it a star ⭐! 40 | 41 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.13' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /.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 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /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 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chat_app", 3 | "short_name": "chat_app", 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /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:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:chat_app/main.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(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.CreateAndShow(L"chat_app", 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 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "819075718473", 4 | "project_id": "haiochatapp", 5 | "storage_bucket": "haiochatapp.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:819075718473:android:8fa8333fdfc6a99e578e98", 11 | "android_client_info": { 12 | "package_name": "com.example.quiz" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "819075718473-nn8q7fpv1bs9i1u8sm8ehc97pf13rj23.apps.googleusercontent.com", 18 | "client_type": 1, 19 | "android_info": { 20 | "package_name": "com.example.quiz", 21 | "certificate_hash": "c869dca32213ea1ca6d6cdfd9e222542055a2821" 22 | } 23 | }, 24 | { 25 | "client_id": "819075718473-qgmudeaj0ucrat7sl8mocfn1pnk7vbdc.apps.googleusercontent.com", 26 | "client_type": 3 27 | } 28 | ], 29 | "api_key": [ 30 | { 31 | "current_key": "AIzaSyDjjljO6QaVZIJl0zcS2luLM_Q2fpGAGYY" 32 | } 33 | ], 34 | "services": { 35 | "appinvite_service": { 36 | "other_platform_oauth_client": [ 37 | { 38 | "client_id": "819075718473-qgmudeaj0ucrat7sl8mocfn1pnk7vbdc.apps.googleusercontent.com", 39 | "client_type": 3 40 | } 41 | ] 42 | } 43 | } 44 | } 45 | ], 46 | "configuration_version": "1" 47 | } -------------------------------------------------------------------------------- /lib/helper/helper_functions.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class HelperFunctions { 4 | //keys 5 | static String userLoggedInKey = "LOGGEDINKEY"; 6 | static String userNameKey = "USERNAMEKEY"; 7 | static String userEmailKey = "USEREMAILKEY"; 8 | //saving data from sf 9 | static Future saveUserLoggedinStatus(bool isUserLoggedIn) async { 10 | SharedPreferences sf = await SharedPreferences.getInstance(); 11 | return await sf.setBool(userLoggedInKey, isUserLoggedIn); 12 | } 13 | static Future saveUserNamesf(String userName) async { 14 | SharedPreferences sf = await SharedPreferences.getInstance(); 15 | return await sf.setString(userNameKey, userName); 16 | } 17 | static Future saveUserEmailsf(String userEmail) async { 18 | SharedPreferences sf = await SharedPreferences.getInstance(); 19 | return await sf.setString(userEmailKey, userEmail); 20 | } 21 | //getting data from sf 22 | static Future getUserLoggedInStatus() async { 23 | SharedPreferences sf = await SharedPreferences.getInstance(); 24 | return sf.getBool(userLoggedInKey); 25 | } 26 | static Future getUserNamefromsf() async { 27 | SharedPreferences sf = await SharedPreferences.getInstance(); 28 | return sf.getString(userNameKey); 29 | } 30 | static Future getUserEmailfromsf() async { 31 | SharedPreferences sf = await SharedPreferences.getInstance(); 32 | return sf.getString(userEmailKey); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/services/auth_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/helper/helper_functions.dart'; 2 | import 'package:chat_app/services/database_service.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | 5 | class AuthService { 6 | final FirebaseAuth firebaseAuth = FirebaseAuth.instance; 7 | 8 | //login 9 | Future loginUserWithEmailandPassword( 10 | String email, String password) async { 11 | try { 12 | User user = (await firebaseAuth.signInWithEmailAndPassword( 13 | email: email, password: password)) 14 | .user!; 15 | 16 | if (user != null) { 17 | return true; 18 | } 19 | } on FirebaseAuthException catch (e) { 20 | return e.message; 21 | } 22 | } 23 | //register 24 | Future registerUserWithEmailandPassword( 25 | String fullname, String email, String password) async { 26 | try { 27 | User user = (await firebaseAuth.createUserWithEmailAndPassword( 28 | email: email, password: password)) 29 | .user!; 30 | 31 | if (user != null) { 32 | //update user data 33 | await DatabaseService(uid: user.uid).saveUserData(fullname, email); 34 | return true; 35 | } 36 | } on FirebaseAuthException catch (e) { 37 | return e.message; 38 | } 39 | } 40 | 41 | //signout 42 | Future signOut() async { 43 | try { 44 | await HelperFunctions.saveUserLoggedinStatus(false); 45 | await HelperFunctions.saveUserNamesf(""); 46 | await HelperFunctions.saveUserEmailsf(""); 47 | await firebaseAuth.signOut(); 48 | } catch (e) { 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/group_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/views/chat_screen.dart'; 2 | import 'package:chat_app/widgets/widgets.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class GroupTile extends StatefulWidget { 6 | final String username; 7 | final String groupid; 8 | final String groupname; 9 | const GroupTile( 10 | {super.key, 11 | required this.groupid, 12 | required this.groupname, 13 | required this.username}); 14 | 15 | @override 16 | State createState() => _GroupTileState(); 17 | } 18 | 19 | class _GroupTileState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | return GestureDetector( 23 | onTap: () { 24 | nextScreen(context, ChatScreen(groupid: widget.groupid,groupname: widget.groupname,username: widget.username,)); 25 | }, 26 | child: Container( 27 | padding: EdgeInsets.symmetric(vertical: 10, horizontal: 5), 28 | child: ListTile( 29 | leading: CircleAvatar( 30 | radius: 30, 31 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 32 | child: Text( 33 | widget.groupname.substring(0, 1).toUpperCase(), 34 | textAlign: TextAlign.center, 35 | style: const TextStyle( 36 | color: Colors.white, fontWeight: FontWeight.w500), 37 | ), 38 | ), 39 | title: Text( 40 | widget.groupname, 41 | style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white), 42 | ), 43 | subtitle: Text( 44 | "join the conversation as ${widget.username}", 45 | style: TextStyle(color: Colors.grey, fontSize: 13), 46 | ), 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.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. 5 | 6 | version: 7 | revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 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: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 17 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 18 | - platform: android 19 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 20 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 21 | - platform: ios 22 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 23 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 24 | - platform: linux 25 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 26 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 27 | - platform: macos 28 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 29 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 30 | - platform: web 31 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 32 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 33 | - platform: windows 34 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 35 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 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 | -------------------------------------------------------------------------------- /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_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Chat App 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | chat_app 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /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 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/helper/helper_functions.dart'; 2 | import 'package:chat_app/views/sing_in.dart'; 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'views/sing_in.dart'; 6 | import 'views/sing_up.dart'; 7 | import 'package:firebase_auth/firebase_auth.dart'; 8 | import 'package:firebase_auth_dart/firebase_auth_dart.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'views/home.dart'; 11 | 12 | void main() async { 13 | WidgetsFlutterBinding.ensureInitialized(); 14 | 15 | if (kIsWeb) { 16 | await Firebase.initializeApp( 17 | options: FirebaseOptions( 18 | apiKey: "AIzaSyDXxEN3F-JZJpv5EbioINkgXgwfsHATopo", 19 | appId: "1:819075718473:web:b122dbf588cdc762578e98", 20 | messagingSenderId: "819075718473", 21 | projectId: "haiochatapp")); 22 | } 23 | 24 | await Firebase.initializeApp(); 25 | runApp(const MyApp()); 26 | } 27 | 28 | class MyApp extends StatefulWidget { 29 | const MyApp({super.key}); 30 | 31 | @override 32 | State createState() => _MyAppState(); 33 | } 34 | 35 | class _MyAppState extends State { 36 | // This widget is the root of your application. 37 | bool _isSignedIn = false; 38 | @override 39 | void initState() { 40 | super.initState(); 41 | getUserLoggedInStatus(); 42 | } 43 | 44 | getUserLoggedInStatus() async { 45 | await HelperFunctions.getUserLoggedInStatus().then((value) { 46 | if (value != null) { 47 | setState(() { 48 | _isSignedIn = value; 49 | }); 50 | ; 51 | } 52 | }); 53 | } 54 | 55 | @override 56 | Widget build(BuildContext context) { 57 | return MaterialApp( 58 | title: 'Flutter Demo', 59 | debugShowCheckedModeBanner: false, 60 | theme: ThemeData( 61 | scaffoldBackgroundColor: Colors.black87, 62 | primarySwatch: Colors.blue, 63 | ), 64 | home: _isSignedIn ? HomePage() : singIn(), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /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 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | chat_app 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /lib/widgets/widgets.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/views/search_screen.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | AppBar appBarMain(BuildContext context) { 5 | return AppBar( 6 | title: Image.asset( 7 | 'assets/images/preview.png', 8 | height: 50, 9 | ), 10 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 11 | ); 12 | } 13 | 14 | AppBar appBarHome(BuildContext context) { 15 | return AppBar( 16 | centerTitle: true, 17 | elevation: 0, 18 | title: const Text( 19 | "Groups", 20 | style: TextStyle( 21 | fontWeight: FontWeight.bold, color: Colors.white, fontSize: 26), 22 | ), 23 | actions: [ 24 | IconButton( 25 | icon: const Icon( 26 | Icons.search, 27 | color: Colors.white, 28 | ), 29 | onPressed: () { 30 | nextScreen(context, searchScreen()); 31 | }, 32 | ) 33 | ], 34 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 35 | ); 36 | } 37 | 38 | InputDecoration textFieldInputDecoration(String hintText) { 39 | return InputDecoration( 40 | hintText: hintText, 41 | hintStyle: TextStyle(color: Colors.white54), 42 | focusedBorder: 43 | UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)), 44 | enabledBorder: 45 | UnderlineInputBorder(borderSide: BorderSide(color: Colors.white))); 46 | } 47 | 48 | TextStyle simpletextstyle() { 49 | return TextStyle(color: Colors.white, fontSize: 17); 50 | } 51 | 52 | TextStyle mediumtextstyle() { 53 | return TextStyle(color: Colors.white, fontSize: 20); 54 | } 55 | 56 | void nextScreen(context, Page) { 57 | Navigator.push(context, MaterialPageRoute(builder: (context) => Page)); 58 | } 59 | 60 | void nextScreenReplace(context, Page) { 61 | Navigator.pushReplacement( 62 | context, MaterialPageRoute(builder: (context) => Page)); 63 | } 64 | 65 | void showSnackBar(context, color, message) { 66 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 67 | content: Text( 68 | message, 69 | style: const TextStyle(fontSize: 14), 70 | ), 71 | backgroundColor: color, 72 | duration: const Duration(seconds: 2), 73 | action: SnackBarAction( 74 | label: "OK", 75 | onPressed: () {}, 76 | textColor: Colors.white, 77 | ), 78 | )); 79 | } 80 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | apply plugin: 'com.google.gms.google-services' 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.quiz" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 50 | minSdkVersion 21 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | multiDexEnabled true 55 | } 56 | 57 | buildTypes { 58 | release { 59 | // TODO: Add your own signing config for the release build. 60 | // Signing with the debug keys for now, so `flutter run --release` works. 61 | signingConfig signingConfigs.debug 62 | } 63 | } 64 | } 65 | 66 | flutter { 67 | source '../..' 68 | } 69 | 70 | dependencies { 71 | 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | implementation platform('com.google.firebase:firebase-bom:31.1.1') 74 | } 75 | -------------------------------------------------------------------------------- /lib/widgets/message_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MessageTile extends StatefulWidget { 4 | final String message; 5 | final String sender; 6 | final bool sentByMe; 7 | const MessageTile( 8 | {super.key, 9 | required this.message, 10 | required this.sender, 11 | required this.sentByMe}); 12 | 13 | @override 14 | State createState() => _MessageTileState(); 15 | } 16 | 17 | class _MessageTileState extends State { 18 | @override 19 | Widget build(BuildContext context) { 20 | return Container( 21 | padding: EdgeInsets.only( 22 | top: 4, 23 | bottom: 4, 24 | left: widget.sentByMe ? 0 : 24, 25 | right: widget.sentByMe ? 24 : 0), 26 | alignment: widget.sentByMe ? Alignment.centerRight : Alignment.centerLeft, 27 | child: Container( 28 | margin: widget.sentByMe 29 | ? const EdgeInsets.only(left: 30) 30 | : const EdgeInsets.only(right: 30), 31 | padding: EdgeInsets.only(top: 17, bottom: 17, right: 20, left: 20), 32 | decoration: BoxDecoration( 33 | color: widget.sentByMe 34 | ? Color.fromARGB(255, 168, 5, 200) 35 | : Colors.grey[700], 36 | borderRadius: widget.sentByMe 37 | ? const BorderRadius.only( 38 | topLeft: Radius.circular(20), 39 | topRight: Radius.circular(20), 40 | bottomLeft: Radius.circular(20)) 41 | : const BorderRadius.only( 42 | topLeft: Radius.circular(20), 43 | topRight: Radius.circular(20), 44 | bottomRight: Radius.circular(20))), 45 | child: Column( 46 | crossAxisAlignment: CrossAxisAlignment.start, 47 | children: [ 48 | Text( 49 | widget.sender.toUpperCase(), 50 | textAlign: TextAlign.center, 51 | style: const TextStyle( 52 | fontSize: 13, 53 | fontWeight: FontWeight.bold, 54 | color: Colors.white, 55 | letterSpacing: -0.5), 56 | ), 57 | SizedBox( 58 | height: 8, 59 | ), 60 | Text( 61 | widget.message, 62 | textAlign: TextAlign.center, 63 | style: const TextStyle( 64 | fontSize: 18, 65 | fontWeight: FontWeight.bold, 66 | color: Colors.white), 67 | ) 68 | ], 69 | ), 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /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", "chat_app" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "chat_app" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "chat_app.exe" "\0" 98 | VALUE "ProductName", "chat_app" "\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/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 and shows a win32 window with |title| and position and size 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 to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 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 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "chat_app"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "chat_app"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_app 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | # In Windows, build-name is used as the major, minor, and patch parts 19 | # of the product and file versions while build-number is used as the build suffix. 20 | version: 1.0.0+1 21 | 22 | environment: 23 | sdk: '>=2.18.5 <3.0.0' 24 | 25 | # Dependencies specify other packages that your package needs in order to work. 26 | # To automatically upgrade your package dependencies to the latest versions 27 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 28 | # dependencies can be manually updated by changing the version numbers below to 29 | # the latest version available on pub.dev. To see which dependencies have newer 30 | # versions available, run `flutter pub outdated`. 31 | dependencies: 32 | flutter: 33 | sdk: flutter 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | cupertino_icons: ^1.0.2 39 | firebase_auth: ^4.2.0 40 | firebase_auth_dart: ^1.0.1 41 | firebase_core: ^2.4.0 42 | shared_preferences: ^2.0.15 43 | cloud_firestore: ^4.3.0 44 | 45 | dev_dependencies: 46 | flutter_test: 47 | sdk: flutter 48 | 49 | # The "flutter_lints" package below contains a set of recommended lints to 50 | # encourage good coding practices. The lint set provided by the package is 51 | # activated in the `analysis_options.yaml` file located at the root of your 52 | # package. See that file for information about deactivating specific lint 53 | # rules and activating additional ones. 54 | flutter_lints: ^2.0.0 55 | 56 | # For information on the generic Dart part of this file, see the 57 | # following page: https://dart.dev/tools/pub/pubspec 58 | 59 | # The following section is specific to Flutter packages. 60 | flutter: 61 | 62 | # The following line ensures that the Material Icons font is 63 | # included with your application, so that you can use the icons in 64 | # the material Icons class. 65 | uses-material-design: true 66 | 67 | # To add assets to your application, add an assets section, like this: 68 | assets: 69 | - assets/images/ 70 | 71 | 72 | # An image asset can refer to one or more resolution-specific "variants", see 73 | # https://flutter.dev/assets-and-images/#resolution-aware 74 | 75 | # For details regarding adding assets from package dependencies, see 76 | # https://flutter.dev/assets-and-images/#from-packages 77 | 78 | # To add custom fonts to your application, add a fonts section here, 79 | # in this "flutter" section. Each entry in this list should have a 80 | # "family" key with the font family name, and a "fonts" key with a 81 | # list giving the asset and other descriptors for the font. For 82 | # example: 83 | # fonts: 84 | # - family: Schyler 85 | # fonts: 86 | # - asset: fonts/Schyler-Regular.ttf 87 | # - asset: fonts/Schyler-Italic.ttf 88 | # style: italic 89 | # - family: Trajan Pro 90 | # fonts: 91 | # - asset: fonts/TrajanPro.ttf 92 | # - asset: fonts/TrajanPro_Bold.ttf 93 | # weight: 700 94 | # 95 | # For details regarding fonts from package dependencies, 96 | # see https://flutter.dev/custom-fonts/#from-packages 97 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(chat_app LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "chat_app") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /lib/services/database_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | 3 | class DatabaseService { 4 | final String? uid; 5 | // ignore: use_function_type_syntax_for_parameters 6 | DatabaseService({this.uid}); 7 | 8 | //refrences 9 | final CollectionReference userCollection = 10 | FirebaseFirestore.instance.collection("users"); 11 | final CollectionReference groupCollection = 12 | FirebaseFirestore.instance.collection("groups"); 13 | //savingtheuserdata 14 | Future saveUserData(String fullname, String email) async { 15 | return await userCollection.doc(uid).set({ 16 | "fullname": fullname, 17 | "email": email, 18 | "groups": [], 19 | "profilepic": "http://", 20 | "uid": uid 21 | }); 22 | } 23 | 24 | //getting user data 25 | Future gettingUserData(String email) async { 26 | QuerySnapshot snapshot = 27 | await userCollection.where("email", isEqualTo: email).get(); 28 | return snapshot; 29 | } 30 | 31 | //get user groups 32 | getUserGroups() async { 33 | return userCollection.doc(uid).snapshots(); 34 | } 35 | 36 | //creating a group 37 | Future creatGroup(String username, String id, String groupname) async { 38 | DocumentReference groupDocumentReference = await groupCollection.add({ 39 | "groupname": groupname, 40 | "groupicon": "", 41 | "admin": "${id}_$username", 42 | "members": [], 43 | "groupid": "", 44 | "recentmessage": "", 45 | "recentmessagesender": "", 46 | }); 47 | //update the members 48 | await groupDocumentReference.update({ 49 | "members": FieldValue.arrayUnion(["${uid}_$username"]), 50 | "groupid": groupDocumentReference.id, 51 | }); 52 | 53 | DocumentReference userDocumentRefrence = userCollection.doc(uid); 54 | return await userDocumentRefrence.update({ 55 | "groups": 56 | FieldValue.arrayUnion(["${groupDocumentReference.id}_$groupname"]) 57 | }); 58 | } 59 | 60 | //getting the chats 61 | getChats(String groupid) async { 62 | return groupCollection 63 | .doc(groupid) 64 | .collection("messages") 65 | .orderBy("time") 66 | .snapshots(); 67 | } 68 | 69 | Future getGroupAdmin(String groupid) async { 70 | DocumentReference d = groupCollection.doc(groupid); 71 | DocumentSnapshot documentSnapshot = await d.get(); 72 | return documentSnapshot['admin']; 73 | } 74 | 75 | //getting the members 76 | getGroupMembers(groupid) async { 77 | return groupCollection.doc(groupid).snapshots(); 78 | } 79 | 80 | //search 81 | searchByname(String groupname) async { 82 | final result = 83 | await groupCollection.where("groupname", isEqualTo: groupname).get(); 84 | return result; 85 | } 86 | 87 | //fonction == bool 88 | Future isUserJoined( 89 | String groupname, String groupid, String username) async { 90 | DocumentReference userDocumentReference = userCollection.doc(uid); 91 | DocumentSnapshot documentSnapshot = await userDocumentReference.get(); 92 | 93 | List groups = await documentSnapshot['groups']; 94 | if (groups.contains("${groupid}_$groupname")) { 95 | return true; 96 | } else { 97 | return false; 98 | } 99 | } 100 | 101 | //group join/exit 102 | Future groupJoin(String groupid, String username, String groupname) async { 103 | //doc refrence 104 | DocumentReference userDocumentReference = userCollection.doc(uid); 105 | DocumentReference groupDocumentReference = groupCollection.doc(groupid); 106 | DocumentSnapshot documentSnapshot = await userDocumentReference.get(); 107 | List groups = await documentSnapshot['groups']; 108 | 109 | //remove group or rejoin 110 | if (groups.contains("${groupid}_$groupname")) { 111 | await userDocumentReference.update({ 112 | "groups": FieldValue.arrayRemove(["${groupid}_$groupname"]) 113 | }); 114 | await groupDocumentReference.update({ 115 | "members": FieldValue.arrayRemove(["${uid}_$username"]) 116 | }); 117 | } else { 118 | await userDocumentReference.update({ 119 | "groups": FieldValue.arrayUnion(["${groupid}_$groupname"]) 120 | }); 121 | await groupDocumentReference.update({ 122 | "members": FieldValue.arrayUnion(["${uid}_$username"]) 123 | }); 124 | } 125 | } 126 | 127 | //send message 128 | sendMessage(String groupid, Map chatMessageData) async { 129 | groupCollection.doc(groupid).collection("messages").add(chatMessageData); 130 | groupCollection.doc(groupid).update({ 131 | "recentmessage": chatMessageData['message'], 132 | "recentmessagesender": chatMessageData['sender'], 133 | "recentmessageTime": chatMessageData['time'].toString(), 134 | }); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /lib/views/chat_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/services/database_service.dart'; 2 | import 'package:chat_app/views/group_info.dart'; 3 | import 'package:chat_app/widgets/message_tile.dart'; 4 | import 'package:chat_app/widgets/widgets.dart'; 5 | import 'package:cloud_firestore/cloud_firestore.dart'; 6 | import 'package:flutter/material.dart'; 7 | 8 | class ChatScreen extends StatefulWidget { 9 | final String groupid; 10 | final String groupname; 11 | final String username; 12 | const ChatScreen( 13 | {super.key, 14 | required this.groupid, 15 | required this.groupname, 16 | required this.username}); 17 | 18 | @override 19 | State createState() => _ChatScreenState(); 20 | } 21 | 22 | class _ChatScreenState extends State { 23 | Stream? chats; 24 | TextEditingController messageController = TextEditingController(); 25 | String admin = ""; 26 | @override 27 | void initState() { 28 | getChatanAdmin(); 29 | super.initState(); 30 | } 31 | 32 | getChatanAdmin() { 33 | DatabaseService().getChats(widget.groupid).then((val) { 34 | setState(() { 35 | chats = val; 36 | }); 37 | }); 38 | DatabaseService().getGroupAdmin(widget.groupid).then((val) { 39 | setState(() { 40 | admin = val; 41 | }); 42 | }); 43 | } 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | return Scaffold( 48 | appBar: AppBar( 49 | centerTitle: true, 50 | elevation: 0, 51 | title: Text( 52 | widget.groupname, 53 | style: TextStyle( 54 | color: Colors.white, fontWeight: FontWeight.bold, fontSize: 27), 55 | ), 56 | backgroundColor: Color.fromARGB(1, 255, 255, 255), 57 | actions: [ 58 | IconButton( 59 | onPressed: () { 60 | nextScreen( 61 | context, 62 | GroupInfo( 63 | groupid: widget.groupid, 64 | groupname: widget.groupname, 65 | adminname: admin, 66 | )); 67 | }, 68 | icon: Icon(Icons.info)) 69 | ], 70 | ), 71 | body: Stack( 72 | children: [ 73 | //chat messages 74 | chatMessages(), 75 | Container( 76 | alignment: Alignment.bottomCenter, 77 | width: MediaQuery.of(context).size.width, 78 | child: Container( 79 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 18), 80 | color: Color.fromARGB(255, 56, 56, 56), 81 | child: Row(children: [ 82 | Expanded( 83 | child: TextFormField( 84 | controller: messageController, 85 | style: TextStyle( 86 | color: Colors.white, 87 | ), 88 | decoration: InputDecoration( 89 | hintText: "send a message...", 90 | hintStyle: TextStyle(color: Colors.white, fontSize: 16), 91 | border: InputBorder.none), 92 | )), 93 | const SizedBox( 94 | width: 12, 95 | ), 96 | GestureDetector( 97 | child: Container( 98 | height: 50, 99 | width: 50, 100 | decoration: BoxDecoration( 101 | color: Color.fromARGB(255, 168, 5, 200), 102 | borderRadius: BorderRadius.circular(30), 103 | ), 104 | child: const Center( 105 | child: Icon(Icons.send), 106 | ), 107 | ), 108 | onTap: () { 109 | sendMessage(); 110 | }, 111 | ) 112 | ]), 113 | ), 114 | ) 115 | ], 116 | ), 117 | ); 118 | } 119 | 120 | chatMessages() { 121 | return StreamBuilder( 122 | stream: chats, 123 | builder: (context, AsyncSnapshot snapshot) { 124 | return snapshot.hasData 125 | ? ListView.builder( 126 | itemCount: snapshot.data.docs.length, 127 | itemBuilder: (context, index) { 128 | return MessageTile( 129 | message: snapshot.data.docs[index]['message'], 130 | sender: snapshot.data.docs[index]['sender'], 131 | sentByMe: widget.username == 132 | snapshot.data.docs[index]['sender']); 133 | }, 134 | ) 135 | : Container(); 136 | }, 137 | ); 138 | } 139 | 140 | sendMessage() { 141 | if (messageController.text.isNotEmpty) { 142 | Map chatMessageMap = { 143 | 'message': messageController.text, 144 | 'sender': widget.username, 145 | 'time': DateTime.now().millisecondsSinceEpoch 146 | }; 147 | DatabaseService().sendMessage(widget.groupid, chatMessageMap); 148 | setState(() { 149 | messageController.clear(); 150 | }); 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "chat_app") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.example.chat_app") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"idiom":"watch","filename":"172.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"86x86","expected-size":"172","role":"quickLook"},{"idiom":"watch","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"40x40","expected-size":"80","role":"appLauncher"},{"idiom":"watch","filename":"88.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"40mm","scale":"2x","size":"44x44","expected-size":"88","role":"appLauncher"},{"idiom":"watch","filename":"102.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"45x45","expected-size":"102","role":"appLauncher"},{"idiom":"watch","filename":"92.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"46x46","expected-size":"92","role":"appLauncher"},{"idiom":"watch","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"50x50","expected-size":"100","role":"appLauncher"},{"idiom":"watch","filename":"196.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"98x98","expected-size":"196","role":"quickLook"},{"idiom":"watch","filename":"216.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"108x108","expected-size":"216","role":"quickLook"},{"idiom":"watch","filename":"48.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"24x24","expected-size":"48","role":"notificationCenter"},{"idiom":"watch","filename":"55.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"27.5x27.5","expected-size":"55","role":"notificationCenter"},{"idiom":"watch","filename":"66.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"33x33","expected-size":"66","role":"notificationCenter"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"3x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"2x"},{"size":"1024x1024","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch-marketing","scale":"1x"},{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]} -------------------------------------------------------------------------------- /lib/views/profile_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/services/auth_service.dart'; 2 | import 'package:chat_app/views/home.dart'; 3 | import 'package:chat_app/views/sing_in.dart'; 4 | import 'package:chat_app/widgets/widgets.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | import '../helper/helper_functions.dart'; 8 | 9 | class profileScreen extends StatefulWidget { 10 | String email; 11 | 12 | String username; 13 | 14 | profileScreen({Key? key, required this.email, required this.username}); 15 | 16 | @override 17 | State createState() => _profileScreenState(); 18 | } 19 | 20 | class _profileScreenState extends State { 21 | AuthService authService = AuthService(); 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar( 26 | centerTitle: true, 27 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 28 | elevation: 0, 29 | title: const Text( 30 | "Profile", 31 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 27), 32 | ), 33 | ), 34 | drawer: Drawer( 35 | backgroundColor: Color.fromARGB(255, 18, 17, 17), 36 | child: ListView( 37 | padding: EdgeInsets.symmetric(vertical: 50), 38 | children: [ 39 | Icon( 40 | Icons.account_circle, 41 | size: 150, 42 | color: Color.fromARGB(255, 255, 255, 255), 43 | ), 44 | SizedBox( 45 | height: 15, 46 | ), 47 | Text( 48 | widget.username, 49 | textAlign: TextAlign.center, 50 | style: TextStyle( 51 | fontWeight: FontWeight.bold, 52 | color: Colors.white, 53 | fontSize: 27), 54 | ), 55 | SizedBox( 56 | height: 30, 57 | ), 58 | const Divider( 59 | height: 2, 60 | ), 61 | ListTile( 62 | onTap: () { 63 | nextScreen(context, HomePage()); 64 | }, 65 | selected: true, 66 | contentPadding: 67 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 68 | leading: const Icon(Icons.group), 69 | title: Text( 70 | "Groups", 71 | style: TextStyle( 72 | color: Colors.white, 73 | ), 74 | ), 75 | ), 76 | ListTile( 77 | onTap: () {}, 78 | selectedColor: Theme.of(context).primaryColor, 79 | selected: true, 80 | contentPadding: 81 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 82 | leading: const Icon(Icons.account_circle), 83 | title: Text( 84 | "Profile", 85 | style: TextStyle( 86 | color: Colors.white, 87 | ), 88 | ), 89 | ), 90 | ListTile( 91 | onTap: () async { 92 | showDialog( 93 | barrierDismissible: false, 94 | context: context, 95 | builder: (context) { 96 | return AlertDialog( 97 | title: Text("Logout"), 98 | content: Text("Are you sure you want to Logout?"), 99 | actions: [ 100 | IconButton( 101 | onPressed: () { 102 | Navigator.pop(context); 103 | }, 104 | icon: const Icon( 105 | Icons.cancel, 106 | color: Colors.red, 107 | )), 108 | IconButton( 109 | onPressed: () async { 110 | await authService.signOut(); 111 | Navigator.of(context).pushAndRemoveUntil( 112 | MaterialPageRoute( 113 | builder: (context) => singIn()), 114 | (route) => false); 115 | }, 116 | icon: const Icon( 117 | Icons.done, 118 | color: Colors.green, 119 | )) 120 | ], 121 | ); 122 | }); 123 | authService.signOut().whenComplete(() {}); 124 | }, 125 | selectedColor: Theme.of(context).primaryColor, 126 | selected: true, 127 | contentPadding: 128 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 129 | leading: const Icon(Icons.exit_to_app), 130 | title: Text( 131 | "Logout", 132 | style: TextStyle( 133 | color: Colors.white, 134 | ), 135 | ), 136 | ), 137 | ], 138 | )), 139 | body: Container( 140 | padding: EdgeInsets.symmetric(horizontal: 40, vertical: 170), 141 | child: Column( 142 | mainAxisAlignment: MainAxisAlignment.start, 143 | children: [ 144 | Icon( 145 | Icons.account_circle, 146 | size: 200, 147 | color: Colors.white, 148 | ), 149 | const SizedBox( 150 | height: 15, 151 | ), 152 | Row( 153 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 154 | children: [ 155 | const Text( 156 | "Full Name", 157 | style: TextStyle(fontSize: 17, color: Colors.white), 158 | ), 159 | Text( 160 | widget.username, 161 | style: TextStyle(fontSize: 17, color: Colors.white), 162 | ) 163 | ], 164 | ), 165 | const Divider( 166 | height: 20, 167 | ), 168 | Row( 169 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 170 | children: [ 171 | const Text( 172 | "Email", 173 | style: TextStyle(fontSize: 17, color: Colors.white), 174 | ), 175 | Text( 176 | widget.email, 177 | style: TextStyle(fontSize: 17, color: Colors.white), 178 | ) 179 | ], 180 | ), 181 | ], 182 | ), 183 | )); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /lib/views/search_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/helper/helper_functions.dart'; 2 | import 'package:chat_app/services/database_service.dart'; 3 | import 'package:chat_app/views/chat_screen.dart'; 4 | import 'package:chat_app/views/group_info.dart'; 5 | import 'package:chat_app/widgets/widgets.dart'; 6 | import 'package:cloud_firestore/cloud_firestore.dart'; 7 | import 'package:firebase_auth/firebase_auth.dart'; 8 | import 'package:flutter/material.dart'; 9 | 10 | class searchScreen extends StatefulWidget { 11 | const searchScreen({super.key}); 12 | 13 | @override 14 | State createState() => _searchScreenState(); 15 | } 16 | 17 | class _searchScreenState extends State { 18 | TextEditingController searchController = TextEditingController(); 19 | bool _isLoading = false; 20 | QuerySnapshot? searchSnapshot; 21 | bool hasUserSearched = false; 22 | String userName = ""; 23 | User? user; 24 | bool isJoined = false; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | getCurrentUserIdandName(); 30 | } 31 | 32 | getCurrentUserIdandName() async { 33 | await HelperFunctions.getUserNamefromsf().then((value) { 34 | setState(() { 35 | userName = value!; 36 | }); 37 | }); 38 | user = FirebaseAuth.instance.currentUser; 39 | } 40 | 41 | String getName(String r) { 42 | return r.substring(r.indexOf("_") + 1); 43 | } 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | return Scaffold( 48 | appBar: AppBar( 49 | centerTitle: true, 50 | elevation: 0, 51 | title: const Text( 52 | "Search", 53 | style: TextStyle( 54 | color: Colors.white, fontWeight: FontWeight.bold, fontSize: 27), 55 | ), 56 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 57 | ), 58 | body: Column( 59 | children: [ 60 | Container( 61 | color: Color.fromARGB(255, 168, 5, 200), 62 | padding: EdgeInsets.symmetric(horizontal: 30, vertical: 10), 63 | child: Row( 64 | children: [ 65 | Expanded( 66 | child: TextField( 67 | controller: searchController, 68 | style: TextStyle(color: Colors.white), 69 | decoration: InputDecoration( 70 | border: InputBorder.none, 71 | hintText: "Search groups....", 72 | hintStyle: 73 | TextStyle(color: Colors.white, fontSize: 16)), 74 | ), 75 | ), 76 | GestureDetector( 77 | onTap: (() { 78 | initiateSearchMethod(); 79 | }), 80 | child: Container( 81 | width: 40, 82 | height: 40, 83 | decoration: BoxDecoration( 84 | color: Colors.white.withOpacity(0.1), 85 | borderRadius: BorderRadius.circular(40)), 86 | child: Icon( 87 | Icons.search, 88 | color: Colors.white, 89 | ), 90 | ), 91 | ) 92 | ], 93 | ), 94 | ), 95 | _isLoading 96 | ? const Center( 97 | child: CircularProgressIndicator( 98 | color: Color.fromARGB(255, 168, 5, 200), 99 | ), 100 | ) 101 | : groupList(), 102 | ], 103 | ), 104 | ); 105 | } 106 | 107 | void initiateSearchMethod() async { 108 | if (searchController.text.isNotEmpty) { 109 | setState(() { 110 | _isLoading = true; 111 | }); 112 | await DatabaseService() 113 | .searchByname(searchController.text) 114 | .then((snapshot) { 115 | setState(() { 116 | searchSnapshot = snapshot; 117 | _isLoading = false; 118 | hasUserSearched = true; 119 | }); 120 | }); 121 | } 122 | } 123 | 124 | groupList() { 125 | return hasUserSearched 126 | ? ListView.builder( 127 | shrinkWrap: true, 128 | itemCount: searchSnapshot!.docs.length, 129 | itemBuilder: (context, index) { 130 | return groupTile( 131 | userName, 132 | searchSnapshot!.docs[index]['groupid'], 133 | searchSnapshot!.docs[index]['groupname'], 134 | searchSnapshot!.docs[index]['admin']); 135 | }, 136 | ) 137 | : Container(); 138 | } 139 | 140 | joinedOrNot( 141 | String username, String groupid, String groupname, String admin) async { 142 | await DatabaseService(uid: user!.uid) 143 | .isUserJoined(groupname, groupid, username) 144 | .then((value) { 145 | setState(() { 146 | isJoined = value; 147 | }); 148 | }); 149 | } 150 | 151 | Widget groupTile( 152 | String userName, String groupId, String groupName, String admin) { 153 | //fonction if the user already joined in group 154 | joinedOrNot(userName, groupId, groupName, admin); 155 | return ListTile( 156 | contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), 157 | leading: CircleAvatar( 158 | radius: 30, 159 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 160 | child: Text( 161 | groupName.substring(0, 1).toUpperCase(), 162 | style: TextStyle(color: Colors.white), 163 | ), 164 | ), 165 | title: Text( 166 | groupName, 167 | style: TextStyle(fontWeight: FontWeight.w600, color: Colors.white), 168 | ), 169 | subtitle: Text( 170 | "Admin :${getName(admin)}", 171 | style: TextStyle(color: Colors.white), 172 | ), 173 | trailing: InkWell( 174 | onTap: () async { 175 | await DatabaseService(uid: user!.uid) 176 | .groupJoin(groupId, userName, groupName); 177 | if (isJoined) { 178 | setState(() { 179 | isJoined = !isJoined; 180 | }); 181 | showSnackBar(context, Colors.green, "Joined the group succesfully"); 182 | Future.delayed(const Duration(seconds: 2), () { 183 | nextScreen( 184 | context, 185 | ChatScreen( 186 | groupid: groupId, 187 | groupname: groupName, 188 | username: userName)); 189 | }); 190 | } else { 191 | setState(() { 192 | isJoined = !isJoined; 193 | showSnackBar(context, Colors.red, "Left the group $groupName"); 194 | }); 195 | } 196 | }, 197 | child: isJoined 198 | ? Container( 199 | decoration: BoxDecoration( 200 | borderRadius: BorderRadius.circular(10), 201 | color: Colors.white, 202 | border: Border.all(color: Colors.black, width: 1)), 203 | padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 204 | child: Text( 205 | "Joined", 206 | style: TextStyle(color: Colors.black), 207 | ), 208 | ) 209 | : Container( 210 | decoration: BoxDecoration( 211 | borderRadius: BorderRadius.circular(10), 212 | color: Theme.of(context).primaryColor, 213 | border: Border.all(color: Colors.black, width: 1)), 214 | padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 215 | child: Text( 216 | "Join Now", 217 | style: TextStyle(color: Colors.white), 218 | ), 219 | ), 220 | ), 221 | ); 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /lib/views/sing_in.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/services/auth_service.dart'; 2 | import 'package:chat_app/services/database_service.dart'; 3 | import 'package:chat_app/views/home.dart'; 4 | import 'package:chat_app/views/sing_up.dart'; 5 | import 'package:chat_app/widgets/widgets.dart'; 6 | import 'package:cloud_firestore/cloud_firestore.dart'; 7 | import 'package:firebase_auth/firebase_auth.dart'; 8 | import 'package:flutter/gestures.dart'; 9 | import 'package:flutter/material.dart'; 10 | 11 | import '../helper/helper_functions.dart'; 12 | 13 | class singIn extends StatefulWidget { 14 | const singIn({super.key}); 15 | 16 | @override 17 | State createState() => _singInState(); 18 | } 19 | 20 | class _singInState extends State { 21 | String email = ""; 22 | String password = ""; 23 | bool _isLoading = false; 24 | final formkey = GlobalKey(); 25 | AuthService authService = AuthService(); 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | appBar: appBarMain(context), 30 | body: _isLoading 31 | ? Center( 32 | child: CircularProgressIndicator( 33 | color: Theme.of(context).primaryColor, 34 | ), 35 | ) 36 | : SingleChildScrollView( 37 | child: Padding( 38 | padding: const EdgeInsets.all(8.0), 39 | child: Form( 40 | key: formkey, 41 | child: Container( 42 | height: MediaQuery.of(context).size.height - 50, 43 | alignment: Alignment.bottomCenter, 44 | child: Container( 45 | padding: EdgeInsets.symmetric(horizontal: 20), 46 | child: Column(mainAxisSize: MainAxisSize.min, children: [ 47 | TextField( 48 | decoration: textFieldInputDecoration("email"), 49 | style: simpletextstyle(), 50 | onChanged: (value) { 51 | setState(() { 52 | email = value; 53 | }); 54 | }, 55 | ), 56 | TextField( 57 | obscureText: true, 58 | decoration: textFieldInputDecoration("password"), 59 | style: simpletextstyle(), 60 | onChanged: (value) { 61 | setState(() { 62 | password = value; 63 | }); 64 | }, 65 | ), 66 | SizedBox( 67 | height: 8, 68 | ), 69 | Container( 70 | alignment: Alignment.centerRight, 71 | child: Container( 72 | padding: EdgeInsets.symmetric( 73 | horizontal: 16, vertical: 8), 74 | child: Text( 75 | "forgot password?", 76 | style: simpletextstyle(), 77 | ), 78 | ), 79 | ), 80 | SizedBox( 81 | height: 8, 82 | ), 83 | GestureDetector( 84 | onTap: () { 85 | login(); 86 | }, 87 | child: Container( 88 | width: MediaQuery.of(context).size.width, 89 | alignment: Alignment.center, 90 | padding: EdgeInsets.symmetric( 91 | vertical: 16, 92 | ), 93 | decoration: BoxDecoration( 94 | gradient: LinearGradient(colors: [ 95 | const Color.fromARGB(255, 218, 57, 247), 96 | Color.fromARGB(255, 218, 106, 193) 97 | ]), 98 | borderRadius: BorderRadius.circular(30), 99 | ), 100 | child: Text( 101 | "Sign in", 102 | style: mediumtextstyle(), 103 | ), 104 | ), 105 | ), 106 | SizedBox( 107 | height: 8, 108 | ), 109 | Container( 110 | width: MediaQuery.of(context).size.width, 111 | alignment: Alignment.center, 112 | padding: EdgeInsets.symmetric( 113 | vertical: 16, 114 | ), 115 | decoration: BoxDecoration( 116 | color: Colors.white, 117 | borderRadius: BorderRadius.circular(30)), 118 | child: Text( 119 | "Sign in with Google", 120 | style: 121 | TextStyle(color: Colors.black87, fontSize: 20), 122 | ), 123 | ), 124 | SizedBox( 125 | height: 8, 126 | ), 127 | Row( 128 | mainAxisAlignment: MainAxisAlignment.center, 129 | children: [ 130 | Text( 131 | "Don't have account ? ", 132 | style: mediumtextstyle(), 133 | ), 134 | Text.rich( 135 | TextSpan( 136 | text: "Register now", 137 | style: TextStyle( 138 | color: Colors.white, 139 | decoration: TextDecoration.underline, 140 | fontSize: 20), 141 | recognizer: TapGestureRecognizer() 142 | ..onTap = () { 143 | nextScreen(context, const signUp()); 144 | }), 145 | ) 146 | ], 147 | ), 148 | SizedBox( 149 | height: 250, 150 | ) 151 | ]), 152 | ), 153 | ), 154 | ), 155 | ), 156 | ), 157 | ); 158 | } 159 | 160 | login() async { 161 | if (formkey.currentState!.validate()) { 162 | setState(() { 163 | _isLoading = true; 164 | }); 165 | await authService 166 | .loginUserWithEmailandPassword(email, password) 167 | .then((value) async { 168 | if (value == true) { 169 | QuerySnapshot snapshot = 170 | await DatabaseService(uid: FirebaseAuth.instance.currentUser!.uid) 171 | .gettingUserData(email); 172 | //saving the value to our shared perferences 173 | await HelperFunctions.saveUserLoggedinStatus(true); 174 | await HelperFunctions.saveUserEmailsf(email); 175 | await HelperFunctions.saveUserNamesf(snapshot.docs[0]['fullname']); 176 | nextScreenReplace(context, const HomePage()); 177 | } else { 178 | showSnackBar(context, Colors.red, value); 179 | setState(() { 180 | _isLoading = false; 181 | }); 182 | } 183 | }); 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /lib/views/sing_up.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/helper/helper_functions.dart'; 2 | import 'package:chat_app/services/auth_service.dart'; 3 | import 'package:chat_app/views/home.dart'; 4 | import 'package:chat_app/views/sing_in.dart'; 5 | import 'package:flutter/gestures.dart'; 6 | import 'package:flutter/material.dart'; 7 | import '../widgets/widgets.dart'; 8 | 9 | class signUp extends StatefulWidget { 10 | const signUp({super.key}); 11 | 12 | @override 13 | State createState() => _signUpState(); 14 | } 15 | 16 | class _signUpState extends State { 17 | TextEditingController userNameTextEdittingController = 18 | new TextEditingController(); 19 | TextEditingController emailTextEdittingController = 20 | new TextEditingController(); 21 | TextEditingController passwordTextEdittingController = 22 | new TextEditingController(); 23 | bool _isLoading = false; 24 | AuthService authService = AuthService(); 25 | final formkey = GlobalKey(); 26 | String email = ""; 27 | String passwoed = ""; 28 | String fullname = ""; 29 | @override 30 | Widget build(BuildContext context) { 31 | return Scaffold( 32 | appBar: appBarMain(context), 33 | body: _isLoading 34 | ? Center( 35 | child: CircularProgressIndicator( 36 | color: Theme.of(context).primaryColor, 37 | ), 38 | ) 39 | : SingleChildScrollView( 40 | child: Padding( 41 | padding: const EdgeInsets.all(8.0), 42 | child: Form( 43 | key: formkey, 44 | child: Container( 45 | height: MediaQuery.of(context).size.height - 50, 46 | alignment: Alignment.bottomCenter, 47 | child: Container( 48 | padding: EdgeInsets.symmetric(horizontal: 20), 49 | child: Column(mainAxisSize: MainAxisSize.min, children: [ 50 | TextField( 51 | controller: userNameTextEdittingController, 52 | decoration: textFieldInputDecoration("user name"), 53 | style: simpletextstyle(), 54 | onChanged: (value) { 55 | setState(() { 56 | fullname = value; 57 | }); 58 | }, 59 | ), 60 | TextField( 61 | controller: emailTextEdittingController, 62 | decoration: textFieldInputDecoration("email"), 63 | style: simpletextstyle(), 64 | onChanged: (value) { 65 | setState(() { 66 | email = value; 67 | }); 68 | }, 69 | ), 70 | TextField( 71 | controller: passwordTextEdittingController, 72 | decoration: textFieldInputDecoration("password"), 73 | style: simpletextstyle(), 74 | onChanged: (value) { 75 | setState(() { 76 | passwoed = value; 77 | }); 78 | }, 79 | ), 80 | SizedBox( 81 | height: 8, 82 | ), 83 | SizedBox( 84 | height: 8, 85 | ), 86 | GestureDetector( 87 | onTap: () { 88 | register(); 89 | }, 90 | child: Container( 91 | width: MediaQuery.of(context).size.width, 92 | alignment: Alignment.center, 93 | padding: EdgeInsets.symmetric( 94 | vertical: 16, 95 | ), 96 | decoration: BoxDecoration( 97 | gradient: LinearGradient(colors: [ 98 | const Color.fromARGB(255, 218, 57, 247), 99 | Color.fromARGB(255, 218, 106, 193) 100 | ]), 101 | borderRadius: BorderRadius.circular(30)), 102 | child: Text( 103 | "Sign up", 104 | style: mediumtextstyle(), 105 | ), 106 | ), 107 | ), 108 | SizedBox( 109 | height: 8, 110 | ), 111 | Container( 112 | width: MediaQuery.of(context).size.width, 113 | alignment: Alignment.center, 114 | padding: EdgeInsets.symmetric( 115 | vertical: 16, 116 | ), 117 | decoration: BoxDecoration( 118 | color: Colors.white, 119 | borderRadius: BorderRadius.circular(30)), 120 | child: Text( 121 | "Sign in with Google", 122 | style: 123 | TextStyle(color: Colors.black87, fontSize: 20), 124 | ), 125 | ), 126 | SizedBox( 127 | height: 8, 128 | ), 129 | Row( 130 | mainAxisAlignment: MainAxisAlignment.center, 131 | children: [ 132 | Text( 133 | "Already have an account ? ", 134 | style: mediumtextstyle(), 135 | ), 136 | Text.rich( 137 | TextSpan( 138 | text: "Login now", 139 | style: TextStyle( 140 | color: Colors.white, 141 | decoration: TextDecoration.underline, 142 | fontSize: 20), 143 | recognizer: TapGestureRecognizer() 144 | ..onTap = () { 145 | nextScreen(context, const singIn()); 146 | }), 147 | ) 148 | ], 149 | ), 150 | SizedBox( 151 | height: 250, 152 | ) 153 | ]), 154 | ), 155 | ), 156 | ), 157 | ), 158 | ), 159 | ); 160 | ; 161 | } 162 | 163 | register() async { 164 | if (formkey.currentState!.validate()) { 165 | setState(() { 166 | _isLoading = true; 167 | }); 168 | await authService 169 | .registerUserWithEmailandPassword(fullname, email, passwoed) 170 | .then((value) async { 171 | if (value == true) { 172 | //saving the shared refrences state 173 | await HelperFunctions.saveUserLoggedinStatus(true); 174 | await HelperFunctions.saveUserEmailsf(email); 175 | await HelperFunctions.saveUserNamesf(fullname); 176 | nextScreenReplace(context, const HomePage()); 177 | } else { 178 | showSnackBar(context, Colors.red, value); 179 | setState(() { 180 | _isLoading = false; 181 | }); 182 | } 183 | }); 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /lib/views/group_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/services/database_service.dart'; 2 | import 'package:chat_app/views/home.dart'; 3 | import 'package:chat_app/widgets/widgets.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:chat_app/services/auth_service.dart'; 7 | import 'sing_in.dart'; 8 | 9 | class GroupInfo extends StatefulWidget { 10 | final String groupid; 11 | final String groupname; 12 | final String adminname; 13 | const GroupInfo( 14 | {super.key, 15 | required this.groupid, 16 | required this.groupname, 17 | required this.adminname}); 18 | 19 | @override 20 | State createState() => _GroupInfoState(); 21 | } 22 | 23 | class _GroupInfoState extends State { 24 | Stream? members; 25 | @override 26 | void initState() { 27 | getMembers(); 28 | super.initState(); 29 | } 30 | 31 | getMembers() async { 32 | DatabaseService(uid: FirebaseAuth.instance.currentUser!.uid) 33 | .getGroupMembers(widget.groupid) 34 | .then((val) { 35 | setState(() { 36 | members = val; 37 | }); 38 | }); 39 | } 40 | 41 | String getName(String r) { 42 | return r.substring(r.indexOf("_") + 1); 43 | } 44 | 45 | String getId(String res) { 46 | return res.substring(0, res.indexOf("_")); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | appBar: AppBar( 53 | centerTitle: true, 54 | elevation: 0, 55 | title: const Text( 56 | "Group info", 57 | style: TextStyle( 58 | color: Colors.white, fontWeight: FontWeight.bold, fontSize: 27), 59 | ), 60 | actions: [ 61 | IconButton( 62 | onPressed: () { 63 | showDialog( 64 | barrierDismissible: false, 65 | context: context, 66 | builder: (context) { 67 | return AlertDialog( 68 | title: Text("Exit"), 69 | content: Text("Are you sure you want to exit?"), 70 | actions: [ 71 | IconButton( 72 | onPressed: () { 73 | Navigator.pop(context); 74 | }, 75 | icon: const Icon( 76 | Icons.cancel, 77 | color: Colors.red, 78 | )), 79 | IconButton( 80 | onPressed: () async { 81 | DatabaseService( 82 | uid: FirebaseAuth 83 | .instance.currentUser!.uid) 84 | .groupJoin( 85 | widget.groupid, 86 | getName(widget.adminname), 87 | widget.groupname) 88 | .whenComplete(() { 89 | nextScreenReplace(context, HomePage()); 90 | }); 91 | }, 92 | icon: const Icon( 93 | Icons.done, 94 | color: Colors.green, 95 | )) 96 | ], 97 | ); 98 | }); 99 | }, 100 | icon: Icon(Icons.exit_to_app)) 101 | ], 102 | backgroundColor: Colors.black, 103 | ), 104 | body: Container( 105 | padding: EdgeInsets.symmetric(horizontal: 20, vertical: 20), 106 | child: Column( 107 | children: [ 108 | Container( 109 | padding: EdgeInsets.all(20), 110 | decoration: BoxDecoration( 111 | borderRadius: BorderRadius.circular(30), 112 | color: Color.fromARGB(255, 60, 22, 67)), 113 | child: Row( 114 | mainAxisAlignment: MainAxisAlignment.start, 115 | children: [ 116 | CircleAvatar( 117 | radius: 30, 118 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 119 | child: Text( 120 | widget.groupname.substring(0, 1).toUpperCase(), 121 | style: const TextStyle( 122 | fontWeight: FontWeight.w500, color: Colors.white), 123 | ), 124 | ), 125 | SizedBox( 126 | width: 20, 127 | ), 128 | Column( 129 | crossAxisAlignment: CrossAxisAlignment.start, 130 | children: [ 131 | Text( 132 | "Group : ${widget.groupname}", 133 | style: const TextStyle( 134 | color: Colors.white, fontWeight: FontWeight.w500), 135 | ), 136 | SizedBox( 137 | height: 5, 138 | ), 139 | Text( 140 | "Admin : ${getName(widget.adminname)}", 141 | style: TextStyle(color: Colors.white, fontSize: 12), 142 | ) 143 | ], 144 | ) 145 | ], 146 | ), 147 | ), 148 | memberList(), 149 | ], 150 | ), 151 | )); 152 | } 153 | 154 | memberList() { 155 | return StreamBuilder( 156 | stream: members, 157 | builder: (context, AsyncSnapshot snapshot) { 158 | if (snapshot.hasData) { 159 | if (snapshot.data['members'] != null) { 160 | if (snapshot.data['members'].length != 0) { 161 | return ListView.builder( 162 | itemCount: snapshot.data['members'].length, 163 | shrinkWrap: true, 164 | itemBuilder: (context, index) { 165 | return Container( 166 | padding: EdgeInsets.symmetric(horizontal: 5, vertical: 10), 167 | child: ListTile( 168 | leading: CircleAvatar( 169 | radius: 30, 170 | backgroundColor: Color.fromARGB(255, 168, 5, 200), 171 | child: Text( 172 | getName(snapshot.data['members'][index]) 173 | .substring(0, 1) 174 | .toUpperCase(), 175 | style: TextStyle( 176 | color: Colors.white, fontWeight: FontWeight.bold), 177 | ), 178 | ), 179 | title: Text( 180 | getName(snapshot.data['members'][index]), 181 | style: TextStyle( 182 | color: Colors.white, fontWeight: FontWeight.w500), 183 | ), 184 | subtitle: Text( 185 | getId(snapshot.data['members'][index]), 186 | style: TextStyle(color: Colors.white), 187 | ), 188 | ), 189 | ); 190 | }, 191 | ); 192 | } else { 193 | return Center( 194 | child: Text( 195 | "NO MEMBERS", 196 | style: TextStyle(color: Colors.white), 197 | ), 198 | ); 199 | } 200 | } else { 201 | return Center( 202 | child: Text("NO MEMBERS", style: TextStyle(color: Colors.white)), 203 | ); 204 | } 205 | } else { 206 | return Center( 207 | child: CircularProgressIndicator( 208 | color: Theme.of(context).primaryColor), 209 | ); 210 | } 211 | }, 212 | ); 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /lib/views/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/helper/helper_functions.dart'; 2 | import 'package:chat_app/services/auth_service.dart'; 3 | import 'package:chat_app/services/database_service.dart'; 4 | import 'package:chat_app/views/profile_screen.dart'; 5 | import 'package:chat_app/views/sing_in.dart'; 6 | import 'package:chat_app/widgets/group_tile.dart'; 7 | import 'package:chat_app/widgets/widgets.dart'; 8 | import 'package:firebase_auth/firebase_auth.dart'; 9 | import 'package:flutter/material.dart'; 10 | 11 | class HomePage extends StatefulWidget { 12 | const HomePage({super.key}); 13 | 14 | @override 15 | State createState() => _HomePageState(); 16 | } 17 | 18 | class _HomePageState extends State { 19 | String username = ""; 20 | String email = ""; 21 | Stream? groups; 22 | bool _isLoading = false; 23 | String groupname = ""; 24 | @override 25 | void initState() { 26 | // TODO: implement initState 27 | super.initState(); 28 | gettingUserData(); 29 | } 30 | 31 | //string manipulation 32 | String getId(String res) { 33 | return res.substring(0, res.indexOf("_")); 34 | } 35 | 36 | String getName(String res) { 37 | return res.substring(res.indexOf("_") + 1); 38 | } 39 | 40 | gettingUserData() async { 41 | await HelperFunctions.getUserNamefromsf().then((value) { 42 | setState(() { 43 | username = value!; 44 | }); 45 | }); 46 | await HelperFunctions.getUserEmailfromsf().then((value) { 47 | setState(() { 48 | email = value!; 49 | }); 50 | }); 51 | //getting list of snapshots in our stream 52 | await DatabaseService(uid: FirebaseAuth.instance.currentUser!.uid) 53 | .getUserGroups() 54 | .then((snapshot) { 55 | setState(() { 56 | groups = snapshot; 57 | }); 58 | }); 59 | } 60 | 61 | AuthService authService = AuthService(); 62 | @override 63 | Widget build(BuildContext context) { 64 | return Scaffold( 65 | appBar: appBarHome(context), 66 | drawer: Drawer( 67 | backgroundColor: Color.fromARGB(255, 18, 17, 17), 68 | child: ListView( 69 | padding: EdgeInsets.symmetric(vertical: 50), 70 | children: [ 71 | Icon( 72 | Icons.account_circle, 73 | size: 150, 74 | color: Color.fromARGB(255, 255, 255, 255), 75 | ), 76 | SizedBox( 77 | height: 15, 78 | ), 79 | Text( 80 | username, 81 | textAlign: TextAlign.center, 82 | style: TextStyle( 83 | fontWeight: FontWeight.bold, 84 | color: Colors.white, 85 | fontSize: 27), 86 | ), 87 | SizedBox( 88 | height: 30, 89 | ), 90 | const Divider( 91 | height: 2, 92 | ), 93 | ListTile( 94 | onTap: () {}, 95 | selected: true, 96 | contentPadding: 97 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 98 | leading: const Icon(Icons.group), 99 | title: Text( 100 | "Groups", 101 | style: TextStyle( 102 | color: Colors.white, 103 | ), 104 | ), 105 | ), 106 | ListTile( 107 | onTap: () { 108 | nextScreenReplace( 109 | context, 110 | profileScreen( 111 | email: email, 112 | username: username, 113 | )); 114 | }, 115 | selectedColor: Theme.of(context).primaryColor, 116 | selected: true, 117 | contentPadding: 118 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 119 | leading: const Icon(Icons.account_circle), 120 | title: Text( 121 | "Profile", 122 | style: TextStyle( 123 | color: Colors.white, 124 | ), 125 | ), 126 | ), 127 | ListTile( 128 | onTap: () async { 129 | showDialog( 130 | barrierDismissible: false, 131 | context: context, 132 | builder: (context) { 133 | return AlertDialog( 134 | title: Text("Logout"), 135 | content: Text("Are you sure you want to Logout?"), 136 | actions: [ 137 | IconButton( 138 | onPressed: () { 139 | Navigator.pop(context); 140 | }, 141 | icon: const Icon( 142 | Icons.cancel, 143 | color: Colors.red, 144 | )), 145 | IconButton( 146 | onPressed: () async { 147 | await authService.signOut(); 148 | Navigator.of(context).pushAndRemoveUntil( 149 | MaterialPageRoute( 150 | builder: (context) => singIn()), 151 | (route) => false); 152 | }, 153 | icon: const Icon( 154 | Icons.done, 155 | color: Colors.green, 156 | )) 157 | ], 158 | ); 159 | }); 160 | authService.signOut().whenComplete(() {}); 161 | }, 162 | selectedColor: Theme.of(context).primaryColor, 163 | selected: true, 164 | contentPadding: 165 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 166 | leading: const Icon(Icons.exit_to_app), 167 | title: Text( 168 | "Logout", 169 | style: TextStyle( 170 | color: Colors.white, 171 | ), 172 | ), 173 | ), 174 | ], 175 | )), 176 | body: grouplist(), 177 | floatingActionButton: FloatingActionButton( 178 | onPressed: () { 179 | popUpDialog(context); 180 | }, 181 | elevation: 0, 182 | backgroundColor: Theme.of(context).primaryColor, 183 | child: const Icon( 184 | Icons.add, 185 | color: Colors.white, 186 | size: 30, 187 | ), 188 | ), 189 | ); 190 | } 191 | 192 | popUpDialog(BuildContext context) { 193 | showDialog( 194 | barrierDismissible: false, 195 | context: context, 196 | builder: (context) { 197 | return StatefulBuilder( 198 | builder: ((context, setState) { 199 | return AlertDialog( 200 | title: const Text( 201 | "Create a group", 202 | textAlign: TextAlign.left, 203 | ), 204 | content: Column(mainAxisSize: MainAxisSize.min, children: [ 205 | _isLoading == true 206 | ? Center( 207 | child: CircularProgressIndicator( 208 | color: Theme.of(context).primaryColor), 209 | ) 210 | : TextField( 211 | onChanged: ((value) { 212 | setState(() { 213 | groupname = value; 214 | }); 215 | }), 216 | style: const TextStyle(color: Colors.black), 217 | decoration: InputDecoration( 218 | enabledBorder: OutlineInputBorder( 219 | borderSide: BorderSide( 220 | color: Theme.of(context).primaryColor), 221 | borderRadius: BorderRadius.circular(20)), 222 | errorBorder: OutlineInputBorder( 223 | borderSide: BorderSide(color: Colors.red), 224 | borderRadius: BorderRadius.circular(20)), 225 | focusedBorder: OutlineInputBorder( 226 | borderSide: BorderSide( 227 | color: Theme.of(context).primaryColor), 228 | borderRadius: BorderRadius.circular(20))), 229 | ) 230 | ]), 231 | actions: [ 232 | ElevatedButton( 233 | onPressed: () { 234 | Navigator.of(context).pop(); 235 | }, 236 | child: Text("Cancel"), 237 | style: ElevatedButton.styleFrom( 238 | backgroundColor: Color.fromARGB(255, 168, 5, 200)), 239 | ), 240 | ElevatedButton( 241 | onPressed: () async { 242 | if (groupname != "") { 243 | setState(() { 244 | _isLoading = true; 245 | }); 246 | DatabaseService( 247 | uid: FirebaseAuth.instance.currentUser!.uid) 248 | .creatGroup( 249 | username, 250 | FirebaseAuth.instance.currentUser!.uid, 251 | groupname) 252 | .whenComplete(() { 253 | _isLoading = false; 254 | }); 255 | Navigator.of(context).pop(); 256 | showSnackBar(context, Colors.green, 257 | "Group created successfully."); 258 | } 259 | }, 260 | child: Text("Create"), 261 | style: ElevatedButton.styleFrom( 262 | backgroundColor: Color.fromARGB(255, 168, 5, 200)), 263 | ) 264 | ], 265 | ); 266 | }), 267 | ); 268 | }); 269 | } 270 | 271 | grouplist() { 272 | return StreamBuilder( 273 | stream: groups, 274 | builder: (context, AsyncSnapshot snapshot) { 275 | //checks 276 | if (snapshot.hasData) { 277 | if (snapshot.data['groups'] != null) { 278 | if (snapshot.data['groups'].length != 0) { 279 | return ListView.builder( 280 | itemCount: snapshot.data['groups'].length, 281 | itemBuilder: ((context, index) { 282 | int reverseIndex = snapshot.data['groups'].length - index - 1; 283 | return GroupTile( 284 | groupid: getId(snapshot.data['groups'][reverseIndex]), 285 | groupname: getName(snapshot.data['groups'][reverseIndex]), 286 | username: snapshot.data['fullname']); 287 | }), 288 | ); 289 | } else { 290 | return noGroupsWidget(); 291 | } 292 | } else { 293 | return noGroupsWidget(); 294 | } 295 | } else { 296 | return Center( 297 | child: CircularProgressIndicator( 298 | color: Theme.of(context).primaryColor, 299 | ), 300 | ); 301 | } 302 | }, 303 | ); 304 | } 305 | 306 | noGroupsWidget() { 307 | return Container( 308 | padding: const EdgeInsets.symmetric(horizontal: 25), 309 | child: Column( 310 | mainAxisAlignment: MainAxisAlignment.center, 311 | crossAxisAlignment: CrossAxisAlignment.center, 312 | children: [ 313 | GestureDetector( 314 | onTap: (() { 315 | popUpDialog(context); 316 | }), 317 | child: Icon( 318 | Icons.add_circle, 319 | color: Colors.grey[700], 320 | size: 75, 321 | ), 322 | ), 323 | SizedBox( 324 | height: 20, 325 | ), 326 | const Text( 327 | "you have not joined to any group! tap on the add icon to create group or search from top button", 328 | style: TextStyle(color: Colors.white), 329 | textAlign: TextAlign.center, 330 | ) 331 | ], 332 | ), 333 | ); 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _discoveryapis_commons: 5 | dependency: transitive 6 | description: 7 | name: _discoveryapis_commons 8 | sha256: efd530ec09e3fea98529b0d2b192495e252e336c6e93ea8df1875e6e823ebc62 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "1.0.5" 12 | _flutterfire_internals: 13 | dependency: transitive 14 | description: 15 | name: _flutterfire_internals 16 | sha256: "3ff770dfff04a67b0863dff205a0936784de1b87a5e99b11c693fc10e66a9ce3" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "1.0.12" 20 | async: 21 | dependency: transitive 22 | description: 23 | name: async 24 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "2.10.0" 28 | boolean_selector: 29 | dependency: transitive 30 | description: 31 | name: boolean_selector 32 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "2.1.1" 36 | characters: 37 | dependency: transitive 38 | description: 39 | name: characters 40 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.2.1" 44 | clock: 45 | dependency: transitive 46 | description: 47 | name: clock 48 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.1.1" 52 | cloud_firestore: 53 | dependency: "direct main" 54 | description: 55 | name: cloud_firestore 56 | sha256: a851106a2169c15614047b75ea10d0346650352c6669ab482306572aa4ed9a7d 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "4.3.1" 60 | cloud_firestore_platform_interface: 61 | dependency: transitive 62 | description: 63 | name: cloud_firestore_platform_interface 64 | sha256: "1fac512fef2bfe84ca7f372defbd9dd8efb108be96854db9023739a5b2aa9977" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "5.10.1" 68 | cloud_firestore_web: 69 | dependency: transitive 70 | description: 71 | name: cloud_firestore_web 72 | sha256: "3fd9581c1447b6e8db6d0f19d0140b196a70ecf582bd1f71e7141fe9abf10ddb" 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "3.2.1" 76 | collection: 77 | dependency: transitive 78 | description: 79 | name: collection 80 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 81 | url: "https://pub.dev" 82 | source: hosted 83 | version: "1.17.0" 84 | crypto: 85 | dependency: transitive 86 | description: 87 | name: crypto 88 | sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 89 | url: "https://pub.dev" 90 | source: hosted 91 | version: "3.0.2" 92 | cupertino_icons: 93 | dependency: "direct main" 94 | description: 95 | name: cupertino_icons 96 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 97 | url: "https://pub.dev" 98 | source: hosted 99 | version: "1.0.5" 100 | fake_async: 101 | dependency: transitive 102 | description: 103 | name: fake_async 104 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 105 | url: "https://pub.dev" 106 | source: hosted 107 | version: "1.3.1" 108 | ffi: 109 | dependency: transitive 110 | description: 111 | name: ffi 112 | sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 113 | url: "https://pub.dev" 114 | source: hosted 115 | version: "2.0.1" 116 | file: 117 | dependency: transitive 118 | description: 119 | name: file 120 | sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" 121 | url: "https://pub.dev" 122 | source: hosted 123 | version: "6.1.4" 124 | firebase_auth: 125 | dependency: "direct main" 126 | description: 127 | name: firebase_auth 128 | sha256: ac3c7c8022c1032c1dc7d16e62db1d6f1e2fbdc8c1039ee706d8deb45eca3a42 129 | url: "https://pub.dev" 130 | source: hosted 131 | version: "4.2.5" 132 | firebase_auth_dart: 133 | dependency: "direct main" 134 | description: 135 | name: firebase_auth_dart 136 | sha256: d1997bd04ef110064f9de1441cfca2a61c402ec0848889177568cb7d1ebd4d28 137 | url: "https://pub.dev" 138 | source: hosted 139 | version: "1.0.1" 140 | firebase_auth_platform_interface: 141 | dependency: transitive 142 | description: 143 | name: firebase_auth_platform_interface 144 | sha256: "325d934e21826b3e7030f5018ef61927e2083b4c4fb25218ddef6ffc0012b717" 145 | url: "https://pub.dev" 146 | source: hosted 147 | version: "6.11.7" 148 | firebase_auth_web: 149 | dependency: transitive 150 | description: 151 | name: firebase_auth_web 152 | sha256: "3fb9fafcd3541005a309c1a696f7df6294893a0c44f010f4ed1b0ded4793c858" 153 | url: "https://pub.dev" 154 | source: hosted 155 | version: "5.2.4" 156 | firebase_core: 157 | dependency: "direct main" 158 | description: 159 | name: firebase_core 160 | sha256: c129209ba55f3d4272c89fb4a4994c15bea77fb6de63a82d45fb6bc5c94e4355 161 | url: "https://pub.dev" 162 | source: hosted 163 | version: "2.4.1" 164 | firebase_core_dart: 165 | dependency: transitive 166 | description: 167 | name: firebase_core_dart 168 | sha256: ccb96c29ae686f43ad80f8f0893717361b7959a88b276c5e2c3627d12a9f1de8 169 | url: "https://pub.dev" 170 | source: hosted 171 | version: "1.0.1" 172 | firebase_core_platform_interface: 173 | dependency: transitive 174 | description: 175 | name: firebase_core_platform_interface 176 | sha256: "5fab93f5b354648efa62e7cc829c90efb68c8796eecf87e0888cae2d5f3accd4" 177 | url: "https://pub.dev" 178 | source: hosted 179 | version: "4.5.2" 180 | firebase_core_web: 181 | dependency: transitive 182 | description: 183 | name: firebase_core_web 184 | sha256: "18b35ce111b0a4266abf723c825bcf9d4e2519d13638cc7f06f2a8dd960c75bc" 185 | url: "https://pub.dev" 186 | source: hosted 187 | version: "2.1.0" 188 | firebaseapis: 189 | dependency: transitive 190 | description: 191 | name: firebaseapis 192 | sha256: "20463b2db376612cac8abdafbb839e8500521c30d0ea14e3673c40487a1f362b" 193 | url: "https://pub.dev" 194 | source: hosted 195 | version: "0.1.2" 196 | flutter: 197 | dependency: "direct main" 198 | description: flutter 199 | source: sdk 200 | version: "0.0.0" 201 | flutter_lints: 202 | dependency: "direct dev" 203 | description: 204 | name: flutter_lints 205 | sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 206 | url: "https://pub.dev" 207 | source: hosted 208 | version: "2.0.1" 209 | flutter_test: 210 | dependency: "direct dev" 211 | description: flutter 212 | source: sdk 213 | version: "0.0.0" 214 | flutter_web_plugins: 215 | dependency: transitive 216 | description: flutter 217 | source: sdk 218 | version: "0.0.0" 219 | googleapis_auth: 220 | dependency: transitive 221 | description: 222 | name: googleapis_auth 223 | sha256: "127b1bbd32170ab8312f503bd57f1d654d8e4039ddfbc63c027d3f7ade0eff74" 224 | url: "https://pub.dev" 225 | source: hosted 226 | version: "1.3.1" 227 | http: 228 | dependency: transitive 229 | description: 230 | name: http 231 | sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" 232 | url: "https://pub.dev" 233 | source: hosted 234 | version: "0.13.5" 235 | http_parser: 236 | dependency: transitive 237 | description: 238 | name: http_parser 239 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" 240 | url: "https://pub.dev" 241 | source: hosted 242 | version: "4.0.2" 243 | intl: 244 | dependency: transitive 245 | description: 246 | name: intl 247 | sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" 248 | url: "https://pub.dev" 249 | source: hosted 250 | version: "0.17.0" 251 | js: 252 | dependency: transitive 253 | description: 254 | name: js 255 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 256 | url: "https://pub.dev" 257 | source: hosted 258 | version: "0.6.5" 259 | lints: 260 | dependency: transitive 261 | description: 262 | name: lints 263 | sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" 264 | url: "https://pub.dev" 265 | source: hosted 266 | version: "2.0.1" 267 | matcher: 268 | dependency: transitive 269 | description: 270 | name: matcher 271 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 272 | url: "https://pub.dev" 273 | source: hosted 274 | version: "0.12.13" 275 | material_color_utilities: 276 | dependency: transitive 277 | description: 278 | name: material_color_utilities 279 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 280 | url: "https://pub.dev" 281 | source: hosted 282 | version: "0.2.0" 283 | meta: 284 | dependency: transitive 285 | description: 286 | name: meta 287 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 288 | url: "https://pub.dev" 289 | source: hosted 290 | version: "1.8.0" 291 | path: 292 | dependency: transitive 293 | description: 294 | name: path 295 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 296 | url: "https://pub.dev" 297 | source: hosted 298 | version: "1.8.2" 299 | path_provider_linux: 300 | dependency: transitive 301 | description: 302 | name: path_provider_linux 303 | sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 304 | url: "https://pub.dev" 305 | source: hosted 306 | version: "2.1.7" 307 | path_provider_platform_interface: 308 | dependency: transitive 309 | description: 310 | name: path_provider_platform_interface 311 | sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 312 | url: "https://pub.dev" 313 | source: hosted 314 | version: "2.0.5" 315 | path_provider_windows: 316 | dependency: transitive 317 | description: 318 | name: path_provider_windows 319 | sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c 320 | url: "https://pub.dev" 321 | source: hosted 322 | version: "2.1.3" 323 | platform: 324 | dependency: transitive 325 | description: 326 | name: platform 327 | sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" 328 | url: "https://pub.dev" 329 | source: hosted 330 | version: "3.1.0" 331 | plugin_platform_interface: 332 | dependency: transitive 333 | description: 334 | name: plugin_platform_interface 335 | sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a 336 | url: "https://pub.dev" 337 | source: hosted 338 | version: "2.1.3" 339 | process: 340 | dependency: transitive 341 | description: 342 | name: process 343 | sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" 344 | url: "https://pub.dev" 345 | source: hosted 346 | version: "4.2.4" 347 | shared_preferences: 348 | dependency: "direct main" 349 | description: 350 | name: shared_preferences 351 | sha256: "5949029e70abe87f75cfe59d17bf5c397619c4b74a099b10116baeb34786fad9" 352 | url: "https://pub.dev" 353 | source: hosted 354 | version: "2.0.17" 355 | shared_preferences_android: 356 | dependency: transitive 357 | description: 358 | name: shared_preferences_android 359 | sha256: "955e9736a12ba776bdd261cf030232b30eadfcd9c79b32a3250dd4a494e8c8f7" 360 | url: "https://pub.dev" 361 | source: hosted 362 | version: "2.0.15" 363 | shared_preferences_foundation: 364 | dependency: transitive 365 | description: 366 | name: shared_preferences_foundation 367 | sha256: "1ffa239043ab8baf881ec3094a3c767af9d10399b2839020b9e4d44c0bb23951" 368 | url: "https://pub.dev" 369 | source: hosted 370 | version: "2.1.2" 371 | shared_preferences_linux: 372 | dependency: transitive 373 | description: 374 | name: shared_preferences_linux 375 | sha256: f8ea038aa6da37090093974ebdcf4397010605fd2ff65c37a66f9d28394cb874 376 | url: "https://pub.dev" 377 | source: hosted 378 | version: "2.1.3" 379 | shared_preferences_platform_interface: 380 | dependency: transitive 381 | description: 382 | name: shared_preferences_platform_interface 383 | sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 384 | url: "https://pub.dev" 385 | source: hosted 386 | version: "2.1.0" 387 | shared_preferences_web: 388 | dependency: transitive 389 | description: 390 | name: shared_preferences_web 391 | sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 392 | url: "https://pub.dev" 393 | source: hosted 394 | version: "2.0.4" 395 | shared_preferences_windows: 396 | dependency: transitive 397 | description: 398 | name: shared_preferences_windows 399 | sha256: "5eaf05ae77658d3521d0e993ede1af962d4b326cd2153d312df716dc250f00c9" 400 | url: "https://pub.dev" 401 | source: hosted 402 | version: "2.1.3" 403 | sky_engine: 404 | dependency: transitive 405 | description: flutter 406 | source: sdk 407 | version: "0.0.99" 408 | source_span: 409 | dependency: transitive 410 | description: 411 | name: source_span 412 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 413 | url: "https://pub.dev" 414 | source: hosted 415 | version: "1.9.1" 416 | stack_trace: 417 | dependency: transitive 418 | description: 419 | name: stack_trace 420 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 421 | url: "https://pub.dev" 422 | source: hosted 423 | version: "1.11.0" 424 | storagebox: 425 | dependency: transitive 426 | description: 427 | name: storagebox 428 | sha256: "698ac7c3399f21d9a8d36820581c0c7b89aae6e8f2a2476edac483936c199a37" 429 | url: "https://pub.dev" 430 | source: hosted 431 | version: "0.1.0+3" 432 | stream_channel: 433 | dependency: transitive 434 | description: 435 | name: stream_channel 436 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 437 | url: "https://pub.dev" 438 | source: hosted 439 | version: "2.1.1" 440 | string_scanner: 441 | dependency: transitive 442 | description: 443 | name: string_scanner 444 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 445 | url: "https://pub.dev" 446 | source: hosted 447 | version: "1.2.0" 448 | term_glyph: 449 | dependency: transitive 450 | description: 451 | name: term_glyph 452 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 453 | url: "https://pub.dev" 454 | source: hosted 455 | version: "1.2.1" 456 | test_api: 457 | dependency: transitive 458 | description: 459 | name: test_api 460 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 461 | url: "https://pub.dev" 462 | source: hosted 463 | version: "0.4.16" 464 | typed_data: 465 | dependency: transitive 466 | description: 467 | name: typed_data 468 | sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" 469 | url: "https://pub.dev" 470 | source: hosted 471 | version: "1.3.1" 472 | vector_math: 473 | dependency: transitive 474 | description: 475 | name: vector_math 476 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 477 | url: "https://pub.dev" 478 | source: hosted 479 | version: "2.1.4" 480 | win32: 481 | dependency: transitive 482 | description: 483 | name: win32 484 | sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 485 | url: "https://pub.dev" 486 | source: hosted 487 | version: "3.1.3" 488 | xdg_directories: 489 | dependency: transitive 490 | description: 491 | name: xdg_directories 492 | sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86 493 | url: "https://pub.dev" 494 | source: hosted 495 | version: "0.2.0+3" 496 | sdks: 497 | dart: ">=2.18.5 <4.0.0" 498 | flutter: ">=3.0.0" 499 | --------------------------------------------------------------------------------