├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ ├── flutter_export_environment.sh │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── assets ├── icon │ ├── logo.png │ ├── github_ic.png │ ├── linkedin_ic.png │ └── ic_notification.png ├── screenshots │ ├── mock1.jpg │ ├── mock2.jpg │ ├── mock3.jpg │ ├── mock4.jpg │ └── mock5.jpg └── fonts │ └── Rubik │ ├── Rubik-Light.ttf │ ├── Rubik-Medium.ttf │ └── Rubik-Regular.ttf ├── android ├── app │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── launcher_icon.png │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── launcher_icon.png │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── launcher_icon.png │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_notification.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── launcher_icon.png │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── chat_app │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── .classpath │ ├── .project │ ├── google-services.json │ └── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .settings │ └── org.eclipse.buildship.core.prefs ├── .project ├── settings.gradle └── build.gradle ├── lib ├── src │ ├── screens │ │ ├── chats │ │ │ ├── chats_gql.dart │ │ │ ├── model.dart │ │ │ └── chats.dart │ │ ├── settings │ │ │ ├── settings_gql.dart │ │ │ └── settings.dart │ │ ├── users │ │ │ ├── users_gql.dart │ │ │ ├── model.dart │ │ │ └── users.dart │ │ ├── auth │ │ │ ├── auth_gql.dart │ │ │ ├── auth.dart │ │ │ ├── model.dart │ │ │ └── components │ │ │ │ ├── tab_bar.dart │ │ │ │ └── auth_views.dart │ │ ├── messages │ │ │ ├── messages_gql.dart │ │ │ ├── model.dart │ │ │ └── messages.dart │ │ └── about │ │ │ └── about.dart │ ├── constants │ │ ├── gradients.dart │ │ └── colors.dart │ ├── state │ │ └── app_state.dart │ └── app.dart └── main.dart ├── .metadata ├── .gitignore ├── README.md ├── pubspec.yaml └── pubspec.lock /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /assets/icon/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/icon/logo.png -------------------------------------------------------------------------------- /assets/icon/github_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/icon/github_ic.png -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /assets/icon/linkedin_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/icon/linkedin_ic.png -------------------------------------------------------------------------------- /assets/screenshots/mock1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/screenshots/mock1.jpg -------------------------------------------------------------------------------- /assets/screenshots/mock2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/screenshots/mock2.jpg -------------------------------------------------------------------------------- /assets/screenshots/mock3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/screenshots/mock3.jpg -------------------------------------------------------------------------------- /assets/screenshots/mock4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/screenshots/mock4.jpg -------------------------------------------------------------------------------- /assets/screenshots/mock5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/screenshots/mock5.jpg -------------------------------------------------------------------------------- /assets/icon/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/icon/ic_notification.png -------------------------------------------------------------------------------- /assets/fonts/Rubik/Rubik-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/fonts/Rubik/Rubik-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/Rubik/Rubik-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/fonts/Rubik/Rubik-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/Rubik/Rubik-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/assets/fonts/Rubik/Rubik-Regular.ttf -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/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/vineeshvk/chat-app-flutter/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/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-hdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-mdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_notification.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vineeshvk/chat-app-flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/src/screens/chats/chats_gql.dart: -------------------------------------------------------------------------------- 1 | String getChatsQuery = """ 2 | query GetChats{ 3 | getChats{ 4 | id 5 | name 6 | lastMessage 7 | members{ 8 | email 9 | id 10 | } 11 | } 12 | } 13 | """; 14 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 08 20:47:03 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=C\:/Program Files/Java/jdk1.8.0_221 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /lib/src/screens/settings/settings_gql.dart: -------------------------------------------------------------------------------- 1 | String deleteUserMutation = """ 2 | mutation DeleteUser{ 3 | deleteUser 4 | } 5 | """; 6 | 7 | String meQuery = """ 8 | query Me{ 9 | me{ 10 | id 11 | name 12 | } 13 | } 14 | """; 15 | 16 | String renameUserMutation = """ 17 | mutation RenameUser(\$name: String){ 18 | renameUser(name: \$name){ 19 | error{ 20 | path 21 | message 22 | } 23 | id 24 | } 25 | } 26 | """; 27 | -------------------------------------------------------------------------------- /lib/src/screens/users/users_gql.dart: -------------------------------------------------------------------------------- 1 | String getUserQuery = """ 2 | query GetUsers { 3 | getUsers{ 4 | users{ 5 | id 6 | email 7 | name 8 | } 9 | error{ 10 | path 11 | message 12 | } 13 | } 14 | } 15 | """; 16 | 17 | String createChatMutation = """ 18 | mutation CreateChat(\$membersId:[String]!,\$name:String){ 19 | createChat(membersId:\$membersId,name:\$name){ 20 | message 21 | path 22 | } 23 | } 24 | """; 25 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/chat_app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.chat_app; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/screens/auth/auth_gql.dart: -------------------------------------------------------------------------------- 1 | String signinMutation = """ 2 | mutation Login(\$email:String!, \$password:String!,\$fcmToken:String){ 3 | login(email:\$email,password:\$password,fcmToken:\$fcmToken){ 4 | error{ 5 | message 6 | } 7 | id 8 | token 9 | } 10 | } 11 | """; 12 | 13 | String signupMutation = """ 14 | mutation Register(\$email:String!, \$password:String!,\$name:String!,\$fcmToken:String){ 15 | register(email:\$email,password:\$password,name:\$name,fcmToken:\$fcmToken){ 16 | error{ 17 | message 18 | } 19 | id 20 | token 21 | } 22 | } 23 | """; 24 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=C:\Users\vineesh\tools\flutter" 4 | export "FLUTTER_APPLICATION_PATH=C:\Users\vineesh\workspace\flutter\chat-app-flutter" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "OTHER_LDFLAGS=$(inherited) -framework Flutter" 9 | export "FLUTTER_FRAMEWORK_DIR=C:\Users\vineesh\tools\flutter\bin\cache\artifacts\engine\ios" 10 | export "FLUTTER_BUILD_NAME=1.0.0" 11 | export "FLUTTER_BUILD_NUMBER=1" 12 | -------------------------------------------------------------------------------- /lib/src/screens/auth/auth.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/screens/auth/components/auth_views.dart'; 2 | import 'package:chat_app/src/screens/auth/components/tab_bar.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | class AuthScreen extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | body: TabBarComponent( 11 | tabs: ["LOG IN", "SIGN UP"], 12 | tabViews: [ 13 | AuthViews(), 14 | AuthViews(signup: true), 15 | ], 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/screens/users/model.dart: -------------------------------------------------------------------------------- 1 | class UsersModel { 2 | final List users; 3 | 4 | UsersModel({this.users}); 5 | 6 | factory UsersModel.fromJson(List json) { 7 | var users = json.map((userItem) => UserModel.fromJson(userItem)).toList(); 8 | return UsersModel(users: users); 9 | } 10 | } 11 | 12 | class UserModel { 13 | final String id, email, name; 14 | 15 | UserModel({this.id, this.email, this.name}); 16 | 17 | factory UserModel.fromJson(dynamic json) { 18 | return UserModel( 19 | id: json['id'].toString(), 20 | email: json['email'].toString(), 21 | name: json['name'], 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | classpath 'com.google.gms:google-services:4.2.0' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/constants/gradients.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | const RED_GRADIENT = RadialGradient( 5 | center: Alignment.bottomRight, radius: 2, colors: [LIGHT_RED, DARK_RED]); 6 | 7 | const BLUE_GRADIENT = LinearGradient( 8 | colors: [DARK_GREEN, LIGHT_GREEN], 9 | begin: Alignment.topLeft, 10 | end: Alignment.bottomRight); 11 | 12 | const ORANGE_GRADIENT = LinearGradient( 13 | colors: [DARK_ORANGE, PALE_ORANGE], 14 | begin: Alignment.topLeft, 15 | end: Alignment.bottomRight); 16 | 17 | const BRIGHT_ORANGE_GRADIENT = 18 | LinearGradient(colors: [Color(0xFFD84708), Color(0xFFF77D48)]); 19 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/app.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:graphql_flutter/graphql_flutter.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | main() async { 7 | WidgetsFlutterBinding.ensureInitialized(); 8 | 9 | SharedPreferences prefs = await SharedPreferences.getInstance(); 10 | var token = prefs.getString('token'); 11 | 12 | HttpLink httpLink = HttpLink(uri: 'https://chapserver.herokuapp.com/'); 13 | 14 | ValueNotifier client = ValueNotifier( 15 | GraphQLClient(cache: InMemoryCache(), link: httpLink), 16 | ); 17 | 18 | runApp(App(auth: token != null, client: client)); 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/screens/auth/model.dart: -------------------------------------------------------------------------------- 1 | class AuthModel { 2 | final String id; 3 | final ErrorModel error; 4 | final String token; 5 | 6 | AuthModel({this.id, this.error, this.token}); 7 | 8 | factory AuthModel.fromJson(Map json) { 9 | return AuthModel( 10 | id: json["id"], 11 | error: 12 | json['error'] != null ? ErrorModel.fromJson(json['error']) : null, 13 | token: json['token']); 14 | } 15 | } 16 | 17 | class ErrorModel { 18 | final String path; 19 | final String message; 20 | 21 | ErrorModel({this.path, this.message}); 22 | 23 | factory ErrorModel.fromJson(Map json) { 24 | return ErrorModel(path: json['path'], message: json['message']); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/constants/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const LIGHT_GREEN = Color.fromRGBO(60, 232, 211, 1); 4 | const DARK_GREEN = Color.fromRGBO(0, 152, 161, 1); 5 | 6 | const CRIMSON_RED = Color.fromRGBO(163, 35, 35, 1); 7 | const DARK_RED = Color.fromRGBO(124, 2, 2, 1); 8 | const LIGHT_RED = Color.fromRGBO(255, 126, 126, 1); 9 | 10 | const WHITE_COLOR = Colors.white; 11 | const BLACK_COLOR = Colors.black; 12 | 13 | const LIGHT_GREY_COLOR = Color.fromRGBO(241, 241, 241, 1); 14 | 15 | const DARK_ORANGE = Color.fromRGBO(214, 68, 5, 1); 16 | const PALE_ORANGE = Color.fromRGBO(247, 126, 74, 1); 17 | 18 | const BLUE_SHADOW = Color.fromRGBO(0, 172, 183, 0.2); 19 | const ORANGE_SHADOW = Color.fromRGBO(254, 137, 0, 0.2); 20 | 21 | const PURPLE_COLOR = Color.fromRGBO(115, 130, 255, 1); 22 | const DARK_PURPLE_COLOR = Color.fromRGBO(28, 34, 87, 1); -------------------------------------------------------------------------------- /lib/src/screens/messages/messages_gql.dart: -------------------------------------------------------------------------------- 1 | String createMessageMutation = """ 2 | mutation createMessage(\$chatId: String!, \$text: String!){ 3 | createMessage(chatId: \$chatId, text: \$text){ 4 | path 5 | message 6 | } 7 | } 8 | """; 9 | 10 | String getMessagesQuery = """ 11 | query getMessages(\$chatId: String!){ 12 | getMessages(chatId: \$chatId){ 13 | error{ 14 | path 15 | message 16 | } 17 | chat{ 18 | id 19 | messages{ 20 | id 21 | sender{ 22 | id 23 | name 24 | email 25 | } 26 | text 27 | me 28 | } 29 | } 30 | } 31 | } 32 | """; 33 | 34 | String deleteChatMutation = """ 35 | mutation DeletChat(\$chatId: String){ 36 | deleteChat(chatId: \$chatId){ 37 | error{ 38 | path 39 | message 40 | } 41 | id 42 | } 43 | } 44 | """; 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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/src/screens/chats/model.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/screens/users/model.dart'; 2 | 3 | class ChatListModel { 4 | final List chats; 5 | ChatListModel({this.chats}); 6 | 7 | factory ChatListModel.fromJson(List json) { 8 | var chats = json.map((chat) => ChatModel.fromJson(chat)); 9 | return ChatListModel(chats: chats.toList() ?? []); 10 | } 11 | } 12 | 13 | class ChatModel { 14 | final String id; 15 | final String name; 16 | final String lastMessage; 17 | final List members; 18 | 19 | ChatModel({this.id, this.name, this.members, this.lastMessage}); 20 | 21 | factory ChatModel.fromJson(Map json) { 22 | List jsonM = json['members']; 23 | var members = jsonM.map((member) => UserModel.fromJson(member)); 24 | return ChatModel( 25 | id: json['id'], 26 | name: json['name'], 27 | members: members.toList(), 28 | lastMessage: json['lastMessage']); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/screens/messages/model.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/screens/users/model.dart'; 2 | 3 | class MessageListModel { 4 | final String chatId; 5 | 6 | final List messages; 7 | 8 | MessageListModel({this.chatId, this.messages}); 9 | 10 | factory MessageListModel.fromJson(Map json) { 11 | List msg = json['messages']; 12 | var messages = msg.map((item) => MessageModel.fromJson(item)); 13 | return MessageListModel(chatId: json['id'], messages: messages.toList()); 14 | } 15 | } 16 | 17 | class MessageModel { 18 | final String id; 19 | final UserModel sender; 20 | final String text; 21 | final bool me; 22 | 23 | MessageModel({this.id, this.sender, this.text, this.me}); 24 | 25 | factory MessageModel.fromJson(dynamic json) { 26 | UserModel sender = UserModel.fromJson(json['sender']); 27 | return MessageModel( 28 | id: json['id'], text: json['text'], me: json['me'], sender: sender); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "979189403657", 4 | "firebase_url": "https://chap-app27.firebaseio.com", 5 | "project_id": "chap-app27", 6 | "storage_bucket": "chap-app27.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:979189403657:android:7c6e37ca0013f22c", 12 | "android_client_info": { 13 | "package_name": "com.example.chat_app" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "979189403657-fvtu5q0u74icq9t711a9tb4pp7r5u81f.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyBEfZdAocxlVf9iZ3nVuRwduyCJ71v-Ftw" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "979189403657-fvtu5q0u74icq9t711a9tb4pp7r5u81f.apps.googleusercontent.com", 32 | "client_type": 3 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ], 39 | "configuration_version": "1" 40 | } -------------------------------------------------------------------------------- /lib/src/state/app_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class AppState extends ChangeNotifier { 6 | AppState() { 7 | findTheme(); 8 | } 9 | 10 | Future findTheme() async { 11 | final pref = await SharedPreferences.getInstance(); 12 | final dark = pref.getBool("dark") ?? false; 13 | final tokenP = pref.getString('token') ?? ""; 14 | if (tokenP != "") _token = tokenP; 15 | if (dark) 16 | setDark(); 17 | else 18 | setLight(); 19 | } 20 | 21 | String _token = ""; 22 | ThemeData currentTheme = ThemeData(fontFamily: "Rubik"); 23 | 24 | void setToken(String val) { 25 | _token = val; 26 | notifyListeners(); 27 | } 28 | 29 | void setDark() { 30 | currentTheme = ThemeData(fontFamily: 'Rubik', brightness: Brightness.dark); 31 | notifyListeners(); 32 | } 33 | 34 | void setLight() { 35 | currentTheme = ThemeData(fontFamily: 'Rubik', brightness: Brightness.light); 36 | notifyListeners(); 37 | } 38 | 39 | void toggleTheme() { 40 | currentTheme = ThemeData( 41 | fontFamily: 'Rubik', 42 | brightness: currentTheme.brightness == Brightness.dark 43 | ? Brightness.light 44 | : Brightness.dark, 45 | ); 46 | notifyListeners(); 47 | } 48 | 49 | String get token => _token; 50 | } 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins* 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | chat_app 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Chap Client 4 | 5 | It's a fully functional and secure cross platform chat application built using flutter and uses a graphql server that acts as an interface between the Database and the client. 6 | 7 | ## Contributors 8 | 9 | [Vineesh](http://github.com/vineeshvk) (me) - **Front-end and Back-end developer** 10 | 11 | [Roshan G Rahman](http://github.com/roshanrahman) - **Designer** 12 | 13 | ## Server 14 | 15 | [Chat app server](http://github.com/vineeshvk/chat-app-server) is the used as the backend for this app. 16 | 17 | ## Release 18 | 19 | > Download the [chap.apk](https://github.com/vineeshvk/chat-app-flutter/releases/download/1.0/Chat-flutter.apk) for android 20 | 21 | ## Screenshots 22 | 23 | ![](assets/screenshots/mock1.jpg) 24 | ![](assets/screenshots/mock2.jpg) 25 | ![](assets/screenshots/mock3.jpg) 26 | ![](assets/screenshots/mock4.jpg) 27 | ![](assets/screenshots/mock5.jpg) 28 | 29 | ## Features 30 | - signup and signin 31 | - create individual and group chats and delete them 32 | - view and add messages 33 | - dark mode 34 | - notification(only for android) 35 | - instant messages 36 | 37 | ## Tools used 38 | - [Flutter & Dart](http://flutter.dev) 39 | - [Firebase Messaging Flutter](https://pub.dev/packages/firebase_messaging) 40 | - [Provider State Management](https://pub.dev/packages/provider) 41 | - [Graphql Flutter](https://pub.dev/packages/graphql_flutter) 42 | - [Shared Preferences](https://pub.dev/packages/shared_preferences) 43 | 44 | ## How to run 45 | 46 | First go and setup the [server](http://github.com/vineeshvk/chat-app-server) for the chat app 47 | ``` 48 | flutter packages get 49 | ``` 50 | 51 | ``` 52 | flutter run --release 53 | ``` 54 | -------------------------------------------------------------------------------- /lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/screens/auth/auth.dart'; 2 | import 'package:chat_app/src/screens/chats/chats.dart'; 3 | import 'package:chat_app/src/state/app_state.dart'; 4 | import 'package:firebase_messaging/firebase_messaging.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | import 'package:graphql_flutter/graphql_flutter.dart'; 8 | import 'package:provider/provider.dart'; 9 | 10 | class App extends StatelessWidget { 11 | final bool auth; 12 | final client; 13 | App({this.auth = false, this.client}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GraphQLProvider( 18 | client: client, 19 | child: CacheProvider( 20 | child: ChangeNotifierProvider( 21 | builder: (_) => AppState(), 22 | child: MaterialAppWidget(auth: auth), 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | 29 | // have to create a new class inorder to use the provider 30 | class MaterialAppWidget extends StatelessWidget { 31 | final bool auth; 32 | final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); 33 | 34 | MaterialAppWidget({this.auth = false}) { 35 | _firebaseMessaging.configure(); 36 | _firebaseMessaging.requestNotificationPermissions( 37 | IosNotificationSettings(sound: true, badge: true, alert: true)); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | final appState = Provider.of(context); 43 | 44 | SystemChrome.setSystemUIOverlayStyle( 45 | SystemUiOverlayStyle.dark.copyWith( 46 | statusBarColor: Colors.transparent, 47 | statusBarIconBrightness: 48 | appState.currentTheme.brightness == Brightness.dark 49 | ? Brightness.light 50 | : Brightness.dark, 51 | ), 52 | ); 53 | 54 | return MaterialApp( 55 | theme: appState.currentTheme, 56 | title: "chat app", 57 | home: auth ? ChatListScreen() : AuthScreen(), 58 | debugShowCheckedModeBanner: false, 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /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 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.chat_app" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | 59 | // implementation 'com.google.firebase:firebase-core:16.0.9' 60 | implementation 'com.google.firebase:firebase-messaging:18.0.0' 61 | testImplementation 'junit:junit:4.12' 62 | androidTestImplementation 'androidx.test:runner:1.1.0' 63 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 64 | } 65 | 66 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 16 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/screens/auth/components/tab_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class TabBarComponent extends StatelessWidget { 5 | final List tabs; 6 | final List tabViews; 7 | 8 | TabBarComponent({@required this.tabs, @required this.tabViews}); 9 | 10 | @override 11 | Widget build(BuildContext context) => body(context); 12 | 13 | Widget body(context) { 14 | return DefaultTabController( 15 | length: 2, 16 | child: Scaffold( 17 | appBar: PreferredSize( 18 | preferredSize: Size.fromHeight(5000), 19 | child: Container( 20 | height: 90.0, 21 | decoration: containerDecoration(), 22 | padding: EdgeInsets.only(top: 20), 23 | child: tabBarComponent()), 24 | ), 25 | body: tabBarViews(), 26 | ), 27 | ); 28 | } 29 | 30 | Decoration containerDecoration() { 31 | return BoxDecoration( 32 | color: Colors.white, 33 | borderRadius: BorderRadius.only( 34 | bottomLeft: Radius.circular(25), 35 | bottomRight: Radius.circular(25), 36 | ), 37 | boxShadow: [ 38 | BoxShadow( 39 | color: BLACK_COLOR.withOpacity(.1), 40 | blurRadius: 16, 41 | offset: Offset(0, 4), 42 | ) 43 | ], 44 | ); 45 | } 46 | 47 | Widget tabBarComponent() { 48 | return TabBar( 49 | labelColor: Color(0xFFFF8652), 50 | unselectedLabelColor: Color(0xFFB6B6B6), 51 | indicator: CustomTabIndicator(), 52 | labelStyle: TextStyle( 53 | fontSize: 18, fontFamily: 'Roboto', fontWeight: FontWeight.w500), 54 | tabs: tabs.map((tab) => Tab(text: tab)).toList(), 55 | ); 56 | } 57 | 58 | Widget tabBarViews() { 59 | return TabBarView( 60 | physics: BouncingScrollPhysics(), 61 | children: tabViews, 62 | ); 63 | } 64 | } 65 | 66 | /* ---------------------CUSTOM_PAINTER------------------------ */ 67 | class CustomTabIndicator extends Decoration { 68 | @override 69 | _CustomPainter createBoxPainter([VoidCallback onChanged]) => 70 | _CustomPainter(this, onChanged); 71 | } 72 | 73 | class _CustomPainter extends BoxPainter { 74 | final CustomTabIndicator decoration; 75 | 76 | _CustomPainter(this.decoration, VoidCallback onChanged) 77 | : assert(decoration != null), 78 | super(onChanged); 79 | 80 | @override 81 | void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { 82 | assert(configuration != null); 83 | assert(configuration.size != null); 84 | 85 | final Rect rect = Rect.fromLTWH( 86 | configuration.size.width / 2 + offset.dx - 35, offset.dy + 65, 75, 5); 87 | final Paint paint = Paint(); 88 | paint.color = Color(0xFFFF8652); 89 | paint.style = PaintingStyle.fill; 90 | canvas.drawRRect( 91 | RRect.fromRectAndCorners( 92 | rect, 93 | topLeft: Radius.circular(10), 94 | topRight: Radius.circular(10), 95 | ), 96 | paint, 97 | ); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_app 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: '>=2.2.2 <3.0.0' 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | 22 | # The following adds the Cupertino Icons font to your application. 23 | # Use with the CupertinoIcons class for iOS style icons. 24 | cupertino_icons: ^0.1.2 25 | shared_preferences: ^0.5.7+3 26 | graphql_flutter: ^3.0.0 27 | outline_material_icons: ^0.1.0 28 | provider: 29 | flutter_launcher_icons: ^0.7.2 30 | firebase_messaging: ^5.0.3 31 | url_launcher: ^5.0.3 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | # For information on the generic Dart part of this file, see the 38 | # following page: https://www.dartlang.org/tools/pub/pubspec 39 | 40 | flutter_icons: 41 | android: 'launcher_icon' 42 | ios: true 43 | image_path: 'assets/icon/logo.png' 44 | # The following section is specific to Flutter. 45 | flutter: 46 | # The following line ensures that the Material Icons font is 47 | # included with your application, so that you can use the icons in 48 | # the material Icons class. 49 | uses-material-design: true 50 | # To add assets to your application, add an assets section, like this: 51 | assets: 52 | - assets/icon/github_ic.png 53 | - assets/linkedin_ic.png 54 | # - images/a_dot_burr.jpeg 55 | # - images/a_dot_ham.jpeg 56 | # An image asset can refer to one or more resolution-specific "variants", see 57 | # https://flutter.io/assets-and-images/#resolution-aware. 58 | # For details regarding adding assets from package dependencies, see 59 | # https://flutter.io/assets-and-images/#from-packages 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | fonts: 66 | - family: Rubik 67 | fonts: 68 | - asset: assets/fonts/Rubik/Rubik-Light.ttf 69 | weight: 300 70 | - asset: assets/fonts/Rubik/Rubik-Regular.ttf 71 | weight: 400 72 | - asset: assets/fonts/Rubik/Rubik-Medium.ttf 73 | weight: 500 74 | # - asset: fonts/Schyler-Italic.ttf 75 | # style: italic 76 | # - family: Trajan Pro 77 | # fonts: 78 | # - asset: fonts/TrajanPro.ttf 79 | # - asset: fonts/TrajanPro_Bold.ttf 80 | # weight: 700 81 | # 82 | # For details regarding fonts from package dependencies, 83 | # see https://flutter.io/custom-fonts/#from-packages 84 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /lib/src/screens/about/about.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/constants/gradients.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:url_launcher/url_launcher.dart'; 5 | 6 | class AboutScreen extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: appBarComponent(context), 11 | body: body(context), 12 | ); 13 | } 14 | 15 | Widget appBarComponent(context) { 16 | return PreferredSize( 17 | preferredSize: Size.fromHeight(kToolbarHeight), 18 | child: Container( 19 | child: Row( 20 | children: [ 21 | Container( 22 | width: 90, 23 | height: 80, 24 | padding: EdgeInsets.only(right: 20), 25 | decoration: BoxDecoration( 26 | gradient: BLUE_GRADIENT, 27 | borderRadius: 28 | BorderRadius.only(bottomRight: Radius.circular(100)), 29 | ), 30 | child: IconButton( 31 | icon: Icon( 32 | Icons.arrow_back, 33 | color: WHITE_COLOR, 34 | ), 35 | onPressed: () => Navigator.of(context).pop(), 36 | ), 37 | ), 38 | ], 39 | )), 40 | ); 41 | } 42 | 43 | Widget body(context) { 44 | return Container( 45 | padding: EdgeInsets.all(25), 46 | child: ListView( 47 | children: [ 48 | headerComponent(), 49 | Container(margin: EdgeInsets.only(top: 40)), 50 | descriptionComponent(), 51 | Container(margin: EdgeInsets.only(top: 40)), 52 | codeSourceComponent(), 53 | Container(margin: EdgeInsets.only(top: 20)), 54 | Divider(), 55 | Container(margin: EdgeInsets.only(top: 40)), 56 | developerItemComponent( 57 | "Front-end and Back-end developer", 58 | "Vineesh V", 59 | github: "https://github.com/vineeshvk", 60 | linkedIn: "https://www.linkedin.com/in/vineeshvk/", 61 | ), 62 | Container(margin: EdgeInsets.only(top: 30)), 63 | developerItemComponent( 64 | "Designer", 65 | "Roshan G Rahman", 66 | github: "https://github.com/roshanrahman/", 67 | linkedIn: "https://www.linkedin.com/in/roshanrahman6399/", 68 | ) 69 | ], 70 | ), 71 | ); 72 | } 73 | 74 | Widget headerComponent() { 75 | return Text("About app", style: TextStyle(fontSize: 36)); 76 | } 77 | 78 | Widget descriptionComponent() { 79 | return Text( 80 | "It’s a fully functioning chat application built using flutter and uses graphql to interact with the database", 81 | style: TextStyle( 82 | fontSize: 19, 83 | fontFamily: 'Roboto', 84 | fontWeight: FontWeight.w300, 85 | ), 86 | ); 87 | } 88 | 89 | Widget codeSourceComponent() { 90 | return Row( 91 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 92 | children: [ 93 | Text( 94 | 'Code for the app', 95 | style: TextStyle(fontSize: 18), 96 | ), 97 | OutlineButton.icon( 98 | icon: Icon(Icons.link), 99 | label: Text("Github"), 100 | onPressed: () { 101 | launchURL("github.com/vineeshvk/chat-app-flutter"); 102 | }, 103 | shape: RoundedRectangleBorder( 104 | borderRadius: BorderRadius.circular(10), 105 | ), 106 | ) 107 | ], 108 | ); 109 | } 110 | 111 | Widget developerItemComponent( 112 | String role, 113 | String name, { 114 | String linkedIn, 115 | String github, 116 | }) { 117 | return Column( 118 | crossAxisAlignment: CrossAxisAlignment.start, 119 | children: [ 120 | Text( 121 | role, 122 | style: TextStyle(fontSize: 18), 123 | ), 124 | Container(margin: EdgeInsets.only(top: 5)), 125 | Row( 126 | children: [ 127 | Text( 128 | name, 129 | style: TextStyle(fontSize: 24, color: PALE_ORANGE), 130 | ), 131 | Expanded(child: Container()), 132 | IconButton( 133 | icon: ClipRRect( 134 | borderRadius: BorderRadius.circular(30), 135 | child: Image.asset( 136 | "assets/icon/linkedin_ic.png", 137 | width: 26, 138 | height: 26, 139 | ), 140 | ), 141 | onPressed: () => launchURL(linkedIn), 142 | ), 143 | Container(margin: EdgeInsets.only(left: 5)), 144 | IconButton( 145 | icon: ClipRRect( 146 | borderRadius: BorderRadius.circular(30), 147 | child: Image.asset( 148 | "assets/icon/github_ic.png", 149 | width: 26, 150 | height: 26, 151 | ), 152 | ), 153 | onPressed: () async { 154 | await launchURL(github); 155 | }, 156 | ) 157 | ], 158 | ) 159 | ], 160 | ); 161 | } 162 | 163 | launchURL(url) async { 164 | if (await canLaunch(url)) { 165 | await launch(url); 166 | } else { 167 | throw 'Could not launch $url'; 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /lib/src/screens/chats/chats.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/constants/gradients.dart'; 3 | import 'package:chat_app/src/screens/auth/components/auth_views.dart'; 4 | import 'package:chat_app/src/screens/chats/chats_gql.dart'; 5 | import 'package:chat_app/src/screens/chats/model.dart'; 6 | import 'package:chat_app/src/screens/messages/messages.dart'; 7 | import 'package:chat_app/src/screens/settings/settings.dart'; 8 | import 'package:chat_app/src/screens/users/users.dart'; 9 | import 'package:chat_app/src/state/app_state.dart'; 10 | import 'package:flutter/cupertino.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:graphql_flutter/graphql_flutter.dart'; 13 | import 'package:outline_material_icons/outline_material_icons.dart'; 14 | import 'package:provider/provider.dart'; 15 | 16 | class ChatListScreen extends StatelessWidget { 17 | @override 18 | Widget build(BuildContext context) => Scaffold(body: body(context)); 19 | 20 | Widget body(context) { 21 | return Container( 22 | child: Column( 23 | children: [ 24 | mainListComponent(context), 25 | bottomBarComponent(context) 26 | ], 27 | ), 28 | ); 29 | } 30 | 31 | Widget mainListComponent(context) { 32 | return Expanded( 33 | flex: 1, 34 | child: ListView( 35 | physics: BouncingScrollPhysics(), 36 | children: [ 37 | Container(margin: EdgeInsets.only(top: 40)), 38 | Padding( 39 | padding: const EdgeInsets.only(left: 30), 40 | child: gradientTextComponent( 41 | BLUE_GRADIENT, 42 | "Your Chats", 43 | align: TextAlign.start, 44 | size: 36, 45 | ), 46 | ), 47 | Container(margin: EdgeInsets.only(top: 20)), 48 | chatQueryComponent(context) 49 | ], 50 | ), 51 | ); 52 | } 53 | 54 | Widget chatQueryComponent(context) { 55 | final appState = Provider.of(context); 56 | 57 | return Query( 58 | options: QueryOptions( 59 | documentNode: gql(getChatsQuery), 60 | fetchPolicy: FetchPolicy.cacheAndNetwork, 61 | pollInterval: 15, 62 | context: { 63 | 'headers': { 64 | 'Authorization': 'Bearer ${appState.token}', 65 | }, 66 | }, 67 | ), 68 | builder: (result, {refetch, fetchMore}) { 69 | if (result.loading) return Center(child: CupertinoActivityIndicator()); 70 | if (result.hasException) 71 | return Center(child: Text("Oops something went wrong")); 72 | 73 | if (result.data != null && result.data['getChats'] != null) { 74 | var chatList = ChatListModel.fromJson(result.data['getChats']); 75 | return chatListComponent(chatList.chats ?? []); 76 | } 77 | return Container(); 78 | }, 79 | ); 80 | } 81 | 82 | Widget chatListComponent(List chats) { 83 | return ListView.separated( 84 | separatorBuilder: (context, index) => Divider(indent: 60, height: 0), 85 | physics: BouncingScrollPhysics(), 86 | shrinkWrap: true, 87 | itemCount: chats.length ?? 0, 88 | itemBuilder: (context, index) => chatItem(context, chats[index]), 89 | ); 90 | } 91 | 92 | Widget chatItem(context, ChatModel chat) { 93 | return InkWell( 94 | splashColor: ORANGE_SHADOW, 95 | highlightColor: WHITE_COLOR.withOpacity(.5), 96 | onTap: () { 97 | Navigator.push( 98 | context, 99 | MaterialPageRoute( 100 | builder: (context) => MessageScreen(chatDetails: chat)), 101 | ); 102 | }, 103 | child: Container( 104 | padding: EdgeInsets.all(20), 105 | child: Row( 106 | mainAxisSize: MainAxisSize.max, 107 | crossAxisAlignment: CrossAxisAlignment.start, 108 | children: [ 109 | Container(margin: EdgeInsets.only(left: 10)), 110 | SizedBox( 111 | width: MediaQuery.of(context).size.width / 1.25, 112 | child: Column( 113 | crossAxisAlignment: CrossAxisAlignment.start, 114 | children: [ 115 | Text( 116 | chat.name, 117 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 18), 118 | ), 119 | Container(margin: EdgeInsets.only(top: 5)), 120 | Text( 121 | chat.lastMessage ?? '', 122 | maxLines: 1, 123 | style: TextStyle( 124 | fontFamily: 'Roboto', 125 | fontSize: 14, 126 | color: Color(0xFF979797), 127 | ), 128 | ), 129 | ], 130 | ), 131 | ) 132 | ], 133 | ), 134 | ), 135 | ); 136 | } 137 | 138 | Widget bottomBarComponent(context) { 139 | return Container( 140 | padding: EdgeInsets.only(left: 15), 141 | child: Row( 142 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 143 | children: [ 144 | IconButton( 145 | icon: Icon(OMIcons.settings), 146 | color: Colors.grey[500], 147 | onPressed: () { 148 | Navigator.push(context, 149 | MaterialPageRoute(builder: (context) => SettingScreen())); 150 | }, 151 | ), 152 | GestureDetector( 153 | onTap: () { 154 | Navigator.push(context, 155 | MaterialPageRoute(builder: (context) => UserListScreen())); 156 | }, 157 | child: Container( 158 | height: 55, 159 | width: 170, 160 | padding: EdgeInsets.only(left: 15), 161 | decoration: BoxDecoration( 162 | gradient: BRIGHT_ORANGE_GRADIENT, 163 | borderRadius: BorderRadius.only(topLeft: Radius.circular(100)), 164 | ), 165 | child: Row( 166 | mainAxisAlignment: MainAxisAlignment.center, 167 | children: [ 168 | Icon(Icons.add, size: 22, color: WHITE_COLOR), 169 | Container(margin: EdgeInsets.only(left: 10)), 170 | Text( 171 | "NEW CHAT", 172 | style: TextStyle( 173 | fontFamily: 'Roboto', 174 | fontWeight: FontWeight.w500, 175 | color: WHITE_COLOR, 176 | fontSize: 16, 177 | ), 178 | ) 179 | ], 180 | ), 181 | ), 182 | ) 183 | ], 184 | ), 185 | ); 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /lib/src/screens/auth/components/auth_views.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/constants/gradients.dart'; 3 | import 'package:chat_app/src/screens/auth/auth_gql.dart'; 4 | import 'package:chat_app/src/screens/auth/model.dart'; 5 | import 'package:chat_app/src/screens/chats/chats.dart'; 6 | import 'package:chat_app/src/state/app_state.dart'; 7 | import 'package:firebase_messaging/firebase_messaging.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:graphql_flutter/graphql_flutter.dart'; 11 | import 'package:provider/provider.dart'; 12 | import 'package:shared_preferences/shared_preferences.dart'; 13 | 14 | class AuthViews extends StatefulWidget { 15 | final bool signup; 16 | 17 | AuthViews({this.signup = false}); 18 | _AuthViewsState createState() => _AuthViewsState(); 19 | } 20 | 21 | class _AuthViewsState extends State { 22 | Map inputValues = {}; 23 | String fcmToken = ""; 24 | String errorText = ""; 25 | 26 | final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | getToken(); 32 | } 33 | 34 | Future getToken() async { 35 | final token = await _firebaseMessaging.getToken(); 36 | setState(() { 37 | fcmToken = token; 38 | }); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) => body(context); 43 | 44 | Widget body(context) { 45 | return ListView( 46 | children: [ 47 | Container(margin: EdgeInsets.only(top: 60)), 48 | gradientTextComponent( 49 | widget.signup ? ORANGE_GRADIENT : BLUE_GRADIENT, 50 | "Welcome", 51 | ), 52 | Container(margin: EdgeInsets.only(top: 35)), 53 | messageTextComponent(), 54 | Container(margin: EdgeInsets.only(top: 35)), 55 | if (widget.signup) ...nameInputComponent(), 56 | textFieldComponent(type: "email", hintText: "Email Address"), 57 | Container(margin: EdgeInsets.only(top: 20)), 58 | textFieldComponent( 59 | type: "password", 60 | hintText: "Password", 61 | obscure: true, 62 | ), 63 | Container(margin: EdgeInsets.only(top: 10)), 64 | errorMessageComponent(), 65 | Container(margin: EdgeInsets.only(top: widget.signup ? 30 : 120)), 66 | mutationComponent(context), 67 | ], 68 | ); 69 | } 70 | 71 | List nameInputComponent() { 72 | return [ 73 | textFieldComponent(type: "name", hintText: "Display Name"), 74 | Container(margin: EdgeInsets.only(top: 20)), 75 | ]; 76 | } 77 | 78 | Widget messageTextComponent() { 79 | return Text( 80 | '${widget.signup ? 'Sign up' : 'Log in'} to continue', 81 | textAlign: TextAlign.center, 82 | style: TextStyle( 83 | fontSize: 18, 84 | color: Colors.grey[700], 85 | fontWeight: FontWeight.w500, 86 | ), 87 | ); 88 | } 89 | 90 | Widget textFieldComponent( 91 | {String hintText, @required String type, bool obscure = false}) { 92 | return Container( 93 | height: 55, 94 | margin: EdgeInsets.only(left: 30, right: 30), 95 | padding: EdgeInsets.only(left: 20), 96 | decoration: BoxDecoration( 97 | color: LIGHT_GREY_COLOR, 98 | borderRadius: BorderRadius.circular(16), 99 | ), 100 | child: Center( 101 | child: TextField( 102 | obscureText: obscure, 103 | onChanged: (value) => setInputValue(type, value), 104 | decoration: InputDecoration( 105 | border: InputBorder.none, 106 | hintText: hintText ?? "", 107 | ), 108 | ), 109 | ), 110 | ); 111 | } 112 | 113 | void setInputValue(String type, String value) { 114 | setState(() { 115 | inputValues[type] = value; 116 | }); 117 | if (errorText != "") 118 | setState(() { 119 | errorText = ""; 120 | }); 121 | } 122 | 123 | Widget errorMessageComponent() { 124 | return Text( 125 | "$errorText", 126 | textAlign: TextAlign.center, 127 | style: TextStyle(color: Colors.red), 128 | ); 129 | } 130 | 131 | Widget mutationComponent(context) { 132 | final appState = Provider.of(context); 133 | 134 | return Mutation( 135 | builder: (run, result) => gradientButtonComponent(run, result), 136 | options: MutationOptions( 137 | update: (Cache cache, QueryResult result) => cache, 138 | documentNode: gql(widget.signup ? signupMutation : signinMutation), 139 | onCompleted: (result) async { 140 | final response = AuthModel.fromJson( 141 | result[widget.signup ? 'register' : 'login'], 142 | ); 143 | 144 | if (response.error == null && response.token != null) { 145 | SharedPreferences prefs = await SharedPreferences.getInstance(); 146 | await prefs.setString("uid", response.id); 147 | await prefs.setString("token", response.token); 148 | 149 | appState.setToken(response.token); 150 | 151 | Navigator.pushReplacement( 152 | context, 153 | MaterialPageRoute( 154 | builder: (context) => ChatListScreen(), 155 | ), 156 | ); 157 | } 158 | if (response.error != null) { 159 | setState(() { 160 | errorText = response.error.message ?? ""; 161 | }); 162 | } 163 | }, 164 | ), 165 | ); 166 | } 167 | 168 | Widget gradientButtonComponent(RunMutation runMutation, QueryResult result) { 169 | return GestureDetector( 170 | onTap: () { 171 | String email = inputValues["email"] ?? ""; 172 | String pass = inputValues["password"] ?? ""; 173 | String name = inputValues["name"] ?? ""; 174 | if (email != "" && pass != "") { 175 | if (!widget.signup || name != "") { 176 | runMutation({ 177 | "email": email, 178 | "password": pass, 179 | "name": name, 180 | "fcmToken": fcmToken 181 | }); 182 | } 183 | } 184 | }, 185 | child: Container( 186 | margin: EdgeInsets.only(left: 30, right: 30), 187 | width: double.infinity, 188 | height: 50, 189 | decoration: BoxDecoration( 190 | gradient: widget.signup ? ORANGE_GRADIENT : BLUE_GRADIENT, 191 | borderRadius: BorderRadius.circular(50), 192 | boxShadow: [ 193 | BoxShadow( 194 | blurRadius: 24, 195 | color: widget.signup ? ORANGE_SHADOW : BLUE_SHADOW, 196 | offset: Offset(0, 16), 197 | ) 198 | ], 199 | ), 200 | child: Center( 201 | child: result.loading 202 | ? CupertinoActivityIndicator() 203 | : Text( 204 | "CONTINUE", 205 | style: TextStyle( 206 | color: WHITE_COLOR, 207 | fontSize: 18, 208 | fontFamily: 'Roboto', 209 | ), 210 | ), 211 | ), 212 | ), 213 | ); 214 | } 215 | } 216 | 217 | Widget gradientTextComponent(Gradient gradient, String text, 218 | {double size = 48, 219 | FontWeight weight = FontWeight.w300, 220 | TextAlign align = TextAlign.center}) { 221 | final rect = Rect.fromLTWH(0.0, 0.0, 200.0, 70.0); 222 | final Shader linearGradient = gradient.createShader(rect); 223 | 224 | return Text( 225 | text, 226 | textAlign: align, 227 | style: TextStyle( 228 | fontSize: size, 229 | fontWeight: weight, 230 | foreground: Paint()..shader = linearGradient), 231 | ); 232 | } 233 | -------------------------------------------------------------------------------- /lib/src/screens/users/users.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/constants/gradients.dart'; 3 | import 'package:chat_app/src/screens/auth/components/auth_views.dart'; 4 | import 'package:chat_app/src/screens/users/model.dart'; 5 | import 'package:chat_app/src/screens/users/users_gql.dart'; 6 | import 'package:chat_app/src/state/app_state.dart'; 7 | import 'package:flutter/cupertino.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:graphql_flutter/graphql_flutter.dart'; 10 | import 'package:provider/provider.dart'; 11 | 12 | class UserListScreen extends StatefulWidget { 13 | @override 14 | _UserListScreenState createState() => _UserListScreenState(); 15 | } 16 | 17 | class _UserListScreenState extends State { 18 | List selectionList = []; 19 | String groupName = ""; 20 | String searchText = ""; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | body: body(), 26 | floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, 27 | ); 28 | } 29 | 30 | Widget body() { 31 | return Column( 32 | children: [ 33 | headerContainerComponent(), 34 | searchBarComponent(), 35 | queryComponent() 36 | ], 37 | ); 38 | } 39 | 40 | Widget headerContainerComponent() { 41 | final group = selectionList.length > 1; 42 | return Container( 43 | padding: EdgeInsets.only(left: 25, right: 25), 44 | decoration: BoxDecoration( 45 | color: Theme.of(context).cardColor, 46 | borderRadius: BorderRadius.vertical(bottom: Radius.circular(20)), 47 | boxShadow: [ 48 | BoxShadow( 49 | blurRadius: 16, 50 | color: Colors.black.withOpacity(.1), 51 | offset: Offset(0, 4), 52 | ) 53 | ], 54 | ), 55 | child: Column( 56 | crossAxisAlignment: CrossAxisAlignment.start, 57 | children: [ 58 | Container(margin: EdgeInsets.only(top: 40)), 59 | gradientTextComponent( 60 | ORANGE_GRADIENT, 61 | "Add a new chat", 62 | size: 24, 63 | weight: FontWeight.w500, 64 | ), 65 | Container(margin: EdgeInsets.only(top: 10)), 66 | Text( 67 | "Select multiple people for group chat", 68 | style: TextStyle( 69 | fontFamily: 'Roboto', 70 | color: Colors.grey, 71 | fontSize: 15, 72 | ), 73 | ), 74 | Container(margin: EdgeInsets.only(top: 15)), 75 | if (group) ...groupNameInputComponent(), 76 | Row( 77 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 78 | children: [ 79 | flatButtonComponent("CANCEL", () => Navigator.pop(context)), 80 | newChatMutationComponent() 81 | ], 82 | ), 83 | Container(margin: EdgeInsets.only(top: 15)), 84 | ], 85 | ), 86 | ); 87 | } 88 | 89 | List groupNameInputComponent() { 90 | return [ 91 | Container(margin: EdgeInsets.only(top: 10)), 92 | Container( 93 | padding: EdgeInsets.only(left: 15, right: 15), 94 | decoration: BoxDecoration( 95 | color: LIGHT_GREY_COLOR, 96 | borderRadius: BorderRadius.circular(15), 97 | ), 98 | child: TextField( 99 | style: TextStyle(color: BLACK_COLOR), 100 | decoration: InputDecoration( 101 | border: InputBorder.none, 102 | hintText: "Group name", 103 | hintStyle: TextStyle(color: Colors.grey), 104 | ), 105 | onChanged: (val) { 106 | setState(() { 107 | groupName = val; 108 | }); 109 | }, 110 | ), 111 | ), 112 | Container(margin: EdgeInsets.only(top: 10)) 113 | ]; 114 | } 115 | 116 | Widget flatButtonComponent( 117 | String text, 118 | VoidCallback onPressed, { 119 | bool primary = false, 120 | }) { 121 | return FlatButton( 122 | textColor: primary ? DARK_ORANGE : null, 123 | child: Text( 124 | text, 125 | style: TextStyle( 126 | fontFamily: 'Roboto', 127 | fontWeight: FontWeight.w500, 128 | fontSize: 16, 129 | ), 130 | ), 131 | onPressed: onPressed, 132 | ); 133 | } 134 | 135 | Widget newChatMutationComponent() { 136 | final appState = Provider.of(context); 137 | 138 | return Mutation( 139 | options: MutationOptions( 140 | documentNode: gql(createChatMutation), 141 | context: { 142 | 'headers': { 143 | 'Authorization': 'Bearer ${appState.token}', 144 | }, 145 | }, 146 | update: (Cache cache, QueryResult result) => cache, 147 | onCompleted: (result) { 148 | Navigator.pop(context); 149 | }, 150 | ), 151 | builder: (runMutation, result) { 152 | return flatButtonComponent( 153 | "START CHAT", 154 | selectionList.length == 0 155 | ? null 156 | : () { 157 | if (selectionList.length == 1 || groupName != '') 158 | runMutation( 159 | {'membersId': selectionList, 'name': groupName}); 160 | }, 161 | primary: true, 162 | ); 163 | }, 164 | ); 165 | } 166 | 167 | Widget searchBarComponent() { 168 | return Container( 169 | padding: EdgeInsets.fromLTRB(20, 20, 10, 10), 170 | child: TextField( 171 | cursorColor: DARK_ORANGE, 172 | onChanged: (val) { 173 | setState(() { 174 | searchText = val; 175 | }); 176 | }, 177 | decoration: InputDecoration( 178 | hintText: "Search", 179 | border: InputBorder.none, 180 | suffixIcon: Icon( 181 | Icons.search, 182 | color: DARK_ORANGE, 183 | ), 184 | ), 185 | ), 186 | ); 187 | } 188 | 189 | Widget queryComponent() { 190 | final appState = Provider.of(context); 191 | 192 | return Query( 193 | options: QueryOptions( 194 | documentNode: gql(getUserQuery), 195 | pollInterval: 10, 196 | context: { 197 | 'headers': { 198 | 'Authorization': 'Bearer ${appState.token}', 199 | }, 200 | }, 201 | ), 202 | builder: (result, {refetch, fetchMore}) { 203 | if (result.data != null && !result.loading) { 204 | List userData = result.data['getUsers']['users']; 205 | var users = UsersModel.fromJson(userData); 206 | return userListComponent(users); 207 | } 208 | return Container(); 209 | }, 210 | ); 211 | } 212 | 213 | Widget userListComponent(UsersModel list) { 214 | final filteredList = searchItem(list); 215 | return Expanded( 216 | child: ListView.separated( 217 | separatorBuilder: (ctx, i) => Divider(height: 20), 218 | padding: EdgeInsets.all(20), 219 | physics: BouncingScrollPhysics(), 220 | itemCount: filteredList.length, 221 | itemBuilder: (context, index) => userItemComponent(filteredList[index]), 222 | ), 223 | ); 224 | } 225 | 226 | List searchItem(UsersModel list) { 227 | final usersList = list.users; 228 | if (searchText == "") return usersList; 229 | 230 | final filteredList = list.users.where( 231 | (user) => user.name.toLowerCase().contains( 232 | searchText.toLowerCase(), 233 | ), 234 | ); 235 | return filteredList.toList(); 236 | } 237 | 238 | Widget userItemComponent(UserModel user) { 239 | bool itemSelected = selectionList.indexOf(user.id) != -1; 240 | 241 | return Row( 242 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 243 | children: [ 244 | Text( 245 | user.name, 246 | style: TextStyle( 247 | fontSize: 18, 248 | fontWeight: FontWeight.w500, 249 | color: itemSelected ? DARK_ORANGE : null, 250 | ), 251 | ), 252 | Checkbox( 253 | checkColor: DARK_ORANGE, 254 | activeColor: PALE_ORANGE.withOpacity(.3), 255 | value: itemSelected, 256 | onChanged: (value) { 257 | setState(() { 258 | value 259 | ? selectionList.add(user.id) 260 | : selectionList.remove(user.id); 261 | }); 262 | }, 263 | ) 264 | ], 265 | ); 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /lib/src/screens/settings/settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/constants/gradients.dart'; 3 | import 'package:chat_app/src/screens/about/about.dart'; 4 | import 'package:chat_app/src/screens/auth/auth.dart'; 5 | import 'package:chat_app/src/screens/settings/settings_gql.dart'; 6 | import 'package:chat_app/src/state/app_state.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:graphql_flutter/graphql_flutter.dart'; 9 | import 'package:provider/provider.dart'; 10 | import 'package:shared_preferences/shared_preferences.dart'; 11 | 12 | class SettingScreen extends StatelessWidget { 13 | final inputController = TextEditingController(); 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: appBarComponent(context), 18 | body: body(context), 19 | ); 20 | } 21 | 22 | Widget appBarComponent(context) { 23 | return PreferredSize( 24 | preferredSize: Size.fromHeight(kToolbarHeight), 25 | child: Container( 26 | child: Row( 27 | children: [ 28 | Container( 29 | width: 90, 30 | height: 80, 31 | padding: EdgeInsets.only(right: 20), 32 | decoration: BoxDecoration( 33 | gradient: BRIGHT_ORANGE_GRADIENT, 34 | borderRadius: BorderRadius.only( 35 | bottomRight: Radius.circular(100), 36 | ), 37 | ), 38 | child: IconButton( 39 | icon: Icon( 40 | Icons.arrow_back, 41 | color: WHITE_COLOR, 42 | ), 43 | onPressed: () => Navigator.of(context).pop(), 44 | ), 45 | ), 46 | ], 47 | )), 48 | ); 49 | } 50 | 51 | Widget body(context) { 52 | return ListView( 53 | children: [headerComponent(), ...settingsListComponent(context)], 54 | ); 55 | } 56 | 57 | Widget headerComponent() { 58 | return Container( 59 | padding: EdgeInsets.only(left: 25, top: 30), 60 | child: Text("Settings", style: TextStyle(fontSize: 36)), 61 | ); 62 | } 63 | 64 | List settingsListComponent(context) { 65 | final appState = Provider.of(context); 66 | 67 | return [ 68 | Container(margin: EdgeInsets.only(top: 20)), 69 | meQueryComponent(context, appState), 70 | darkModeComponent(appState), 71 | logOutComponent(appState, context), 72 | deleteUserMutationComponent(context, appState), 73 | aboutAppComponent(context) 74 | ]; 75 | } 76 | 77 | Widget meQueryComponent(context, appState) { 78 | return Query( 79 | options: QueryOptions( 80 | pollInterval: 5, 81 | documentNode: gql(meQuery), 82 | context: { 83 | 'headers': { 84 | 'Authorization': 'Bearer ${appState.token}', 85 | }, 86 | }, 87 | ), 88 | builder: (res, {refetch, fetchMore}) { 89 | var data = {}; 90 | if (res.data != null) data = res.data["me"] ?? {}; 91 | return renameMutationComponent(context, data, appState); 92 | }, 93 | ); 94 | } 95 | 96 | Widget renameMutationComponent(context, Map name, appState) { 97 | return Mutation( 98 | options: MutationOptions( 99 | documentNode: gql(renameUserMutation), 100 | context: { 101 | 'headers': { 102 | 'Authorization': 'Bearer ${appState.token}', 103 | }, 104 | }, 105 | ), 106 | builder: (run, res) => displayNameComponent(context, run, name), 107 | ); 108 | } 109 | 110 | Widget displayNameComponent(context, runMutation, name) { 111 | return settingsItemComponent( 112 | title: "Change your display name", 113 | info: "Your name is set to '${name['name'] ?? ""}'", 114 | color: Color(0xFFDE6614), 115 | onPressed: () => displayDialog(context, runMutation, rename: true), 116 | ); 117 | } 118 | 119 | Widget darkModeComponent(appState) { 120 | return settingsItemComponent( 121 | title: "Enable Dark Theme", 122 | info: "Switch to dark theme", 123 | color: Color(0xFFDE5215), 124 | onPressed: () async { 125 | final pref = await SharedPreferences.getInstance(); 126 | appState.toggleTheme(); 127 | final dark = appState.currentTheme.brightness == Brightness.dark; 128 | await pref.setBool("dark", dark); 129 | }, 130 | ); 131 | } 132 | 133 | Widget logOutComponent(appState, context) { 134 | return settingsItemComponent( 135 | title: "Log out", 136 | info: "Log out from your account", 137 | color: Colors.red, 138 | onPressed: () async { 139 | await resetApp(appState, context); 140 | }, 141 | ); 142 | } 143 | 144 | Widget deleteUserMutationComponent(context, appState) { 145 | return Mutation( 146 | options: MutationOptions( 147 | documentNode: gql(deleteUserMutation), 148 | context: { 149 | 'headers': { 150 | 'Authorization': 'Bearer ${appState.token}', 151 | }, 152 | }, 153 | onCompleted: (result) async { 154 | if (result != null) { 155 | await resetApp(appState, context); 156 | } 157 | }, 158 | ), 159 | builder: (runMutation, result) { 160 | return deleteItemComponent(context, runMutation); 161 | }, 162 | ); 163 | } 164 | 165 | Future resetApp(appState, context) async { 166 | final pref = await SharedPreferences.getInstance(); 167 | await pref.clear(); 168 | appState.setToken(""); 169 | appState.setLight(); 170 | Navigator.of(context).pushAndRemoveUntil( 171 | MaterialPageRoute(builder: (context) => AuthScreen()), (val) => false); 172 | } 173 | 174 | Widget deleteItemComponent(context, RunMutation runMutation) { 175 | return settingsItemComponent( 176 | title: "Delete Account", 177 | info: "Delete your account permanently", 178 | color: Colors.redAccent[700], 179 | onPressed: () => displayDialog(context, runMutation), 180 | ); 181 | } 182 | 183 | Widget aboutAppComponent(context) { 184 | return settingsItemComponent( 185 | title: "About app", 186 | info: "View info about the app", 187 | color: Color(0xFF2A99A0), 188 | onPressed: () { 189 | Navigator.push( 190 | context, MaterialPageRoute(builder: (context) => AboutScreen())); 191 | }, 192 | ); 193 | } 194 | 195 | Widget settingsItemComponent( 196 | {String title, String info, Color color, VoidCallback onPressed}) { 197 | return InkWell( 198 | onTap: onPressed, 199 | child: Container( 200 | padding: EdgeInsets.only(left: 25, right: 25), 201 | child: Column( 202 | crossAxisAlignment: CrossAxisAlignment.start, 203 | children: [ 204 | Container(margin: EdgeInsets.only(top: 20)), 205 | Text( 206 | title, 207 | style: TextStyle( 208 | color: color, 209 | fontSize: 18, 210 | fontWeight: FontWeight.w500, 211 | ), 212 | ), 213 | Container(margin: EdgeInsets.only(top: 5)), 214 | Text(info, style: TextStyle(fontFamily: 'Roboto', fontSize: 14)), 215 | Container(margin: EdgeInsets.only(top: 20)), 216 | ], 217 | ), 218 | ), 219 | ); 220 | } 221 | 222 | displayDialog( 223 | BuildContext context, 224 | RunMutation runMutation, { 225 | bool rename = false, 226 | }) async { 227 | return showDialog( 228 | context: context, 229 | builder: (context) { 230 | return AlertDialog( 231 | contentPadding: EdgeInsets.fromLTRB(20, 10, 10, 1), 232 | titlePadding: EdgeInsets.fromLTRB(20, 20, 10, 0), 233 | shape: RoundedRectangleBorder( 234 | borderRadius: BorderRadius.circular(20), 235 | ), 236 | title: Column( 237 | crossAxisAlignment: CrossAxisAlignment.start, 238 | children: [ 239 | Text( 240 | rename 241 | ? 'Enter a name' 242 | : 'Do you really wanna delete your accout?', 243 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 15), 244 | ), 245 | if (rename) 246 | TextField( 247 | scrollPadding: EdgeInsets.all(0), 248 | controller: inputController, 249 | decoration: InputDecoration( 250 | hintText: "Name", 251 | border: InputBorder.none, 252 | ), 253 | ), 254 | Row( 255 | mainAxisAlignment: MainAxisAlignment.end, 256 | children: [ 257 | FlatButton( 258 | child: Text('CANCEL'), 259 | onPressed: () => Navigator.pop(context), 260 | ), 261 | Container(margin: EdgeInsets.only(left: 15)), 262 | FlatButton( 263 | textColor: PALE_ORANGE, 264 | child: Text("OK"), 265 | onPressed: () { 266 | final name = inputController.text; 267 | if (name != "" || !rename) runMutation({"name": name}); 268 | Navigator.pop(context); 269 | }, 270 | ) 271 | ], 272 | ) 273 | ], 274 | ), 275 | ); 276 | }, 277 | ); 278 | } 279 | } 280 | -------------------------------------------------------------------------------- /lib/src/screens/messages/messages.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app/src/constants/colors.dart'; 2 | import 'package:chat_app/src/screens/chats/model.dart'; 3 | import 'package:chat_app/src/screens/messages/messages_gql.dart'; 4 | import 'package:chat_app/src/screens/messages/model.dart'; 5 | import 'package:chat_app/src/state/app_state.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:graphql_flutter/graphql_flutter.dart'; 8 | import 'package:outline_material_icons/outline_material_icons.dart'; 9 | import 'package:provider/provider.dart'; 10 | 11 | class MessageScreen extends StatelessWidget { 12 | final ChatModel chatDetails; 13 | final messageController = TextEditingController(); 14 | VoidCallback _refetch; 15 | 16 | MessageScreen({@required this.chatDetails}); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | backgroundColor: WHITE_COLOR, 22 | appBar: appBarComponent(context), 23 | body: body(context), 24 | ); 25 | } 26 | 27 | Widget appBarComponent(context) { 28 | final theme = Theme.of(context); 29 | final dark = theme.brightness == Brightness.dark; 30 | return PreferredSize( 31 | preferredSize: Size.square(kToolbarHeight), 32 | child: Container( 33 | height: 90, 34 | decoration: BoxDecoration( 35 | color: dark ? DARK_PURPLE_COLOR : theme.cardColor, 36 | boxShadow: [ 37 | BoxShadow( 38 | blurRadius: 16, 39 | color: PURPLE_COLOR.withOpacity(.24), 40 | offset: Offset(0, 4), 41 | ) 42 | ], 43 | ), 44 | child: Row( 45 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 46 | crossAxisAlignment: CrossAxisAlignment.center, 47 | children: [ 48 | Container( 49 | height: 90, 50 | width: 90, 51 | padding: EdgeInsets.only(top: 10, right: 15), 52 | child: IconButton( 53 | icon: Icon( 54 | Icons.arrow_back, 55 | size: 28, 56 | color: !dark ? PURPLE_COLOR : null, 57 | ), 58 | onPressed: () => Navigator.pop(context), 59 | ), 60 | decoration: BoxDecoration( 61 | color: PURPLE_COLOR.withOpacity(.1), 62 | borderRadius: BorderRadius.only( 63 | bottomRight: Radius.circular(60), 64 | ), 65 | ), 66 | ), 67 | Padding( 68 | padding: EdgeInsets.only(top: 15), 69 | child: SizedBox( 70 | width: MediaQuery.of(context).size.width / 2, 71 | child: Text( 72 | chatDetails.name, 73 | maxLines: 1, 74 | textAlign: TextAlign.center, 75 | style: TextStyle( 76 | fontWeight: FontWeight.w500, 77 | fontSize: 18, 78 | color: !dark ? PURPLE_COLOR : null), 79 | ), 80 | ), 81 | ), 82 | Container( 83 | width: 90, 84 | height: 90, 85 | padding: EdgeInsets.only(top: 15), 86 | child: deleteChatMutationComponent(context)) 87 | ], 88 | ), 89 | ), 90 | ); 91 | } 92 | 93 | Widget deleteChatMutationComponent(context) { 94 | final appState = Provider.of(context); 95 | 96 | return Mutation( 97 | options: MutationOptions( 98 | documentNode: gql(deleteChatMutation), 99 | context: { 100 | 'headers': { 101 | 'Authorization': 'Bearer ${appState.token}', 102 | } 103 | }, 104 | onCompleted: (result) { 105 | Navigator.pop(context); 106 | }, 107 | ), 108 | builder: (runMutation, result) { 109 | return PopupMenuButton( 110 | onSelected: (val) { 111 | if (val == "delete") runMutation({"chatId": chatDetails.id}); 112 | }, 113 | icon: Icon(Icons.more_horiz), 114 | itemBuilder: (ctx) => 115 | [PopupMenuItem(child: Text("Delete Chat"), value: "delete")], 116 | ); 117 | }, 118 | ); 119 | } 120 | 121 | Widget body(context) { 122 | return Container( 123 | padding: EdgeInsets.fromLTRB(10, 0, 10, 10), 124 | color: Theme.of(context).canvasColor, 125 | child: Column( 126 | crossAxisAlignment: CrossAxisAlignment.start, 127 | children: [ 128 | messageQueryComponent(context), 129 | createMessageInputComponent(context) 130 | ], 131 | ), 132 | ); 133 | } 134 | 135 | Widget messageQueryComponent(context) { 136 | final appState = Provider.of(context); 137 | 138 | return Query( 139 | options: QueryOptions( 140 | documentNode: gql(getMessagesQuery), 141 | fetchPolicy: FetchPolicy.cacheAndNetwork, 142 | pollInterval: 3, 143 | variables: {'chatId': chatDetails.id}, 144 | context: { 145 | 'headers': { 146 | 'Authorization': 'Bearer ${appState.token}', 147 | }, 148 | }, 149 | ), 150 | builder: (result, {refetch, fetchMore}) { 151 | _refetch = refetch; 152 | if (result.data != null && 153 | !result.loading && 154 | result.data['getMessages'] != null) { 155 | var messages = MessageListModel.fromJson( 156 | result.data['getMessages']['chat'], 157 | ); 158 | return messageListComponent(messages.messages); 159 | } 160 | return Expanded(child: Container()); 161 | }, 162 | ); 163 | } 164 | 165 | Widget messageListComponent(List messages) { 166 | return Expanded( 167 | flex: 1, 168 | child: ListView.builder( 169 | itemCount: messages.length, 170 | reverse: true, 171 | physics: BouncingScrollPhysics(), 172 | itemBuilder: (context, i) => messageItemComponent(messages[i], context), 173 | ), 174 | ); 175 | } 176 | 177 | Widget messageItemComponent(MessageModel message, context) { 178 | final group = chatDetails.members.length > 2; 179 | double marginL = message.me ? 25 : 15; 180 | double marginR = message.me ? 15 : 25; 181 | final mWidth = MediaQuery.of(context).size.width; 182 | final width = message.text.length > mWidth / 7 ? mWidth / 1.3 : null; 183 | 184 | return Row( 185 | mainAxisAlignment: 186 | message.me ? MainAxisAlignment.end : MainAxisAlignment.start, 187 | children: [ 188 | Container( 189 | margin: EdgeInsets.all(10), 190 | padding: EdgeInsets.fromLTRB(marginL, 10, marginR, 10), 191 | decoration: BoxDecoration( 192 | color: message.me ? PURPLE_COLOR : Colors.grey[200], 193 | borderRadius: BorderRadius.circular(10), 194 | ), 195 | child: Container( 196 | width: width, 197 | child: Column( 198 | crossAxisAlignment: CrossAxisAlignment.start, 199 | children: [ 200 | if (group && !message.me) ...[ 201 | Text( 202 | "${message.sender.name}", 203 | style: TextStyle(color: Colors.grey[800]), 204 | ), 205 | Container(margin: EdgeInsets.only(top: 5)) 206 | ], 207 | Text( 208 | message.text, 209 | style: TextStyle( 210 | color: message.me ? Colors.white : Colors.black, 211 | fontWeight: FontWeight.w500, 212 | ), 213 | ), 214 | ], 215 | ), 216 | ), 217 | ) 218 | ], 219 | ); 220 | } 221 | 222 | Widget createMessageInputComponent(context) { 223 | return Container( 224 | padding: EdgeInsets.fromLTRB(15, 1, 5, 1), 225 | child: Row( 226 | mainAxisSize: MainAxisSize.max, 227 | children: [ 228 | Expanded( 229 | flex: 1, 230 | child: TextField( 231 | controller: messageController, 232 | style: TextStyle( 233 | fontSize: 18, 234 | fontFamily: 'Roboto', 235 | fontWeight: FontWeight.w400, 236 | ), 237 | decoration: InputDecoration( 238 | border: InputBorder.none, 239 | hintText: "Tap to send a message", 240 | hintStyle: TextStyle( 241 | color: Colors.grey[400], 242 | fontSize: 18, 243 | fontFamily: "Roboto", 244 | fontWeight: FontWeight.w400, 245 | ), 246 | ), 247 | ), 248 | ), 249 | createMessageMutationComponent(context) 250 | ], 251 | ), 252 | ); 253 | } 254 | 255 | Widget createMessageMutationComponent(context) { 256 | final appState = Provider.of(context); 257 | 258 | return Mutation( 259 | builder: (runMutation, result) => sendButton(runMutation, result), 260 | options: MutationOptions( 261 | documentNode: gql(createMessageMutation), 262 | onCompleted: (result) { 263 | _refetch(); 264 | }, 265 | context: { 266 | 'headers': { 267 | 'Authorization': 'Bearer ${appState.token}', 268 | }, 269 | }, 270 | ), 271 | ); 272 | } 273 | 274 | Widget sendButton(RunMutation runMutation, QueryResult result) { 275 | return result.loading 276 | ? Container( 277 | width: 25, 278 | height: 25, 279 | margin: EdgeInsets.only(right: 15), 280 | child: CircularProgressIndicator( 281 | backgroundColor: PURPLE_COLOR, 282 | )) 283 | : IconButton( 284 | color: PURPLE_COLOR, 285 | icon: Icon(OMIcons.send), 286 | onPressed: () { 287 | var text = messageController.text.trim(); 288 | if (text != '') 289 | runMutation({'chatId': chatDetails.id, 'text': text}); 290 | messageController.clear(); 291 | }, 292 | ); 293 | } 294 | } 295 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.13" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.6.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.1" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.0.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.12" 46 | connectivity: 47 | dependency: transitive 48 | description: 49 | name: connectivity 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.4.8+6" 53 | connectivity_macos: 54 | dependency: transitive 55 | description: 56 | name: connectivity_macos 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.1.0+3" 60 | connectivity_platform_interface: 61 | dependency: transitive 62 | description: 63 | name: connectivity_platform_interface 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.0.6" 67 | convert: 68 | dependency: transitive 69 | description: 70 | name: convert 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.1" 74 | crypto: 75 | dependency: transitive 76 | description: 77 | name: crypto 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.1.4" 81 | cupertino_icons: 82 | dependency: "direct main" 83 | description: 84 | name: cupertino_icons 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.2" 88 | file: 89 | dependency: transitive 90 | description: 91 | name: file 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "5.1.0" 95 | firebase_messaging: 96 | dependency: "direct main" 97 | description: 98 | name: firebase_messaging 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "5.0.3" 102 | flutter: 103 | dependency: "direct main" 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | flutter_launcher_icons: 108 | dependency: "direct main" 109 | description: 110 | name: flutter_launcher_icons 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "0.7.2" 114 | flutter_test: 115 | dependency: "direct dev" 116 | description: flutter 117 | source: sdk 118 | version: "0.0.0" 119 | flutter_web_plugins: 120 | dependency: transitive 121 | description: flutter 122 | source: sdk 123 | version: "0.0.0" 124 | gql: 125 | dependency: transitive 126 | description: 127 | name: gql 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "0.12.3" 131 | graphql: 132 | dependency: transitive 133 | description: 134 | name: graphql 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "3.0.2" 138 | graphql_flutter: 139 | dependency: "direct main" 140 | description: 141 | name: graphql_flutter 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "3.0.1" 145 | http: 146 | dependency: transitive 147 | description: 148 | name: http 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "0.12.1" 152 | http_parser: 153 | dependency: transitive 154 | description: 155 | name: http_parser 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "3.1.3" 159 | image: 160 | dependency: transitive 161 | description: 162 | name: image 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "2.1.12" 166 | intl: 167 | dependency: transitive 168 | description: 169 | name: intl 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "0.16.1" 173 | matcher: 174 | dependency: transitive 175 | description: 176 | name: matcher 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.12.6" 180 | meta: 181 | dependency: transitive 182 | description: 183 | name: meta 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.8" 187 | mime: 188 | dependency: transitive 189 | description: 190 | name: mime 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "0.9.6+2" 194 | outline_material_icons: 195 | dependency: "direct main" 196 | description: 197 | name: outline_material_icons 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.1.0" 201 | path: 202 | dependency: transitive 203 | description: 204 | name: path 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.6.4" 208 | path_provider: 209 | dependency: transitive 210 | description: 211 | name: path_provider 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.6.10" 215 | path_provider_linux: 216 | dependency: transitive 217 | description: 218 | name: path_provider_linux 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "0.0.1+1" 222 | path_provider_macos: 223 | dependency: transitive 224 | description: 225 | name: path_provider_macos 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "0.0.4+3" 229 | path_provider_platform_interface: 230 | dependency: transitive 231 | description: 232 | name: path_provider_platform_interface 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.0.2" 236 | pedantic: 237 | dependency: transitive 238 | description: 239 | name: pedantic 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.5.0" 243 | petitparser: 244 | dependency: transitive 245 | description: 246 | name: petitparser 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "2.4.0" 250 | platform: 251 | dependency: transitive 252 | description: 253 | name: platform 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.2.0" 257 | plugin_platform_interface: 258 | dependency: transitive 259 | description: 260 | name: plugin_platform_interface 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "1.0.2" 264 | process: 265 | dependency: transitive 266 | description: 267 | name: process 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "3.0.13" 271 | provider: 272 | dependency: "direct main" 273 | description: 274 | name: provider 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.0.1+1" 278 | quiver: 279 | dependency: transitive 280 | description: 281 | name: quiver 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "2.1.3" 285 | rxdart: 286 | dependency: transitive 287 | description: 288 | name: rxdart 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "0.23.1" 292 | shared_preferences: 293 | dependency: "direct main" 294 | description: 295 | name: shared_preferences 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "0.5.7+3" 299 | shared_preferences_macos: 300 | dependency: transitive 301 | description: 302 | name: shared_preferences_macos 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "0.0.1+10" 306 | shared_preferences_platform_interface: 307 | dependency: transitive 308 | description: 309 | name: shared_preferences_platform_interface 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.0.4" 313 | shared_preferences_web: 314 | dependency: transitive 315 | description: 316 | name: shared_preferences_web 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "0.1.2+7" 320 | sky_engine: 321 | dependency: transitive 322 | description: flutter 323 | source: sdk 324 | version: "0.0.99" 325 | source_span: 326 | dependency: transitive 327 | description: 328 | name: source_span 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "1.7.0" 332 | stack_trace: 333 | dependency: transitive 334 | description: 335 | name: stack_trace 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "1.9.3" 339 | stream_channel: 340 | dependency: transitive 341 | description: 342 | name: stream_channel 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "2.0.0" 346 | string_scanner: 347 | dependency: transitive 348 | description: 349 | name: string_scanner 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "1.0.5" 353 | term_glyph: 354 | dependency: transitive 355 | description: 356 | name: term_glyph 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "1.1.0" 360 | test_api: 361 | dependency: transitive 362 | description: 363 | name: test_api 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "0.2.15" 367 | typed_data: 368 | dependency: transitive 369 | description: 370 | name: typed_data 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "1.1.6" 374 | url_launcher: 375 | dependency: "direct main" 376 | description: 377 | name: url_launcher 378 | url: "https://pub.dartlang.org" 379 | source: hosted 380 | version: "5.0.3" 381 | uuid_enhanced: 382 | dependency: transitive 383 | description: 384 | name: uuid_enhanced 385 | url: "https://pub.dartlang.org" 386 | source: hosted 387 | version: "3.0.2" 388 | vector_math: 389 | dependency: transitive 390 | description: 391 | name: vector_math 392 | url: "https://pub.dartlang.org" 393 | source: hosted 394 | version: "2.0.8" 395 | websocket: 396 | dependency: transitive 397 | description: 398 | name: websocket 399 | url: "https://pub.dartlang.org" 400 | source: hosted 401 | version: "0.0.5" 402 | xdg_directories: 403 | dependency: transitive 404 | description: 405 | name: xdg_directories 406 | url: "https://pub.dartlang.org" 407 | source: hosted 408 | version: "0.1.0" 409 | xml: 410 | dependency: transitive 411 | description: 412 | name: xml 413 | url: "https://pub.dartlang.org" 414 | source: hosted 415 | version: "3.6.1" 416 | yaml: 417 | dependency: transitive 418 | description: 419 | name: yaml 420 | url: "https://pub.dartlang.org" 421 | source: hosted 422 | version: "2.1.15" 423 | sdks: 424 | dart: ">=2.7.2 <3.0.0" 425 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 426 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatApp; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatApp; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatApp; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | --------------------------------------------------------------------------------