├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── app │ │ │ │ └── datacode │ │ │ │ └── wecode │ │ │ │ └── wecode │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoogleService-Info.plist │ ├── Info.plist │ └── Runner-Bridging-Header.h └── firebase_app_id_file.json ├── lib ├── firebase_options.dart ├── main.dart ├── src │ ├── app.dart │ ├── common │ │ ├── strings.dart │ │ ├── style │ │ │ └── style.dart │ │ └── widgets │ │ │ ├── general_drop_down_widget.dart │ │ │ └── loading_indicator.dart │ ├── models │ │ ├── vacancy_data_model.dart │ │ └── weCodeUser_data_model.dart │ ├── providers │ │ └── user_provider.dart │ ├── screens │ │ ├── Job Screen │ │ │ └── create_job_screen_view.dart │ │ ├── auth │ │ │ ├── forgot_pass_screen.dart │ │ │ ├── handler_screen.dart │ │ │ ├── login_screen.dart │ │ │ ├── registerScreen.dart │ │ │ └── reset_pass_screen.dart │ │ ├── create_profile_screen │ │ │ └── create_profile.dart │ │ ├── fav_screen │ │ │ └── fav_screen.dart │ │ ├── info_screen │ │ │ └── info_screen.dart │ │ ├── jobs_screen │ │ │ ├── bottom_navigation_bar.dart │ │ │ ├── button_value_changer.dart │ │ │ └── jobs_screen.dart │ │ ├── navigator_screen.dart │ │ └── screenHandler.dart │ ├── services │ │ ├── auth_service.dart │ │ ├── dynamic_links_service.dart │ │ ├── firestore_service.dart │ │ └── push_notifications_service.dart │ └── temp │ │ ├── class1 copy 2.dart │ │ ├── class1 copy 4.dart │ │ ├── class1.dart │ │ ├── class2.dart │ │ ├── class3.dart │ │ └── number_provider.dart └── widget │ ├── costume_button.dart │ ├── costume_textField.dart │ └── create_profile_textfield.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── Flutter │ ├── GeneratedPluginRegistrant.swift │ └── ephemeral │ │ ├── .symlinks │ │ └── plugins │ │ │ ├── cloud_firestore │ │ │ ├── firebase_auth │ │ │ ├── firebase_core │ │ │ └── path_provider_macos │ │ ├── Flutter-Generated.xcconfig │ │ ├── FlutterMacOS.podspec │ │ └── flutter_export_environment.sh ├── Podfile └── Pods │ └── Local Podspecs │ └── FlutterMacOS.podspec.json ├── pubspec.lock ├── pubspec.yaml ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: f1875d570e39de09040c8f79aa13cc56baab8db1 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 17 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 18 | - platform: android 19 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 20 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 21 | - platform: ios 22 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 23 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 24 | - platform: linux 25 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 26 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 27 | - platform: macos 28 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 29 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 30 | - platform: web 31 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 32 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 33 | - platform: windows 34 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 35 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wecode Job vacancies 2 | 3 | ### Features 4 | - [ ] register/login using firebase auth 5 | - [ ] create profile 6 | - [ ] update profile 7 | - [ ] upload image //firebase storage 8 | - [ ] post a job 9 | - [ ] upvote/downvote a vacancy 10 | - [ ] fav/unFav a vacancy //local 11 | 12 | 13 | 14 | ### Tech stack 15 | - [ ] firebase core 16 | - [ ] firebase firestore 17 | - [ ] firebase auth 18 | - [ ] firebase storage 19 | - [ ] firebase analytics 20 | - [ ] firebase messaging push notifications 21 | - [ ] dynamic links 22 | - [ ] imagePicker 23 | - [ ] Local notifications 24 | - [ ] Provider 25 | - [ ] google fonts 26 | - [ ] Font awesome 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | 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 | // START: FlutterFire Configuration 26 | apply plugin: 'com.google.gms.google-services' 27 | // END: FlutterFire Configuration 28 | apply plugin: 'kotlin-android' 29 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 30 | 31 | android { 32 | compileSdkVersion 33 33 | ndkVersion flutter.ndkVersion 34 | 35 | compileOptions { 36 | sourceCompatibility JavaVersion.VERSION_1_8 37 | targetCompatibility JavaVersion.VERSION_1_8 38 | } 39 | 40 | kotlinOptions { 41 | jvmTarget = '1.8' 42 | } 43 | 44 | sourceSets { 45 | main.java.srcDirs += 'src/main/kotlin' 46 | } 47 | 48 | defaultConfig { 49 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 50 | applicationId "app.datacode.wecode.wecode" 51 | // You can update the following values to match your application needs. 52 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 53 | // minSdkVersion flutter.minSdkVersion 54 | minSdkVersion 19 55 | targetSdkVersion flutter.targetSdkVersion 56 | versionCode flutterVersionCode.toInteger() 57 | versionName flutterVersionName 58 | multiDexEnabled true 59 | } 60 | 61 | buildTypes { 62 | release { 63 | // TODO: Add your own signing config for the release build. 64 | // Signing with the debug keys for now, so `flutter run --release` works. 65 | signingConfig signingConfigs.debug 66 | } 67 | } 68 | } 69 | 70 | flutter { 71 | source '../..' 72 | } 73 | 74 | dependencies { 75 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 76 | implementation 'com.android.support:multidex:1.0.3' 77 | } 78 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "937914090303", 4 | "firebase_url": "https://sakar-a6fd5.firebaseio.com", 5 | "project_id": "sakar-a6fd5", 6 | "storage_bucket": "sakar-a6fd5.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:937914090303:android:e8a0baa388f1e54b1f898a", 12 | "android_client_info": { 13 | "package_name": "app.datacode.sakar" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "937914090303-2te217mg2tancg3o1meurdhohh5lk9na.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "app.datacode.sakar", 22 | "certificate_hash": "1542bfc3789b17ba48a0e46eb59183c7bc3c5269" 23 | } 24 | }, 25 | { 26 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyDvl6B3PzUkfLGIuolFTIVCMx_AsL0cnvE" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 40 | "client_type": 3 41 | }, 42 | { 43 | "client_id": "937914090303-50so6tnsa0tk4ms448og1otf5nqurh28.apps.googleusercontent.com", 44 | "client_type": 2, 45 | "ios_info": { 46 | "bundle_id": "com.example.wecodeFirebaseFlutter" 47 | } 48 | } 49 | ] 50 | } 51 | } 52 | }, 53 | { 54 | "client_info": { 55 | "mobilesdk_app_id": "1:937914090303:android:399d984de95a738f1f898a", 56 | "android_client_info": { 57 | "package_name": "app.datacode.wecode.wecode" 58 | } 59 | }, 60 | "oauth_client": [ 61 | { 62 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 63 | "client_type": 3 64 | } 65 | ], 66 | "api_key": [ 67 | { 68 | "current_key": "AIzaSyDvl6B3PzUkfLGIuolFTIVCMx_AsL0cnvE" 69 | } 70 | ], 71 | "services": { 72 | "appinvite_service": { 73 | "other_platform_oauth_client": [ 74 | { 75 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 76 | "client_type": 3 77 | }, 78 | { 79 | "client_id": "937914090303-50so6tnsa0tk4ms448og1otf5nqurh28.apps.googleusercontent.com", 80 | "client_type": 2, 81 | "ios_info": { 82 | "bundle_id": "com.example.wecodeFirebaseFlutter" 83 | } 84 | } 85 | ] 86 | } 87 | } 88 | }, 89 | { 90 | "client_info": { 91 | "mobilesdk_app_id": "1:937914090303:android:a4fe73b377c277741f898a", 92 | "android_client_info": { 93 | "package_name": "com.example.wecode_firebase_flutter" 94 | } 95 | }, 96 | "oauth_client": [ 97 | { 98 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 99 | "client_type": 3 100 | } 101 | ], 102 | "api_key": [ 103 | { 104 | "current_key": "AIzaSyDvl6B3PzUkfLGIuolFTIVCMx_AsL0cnvE" 105 | } 106 | ], 107 | "services": { 108 | "appinvite_service": { 109 | "other_platform_oauth_client": [ 110 | { 111 | "client_id": "937914090303-cpl42j9n6l1c1dnikc1tiqmemk8btogd.apps.googleusercontent.com", 112 | "client_type": 3 113 | }, 114 | { 115 | "client_id": "937914090303-50so6tnsa0tk4ms448og1otf5nqurh28.apps.googleusercontent.com", 116 | "client_type": 2, 117 | "ios_info": { 118 | "bundle_id": "com.example.wecodeFirebaseFlutter" 119 | } 120 | } 121 | ] 122 | } 123 | } 124 | } 125 | ], 126 | "configuration_version": "1" 127 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 18 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/app/datacode/wecode/wecode/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package app.datacode.wecode.wecode 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | // START: FlutterFire Configuration 11 | classpath 'com.google.gms:google-services:4.3.10' 12 | // END: FlutterFire Configuration 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | rootProject.buildDir = '../build' 25 | subprojects { 26 | project.buildDir = "${rootProject.buildDir}/${project.name}" 27 | } 28 | subprojects { 29 | project.evaluationDependsOn(':app') 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 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-7.4-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | if #available(iOS 10.0, *) { 11 | UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate 12 | } 13 | GeneratedPluginRegistrant.register(with: self) 14 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/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/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLIENT_ID 6 | 937914090303-i53qrhcud6033d6ft4oug75r6kp5kf96.apps.googleusercontent.com 7 | REVERSED_CLIENT_ID 8 | com.googleusercontent.apps.937914090303-i53qrhcud6033d6ft4oug75r6kp5kf96 9 | ANDROID_CLIENT_ID 10 | 937914090303-2te217mg2tancg3o1meurdhohh5lk9na.apps.googleusercontent.com 11 | API_KEY 12 | AIzaSyBQ9Ri2SPFZd1Y0BC3frZAGAdTlRrj3ECw 13 | GCM_SENDER_ID 14 | 937914090303 15 | PLIST_VERSION 16 | 1 17 | BUNDLE_ID 18 | app.datacode.wecode.wecode 19 | PROJECT_ID 20 | sakar-a6fd5 21 | STORAGE_BUCKET 22 | sakar-a6fd5.appspot.com 23 | IS_ADS_ENABLED 24 | 25 | IS_ANALYTICS_ENABLED 26 | 27 | IS_APPINVITE_ENABLED 28 | 29 | IS_GCM_ENABLED 30 | 31 | IS_SIGNIN_ENABLED 32 | 33 | GOOGLE_APP_ID 34 | 1:937914090303:ios:86091afe2b84bbf01f898a 35 | DATABASE_URL 36 | https://sakar-a6fd5.firebaseio.com 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Wecode 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | wecode 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/firebase_app_id_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_generated_by": "FlutterFire CLI", 3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", 4 | "GOOGLE_APP_ID": "1:937914090303:ios:86091afe2b84bbf01f898a", 5 | "FIREBASE_PROJECT_ID": "sakar-a6fd5", 6 | "GCM_SENDER_ID": "937914090303" 7 | } -------------------------------------------------------------------------------- /lib/firebase_options.dart: -------------------------------------------------------------------------------- 1 | // File generated by FlutterFire CLI. 2 | // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members 3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; 4 | import 'package:flutter/foundation.dart' 5 | show defaultTargetPlatform, kIsWeb, TargetPlatform; 6 | 7 | /// Default [FirebaseOptions] for use with your Firebase apps. 8 | /// 9 | /// Example: 10 | /// ```dart 11 | /// import 'firebase_options.dart'; 12 | /// // ... 13 | /// await Firebase.initializeApp( 14 | /// options: DefaultFirebaseOptions.currentPlatform, 15 | /// ); 16 | /// ``` 17 | class DefaultFirebaseOptions { 18 | static FirebaseOptions get currentPlatform { 19 | if (kIsWeb) { 20 | return web; 21 | } 22 | switch (defaultTargetPlatform) { 23 | case TargetPlatform.android: 24 | return android; 25 | case TargetPlatform.iOS: 26 | return ios; 27 | case TargetPlatform.macOS: 28 | return macos; 29 | case TargetPlatform.windows: 30 | throw UnsupportedError( 31 | 'DefaultFirebaseOptions have not been configured for windows - ' 32 | 'you can reconfigure this by running the FlutterFire CLI again.', 33 | ); 34 | case TargetPlatform.linux: 35 | throw UnsupportedError( 36 | 'DefaultFirebaseOptions have not been configured for linux - ' 37 | 'you can reconfigure this by running the FlutterFire CLI again.', 38 | ); 39 | default: 40 | throw UnsupportedError( 41 | 'DefaultFirebaseOptions are not supported for this platform.', 42 | ); 43 | } 44 | } 45 | 46 | static const FirebaseOptions web = FirebaseOptions( 47 | apiKey: 'AIzaSyDM2i6o6NNAlRJw4FCLOnDCW7tQd-eKW4c', 48 | appId: '1:937914090303:web:78d6c7c5e57c6a851f898a', 49 | messagingSenderId: '937914090303', 50 | projectId: 'sakar-a6fd5', 51 | authDomain: 'sakar-a6fd5.firebaseapp.com', 52 | databaseURL: 'https://sakar-a6fd5.firebaseio.com', 53 | storageBucket: 'sakar-a6fd5.appspot.com', 54 | measurementId: 'G-ETWTPR87ED', 55 | ); 56 | 57 | static const FirebaseOptions android = FirebaseOptions( 58 | apiKey: 'AIzaSyDvl6B3PzUkfLGIuolFTIVCMx_AsL0cnvE', 59 | appId: '1:937914090303:android:399d984de95a738f1f898a', 60 | messagingSenderId: '937914090303', 61 | projectId: 'sakar-a6fd5', 62 | databaseURL: 'https://sakar-a6fd5.firebaseio.com', 63 | storageBucket: 'sakar-a6fd5.appspot.com', 64 | ); 65 | 66 | static const FirebaseOptions ios = FirebaseOptions( 67 | apiKey: 'AIzaSyBQ9Ri2SPFZd1Y0BC3frZAGAdTlRrj3ECw', 68 | appId: '1:937914090303:ios:86091afe2b84bbf01f898a', 69 | messagingSenderId: '937914090303', 70 | projectId: 'sakar-a6fd5', 71 | databaseURL: 'https://sakar-a6fd5.firebaseio.com', 72 | storageBucket: 'sakar-a6fd5.appspot.com', 73 | androidClientId: '937914090303-2te217mg2tancg3o1meurdhohh5lk9na.apps.googleusercontent.com', 74 | iosClientId: '937914090303-i53qrhcud6033d6ft4oug75r6kp5kf96.apps.googleusercontent.com', 75 | iosBundleId: 'app.datacode.wecode.wecode', 76 | ); 77 | 78 | static const FirebaseOptions macos = FirebaseOptions( 79 | apiKey: 'AIzaSyBQ9Ri2SPFZd1Y0BC3frZAGAdTlRrj3ECw', 80 | appId: '1:937914090303:ios:86091afe2b84bbf01f898a', 81 | messagingSenderId: '937914090303', 82 | projectId: 'sakar-a6fd5', 83 | databaseURL: 'https://sakar-a6fd5.firebaseio.com', 84 | storageBucket: 'sakar-a6fd5.appspot.com', 85 | androidClientId: '937914090303-2te217mg2tancg3o1meurdhohh5lk9na.apps.googleusercontent.com', 86 | iosClientId: '937914090303-i53qrhcud6033d6ft4oug75r6kp5kf96.apps.googleusercontent.com', 87 | iosBundleId: 'app.datacode.wecode.wecode', 88 | ); 89 | } 90 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_messaging/firebase_messaging.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:hive_flutter/hive_flutter.dart'; 6 | import 'package:provider/provider.dart'; 7 | import 'package:wecode/src/app.dart'; 8 | import 'package:firebase_core/firebase_core.dart'; 9 | import 'package:wecode/src/providers/user_provider.dart'; 10 | import 'package:wecode/src/temp/number_provider.dart'; 11 | import 'firebase_options.dart'; 12 | 13 | void main() async { 14 | WidgetsFlutterBinding.ensureInitialized(); 15 | await Firebase.initializeApp( 16 | options: DefaultFirebaseOptions.currentPlatform, 17 | ); 18 | await Hive.initFlutter(); 19 | final favBox = await Hive.openBox('favBox'); 20 | // favBox.delete('jobId'); 21 | // debugPrint(favBox.get('jobId')); 22 | 23 | // and instance from the local notifications plugin 24 | FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = 25 | FlutterLocalNotificationsPlugin(); 26 | 27 | //android init 28 | // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project 29 | const AndroidInitializationSettings initializationSettingsAndroid = 30 | AndroidInitializationSettings("mipmap/ic_launcher"); 31 | 32 | final IOSInitializationSettings initializationSettingsIOS = 33 | IOSInitializationSettings( 34 | onDidReceiveLocalNotification: (id, title, body, payload) { 35 | debugPrint('on foreground : $id'); 36 | debugPrint(title); 37 | debugPrint(body); 38 | debugPrint(payload); 39 | }); 40 | 41 | final InitializationSettings initializationSettings = InitializationSettings( 42 | android: initializationSettingsAndroid, 43 | iOS: initializationSettingsIOS, 44 | ); 45 | 46 | await flutterLocalNotificationsPlugin.initialize(initializationSettings, 47 | onSelectNotification: (value) => debugPrint('tapped$value')); 48 | final String? fcmToken = await FirebaseMessaging.instance.getToken(); 49 | debugPrint("FCM" ':' + (fcmToken ?? 'no token')); 50 | 51 | Future _firebaseMessagingBackgroundHandler( 52 | RemoteMessage message) async { 53 | debugPrint('Handling a background message ${message.messageId}'); 54 | } 55 | 56 | FirebaseMessaging.onBackgroundMessage( 57 | (message) => _firebaseMessagingBackgroundHandler(message)); 58 | 59 | FirebaseMessaging.onMessage.listen((RemoteMessage message) { 60 | debugPrint('Got a message whilst in the foreground!'); 61 | debugPrint('Message data: ${message.notification}'); 62 | if (message.notification != null) { 63 | // flutterLocalNotificationsPlugin.show( 64 | // message.hashCode, 65 | // message.notification!.title, 66 | // message.notification!.body, 67 | // NotificationDetails( 68 | // android: AndroidNotificationDetails( 69 | // PushNotifService.androidChannel.id, 70 | // PushNotifService.androidChannel.name, 71 | // channelDescription: PushNotifService.androidChannel.description, 72 | // // icon: android.smallIcon, 73 | // // other properties... 74 | // ), 75 | // )); 76 | 77 | Get.snackbar(message.notification!.title!, message.notification!.body!); 78 | } else { 79 | Get.snackbar('null', 'notification is null'); 80 | } 81 | 82 | if (message.notification != null) { 83 | debugPrint('Message also contained a notification: ${message.notification}'); 84 | } 85 | }); 86 | 87 | runApp( 88 | MultiProvider( 89 | providers: [ 90 | ChangeNotifierProvider(create: (context) => NumberProvider()), 91 | ChangeNotifierProvider(create: (context) => UserProvider()) 92 | ], 93 | child: const WeCodeApp(), 94 | ), 95 | ); 96 | } 97 | -------------------------------------------------------------------------------- /lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:google_fonts/google_fonts.dart'; 4 | import 'package:wecode/src/screens/auth/handler_screen.dart'; 5 | 6 | class WeCodeApp extends StatelessWidget { 7 | const WeCodeApp({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | //change to Getmaterial app to use the get package 12 | return GetMaterialApp( 13 | debugShowCheckedModeBanner: false, 14 | title: 'WeCode', 15 | theme: ThemeData( 16 | primaryColor: Colors.green, 17 | // brightness: Brightness.dark, 18 | fontFamily: GoogleFonts.roboto().fontFamily, 19 | primarySwatch: Colors.green, 20 | visualDensity: VisualDensity.adaptivePlatformDensity, 21 | textTheme: TextTheme( 22 | titleMedium: TextStyle( 23 | fontSize: 22, 24 | fontWeight: FontWeight.w500, 25 | fontFamily: GoogleFonts.roboto().fontFamily), 26 | ), 27 | appBarTheme: AppBarTheme( 28 | color: Colors.green, 29 | titleTextStyle: TextStyle( 30 | color: Colors.grey[800], 31 | fontSize: 26, 32 | fontWeight: FontWeight.w500, 33 | fontFamily: GoogleFonts.roboto().fontFamily, 34 | letterSpacing: 1, 35 | ), 36 | ), 37 | buttonTheme: Theme.of(context).buttonTheme.copyWith( 38 | buttonColor: Colors.amber, 39 | textTheme: ButtonTextTheme.primary, 40 | ), 41 | ), 42 | home: const HandlerScreen()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/common/strings.dart: -------------------------------------------------------------------------------- 1 | class RequiredStrings { 2 | static List jobCategories = [ 3 | 'All', 4 | 'Full Stack Flutter Developer', 5 | 'Front end Web Developer', 6 | 'Data Engineer', 7 | 'Ui/Ux designer' 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/common/style/style.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GeneralStyle { 4 | static TextStyle additionTextStyle = const TextStyle( 5 | color: Colors.green, 6 | fontWeight: FontWeight.w300, 7 | fontSize: 14, 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/common/widgets/general_drop_down_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GeneralDropDownButton extends StatelessWidget { 4 | GeneralDropDownButton( 5 | {Key? key, 6 | this.selectedItem, 7 | required this.itemsList, 8 | required this.valueChanged}) 9 | : super(key: key); 10 | String? selectedItem; 11 | final List itemsList; 12 | final ValueChanged valueChanged; 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | padding: const EdgeInsets.symmetric(horizontal: 15), 17 | child: DropdownButtonFormField( 18 | decoration: InputDecoration( 19 | focusedBorder: const OutlineInputBorder( 20 | borderSide: BorderSide(color: Colors.green)), 21 | enabledBorder: OutlineInputBorder( 22 | borderRadius: BorderRadius.circular(5), 23 | borderSide: const BorderSide( 24 | color: Colors.green, 25 | width: 2, 26 | ))), 27 | value: selectedItem ?? itemsList.first, 28 | items: itemsList 29 | .map((item) => DropdownMenuItem( 30 | value: item, 31 | child: Text( 32 | item, 33 | style: 34 | // Style of text inside Drop Down Button 35 | 36 | const TextStyle( 37 | fontSize: 15, 38 | ), 39 | ))) 40 | .toList(), 41 | onChanged: (item) { 42 | // setState(() { 43 | 44 | // selec = item; 45 | // }); 46 | valueChanged(item!); 47 | }), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/common/widgets/loading_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoadingIndicator extends StatelessWidget { 4 | const LoadingIndicator({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Center(child: CircularProgressIndicator()); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/models/vacancy_data_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 4 | 5 | // the 6 | class Vacancy { 7 | String type; 8 | String id; //remote, intern, part-time, full-time 9 | String title; 10 | String description; //create a text editor for mark down 11 | String? responsibilities; 12 | String org; 13 | String city; 14 | String category; //flutter, ds, 15 | int? upVote; 16 | int? downVote; 17 | String? dynamicLink; 18 | DateTime? expDate; 19 | DateTime createdAt; 20 | WeCodeUser user; 21 | Vacancy({ 22 | required this.type, 23 | required this.title, 24 | required this.id, 25 | required this.description, 26 | this.responsibilities, 27 | required this.org, 28 | required this.city, 29 | required this.category, 30 | this.upVote, 31 | this.downVote, 32 | this.dynamicLink, 33 | this.expDate, 34 | required this.createdAt, 35 | required this.user, 36 | }); 37 | 38 | Vacancy copyWith({ 39 | String? type, 40 | String? id, 41 | String? title, 42 | String? description, 43 | String? responsibilities, 44 | String? org, 45 | String? city, 46 | String? category, 47 | int? upVote, 48 | int? downVote, 49 | String? dynamicLink, 50 | DateTime? expDate, 51 | DateTime? createdAt, 52 | WeCodeUser? user, 53 | }) { 54 | return Vacancy( 55 | type: type ?? this.type, 56 | title: title ?? this.title, 57 | description: description ?? this.description, 58 | responsibilities: responsibilities ?? this.responsibilities, 59 | org: org ?? this.org, 60 | city: city ?? this.city, 61 | id: id ?? this.id, 62 | category: category ?? this.category, 63 | upVote: upVote ?? this.upVote, 64 | downVote: downVote ?? this.downVote, 65 | dynamicLink: dynamicLink ?? this.dynamicLink, 66 | expDate: expDate ?? this.expDate, 67 | createdAt: createdAt ?? this.createdAt, 68 | user: user ?? this.user, 69 | ); 70 | } 71 | 72 | Map toMap() { 73 | return { 74 | 'type': type, 75 | 'title': title, 76 | 'description': description, 77 | 'responsibilities': responsibilities, 78 | 'org': org, 79 | 'city': city, 80 | 'id': id, 81 | 'category': category, 82 | 'upVote': upVote, 83 | 'downVote': downVote, 84 | 'dynamicLink': dynamicLink, 85 | 'expDate': expDate?.millisecondsSinceEpoch, 86 | 'createdAt': createdAt.millisecondsSinceEpoch, 87 | 'user': user.toMap(), 88 | }; 89 | } 90 | 91 | factory Vacancy.fromMap(Map map) { 92 | return Vacancy( 93 | type: map['type'] ?? '', 94 | title: map['title'] ?? '', 95 | id: map['id'] ?? 'no id', 96 | description: map['description'] ?? '', 97 | responsibilities: map['responsibilities'], 98 | org: map['org'] ?? '', 99 | city: map['city'] ?? '', 100 | category: map['category'] ?? '', 101 | upVote: map['upVote']?.toInt(), 102 | downVote: map['downVote']?.toInt(), 103 | dynamicLink: map['dynamicLink'], 104 | expDate: map['expDate'] != null 105 | ? DateTime.fromMillisecondsSinceEpoch(map['expDate']) 106 | : null, 107 | createdAt: DateTime.fromMillisecondsSinceEpoch(map['createdAt']), 108 | user: WeCodeUser.fromMap(map['user'].cast()), 109 | ); 110 | } 111 | 112 | String toJson() => json.encode(toMap()); 113 | 114 | factory Vacancy.fromJson(String source) => 115 | Vacancy.fromMap(json.decode(source)); 116 | 117 | @override 118 | String toString() { 119 | return 'Vacancy(type: $type, title: $title, description: $description, responsibilities: $responsibilities, org: $org, city: $city, category: $category, upVote: $upVote, downVote: $downVote, dynamicLink: $dynamicLink, expDate: $expDate, createdAt: $createdAt, user: $user)'; 120 | } 121 | 122 | @override 123 | bool operator ==(Object other) { 124 | if (identical(this, other)) return true; 125 | 126 | return other is Vacancy && 127 | other.type == type && 128 | other.title == title && 129 | other.description == description && 130 | other.responsibilities == responsibilities && 131 | other.org == org && 132 | other.city == city && 133 | other.category == category && 134 | other.upVote == upVote && 135 | other.downVote == downVote && 136 | other.dynamicLink == dynamicLink && 137 | other.expDate == expDate && 138 | other.createdAt == createdAt && 139 | other.user == user; 140 | } 141 | 142 | @override 143 | int get hashCode { 144 | return type.hashCode ^ 145 | title.hashCode ^ 146 | description.hashCode ^ 147 | responsibilities.hashCode ^ 148 | org.hashCode ^ 149 | city.hashCode ^ 150 | category.hashCode ^ 151 | upVote.hashCode ^ 152 | downVote.hashCode ^ 153 | dynamicLink.hashCode ^ 154 | expDate.hashCode ^ 155 | createdAt.hashCode ^ 156 | user.hashCode; 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /lib/src/models/weCodeUser_data_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | 6 | class WeCodeUser { 7 | //TODO: from snapshot 8 | String name; 9 | String uid; 10 | String? surName; 11 | String? imgUrl; 12 | DateTime createdAt; 13 | String? github; 14 | List? skills; 15 | String? website; 16 | String? linkedin; 17 | String email; 18 | String? phone; 19 | List? deviceTokens; 20 | DocumentReference? reference; 21 | WeCodeUser( 22 | {required this.name, 23 | this.surName, 24 | this.imgUrl, 25 | required this.createdAt, 26 | this.github, 27 | this.skills, 28 | this.website, 29 | this.linkedin, 30 | required this.uid, 31 | required this.email, 32 | this.deviceTokens, 33 | this.phone, 34 | this.reference}); 35 | 36 | WeCodeUser copyWith({ 37 | String? name, 38 | String? surName, 39 | String? imgUrl, 40 | DateTime? createdAt, 41 | String? github, 42 | List? skills, 43 | List? deviceTokens, 44 | String? website, 45 | String? linkedin, 46 | String? email, 47 | String? uid, 48 | String? phone, 49 | }) { 50 | return WeCodeUser( 51 | name: name ?? this.name, 52 | surName: surName ?? this.surName, 53 | imgUrl: imgUrl ?? this.imgUrl, 54 | createdAt: createdAt ?? this.createdAt, 55 | github: github ?? this.github, 56 | skills: skills ?? this.skills, 57 | deviceTokens: deviceTokens ?? this.deviceTokens, 58 | website: website ?? this.website, 59 | linkedin: linkedin ?? this.linkedin, 60 | email: email ?? this.email, 61 | phone: phone ?? this.phone, 62 | uid: uid ?? this.uid, 63 | ); 64 | } 65 | 66 | Map toMap() { 67 | return { 68 | 'name': name, 69 | 'surName': surName, 70 | 'imgUrl': imgUrl, 71 | 'createdAt': createdAt.millisecondsSinceEpoch, 72 | 'github': github, 73 | 'skills': skills, 74 | 'website': website, 75 | 'linkedin': linkedin, 76 | 'deviceTokens': deviceTokens, 77 | 'email': email, 78 | 'phone': phone, 79 | 'uid': uid, 80 | }; 81 | } 82 | // factory from document snapshot 83 | 84 | factory WeCodeUser.fromSnapShot(DocumentSnapshot documentSnapshot) { 85 | return WeCodeUser.fromMap(documentSnapshot.data() as Map, 86 | reference: documentSnapshot.reference); 87 | } 88 | 89 | factory WeCodeUser.fromMap(Map map, 90 | {DocumentReference? reference}) { 91 | return WeCodeUser( 92 | name: map['name'] ?? '', 93 | surName: map['surName'], 94 | imgUrl: map['imgUrl'], 95 | createdAt: DateTime.fromMillisecondsSinceEpoch(map['createdAt']), 96 | github: map['github'], 97 | skills: map['skills'] == null ? null : List.from(map['skills']), 98 | deviceTokens: map['deviceTokens'] == null 99 | ? null 100 | : List.from(map['deviceTokens']), 101 | website: map['website'], 102 | linkedin: map['linkedin'], 103 | email: map['email'] ?? '', 104 | phone: map['phone'], 105 | uid: map['uid'], 106 | reference: reference, 107 | ); 108 | } 109 | 110 | String toJson() => json.encode(toMap()); 111 | 112 | factory WeCodeUser.fromJson(String source) => 113 | WeCodeUser.fromMap(json.decode(source)); 114 | 115 | @override 116 | String toString() { 117 | return 'WeCodeUser(name: $name, surName: $surName, imgUrl: $imgUrl, createdAt: $createdAt, github: $github, skills: $skills, website: $website, linkedin: $linkedin, email: $email, phone: $phone , deviceTokens: $deviceTokens)'; 118 | } 119 | 120 | @override 121 | bool operator ==(Object other) { 122 | if (identical(this, other)) return true; 123 | 124 | return other is WeCodeUser && 125 | other.name == name && 126 | other.surName == surName && 127 | other.imgUrl == imgUrl && 128 | other.createdAt == createdAt && 129 | other.github == github && 130 | listEquals(other.skills, skills) && 131 | other.website == website && 132 | other.linkedin == linkedin && 133 | other.uid == uid && 134 | other.email == email && 135 | other.phone == phone; 136 | } 137 | 138 | @override 139 | int get hashCode { 140 | return name.hashCode ^ 141 | surName.hashCode ^ 142 | imgUrl.hashCode ^ 143 | createdAt.hashCode ^ 144 | github.hashCode ^ 145 | skills.hashCode ^ 146 | website.hashCode ^ 147 | linkedin.hashCode ^ 148 | uid.hashCode ^ 149 | email.hashCode ^ 150 | phone.hashCode; 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /lib/src/providers/user_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 3 | 4 | class UserProvider extends ChangeNotifier { 5 | WeCodeUser? weCodeUser; 6 | 7 | setWeCodeUser(WeCodeUser user) { 8 | weCodeUser = user; 9 | debugPrint('from provider : $weCodeUser'); 10 | notifyListeners(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/screens/Job Screen/create_job_screen_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:provider/provider.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | import 'package:wecode/src/common/strings.dart'; 6 | import 'package:wecode/src/common/widgets/general_drop_down_widget.dart'; 7 | import 'package:wecode/src/models/vacancy_data_model.dart'; 8 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 9 | import 'package:wecode/src/providers/user_provider.dart'; 10 | import 'package:wecode/src/services/dynamic_links_service.dart'; 11 | import 'package:wecode/src/services/firestore_service.dart'; 12 | 13 | class CreateJobScreen extends StatefulWidget { 14 | const CreateJobScreen({Key? key}) : super(key: key); 15 | 16 | @override 17 | State createState() => deferent(); 18 | } 19 | 20 | class deferent extends State { 21 | List citysList = [ 22 | 'Erbil', 23 | 'Duhok', 24 | 'Slemmany', 25 | 'Karkuk', 26 | 'Zakho', 27 | 'Halabja' 28 | ]; 29 | 30 | FireStoreService _fireStoreService = FireStoreService(); 31 | DynamicLinksService _dynamicLinksService = DynamicLinksService(); 32 | 33 | List typeList = ['Full Time', 'Part Time', 'Remote', 'Intern']; 34 | 35 | String? selectedtypeOfJob; 36 | String? selectedCity = 'Erbil'; 37 | String? selectedCategory = RequiredStrings.jobCategories.first; 38 | 39 | TextEditingController titleTextEditingController = TextEditingController(); 40 | TextEditingController descriptionTextEditingController = 41 | TextEditingController(); 42 | TextEditingController organizationController = TextEditingController(); 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return Scaffold( 47 | appBar: AppBar( 48 | elevation: 0, 49 | backgroundColor: Colors.transparent, 50 | centerTitle: true, 51 | foregroundColor: Colors.red, 52 | title: Text( 53 | 'JOB INFO', 54 | style: headerTextStyle(), 55 | ), 56 | actions: [ 57 | IconButton( 58 | color: Colors.red, 59 | onPressed: () {}, 60 | icon: const Icon(Icons.save), 61 | ) 62 | ]), 63 | body: Center( 64 | child: SingleChildScrollView( 65 | reverse: true, 66 | child: Column( 67 | mainAxisAlignment: MainAxisAlignment.start, 68 | children: [ 69 | // to fix asset image error 70 | // Container( 71 | // margin: EdgeInsets.only(top: 40, bottom: 20), 72 | // child: Image.asset('assets/images/job.png'), 73 | // ), 74 | Column( 75 | mainAxisAlignment: MainAxisAlignment.center, 76 | crossAxisAlignment: CrossAxisAlignment.center, 77 | children: [ 78 | //* Type of the Job 79 | //header. 80 | headerInformationOfInputs(name: 'Type'), 81 | // space between header and Input. 82 | spaceBetweenHeaderAndInput(), 83 | // DropDown Button for Type of Jobs. 84 | GeneralDropDownButton( 85 | selectedItem: selectedtypeOfJob, 86 | itemsList: typeList, 87 | valueChanged: (job) => selectedtypeOfJob = job), 88 | 89 | /// 90 | /// 91 | /// 92 | 93 | //* Title of the Job 94 | // space between header and Input. 95 | spaceBetweenHeaderAndInput(), 96 | // TextField for title of the job 97 | textField( 98 | name: 'Title', 99 | textController: titleTextEditingController), 100 | 101 | /// 102 | /// 103 | /// 104 | 105 | //* Description of Job 106 | // space between header and input widget 107 | spaceBetweenHeaderAndInput(), 108 | // DropDown Button for city 109 | textField( 110 | textController: descriptionTextEditingController, 111 | name: 'Description'), 112 | 113 | /// 114 | /// 115 | /// 116 | 117 | //* Organization 118 | // space between header and input widget 119 | spaceBetweenHeaderAndInput(), 120 | // DropDown Button for city 121 | textField( 122 | textController: organizationController, 123 | name: 'Organization'), 124 | 125 | /// 126 | /// 127 | /// 128 | 129 | //* City 130 | // Space between 2 input Widget 131 | spaceBetweenHeaderAndInput(), 132 | // header 133 | headerInformationOfInputs(name: 'City'), 134 | // space between header and input widget 135 | spaceBetweenHeaderAndInput(), 136 | // DropDown Button for city 137 | GeneralDropDownButton( 138 | selectedItem: selectedCity, 139 | itemsList: citysList, 140 | valueChanged: (city) => setState(() { 141 | selectedCity = city; 142 | })), 143 | 144 | /// 145 | /// 146 | /// 147 | 148 | //* Category 149 | // Space between 2 input Widget 150 | spaceBetweenHeaderAndInput(), 151 | // header 152 | headerInformationOfInputs(name: 'Category'), 153 | // space between header and input widget 154 | spaceBetweenHeaderAndInput(), 155 | // DropDown Button for city 156 | GeneralDropDownButton( 157 | selectedItem: selectedCategory, 158 | itemsList: RequiredStrings.jobCategories, 159 | valueChanged: (value) => selectedCategory = value), 160 | spaceBetweenHeaderAndInput(), 161 | 162 | ElevatedButton.icon( 163 | onPressed: () async { 164 | String _vacancyID = Uuid().v4(); 165 | 166 | //to create a dynamic link for a job id 167 | Uri dynamicLink = await _dynamicLinksService 168 | .createDynamicLink(vacancyID: _vacancyID); 169 | 170 | WeCodeUser? weCodeUser = 171 | context.read().weCodeUser; 172 | if (weCodeUser != null) { 173 | Vacancy _vacancy = Vacancy( 174 | type: selectedtypeOfJob ?? typeList.first, 175 | title: titleTextEditingController.text, 176 | description: 177 | descriptionTextEditingController.text, 178 | org: organizationController.text, 179 | city: selectedCity ?? 180 | citysList.firstWhere( 181 | (element) => element == 'Erbil'), 182 | category: selectedCategory ?? 183 | RequiredStrings.jobCategories.first, 184 | createdAt: DateTime.now(), 185 | expDate: DateTime.now().add(Duration(days: 15)), 186 | dynamicLink: dynamicLink.toString(), 187 | user: weCodeUser, 188 | id: _vacancyID); 189 | 190 | Get.defaultDialog( 191 | title: 'values', 192 | content: Container( 193 | height: 500, 194 | child: Column( 195 | children: [ 196 | Expanded(child: Text(_vacancy.toString())), 197 | ElevatedButton( 198 | onPressed: () async { 199 | //TODO: _loading 200 | 201 | await _fireStoreService 202 | .addNewVacancy(_vacancy) 203 | .then((value) { 204 | debugPrint(" ref id : ${value.id}"); 205 | Navigator.of(context).pop(); 206 | }); 207 | }, 208 | child: const Text('Are you sure? ')) 209 | ], 210 | ), 211 | ), 212 | ); 213 | } else { 214 | Get.snackbar('Error', 215 | 'You don\'t have the privileges to do that '); 216 | } 217 | }, 218 | icon: const Icon(Icons.add), 219 | label: const Text('Add a New Vacancy')), 220 | 221 | /// 222 | /// 223 | /// 224 | ], 225 | ), 226 | ], 227 | ), 228 | ), 229 | ), 230 | ); 231 | } 232 | 233 | // this is the style of header text 234 | // Have Font Weight Bold and font Size 24 235 | TextStyle headerTextStyle() { 236 | return const TextStyle( 237 | color: Colors.red, 238 | fontWeight: FontWeight.bold, 239 | fontSize: 20, 240 | ); 241 | } 242 | 243 | // Information Header Text Style [ City , Category , ... etc] 244 | // Font Weight is BOLD. 245 | TextStyle informationHeaderOfInputsTextStyle() { 246 | return const TextStyle( 247 | fontWeight: FontWeight.bold, 248 | ); 249 | } 250 | 251 | // Drop Down Button form field 252 | // required 2 parameter ( selectedItem and List of Items) 253 | // List of items is the items that will show when drop down is pressed 254 | // Sized Box used to resize the Drop Down button : Size ( 350 ) 255 | // the size will be different for other platforms 256 | // the drop down button controller will return String 257 | // using ( drop DownItemStyle() ) is a method that user define is this file 258 | // Widget dropDownButton( 259 | // {required String? selectedItem, 260 | // required List itemsList, 261 | // required valueChanged}) { 262 | // final ValueChanged valueChanged; 263 | // return SizedBox( 264 | // width: 350, 265 | // child: DropdownButtonFormField( 266 | // decoration: InputDecoration( 267 | // focusedBorder: 268 | // OutlineInputBorder(borderSide: BorderSide(color: Colors.red)), 269 | // enabledBorder: OutlineInputBorder( 270 | // borderRadius: BorderRadius.circular(5), 271 | // borderSide: BorderSide( 272 | // color: Colors.red, 273 | // width: 1, 274 | // ))), 275 | // value: selectedItem, 276 | // items: itemsList 277 | // .map((item) => DropdownMenuItem( 278 | // value: item, 279 | // child: Text( 280 | // item, 281 | // style: dropDownItemStyle(), 282 | // ))) 283 | // .toList(), 284 | // onChanged: (item) { 285 | // // setState(() { 286 | 287 | // // selec = item; 288 | // // }); 289 | // valueChanged(item!); 290 | // }), 291 | // ); 292 | 293 | // } 294 | 295 | // this is the header of the text field and drop down button. 296 | Widget headerInformationOfInputs({required String name}) { 297 | return Container( 298 | margin: const EdgeInsets.only(right: 290, left: 24), 299 | child: Text( 300 | name, 301 | style: informationHeaderOfInputsTextStyle(), 302 | ), 303 | ); 304 | } 305 | 306 | // space between the header and input widget 307 | Widget spaceBetweenHeaderAndInput() { 308 | return const SizedBox( 309 | height: 15, 310 | ); 311 | } 312 | 313 | // space between 2 input widget 314 | Widget spaceBetweenTwoInput() { 315 | return const SizedBox( 316 | height: 40, 317 | ); 318 | } 319 | 320 | // text field 321 | Widget textField( 322 | {required TextEditingController textController, required String name}) { 323 | return Container( 324 | width: 340, 325 | child: TextField( 326 | controller: textController, 327 | decoration: InputDecoration( 328 | labelStyle: const TextStyle(color: Colors.red), 329 | label: Text(name), 330 | focusedBorder: const OutlineInputBorder( 331 | borderSide: BorderSide(color: Colors.red))), 332 | ), 333 | ); 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /lib/src/screens/auth/forgot_pass_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:wecode/src/screens/auth/login_screen.dart'; 3 | import 'package:wecode/src/services/auth_service.dart'; 4 | import 'package:wecode/widget/costume_button.dart'; 5 | 6 | import '../../../widget/costume_textField.dart'; 7 | 8 | class ForgotPassScreen extends StatefulWidget { 9 | const ForgotPassScreen({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _ForgotPassScreenState(); 13 | } 14 | 15 | class _ForgotPassScreenState extends State { 16 | final TextEditingController emailController = TextEditingController(); 17 | AuthService auth = AuthService(); 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | leading: GestureDetector( 23 | onTap: () { 24 | Navigator.push( 25 | context, 26 | MaterialPageRoute( 27 | builder: (BuildContext context) => LoginScreen(), 28 | ), 29 | ); 30 | }, 31 | child: const Icon( 32 | Icons.arrow_back_ios_new, 33 | ), 34 | ), 35 | ), 36 | body: Container( 37 | padding: const EdgeInsets.all(16), 38 | child: Column( 39 | mainAxisAlignment: MainAxisAlignment.center, 40 | crossAxisAlignment: CrossAxisAlignment.center, 41 | children: [ 42 | Image.network( 43 | 'https://image.freepik.com/free-vector/forgot-password-concept-isolated-white_263070-194.jpg'), 44 | Column( 45 | children: const [ 46 | Align( 47 | alignment: Alignment(-1, -1), 48 | child: Padding( 49 | padding: EdgeInsets.only(left: 15.0), 50 | child: Text( 51 | 'Forgot Passowrd ?', 52 | style: 53 | TextStyle(fontWeight: FontWeight.bold, fontSize: 28), 54 | ), 55 | ), 56 | ), 57 | SizedBox( 58 | height: 15, 59 | ), 60 | Align( 61 | alignment: Alignment(-1, -1), 62 | child: Padding( 63 | padding: EdgeInsets.only(left: 15.0), 64 | child: Text( 65 | "Don't worry it happens, please enter email associated with your account ", 66 | style: 67 | TextStyle(fontWeight: FontWeight.w400, fontSize: 16), 68 | ), 69 | ), 70 | ), 71 | ], 72 | ), 73 | Container( 74 | margin: const EdgeInsets.all(20), 75 | child: Form( 76 | child: Column( 77 | children: [ 78 | CustomTextField( 79 | hint: 'Email', 80 | control: emailController, 81 | icon: const Icon(Icons.alternate_email), 82 | ), 83 | ], 84 | ), 85 | ), 86 | ), 87 | const SizedBox( 88 | height: 15, 89 | ), 90 | CostumeButton( 91 | onPressed: () { 92 | auth.forgetPassword(email: emailController.text); 93 | 94 | Navigator.push( 95 | context, 96 | MaterialPageRoute( 97 | builder: (BuildContext context) => LoginScreen(), 98 | ), 99 | ); 100 | }, 101 | color: const Color.fromARGB(255, 42, 146, 231), 102 | text: const Text( 103 | 'Submit', 104 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), 105 | ), 106 | ), 107 | const SizedBox( 108 | height: 15, 109 | ), 110 | ], 111 | ), 112 | ), 113 | ); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /lib/src/screens/auth/handler_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | import 'package:firebase_messaging/firebase_messaging.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:wecode/src/common/widgets/loading_indicator.dart'; 7 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 8 | import 'package:wecode/src/providers/user_provider.dart'; 9 | import 'package:wecode/src/screens/auth/login_screen.dart'; 10 | import 'package:wecode/src/screens/jobs_screen/jobs_screen.dart'; 11 | import 'package:wecode/src/screens/navigator_screen.dart'; 12 | import 'package:wecode/src/services/firestore_service.dart'; 13 | 14 | class HandlerScreen extends StatefulWidget { 15 | const HandlerScreen({Key? key}) : super(key: key); 16 | 17 | @override 18 | State createState() => _HandlerScreenState(); 19 | } 20 | 21 | class _HandlerScreenState extends State { 22 | FirebaseAuth auth = FirebaseAuth.instance; 23 | FireStoreService fireStoreService = FireStoreService(); 24 | 25 | WeCodeUser? thWecodeUser; 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | // FirebaseAuth(auth service) => 30 | // FirebaseFirestore(database service) => 31 | // save it on a global object as provider to use it on all the app sections 32 | 33 | return Scaffold( 34 | body: StreamBuilder( 35 | stream: auth.authStateChanges(), 36 | builder: (context, snapshot) { 37 | //TODO: check if loading 38 | if (snapshot.connectionState == ConnectionState.waiting) { 39 | return const LoadingIndicator(); 40 | } else if (snapshot.data == null) { 41 | return LoginScreen(); 42 | } else if (snapshot.hasError) { 43 | return const Center(child: Text('error')); 44 | } 45 | 46 | return FutureBuilder( 47 | future: getUser(snapshot.data!), 48 | builder: (context, snapshotFromFuture) { 49 | if (snapshotFromFuture.connectionState == 50 | ConnectionState.waiting) { 51 | return const LoadingIndicator(); 52 | } else if (snapshotFromFuture.hasError) { 53 | return Center( 54 | child: Text(snapshotFromFuture.error.toString()), 55 | ); 56 | } else if (snapshotFromFuture.data == null) { 57 | //TODO: get the device token 58 | 59 | //TODO: save the device token to user/device_tokens 60 | 61 | } 62 | return const NavigatorScreen(); 63 | }); 64 | }, 65 | ), 66 | ); 67 | } 68 | 69 | Future getUser(User user) async { 70 | WeCodeUser weCodeUser = await FirebaseFirestore.instance 71 | .collection('users') 72 | .doc(user.uid) 73 | .get() 74 | .then((value) => WeCodeUser.fromSnapShot(value)); 75 | 76 | if (weCodeUser != null) { 77 | String? deviceToken = await FirebaseMessaging.instance.getToken(); 78 | if (deviceToken != null) { 79 | fireStoreService.addDeviceToken(token: deviceToken, user: weCodeUser); 80 | debugPrint('token for user: ' + (deviceToken ?? 'null')); 81 | } 82 | } 83 | 84 | Provider.of(context, listen: false).setWeCodeUser(weCodeUser); 85 | 86 | return weCodeUser; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/src/screens/auth/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:wecode/src/common/style/style.dart'; 5 | import 'package:wecode/src/screens/auth/forgot_pass_screen.dart'; 6 | import 'package:wecode/src/screens/auth/handler_screen.dart'; 7 | import 'package:wecode/src/screens/auth/registerScreen.dart'; 8 | import 'package:wecode/src/services/auth_service.dart'; 9 | import 'package:wecode/widget/costume_button.dart'; 10 | import 'package:wecode/widget/costume_textField.dart'; 11 | 12 | class LoginScreen extends StatelessWidget { 13 | LoginScreen({Key? key}) : super(key: key); 14 | 15 | final TextEditingController emailController = TextEditingController(); 16 | final TextEditingController passwordController = TextEditingController(); 17 | 18 | AuthService authService = AuthService(); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | body: SingleChildScrollView( 24 | child: Container( 25 | padding: const EdgeInsets.all(16), 26 | child: Column( 27 | mainAxisAlignment: MainAxisAlignment.center, 28 | crossAxisAlignment: CrossAxisAlignment.center, 29 | children: [ 30 | Container( 31 | padding: EdgeInsets.all(20), 32 | height: 300, 33 | child: CachedNetworkImage( 34 | imageUrl: 35 | 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimage.freepik.com%2Ffree-vector%2Fmobile-login-concept-illustration_114360-83.jpg&f=1&nofb=1', 36 | placeholder: (context, url) => Container(), 37 | fit: BoxFit.cover, 38 | ), 39 | ), 40 | const Align( 41 | alignment: Alignment(-1, -1), 42 | child: Padding( 43 | padding: EdgeInsets.only(left: 15.0), 44 | child: Text( 45 | 'Login', 46 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22), 47 | ), 48 | ), 49 | ), 50 | Container( 51 | margin: const EdgeInsets.all(20), 52 | child: Form( 53 | child: Column( 54 | children: [ 55 | CustomTextField( 56 | hint: 'Email', 57 | control: emailController, 58 | icon: const Icon(Icons.alternate_email), 59 | ), 60 | CustomTextField( 61 | hint: 'Password', 62 | control: passwordController, 63 | icon: const Icon(Icons.lock_outline), 64 | ), 65 | Align( 66 | alignment: const Alignment(1, 1), 67 | child: GestureDetector( 68 | onTap: () { 69 | Navigator.push( 70 | context, 71 | MaterialPageRoute( 72 | builder: (BuildContext context) => 73 | const ForgotPassScreen(), 74 | ), 75 | ); 76 | }, 77 | child: Padding( 78 | padding: EdgeInsets.only(top: 20.0), 79 | child: Text( 80 | 'Forgot Password ?', 81 | style: GeneralStyle.additionTextStyle 82 | .copyWith(fontSize: 14), 83 | ), 84 | ), 85 | ), 86 | ), 87 | ], 88 | )), 89 | ), 90 | const SizedBox( 91 | height: 15, 92 | ), 93 | CostumeButton( 94 | onPressed: () async { 95 | //First step auth with firebase auth 96 | await authService 97 | .signInWithEmailAndPassword( 98 | email: emailController.text.trim(), 99 | password: passwordController.text) 100 | .then((value) => Get.to(() => const HandlerScreen()) 101 | 102 | // .then( 103 | 104 | // // Second step get the user data from firestore 105 | // (userCredential) { 106 | // //TODO: check userCredential user not to be null 107 | 108 | // return FirebaseFirestore.instance 109 | // .collection('users') 110 | // .doc(userCredential!.user!.uid) 111 | // .get() 112 | // .then( 113 | // (value) { 114 | // //third step : save the user information into the provider 115 | // context.read().setWeCodeUser( 116 | // WeCodeUser.fromSnapShot(value), 117 | // ); 118 | // }, 119 | // ); 120 | // }, 121 | 122 | ); 123 | }, 124 | color: Colors.green, 125 | text: const Text( 126 | 'Login', 127 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), 128 | ), 129 | ), 130 | const SizedBox( 131 | height: 15, 132 | ), 133 | // CostumeButton( 134 | // onPressed: () { 135 | // debugPrint('Login'); 136 | // }, 137 | // color: const Color.fromARGB(255, 211, 211, 211), 138 | // text: const Text( 139 | // 'Login with Google', 140 | // style: TextStyle( 141 | // fontWeight: FontWeight.w200, 142 | // fontSize: 20, 143 | // color: Color.fromARGB(255, 68, 68, 68)), 144 | // ), 145 | // ), 146 | Row( 147 | mainAxisAlignment: MainAxisAlignment.center, 148 | children: [ 149 | const Padding( 150 | padding: EdgeInsets.only(top: 20.0), 151 | child: Text( 152 | "Don't Have An Account ? ", 153 | style: 154 | TextStyle(fontWeight: FontWeight.w300, fontSize: 14), 155 | ), 156 | ), 157 | GestureDetector( 158 | onTap: () { 159 | Navigator.push( 160 | context, 161 | MaterialPageRoute( 162 | builder: (BuildContext context) => 163 | const RegisterScreen(), 164 | ), 165 | ); 166 | }, 167 | child: Padding( 168 | padding: EdgeInsets.only(top: 20.0), 169 | child: Text( 170 | 'Register', 171 | style: GeneralStyle.additionTextStyle, 172 | ), 173 | ), 174 | ), 175 | ], 176 | ), 177 | ], 178 | ), 179 | ), 180 | ), 181 | ); 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /lib/src/screens/auth/registerScreen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: file_names 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:wecode/src/common/widgets/loading_indicator.dart'; 7 | import 'package:wecode/src/providers/user_provider.dart'; 8 | 9 | import 'package:wecode/src/screens/auth/login_screen.dart'; 10 | import 'package:wecode/src/screens/create_profile_screen/create_profile.dart'; 11 | import 'package:wecode/src/services/auth_service.dart'; 12 | import 'package:wecode/src/services/firestore_service.dart'; 13 | import 'package:wecode/widget/costume_button.dart'; 14 | import 'package:wecode/widget/costume_textField.dart'; 15 | 16 | class RegisterScreen extends StatefulWidget { 17 | const RegisterScreen({Key? key}) : super(key: key); 18 | 19 | @override 20 | State createState() => _RegisterScreenState(); 21 | } 22 | 23 | class _RegisterScreenState extends State { 24 | final TextEditingController userNameController = TextEditingController(); 25 | final TextEditingController emailController = TextEditingController(); 26 | final TextEditingController passwordController = TextEditingController(); 27 | final TextEditingController phoneNumberController = TextEditingController(); 28 | 29 | AuthService authService = AuthService(); 30 | FireStoreService fireStoreService = FireStoreService(); 31 | 32 | bool isLoading = false; 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Scaffold( 37 | body: isLoading == true 38 | ? const LoadingIndicator() 39 | : SingleChildScrollView( 40 | child: Container( 41 | padding: const EdgeInsets.all(16), 42 | child: Column( 43 | mainAxisAlignment: MainAxisAlignment.center, 44 | crossAxisAlignment: CrossAxisAlignment.center, 45 | children: [ 46 | Image.network( 47 | 'https://media.istockphoto.com/vectors/register-account-submit-access-login-password-username-internet-vector-id1281150061?k=20&m=1281150061&s=170667a&w=0&h=r2JoluPHXUIdKb2cNnvcwFg7BIIf-SrBDFdoU0fZBnc='), 48 | const Align( 49 | alignment: Alignment(-1, -1), 50 | child: Padding( 51 | padding: EdgeInsets.only(left: 15.0), 52 | child: Text( 53 | 'Register', 54 | style: TextStyle( 55 | fontWeight: FontWeight.bold, fontSize: 28), 56 | ), 57 | ), 58 | ), 59 | Container( 60 | margin: const EdgeInsets.all(20), 61 | child: Form( 62 | child: Column( 63 | children: [ 64 | CustomTextField( 65 | hint: 'User Name', 66 | control: userNameController, 67 | icon: const Icon(Icons.person), 68 | ), 69 | CustomTextField( 70 | hint: 'Email', 71 | control: emailController, 72 | icon: const Icon(Icons.alternate_email), 73 | ), 74 | CustomTextField( 75 | hint: 'Password', 76 | control: passwordController, 77 | icon: const Icon(Icons.lock_outline), 78 | ), 79 | CustomTextField( 80 | hint: 'Phone Number', 81 | control: phoneNumberController, 82 | icon: const Icon(Icons.phone), 83 | ), 84 | ], 85 | )), 86 | ), 87 | const SizedBox( 88 | height: 15, 89 | ), 90 | CostumeButton( 91 | onPressed: () async { 92 | setState(() { 93 | isLoading = true; 94 | }); 95 | //first step firebase auth to register user with the auth 96 | await authService 97 | .createUserWithEmailAndPassword( 98 | email: emailController.text.trim(), 99 | password: passwordController.text) 100 | .then((userCredential) async { 101 | //second step 102 | if (userCredential != null && 103 | userCredential.user != null) { 104 | await fireStoreService 105 | .addUserWithInitialInformationToDB( 106 | user: userCredential.user!, 107 | userName: userNameController.text, 108 | phoneNumber: phoneNumberController.text) 109 | .then((weCodeUser) { 110 | // Provider.of(context, listen: false) 111 | // .setWeCodeUser(weCodeUser); 112 | 113 | // basically the same as above 114 | context 115 | .read() 116 | .setWeCodeUser(weCodeUser); 117 | 118 | setState(() { 119 | isLoading = false; 120 | }); 121 | 122 | Get.to(() => const CreateProfileScreen( 123 | isUpdate: false, 124 | )); 125 | }); 126 | setState(() { 127 | isLoading = false; 128 | }); 129 | } 130 | 131 | // navigate to next screen 132 | 133 | // Navigator.of(context).push(MaterialPageRoute(builder:(context)=> CreateProfileScreen())); 134 | }); 135 | }, 136 | color: const Color.fromARGB(255, 42, 146, 231), 137 | text: const Text( 138 | 'Register', 139 | style: TextStyle( 140 | fontWeight: FontWeight.bold, fontSize: 20), 141 | ), 142 | ), 143 | Row( 144 | mainAxisAlignment: MainAxisAlignment.center, 145 | children: [ 146 | const Padding( 147 | padding: EdgeInsets.only(top: 20.0), 148 | child: Text( 149 | "Already Have An Account ? ", 150 | style: TextStyle( 151 | fontWeight: FontWeight.bold, fontSize: 16), 152 | ), 153 | ), 154 | GestureDetector( 155 | onTap: () { 156 | Navigator.push( 157 | context, 158 | MaterialPageRoute( 159 | builder: (BuildContext context) => 160 | LoginScreen(), 161 | ), 162 | ); 163 | }, 164 | child: const Padding( 165 | padding: EdgeInsets.only(top: 20.0), 166 | child: Text( 167 | 'Login', 168 | style: TextStyle( 169 | color: Color.fromARGB(255, 21, 116, 224), 170 | fontWeight: FontWeight.bold, 171 | fontSize: 16, 172 | ), 173 | ), 174 | ), 175 | ), 176 | ], 177 | ), 178 | ], 179 | ), 180 | ), 181 | ), 182 | ); 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /lib/src/screens/auth/reset_pass_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:wecode/src/screens/auth/forgot_pass_screen.dart'; 3 | import 'package:wecode/widget/costume_button.dart'; 4 | import '../../../widget/costume_textField.dart'; 5 | 6 | class ResetPassScreen extends StatefulWidget { 7 | const ResetPassScreen({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _ResetPassScreenState(); 11 | } 12 | 13 | class _ResetPassScreenState extends State { 14 | final TextEditingController newPasswordController = TextEditingController(); 15 | final TextEditingController confirmPasswordController = 16 | TextEditingController(); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | leading: GestureDetector( 23 | onTap: () { 24 | Navigator.push( 25 | context, 26 | MaterialPageRoute( 27 | builder: (BuildContext context) => const ForgotPassScreen(), 28 | ), 29 | ); 30 | }, 31 | child: const Icon( 32 | Icons.arrow_back_ios_new, 33 | ), 34 | ), 35 | ), 36 | body: Container( 37 | padding: const EdgeInsets.all(16), 38 | child: Column( 39 | mainAxisAlignment: MainAxisAlignment.center, 40 | crossAxisAlignment: CrossAxisAlignment.center, 41 | children: [ 42 | Image.network( 43 | 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimage.freepik.com%2Ffree-vector%2Fforgot-password-concept-flat-illustration_203587-4.jpg&f=1&nofb=1'), 44 | Column( 45 | children: const [ 46 | Align( 47 | alignment: Alignment(-1, -1), 48 | child: Padding( 49 | padding: EdgeInsets.only(left: 15.0), 50 | child: Text( 51 | 'Reset Password', 52 | style: 53 | TextStyle(fontWeight: FontWeight.bold, fontSize: 28), 54 | ), 55 | ), 56 | ), 57 | SizedBox( 58 | height: 15, 59 | ), 60 | ], 61 | ), 62 | Container( 63 | margin: const EdgeInsets.all(20), 64 | child: Form( 65 | child: Column( 66 | children: [ 67 | CustomTextField( 68 | hint: 'New Password', 69 | control: newPasswordController, 70 | icon: const Icon(Icons.lock_outlined), 71 | ), 72 | CustomTextField( 73 | hint: 'Confirm your Password', 74 | control: confirmPasswordController, 75 | icon: const Icon(Icons.lock_outlined), 76 | ), 77 | ], 78 | ), 79 | ), 80 | ), 81 | const SizedBox( 82 | height: 15, 83 | ), 84 | CostumeButton( 85 | onPressed: () {}, 86 | color: const Color.fromARGB(255, 42, 146, 231), 87 | text: const Text( 88 | 'Submit', 89 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), 90 | ), 91 | ), 92 | const SizedBox( 93 | height: 15, 94 | ), 95 | ], 96 | ), 97 | ), 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/src/screens/create_profile_screen/create_profile.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:get/get.dart'; 6 | import 'package:provider/provider.dart'; 7 | import 'package:wecode/src/common/strings.dart'; 8 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 9 | import 'package:wecode/src/providers/user_provider.dart'; 10 | import 'package:wecode/src/screens/jobs_screen/jobs_screen.dart'; 11 | import 'package:wecode/widget/create_profile_textfield.dart'; 12 | 13 | class CreateProfileScreen extends StatefulWidget { 14 | const CreateProfileScreen({Key? key, required this.isUpdate}) 15 | : super(key: key); 16 | 17 | final bool isUpdate; 18 | 19 | @override 20 | State createState() => _CreateProfileScreenState(); 21 | } 22 | 23 | class _CreateProfileScreenState extends State { 24 | TextEditingController nameController = TextEditingController(); 25 | TextEditingController surNameController = TextEditingController(); 26 | TextEditingController githubController = TextEditingController(); 27 | TextEditingController linkedInController = TextEditingController(); 28 | TextEditingController whatsAppController = TextEditingController(); 29 | 30 | //* put first value of the item list in dropdownValue. 31 | String dropdownValue = 'Full Stack Flutter Developer'; 32 | @override 33 | Widget build(BuildContext context) { 34 | WeCodeUser weCodeUser = context.watch().weCodeUser!; 35 | 36 | return Scaffold( 37 | backgroundColor: Colors.white, 38 | appBar: AppBar( 39 | backgroundColor: Colors.transparent, 40 | elevation: 0, 41 | automaticallyImplyLeading: false, 42 | title: const Text( 43 | 'Profile info', 44 | style: TextStyle( 45 | color: Colors.black, fontSize: 18, fontWeight: FontWeight.w500), 46 | ), 47 | leading: IconButton( 48 | icon: Icon(Icons.arrow_back), 49 | iconSize: 30, 50 | color: Colors.black, 51 | onPressed: () { 52 | Navigator.of(context).pop(); 53 | }, 54 | ), 55 | actions: [ 56 | Container( 57 | width: 75, 58 | margin: EdgeInsets.fromLTRB(0, 5, 20, 0), 59 | child: ElevatedButton( 60 | onPressed: () async { 61 | WeCodeUser newWecodeUser = WeCodeUser( 62 | name: nameController.text.isEmpty 63 | ? weCodeUser.name 64 | : nameController.text, 65 | createdAt: DateTime.now(), 66 | uid: weCodeUser.uid, 67 | email: weCodeUser.email, 68 | github: githubController.text, 69 | linkedin: linkedInController.text, 70 | phone: whatsAppController.text.isEmpty || 71 | whatsAppController.text.length < 8 72 | ? weCodeUser.phone 73 | : whatsAppController.text, 74 | skills: [dropdownValue], 75 | ); 76 | 77 | //TODO: update the current user with the new data 78 | await FirebaseFirestore.instance 79 | .collection('users') 80 | .doc(weCodeUser.uid) 81 | .update( 82 | newWecodeUser.toMap(), 83 | ) 84 | .then((value) => Get.to(JobsScreen())); 85 | }, 86 | style: ElevatedButton.styleFrom( 87 | fixedSize: Size(50, 0), 88 | primary: Color.fromARGB(255, 70, 155, 74), 89 | shape: RoundedRectangleBorder( 90 | borderRadius: BorderRadius.circular(50), // <-- Radius 91 | ), 92 | elevation: 0), 93 | child: Text( 94 | "Save", 95 | style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500), 96 | ), 97 | ), 98 | ) 99 | ], 100 | ), 101 | body: SingleChildScrollView( 102 | child: Column( 103 | crossAxisAlignment: CrossAxisAlignment.start, 104 | children: [ 105 | Text(weCodeUser.email), 106 | Text(weCodeUser.uid), 107 | SizedBox(height: 20), 108 | Row( 109 | mainAxisAlignment: MainAxisAlignment.center, 110 | children: [ 111 | Column( 112 | children: [ 113 | CircleAvatar( 114 | maxRadius: 52, 115 | backgroundColor: Colors.grey[500], 116 | //* backgroundImage: , set User image here. 117 | ), 118 | ], 119 | ), 120 | SizedBox(width: 15), 121 | Column( 122 | children: [ 123 | Text( 124 | "Update your Picture", 125 | style: 126 | TextStyle(fontSize: 22, fontWeight: FontWeight.w700), 127 | ), 128 | SizedBox(height: 5), 129 | Text( 130 | "Upload a photo under 2 MB", 131 | style: TextStyle( 132 | letterSpacing: 0.5, 133 | color: Colors.grey, 134 | fontSize: 15, 135 | fontWeight: FontWeight.w700), 136 | ), 137 | Row( 138 | children: [ 139 | ElevatedButton.icon( 140 | onPressed: () {}, 141 | icon: Icon(Icons.upload), 142 | label: Text( 143 | 'Upload', 144 | style: TextStyle(fontSize: 12), 145 | ), 146 | style: ElevatedButton.styleFrom( 147 | primary: Color.fromARGB(255, 77, 165, 146)), 148 | ), 149 | TextButton( 150 | onPressed: () {}, 151 | style: ButtonStyle( 152 | overlayColor: 153 | MaterialStateProperty.all(Colors.transparent), 154 | ), 155 | child: Text( 156 | 'Delete Current Picture', 157 | style: TextStyle( 158 | color: Colors.redAccent, 159 | fontSize: 13, 160 | fontWeight: FontWeight.w800), 161 | ), 162 | ) 163 | ], 164 | ), 165 | ], 166 | ) 167 | ], 168 | ), 169 | Padding( 170 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 171 | child: Text( 172 | "Name", 173 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 174 | ), 175 | ), 176 | CustomTextFieldForm( 177 | controller: nameController, 178 | ), 179 | Padding( 180 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 181 | child: Text( 182 | "Surename", 183 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 184 | ), 185 | ), 186 | CustomTextFieldForm( 187 | controller: surNameController, 188 | ), 189 | Padding( 190 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 10), 191 | child: Text( 192 | "Skils", 193 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 194 | ), 195 | ), 196 | Container( 197 | width: 365, 198 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 199 | child: DropdownButtonFormField( 200 | decoration: InputDecoration( 201 | fillColor: Color(0xffF6FAFB), 202 | filled: true, 203 | enabledBorder: UnderlineInputBorder( 204 | borderSide: BorderSide(color: Colors.white), 205 | ), 206 | ), 207 | iconSize: 27, 208 | value: dropdownValue, 209 | icon: const Icon(Icons.arrow_downward), 210 | elevation: 16, 211 | style: const TextStyle( 212 | color: Colors.black, 213 | fontSize: 15, 214 | fontWeight: FontWeight.w400), 215 | onChanged: (String? newValue) { 216 | setState(() { 217 | dropdownValue = newValue!; 218 | }); 219 | }, 220 | items: RequiredStrings.jobCategories 221 | .map>((String value) { 222 | return DropdownMenuItem( 223 | value: value, 224 | child: Text(value), 225 | ); 226 | }).toList(), 227 | ), 228 | ), 229 | Padding( 230 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 231 | child: Text( 232 | "github", 233 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 234 | ), 235 | ), 236 | CustomTextFieldForm( 237 | controller: githubController, 238 | ), 239 | Padding( 240 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 241 | child: Text( 242 | "Linkedin", 243 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 244 | ), 245 | ), 246 | CustomTextFieldForm( 247 | controller: linkedInController, 248 | ), 249 | Padding( 250 | padding: const EdgeInsets.fromLTRB(25, 25, 0, 15), 251 | child: Text( 252 | "whatsapp", 253 | style: TextStyle(fontWeight: FontWeight.w500, fontSize: 21), 254 | ), 255 | ), 256 | CustomTextFieldForm( 257 | controller: whatsAppController, 258 | ), 259 | SizedBox( 260 | height: 40, 261 | ), 262 | widget.isUpdate != true 263 | ? Container() 264 | : Container( 265 | margin: EdgeInsets.only(left: 30), 266 | width: 325, 267 | child: ElevatedButton( 268 | onPressed: () {}, 269 | child: Text( 270 | 'Change your password', 271 | style: TextStyle(), 272 | ), 273 | style: ElevatedButton.styleFrom( 274 | primary: Color.fromARGB(255, 18, 18, 18)), 275 | ), 276 | ), 277 | widget.isUpdate != true 278 | ? Container() 279 | : Container( 280 | margin: EdgeInsets.fromLTRB(115, 25, 0, 75), 281 | width: 165, 282 | height: 50, 283 | decoration: 284 | BoxDecoration(borderRadius: BorderRadius.circular(50)), 285 | child: ElevatedButton( 286 | onPressed: () {}, 287 | child: Text( 288 | 'Delete your account', 289 | style: TextStyle( 290 | color: Colors.red, fontWeight: FontWeight.w600), 291 | ), 292 | style: ElevatedButton.styleFrom( 293 | elevation: 0, 294 | primary: Color.fromARGB(255, 245, 244, 244), 295 | ), 296 | ), 297 | ), 298 | ], 299 | ), 300 | ), 301 | ); 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /lib/src/screens/fav_screen/fav_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:hive_flutter/hive_flutter.dart'; 3 | import 'package:wecode/src/models/vacancy_data_model.dart'; 4 | import 'package:wecode/src/screens/jobs_screen/bottom_navigation_bar.dart'; 5 | 6 | class FavoritesScreen extends StatelessWidget { 7 | const FavoritesScreen({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | centerTitle: true, 14 | title: const Text('Favorites', style: TextStyle(color: Colors.white)), 15 | actions: const [ 16 | Icon(Icons.favorite), 17 | SizedBox( 18 | width: 20, 19 | ) 20 | ], 21 | ), 22 | body: Container( 23 | padding: const EdgeInsets.all(20), 24 | child: ValueListenableBuilder( 25 | valueListenable: Hive.box('favBox').listenable(), 26 | builder: (context, box, widget) { 27 | return Center( 28 | child: ListView.builder( 29 | itemCount: box.length, 30 | itemBuilder: (context, index) { 31 | Map _data = box.getAt(index); 32 | Vacancy _vacancy = 33 | Vacancy.fromMap(_data.cast()); 34 | 35 | return MyExpansionTile( 36 | org: _vacancy.org, 37 | userName: _vacancy.user.name, 38 | title: _vacancy.title, 39 | type: _vacancy.type, 40 | city: _vacancy.city); 41 | }), 42 | ); 43 | }, 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | 50 | class MyExpansionTile extends StatefulWidget { 51 | const MyExpansionTile( 52 | {super.key, 53 | required this.org, 54 | required this.userName, 55 | required this.title, 56 | required this.type, 57 | required this.city}); 58 | final String org; 59 | final String userName; 60 | final String title; 61 | final String type; 62 | final String city; 63 | 64 | @override 65 | State createState() => _MyExpansionTileState(); 66 | } 67 | 68 | class _MyExpansionTileState extends State { 69 | bool _customTileExpanded = false; 70 | 71 | @override 72 | Widget build(BuildContext context) { 73 | return ExpansionTile( 74 | title: Text(widget.org), 75 | trailing: Icon( 76 | _customTileExpanded 77 | ? Icons.arrow_drop_down_circle 78 | : Icons.arrow_drop_down, 79 | ), 80 | childrenPadding: const EdgeInsets.only(left: 40), 81 | expandedAlignment: Alignment.centerLeft, 82 | expandedCrossAxisAlignment: CrossAxisAlignment.start, 83 | children: [ 84 | customeText( 85 | name: widget.userName, 86 | fontSize: 018, 87 | fontWeight: FontWeight.w500, 88 | letterSpacing: 0.4, 89 | maxLines: 1), 90 | customeText( 91 | name: '${widget.title} • ${widget.type}', 92 | fontSize: 015, 93 | letterSpacing: 0.4, 94 | maxLines: 2), 95 | customeText( 96 | name: widget.city, 97 | fontSize: 15, 98 | maxLines: 1, 99 | ), 100 | const SizedBox( 101 | height: 15, 102 | ) 103 | ], 104 | onExpansionChanged: (bool expanded) { 105 | setState(() => _customTileExpanded = expanded); 106 | }, 107 | ); 108 | } 109 | 110 | Widget customeText({ 111 | required String name, 112 | required double fontSize, 113 | FontWeight? fontWeight, 114 | double? letterSpacing, 115 | int? maxLines, 116 | }) { 117 | return Column( 118 | children: [ 119 | Text( 120 | name, 121 | style: TextStyle( 122 | fontSize: fontSize, 123 | fontWeight: fontWeight, 124 | letterSpacing: letterSpacing, 125 | color: Colors.black87), 126 | maxLines: maxLines, 127 | ), 128 | const SizedBox( 129 | height: 7, 130 | ) 131 | ], 132 | ); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/src/screens/info_screen/info_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:wecode/src/screens/jobs_screen/bottom_navigation_bar.dart'; 3 | 4 | class InfoScreen extends StatelessWidget { 5 | const InfoScreen({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text('Info'), 12 | ), 13 | body: Container( 14 | color: Colors.grey, 15 | child: const Center(child: Text('Info')), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/screens/jobs_screen/bottom_navigation_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:wecode/src/screens/fav_screen/fav_screen.dart'; 4 | import 'package:wecode/src/screens/info_screen/info_screen.dart'; 5 | import 'package:wecode/src/screens/jobs_screen/jobs_screen.dart'; 6 | 7 | class CustomeBottomNavigationBar extends StatefulWidget { 8 | const CustomeBottomNavigationBar({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => 12 | _CustomeBottomNavigationBarState(); 13 | } 14 | 15 | class _CustomeBottomNavigationBarState 16 | extends State { 17 | int? _selectedIndex; 18 | @override 19 | void initState() { 20 | _selectedIndex = 1; 21 | super.initState(); 22 | } 23 | 24 | List screens = [FavoritesScreen(), JobsScreen(), InfoScreen()]; 25 | 26 | void _onItemTapped(int index) { 27 | setState(() { 28 | _selectedIndex = index; 29 | }); 30 | switch (_selectedIndex) { 31 | case 0: 32 | Get.to(() => const FavoritesScreen()); 33 | break; 34 | case 1: 35 | Get.to(() => const JobsScreen()); 36 | break; 37 | case 2: 38 | Get.to(() => const InfoScreen()); 39 | break; 40 | } 41 | } 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return BottomNavigationBar( 46 | currentIndex: _selectedIndex!, 47 | selectedItemColor: Colors.white, 48 | unselectedItemColor: Colors.white70, 49 | backgroundColor: Colors.green, 50 | selectedLabelStyle: TextStyle(letterSpacing: 1.5), 51 | showSelectedLabels: true, 52 | showUnselectedLabels: false, 53 | items: const [ 54 | BottomNavigationBarItem(icon: Icon(Icons.favorite), label: 'Favs'), 55 | BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Jobs'), 56 | BottomNavigationBarItem(icon: Icon(Icons.info), label: 'Info'), 57 | ], 58 | onTap: _onItemTapped, 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/src/screens/jobs_screen/button_value_changer.dart: -------------------------------------------------------------------------------- 1 | // the ValueChanger class is used to retrieve initial values, may we get it from shared preferience in #futuretodo 2 | class ButtonValueChanger { 3 | static bool favRecord = !true; 4 | static bool hasNotification = true; 5 | } 6 | -------------------------------------------------------------------------------- /lib/src/screens/navigator_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/src/widgets/container.dart'; 3 | import 'package:flutter/src/widgets/framework.dart'; 4 | import 'package:wecode/src/screens/fav_screen/fav_screen.dart'; 5 | import 'package:wecode/src/screens/info_screen/info_screen.dart'; 6 | import 'package:wecode/src/screens/jobs_screen/jobs_screen.dart'; 7 | 8 | class NavigatorScreen extends StatefulWidget { 9 | const NavigatorScreen({super.key}); 10 | 11 | @override 12 | State createState() => _NavigatorScreenState(); 13 | } 14 | 15 | class _NavigatorScreenState extends State { 16 | int _selectedIndex = 1; 17 | 18 | Widget? _selectedScreen = JobsScreen(); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | body: _selectedScreen, 24 | bottomNavigationBar: BottomNavigationBar( 25 | currentIndex: _selectedIndex!, 26 | selectedItemColor: Colors.white, 27 | unselectedItemColor: Colors.white70, 28 | backgroundColor: Colors.green, 29 | selectedLabelStyle: TextStyle(letterSpacing: 1.5), 30 | showSelectedLabels: true, 31 | showUnselectedLabels: false, 32 | items: const [ 33 | BottomNavigationBarItem(icon: Icon(Icons.favorite), label: 'Favs'), 34 | BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Jobs'), 35 | BottomNavigationBarItem(icon: Icon(Icons.info), label: 'Info'), 36 | ], 37 | onTap: _onItemTapped, 38 | ), 39 | ); 40 | } 41 | 42 | void _onItemTapped(int index) { 43 | setState(() { 44 | _selectedIndex = index; 45 | }); 46 | switch (_selectedIndex) { 47 | case 0: 48 | setState(() { 49 | _selectedScreen = FavoritesScreen(); 50 | }); 51 | break; 52 | case 1: 53 | setState(() { 54 | _selectedScreen = JobsScreen(); 55 | }); 56 | break; 57 | case 2: 58 | setState(() { 59 | _selectedScreen = InfoScreen(); 60 | }); 61 | break; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/src/screens/screenHandler.dart: -------------------------------------------------------------------------------- 1 | // import 'package:flutter/material.dart'; 2 | // import 'package:flutter/src/foundation/key.dart'; 3 | // import 'package:flutter/src/widgets/framework.dart'; 4 | // import 'package:wecode/src/screens/auth/login_screen.dart'; 5 | 6 | // class ScreenHandler extends StatefulWidget { 7 | // const ScreenHandler({Key? key}) : super(key: key); 8 | 9 | // @override 10 | // State createState() => _ScreenHandlerState(); 11 | // } 12 | 13 | // class _ScreenHandlerState extends State { 14 | // @override 15 | // Widget build(BuildContext context) { 16 | // //TODO: if user is logged in and created the profile retrun the screen with bottom navigation 17 | // return Scaffold( 18 | // body: LoginScreen(), 19 | // ); 20 | // } 21 | // } 22 | -------------------------------------------------------------------------------- /lib/src/services/auth_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | class AuthService { 7 | //TODO: write methods to authenticate user using firebase auth 8 | 9 | FirebaseAuth auth = FirebaseAuth.instance; 10 | 11 | Future createUserWithEmailAndPassword( 12 | {required String email, required String password}) async { 13 | UserCredential? credential; 14 | try { 15 | credential = await auth.createUserWithEmailAndPassword( 16 | email: email, 17 | password: password, 18 | ); 19 | } on FirebaseAuthException catch (e) { 20 | if (e.code == 'weak-password') { 21 | Get.snackbar('error', 'The password provided is too weak.'); 22 | } else if (e.code == 'email-already-in-use') { 23 | Get.snackbar('error', 'The account already exists for that email.'); 24 | } else { 25 | Get.snackbar('error', e.message.toString()); 26 | } 27 | } catch (e) { 28 | Get.snackbar('error', e.toString()); 29 | } 30 | return credential; 31 | } 32 | 33 | Future signInWithEmailAndPassword( 34 | {required String email, required String password}) async { 35 | UserCredential? credential; 36 | 37 | try { 38 | credential = await auth.signInWithEmailAndPassword( 39 | email: email, password: password); 40 | } on FirebaseAuthException catch (e) { 41 | if (e.code == 'user-not-found') { 42 | Get.snackbar('Error', 'No user found for that email.'); 43 | } else if (e.code == 'wrong-password') { 44 | Get.snackbar('Error', 'Wrong information provided for that user.'); 45 | } else { 46 | Get.snackbar('Error', e.message.toString()); 47 | } 48 | } 49 | return credential; 50 | } 51 | 52 | forgetPassword({required String email}) async { 53 | try { 54 | await auth.sendPasswordResetEmail(email: email).catchError((err) { 55 | Get.snackbar('error', '$err'); 56 | }); 57 | } on FirebaseAuthException catch (e) { 58 | Get.snackbar('firebase error ', e.message.toString()); 59 | } 60 | // await auth.verifyPasswordResetCode(code); 61 | } 62 | 63 | Future logout() async { 64 | await auth.signOut(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/src/services/dynamic_links_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; 2 | 3 | class DynamicLinksService { 4 | Future createDynamicLink({required String vacancyID}) async { 5 | final dynamicLinkParams = DynamicLinkParameters( 6 | link: Uri.parse("https://www.wecode-rwanga.com/vacancy/$vacancyID"), 7 | uriPrefix: "https://wecode2.page.link", 8 | androidParameters: 9 | const AndroidParameters(packageName: "app.datacode.wecode.wecode"), 10 | iosParameters: 11 | const IOSParameters(bundleId: "app.datacode.wecode.wecode"), 12 | ); 13 | final dynamicLink = 14 | await FirebaseDynamicLinks.instance.buildLink(dynamicLinkParams); 15 | return dynamicLink; 16 | } 17 | 18 | Future createShortLink({required String vacancyID}) async { 19 | final dynamicLinkParams = DynamicLinkParameters( 20 | link: Uri.parse("https://www.wecode-rwanga.com/$vacancyID"), 21 | uriPrefix: "https://wecode2.page.link", 22 | androidParameters: 23 | const AndroidParameters(packageName: "app.datacode.wecode.wecode"), 24 | iosParameters: 25 | const IOSParameters(bundleId: "app.datacode.wecode.wecode"), 26 | ); 27 | final dynamicLink = 28 | await FirebaseDynamicLinks.instance.buildShortLink(dynamicLinkParams); 29 | 30 | return dynamicLink; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/services/firestore_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | import 'package:wecode/src/models/vacancy_data_model.dart'; 4 | import 'package:wecode/src/models/weCodeUser_data_model.dart'; 5 | 6 | class FireStoreService { 7 | final FirebaseFirestore _firestore = FirebaseFirestore.instance; 8 | 9 | // add user with initial information to database 10 | 11 | Future? addDeviceToken( 12 | {required WeCodeUser user, required String token}) { 13 | if (user.reference != null) { 14 | user.reference!.update({ 15 | 'deviceTokens': FieldValue.arrayUnion([token]) 16 | }); 17 | } else { 18 | _firestore.collection('users').doc(user.uid).update({ 19 | 'deviceTokens': FieldValue.arrayUnion([token]) 20 | }); 21 | } 22 | } 23 | 24 | Future addUserWithInitialInformationToDB( 25 | {required User user, 26 | required String userName, 27 | String? phoneNumber}) async { 28 | WeCodeUser weCodeUser = WeCodeUser( 29 | name: userName, 30 | createdAt: DateTime.now(), 31 | email: user.email!, 32 | phone: phoneNumber, 33 | uid: user.uid); 34 | 35 | await _firestore.collection('users').doc(user.uid).set(weCodeUser.toMap()); 36 | return weCodeUser; 37 | } 38 | 39 | Future addNewVacancy(Vacancy vacancy) async { 40 | return await _firestore.collection('jobs').add(vacancy.toMap()); 41 | } 42 | 43 | updateUserInformationFromCreateProfile({required WeCodeUser weCodeUser}) {} 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/services/push_notifications_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 2 | 3 | class PushNotifService { 4 | static const AndroidNotificationChannel androidChannel = 5 | AndroidNotificationChannel( 6 | 'high_importance_channel', // id 7 | 'High Importance Notifications', // title 8 | description: 9 | 'This channel is used for important notifications.', // description 10 | importance: Importance.max, 11 | playSound: true, 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/temp/class1 copy 2.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ClassOne extends StatelessWidget { 4 | const ClassOne({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | body: Center( 10 | child: Column( 11 | children: const [ 12 | Text('the number'), 13 | ], 14 | )), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/temp/class1 copy 4.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ClassOne extends StatelessWidget { 4 | const ClassOne({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Scaffold( 9 | body: Center(child: Text('the number')), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/temp/class1.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:wecode/src/temp/class2.dart'; 3 | 4 | class ClassOne extends StatelessWidget { 5 | const ClassOne({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const Scaffold( 10 | body: Center(child: ClassTwo()), 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/temp/class2.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:wecode/src/temp/class3.dart'; 4 | import 'package:wecode/src/temp/number_provider.dart'; 5 | 6 | class ClassTwo extends StatelessWidget { 7 | const ClassTwo({ 8 | Key? key, 9 | }) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | body: Center( 15 | child: Column( 16 | children: [ 17 | Expanded(child: ClassThree()), 18 | Expanded( 19 | child: Text(context.watch().theNumber.toString())) 20 | ], 21 | )), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/temp/class3.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:wecode/src/temp/number_provider.dart'; 4 | 5 | class ClassThree extends StatelessWidget { 6 | ClassThree({ 7 | Key? key, 8 | }) : super(key: key); 9 | 10 | final TextEditingController _numberController = TextEditingController(); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | final int number = context.watch().theNumber; 15 | 16 | return Scaffold( 17 | body: Center( 18 | child: Container( 19 | margin: const EdgeInsets.all(20), 20 | child: Column( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | crossAxisAlignment: CrossAxisAlignment.center, 23 | children: [ 24 | const Text('consumer'), 25 | Consumer( 26 | builder: (BuildContext context, value, __) => 27 | Text('${value.theNumber}')), 28 | const Divider(), 29 | TextField( 30 | controller: _numberController, 31 | ), 32 | ElevatedButton( 33 | onPressed: () { 34 | context 35 | .read() 36 | .changeTheNumber(int.parse(_numberController.text)); 37 | }, 38 | child: const Text('update number')) 39 | ], 40 | ), 41 | )), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/temp/number_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NumberProvider extends ChangeNotifier { 4 | int theNumber = 322; 5 | 6 | changeTheNumber(int number) { 7 | theNumber = number; 8 | notifyListeners(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/widget/costume_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CostumeButton extends StatelessWidget { 4 | const CostumeButton({ 5 | Key? key, 6 | required this.onPressed, 7 | required this.color, 8 | required this.text, 9 | }) : super(key: key); 10 | 11 | final Text text; 12 | final onPressed; 13 | final Color color; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return SizedBox( 18 | width: 350, 19 | height: 50, 20 | child: ElevatedButton( 21 | onPressed: onPressed, 22 | style: ElevatedButton.styleFrom( 23 | backgroundColor: color, 24 | textStyle: TextStyle(fontSize: 12), 25 | shape: 26 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), 27 | ), 28 | child: text, 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/widget/costume_textField.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextField extends StatelessWidget { 4 | const CustomTextField({ 5 | Key? key, 6 | required this.hint, 7 | required this.icon, 8 | required this.control, 9 | }) : super(key: key); 10 | 11 | final String hint; 12 | final Icon icon; 13 | final TextEditingController control; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return TextField( 18 | controller: control, 19 | style: const TextStyle(fontSize: 16), 20 | decoration: InputDecoration( 21 | icon: icon, 22 | hintText: hint, 23 | hintStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w400), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/widget/create_profile_textfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextFieldForm extends StatelessWidget { 4 | const CustomTextFieldForm({ 5 | Key? key, 6 | this.controller, 7 | this.validator, 8 | this.text, 9 | }) : super(key: key); 10 | 11 | final TextEditingController? controller; 12 | final String? Function(String?)? validator; 13 | final String? text; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Column( 17 | children: [ 18 | Padding( 19 | padding: const EdgeInsets.symmetric(horizontal: 25), 20 | child: TextFormField( 21 | validator: validator, 22 | controller: controller, 23 | decoration: const InputDecoration( 24 | border: InputBorder.none, 25 | filled: true, 26 | fillColor: Color(0xffF6FAFB), 27 | labelStyle: TextStyle( 28 | color: Colors.white, 29 | fontSize: 20, 30 | ), 31 | focusedBorder: OutlineInputBorder( 32 | borderSide: BorderSide(color: Colors.transparent), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ], 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "wecode") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "app.datacode.wecode.wecode") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "wecode"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "wecode"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import cloud_firestore 9 | import firebase_auth 10 | import firebase_core 11 | import firebase_messaging 12 | import flutter_local_notifications 13 | import path_provider_macos 14 | import sqflite 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 18 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 19 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 20 | FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) 21 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 22 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 23 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/.symlinks/plugins/cloud_firestore: -------------------------------------------------------------------------------- 1 | /Users/hooshyar/Desktop/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/.symlinks/plugins/firebase_auth: -------------------------------------------------------------------------------- 1 | /Users/hooshyar/Desktop/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.6.2/ -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/.symlinks/plugins/firebase_core: -------------------------------------------------------------------------------- 1 | /Users/hooshyar/Desktop/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.20.0/ -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/.symlinks/plugins/path_provider_macos: -------------------------------------------------------------------------------- 1 | /Users/hooshyar/Desktop/development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.6/ -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/Flutter-Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=/Users/hooshyar/Desktop/development/flutter 3 | FLUTTER_APPLICATION_PATH=/Users/hooshyar/Desktop/development/wecode 4 | COCOAPODS_PARALLEL_CODE_SIGN=true 5 | FLUTTER_BUILD_DIR=build 6 | FLUTTER_BUILD_NAME=1.0.0 7 | FLUTTER_BUILD_NUMBER=1 8 | DART_OBFUSCATION=false 9 | TRACK_WIDGET_CREATION=true 10 | TREE_SHAKE_ICONS=false 11 | PACKAGE_CONFIG=.dart_tool/package_config.json 12 | -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/FlutterMacOS.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # This is a generated file; do not edit or check into version control. 4 | # 5 | 6 | Pod::Spec.new do |s| 7 | s.name = 'FlutterMacOS' 8 | s.version = '1.0.0' 9 | s.summary = 'High-performance, high-fidelity mobile apps.' 10 | s.homepage = 'https://flutter.io' 11 | s.license = { :type => 'MIT' } 12 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 13 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 14 | s.osx.deployment_target = '10.11' 15 | # Framework linking is handled by Flutter tooling, not CocoaPods. 16 | # Add a placeholder to satisfy `s.dependency 'FlutterMacOS'` plugin podspecs. 17 | s.vendored_frameworks = 'path/to/nothing' 18 | end 19 | -------------------------------------------------------------------------------- /macos/Flutter/ephemeral/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=/Users/hooshyar/Desktop/development/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/hooshyar/Desktop/development/wecode" 5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "FLUTTER_BUILD_NAME=1.0.0" 8 | export "FLUTTER_BUILD_NUMBER=1" 9 | export "DART_OBFUSCATION=false" 10 | export "TRACK_WIDGET_CREATION=true" 11 | export "TREE_SHAKE_ICONS=false" 12 | export "PACKAGE_CONFIG=.dart_tool/package_config.json" 13 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Pods/Local Podspecs/FlutterMacOS.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FlutterMacOS", 3 | "version": "1.0.0", 4 | "summary": "High-performance, high-fidelity mobile apps.", 5 | "homepage": "https://flutter.io", 6 | "license": { 7 | "type": "MIT" 8 | }, 9 | "authors": { 10 | "Flutter Dev Team": "flutter-dev@googlegroups.com" 11 | }, 12 | "source": { 13 | "git": "https://github.com/flutter/engine", 14 | "tag": "1.0.0" 15 | }, 16 | "platforms": { 17 | "osx": "10.11" 18 | }, 19 | "vendored_frameworks": "path/to/nothing" 20 | } 21 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: wecode 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.17.6 <3.0.0" 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | flutter: 31 | sdk: flutter 32 | 33 | 34 | # The following adds the Cupertino Icons font to your application. 35 | # Use with the CupertinoIcons class for iOS style icons. 36 | cupertino_icons: ^1.0.2 37 | firebase_core: ^1.20.0 38 | google_fonts: ^3.0.1 39 | provider: ^6.0.3 40 | font_awesome_flutter: ^10.1.0 41 | cloud_firestore: ^3.4.3 42 | firebase_auth: ^3.6.2 43 | get: ^4.6.5 44 | hive: ^2.2.3 45 | hive_flutter: ^1.1.0 46 | flutter_local_notifications: ^9.8.0+1 47 | firebase_messaging: ^12.0.3 48 | firebase_dynamic_links: ^4.3.6 49 | uuid: ^3.0.6 50 | cached_network_image: ^3.2.2 51 | 52 | dev_dependencies: 53 | hive_generator: 54 | build_runner: 55 | flutter_test: 56 | sdk: flutter 57 | 58 | # The "flutter_lints" package below contains a set of recommended lints to 59 | # encourage good coding practices. The lint set provided by the package is 60 | # activated in the `analysis_options.yaml` file located at the root of your 61 | # package. See that file for information about deactivating specific lint 62 | # rules and activating additional ones. 63 | flutter_lints: ^2.0.0 64 | 65 | # For information on the generic Dart part of this file, see the 66 | # following page: https://dart.dev/tools/pub/pubspec 67 | 68 | # The following section is specific to Flutter packages. 69 | flutter: 70 | 71 | # The following line ensures that the Material Icons font is 72 | # included with your application, so that you can use the icons in 73 | # the material Icons class. 74 | uses-material-design: true 75 | 76 | # To add assets to your application, add an assets section, like this: 77 | #assets: 78 | # - image1.jpg 79 | # - images/a_dot_ham.jpeg 80 | 81 | # An image asset can refer to one or more resolution-specific "variants", see 82 | # https://flutter.dev/assets-and-images/#resolution-aware 83 | 84 | # For details regarding adding assets from package dependencies, see 85 | # https://flutter.dev/assets-and-images/#from-packages 86 | 87 | # To add custom fonts to your application, add a fonts section here, 88 | # in this "flutter" section. Each entry in this list should have a 89 | # "family" key with the font family name, and a "fonts" key with a 90 | # list giving the asset and other descriptors for the font. For 91 | # example: 92 | # fonts: 93 | # - family: Schyler 94 | # fonts: 95 | # - asset: fonts/Schyler-Regular.ttf 96 | # - asset: fonts/Schyler-Italic.ttf 97 | # style: italic 98 | # - family: Trajan Pro 99 | # fonts: 100 | # - asset: fonts/TrajanPro.ttf 101 | # - asset: fonts/TrajanPro_Bold.ttf 102 | # weight: 700 103 | # 104 | # For details regarding fonts from package dependencies, 105 | # see https://flutter.dev/custom-fonts/#from-packages 106 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | wecode 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wecode", 3 | "short_name": "wecode", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(wecode LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "wecode") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Disable Windows macros that collide with C++ standard library functions. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 25 | 26 | # Add dependency libraries and include directories. Add any application-specific 27 | # dependencies here. 28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 30 | 31 | # Run the Flutter tool portions of the build. This must not be removed. 32 | add_dependencies(${BINARY_NAME} flutter_assemble) 33 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "app.datacode.wecode" "\0" 93 | VALUE "FileDescription", "wecode" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "wecode" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 app.datacode.wecode. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "wecode.exe" "\0" 98 | VALUE "ProductName", "wecode" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"wecode", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hooshyar/wecode/99813c12c0db58bbb575ffe24d1f4778c3c66eb5/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------