├── .gitignore ├── .metadata ├── .vscode └── launch.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ ├── progaurd-rules.pro │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── testing │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── animation ├── bg-1.json ├── bg-2.json ├── bg-3.json ├── biometric.json ├── cctv.json ├── finger.json ├── privacy.json ├── recognition.json ├── shield.json └── wire.json ├── fonts ├── Flix-Normal.ttf ├── Helvetica-Bold.ttf ├── Helvetica.ttf ├── Poppins-Bold.ttf ├── Poppins-Regular.ttf ├── Poppins-SemiBold.ttf ├── Roboto-Black.ttf └── Roboto-Regular.ttf ├── images ├── Capture.jpg ├── air-conditioner.png ├── alerts.gif ├── cancel.gif ├── cctv.gif ├── complogo.png ├── creative.png ├── eagle.png ├── email.png ├── icon_email.png ├── icon_email.svg ├── icon_lock.png ├── icon_lock.svg ├── image.jpg ├── img-1.png ├── img-2.png ├── img-3.png ├── lock-object.svg ├── lock.png ├── login.svg ├── login1.svg ├── logo.png ├── mail-verification.gif ├── picture1.jpg ├── profile.png ├── success.svg ├── successful.gif ├── sucess.gif ├── uploading.gif ├── vv.jpg ├── washing-machine.png └── wh.jpg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-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 │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── Hero.dart ├── colors.dart ├── common │ └── theme_helper.dart ├── components │ └── rounded_btn │ │ └── rounded_btn.dart ├── constants.dart ├── detailpage.dart ├── dragger.dart ├── finerprint.dart ├── fingerpage.dart ├── home.dart ├── main.dart ├── methods.dart ├── navbar.dart ├── noti.dart ├── notifications.dart ├── pages │ └── onboarding_page.dart ├── profile.dart ├── schedules.dart ├── settings.dart ├── skelton.dart ├── smart │ ├── forgot_password_page.dart │ ├── login_page.dart │ ├── registration_page.dart │ └── widgets │ │ └── header_widget.dart ├── upload.dart ├── userCheck.dart └── widget │ └── card_planet.dart ├── package-lock.json ├── package.json ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── 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 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 5464c5bac742001448fe4fc0597be939379f88ea 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "name": "testing", 10 | "request": "launch", 11 | "type": "dart", 12 | "args": [ 13 | "--no-sound-null-safety" 14 | ] 15 | }, 16 | { 17 | "name": "testing (profile mode)", 18 | "request": "launch", 19 | "type": "dart", 20 | "flutterMode": "profile", 21 | "args": [ 22 | "--no-sound-null-safety" 23 | ] 24 | }, 25 | { 26 | "name": "testing (release mode)", 27 | "request": "launch", 28 | "type": "dart", 29 | "flutterMode": "release", 30 | "args": [ 31 | "--no-sound-null-safety" 32 | ] 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Smart Home Security System Using Flutter & Python 2 | 3 | This is a Flutter Application based on Python Server and Firebase Server. 4 | 5 | * Python Server: 6 | https://github.com/Executer13/Smart-Home-Security-System-Python-Server 7 | 8 | This App uses RTSP Link of Cameras to Stream the Camera footage and Python Sever is used to Process Video to Perform Facial recogntion and Pedestrian Detection annd generate Alert in case of Intrusion over line or Area over specific area drawn by user on Flutter App. 9 | 10 | ## Description 11 | 12 | OnBoadring Screen is used to guide the new Users. User Created Account and Confirms via Email and Finally Logs in to the account. Hpmepage presents the Footage of the Camera which uses rtsp link to fetch it and the buttons on the Homepage are used to change the model modes. notification panel is used to display all the notifiations while draw screen is used to draw the specfic area where the user wants to monitor. once the alert is generated from python server the user will be informed via notificatoin which includes date time and picture. 13 | 14 | ## Getting Started 15 | 16 | ### Dependencies 17 | 18 | * Openvino Toolkit. 19 | 20 | 21 | Openvino Models: 22 | * Face-detection-0200 23 | * face-detections-adas-001 24 | * face-detection-retail-0004 25 | * face-reidentification-retail-0095 26 | * landmarks-regression-retail-0009 27 | 28 | ### Android Screenshots 29 | 30 | 31 | onBoarding | onBoarding | onBoarding 32 | :-------------------------:|:-------------------------:|:-------------------------: 33 | ![Onboarding](https://user-images.githubusercontent.com/94052423/194963022-8c899c99-79da-40c2-955d-4494141dcb7c.jpeg) | ![on3](https://user-images.githubusercontent.com/94052423/194963023-a8a9b6e6-f731-4f7c-934a-ec226dd6e3ba.jpeg) | ![on2](https://user-images.githubusercontent.com/94052423/194963026-9cc58911-7fed-49b8-bca2-7079835c8a32.jpeg) 34 | 35 | 36 | 37 | 38 | Notification | Notification | Notification 39 | :-------------------------:|:-------------------------:|:-------------------------: 40 | ![not](https://user-images.githubusercontent.com/94052423/194962950-0328a793-f39e-4ede-b006-616ad1573e92.jpeg) | ![not1](https://user-images.githubusercontent.com/94052423/194962954-5cff0870-ed0c-4be2-baf6-cb4141183d9c.jpeg) | ![not2](https://user-images.githubusercontent.com/94052423/194962958-a8b40791-d029-4377-bc17-96b74fc507af.jpeg) 41 | 42 | 43 | Login | Onboarding | Forgot 44 | :-------------------------:|:-------------------------:|:-------------------------: 45 | ![Login](https://user-images.githubusercontent.com/94052423/194961604-1ed46b3d-64f7-4a5b-b694-85cdec9203e4.jpeg) |![Onboarding](https://user-images.githubusercontent.com/94052423/194961772-4bc10e69-d7df-47f4-ba5b-2c7292fd77c7.jpeg) |![Forgot](https://user-images.githubusercontent.com/94052423/194961816-eb21ce1e-a8f1-4559-9a01-fbeb44d466fc.jpeg) 46 | 47 | 48 | 49 | Home | Settings | Drawer 50 | :-------------------------:|:-------------------------:|:-------------------------: 51 | ![Home](https://user-images.githubusercontent.com/94052423/194962776-f9208ed5-78c4-4e9e-b7d9-6b7ac1a43179.jpeg) | ![Setting](https://user-images.githubusercontent.com/94052423/194962771-dfe99def-4fc9-4abc-b623-8abd95902e82.jpeg) | ![Drawer](https://user-images.githubusercontent.com/94052423/194962773-0fc6e661-e2da-4d43-b877-730274ad602b.jpeg) 52 | 53 | 54 | 55 | ## Help 56 | 57 | Suggested to use it along the Python Server. 58 | 59 | ## Authors 60 | 61 | Contributors names and contact info 62 | 63 | ex. Yasan Malik 64 | ex. [@YasanMalik]([https://twitter.com/dompizzie](https://www.linkedin.com/in/yasan-malik-7ba1aa247/?originalSubdomain=pk)) 65 | ex. https://www.fiverr.com/yasanmalik 66 | ex. https://www.linkedin.com/in/yasan-malik-7ba1aa247/ 67 | 68 | ## Version History 69 | * Initial Release 70 | 71 | ## License 72 | 73 | This Project Also Includes OpenVino Facial Recogniton API. 74 | -------------------------------------------------------------------------------- /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 | apply plugin: 'com.google.gms.google-services' 26 | apply plugin: 'kotlin-android' 27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 28 | 29 | android { 30 | compileSdkVersion 33 31 | 32 | 33 | compileOptions { 34 | sourceCompatibility JavaVersion.VERSION_1_8 35 | targetCompatibility JavaVersion.VERSION_1_8 36 | } 37 | 38 | kotlinOptions { 39 | jvmTarget = '1.8' 40 | } 41 | 42 | sourceSets { 43 | main.java.srcDirs += 'src/main/kotlin' 44 | } 45 | 46 | defaultConfig { 47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 48 | applicationId "com.example.testing" 49 | minSdkVersion 21 50 | targetSdkVersion flutter.targetSdkVersion 51 | versionCode flutterVersionCode.toInteger() 52 | versionName flutterVersionName 53 | } 54 | packagingOptions { 55 | // Fixes duplicate libraries build issue, 56 | // when your project uses more than one plugin that depend on C++ libs. 57 | pickFirst 'lib/**/libc++_shared.so' 58 | } 59 | lintOptions { 60 | checkReleaseBuilds false 61 | } 62 | 63 | buildTypes { 64 | release { 65 | // TODO: Add your own signing config for the release build. 66 | // Signing with the debug keys for now, so `flutter run --release` works. 67 | signingConfig signingConfigs.debug 68 | minifyEnabled true 69 | useProguard true 70 | proguardFiles getDefaultProguardFile( 71 | 'proguard-android-optimize.txt'), 72 | 'proguard-rules.pro' 73 | 74 | } 75 | } 76 | } 77 | 78 | flutter { 79 | source '../..' 80 | } 81 | 82 | dependencies { 83 | implementation platform('com.google.firebase:firebase-bom:29.3.1') 84 | implementation 'com.google.firebase:firebase-analytics' 85 | implementation 'com.google.firebase:firebase-messaging:20.2.4' 86 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 87 | } 88 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "581039040412", 4 | "project_id": "smart-home-security-823d8", 5 | "storage_bucket": "smart-home-security-823d8.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:581039040412:android:75551a17ef4e4c58ee4a59", 11 | "android_client_info": { 12 | "package_name": "com.example.testing" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "581039040412-o4m2g7173q77tnmqi5i4e0bmpe610rmt.apps.googleusercontent.com", 18 | "client_type": 3 19 | } 20 | ], 21 | "api_key": [ 22 | { 23 | "current_key": "AIzaSyDICa0KQakbtcp13pPXJsxJCJT2_ZqkzHI" 24 | } 25 | ], 26 | "services": { 27 | "appinvite_service": { 28 | "other_platform_oauth_client": [ 29 | { 30 | "client_id": "581039040412-o4m2g7173q77tnmqi5i4e0bmpe610rmt.apps.googleusercontent.com", 31 | "client_type": 3 32 | } 33 | ] 34 | } 35 | } 36 | } 37 | ], 38 | "configuration_version": "1" 39 | } -------------------------------------------------------------------------------- /android/app/progaurd-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class org.videolan.libvlc.** { *; } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | android:usesCleartextTraffic="true" 16 | 24 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/testing/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.testing 2 | 3 | 4 | import androidx.annotation.NonNull; 5 | import io.flutter.embedding.android.FlutterFragmentActivity 6 | import io.flutter.embedding.engine.FlutterEngine 7 | import io.flutter.plugins.GeneratedPluginRegistrant 8 | 9 | class MainActivity: FlutterFragmentActivity() { 10 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } -------------------------------------------------------------------------------- /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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.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 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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:4.1.0' 10 | classpath 'com.google.gms:google-services:4.3.10' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=false 5 | -------------------------------------------------------------------------------- /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-6.7-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 | -------------------------------------------------------------------------------- /animation/wire.json: -------------------------------------------------------------------------------- 1 | {"v":"5.7.1","fr":30,"ip":0,"op":90,"w":102,"h":102,"nm":"Design","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"circle Outlines","parent":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[4.321,4.321,0],"ix":2},"a":{"a":0,"k":[59.985,59.985,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-10.368],[10.368,0],[0,10.369],[-10.37,0]],"o":[[0,10.369],[-10.37,0],[0,-10.368],[10.368,0]],"v":[[18.774,-0.001],[0.001,18.773],[-18.774,-0.001],[0.001,-18.773]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.9372549019607843,0.40784313725490196,0.40784313725490196,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0.8,"ix":5},"lc":1,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[59.985,59.985],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.782],"y":[0.998]},"o":{"x":[0.977],"y":[-0.006]},"t":10.825,"s":[0]},{"t":37,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":9,"op":125,"st":9,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"square Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.22],"y":[1.133]},"o":{"x":[1],"y":[-0.079]},"t":2.55,"s":[0]},{"t":51,"s":[180]}],"ix":10},"p":{"a":0,"k":[51.12566399999999,50.920848,0],"ix":2},"a":{"a":0,"k":[32.154,32.153,0],"ix":1},"s":{"a":0,"k":[81.6,81.6,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-27.833,-10.661],[-27.833,-27.832],[27.833,-27.832],[27.833,27.832],[-27.833,27.832]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.7372549019607844,0.3176470588235294,0.3176470588235294,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0.8,"ix":5},"lc":1,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[32.154,32.153],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0],"y":[0.982]},"o":{"x":[0.861],"y":[0.92]},"t":2.55,"s":[0]},{"t":45.900390625,"s":[100]}],"ix":2},"o":{"a":0,"k":21,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":2,"op":118,"st":2,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"R UP Outlines","parent":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":10.2,"s":[0]},{"t":16.5751953125,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[59.986,4.321,0],"ix":2},"a":{"a":0,"k":[59.985,4.321,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-0.844,-0.844],[0,-1.106],[0.844,-0.843],[1.106,0],[0.843,0.844],[0,1.106],[-0.844,0.844],[-1.106,0]],"o":[[0.844,0.844],[0,1.106],[-0.844,0.844],[-1.106,0],[-0.844,-0.843],[0,-1.106],[0.843,-0.844],[1.106,0]],"v":[[3.055,-3.056],[4.321,0.001],[3.055,3.055],[0,4.322],[-3.055,3.055],[-4.321,0.001],[-3.055,-3.056],[0,-4.322]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.7372549019607844,0.3176470588235294,0.3176470588235294,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[59.985,4.321],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":2,"op":118,"st":2,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"R DWN Outlines","parent":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":16.575,"s":[0]},{"t":22.9501953125,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[59.986,59.985,0],"ix":2},"a":{"a":0,"k":[60.041,60.331,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.278,1.819],[-0.929,0.928],[-1.194,0],[-0.782,-0.783],[0,-1.192],[0.782,-0.781],[1.46,0.224]],"o":[[-0.224,-1.46],[0.782,-0.783],[1.193,0],[0.782,0.781],[0,1.194],[-0.928,0.929],[-1.819,-0.279]],"v":[[-4.183,0.597],[-2.97,-3.141],[0.086,-4.407],[3.141,-3.141],[4.407,-0.087],[3.141,2.969],[-0.598,4.183]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.7372549019607844,0.3176470588235294,0.3176470588235294,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[59.955,60.417],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":2,"op":118,"st":2,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"L UP Outlines","parent":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":6.375,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[4.321,4.321,0],"ix":2},"a":{"a":0,"k":[4.321,4.321,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-0.844,-0.844],[0,-1.106],[0.844,-0.843],[1.106,0],[0.843,0.844],[0,1.106],[-0.844,0.844],[-1.106,0]],"o":[[0.844,0.844],[0,1.106],[-0.844,0.844],[-1.106,0],[-0.844,-0.843],[0,-1.106],[0.843,-0.844],[1.106,0]],"v":[[3.055,-3.056],[4.321,0.001],[3.055,3.055],[-0.001,4.322],[-3.056,3.055],[-4.322,0.001],[-3.056,-3.056],[-0.001,-4.322]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.7372549019607844,0.3176470588235294,0.3176470588235294,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[4.321,4.321],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":116,"st":0,"bm":0},{"ddd":0,"ind":11,"ty":4,"nm":"L DWN Outlines","parent":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":20.4,"s":[0]},{"t":26.775390625,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[4.321,59.985,0],"ix":2},"a":{"a":0,"k":[4.321,60.331,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.278,1.819],[-0.929,0.928],[-1.194,0],[-0.782,-0.783],[0,-1.192],[0.782,-0.781],[1.46,0.224]],"o":[[-0.224,-1.46],[0.782,-0.783],[1.193,0],[0.782,0.781],[0,1.194],[-0.929,0.929],[-1.819,-0.279]],"v":[[-4.269,0.597],[-3.056,-3.141],[0,-4.407],[3.055,-3.141],[4.321,-0.087],[3.055,2.969],[-0.684,4.183]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.7372549019607844,0.3176470588235294,0.3176470588235294,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[4.321,60.417],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":116,"st":0,"bm":0}],"markers":[]} -------------------------------------------------------------------------------- /fonts/Flix-Normal.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Flix-Normal.ttf -------------------------------------------------------------------------------- /fonts/Helvetica-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Helvetica-Bold.ttf -------------------------------------------------------------------------------- /fonts/Helvetica.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Helvetica.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /fonts/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /images/Capture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/Capture.jpg -------------------------------------------------------------------------------- /images/air-conditioner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/air-conditioner.png -------------------------------------------------------------------------------- /images/alerts.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/alerts.gif -------------------------------------------------------------------------------- /images/cancel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/cancel.gif -------------------------------------------------------------------------------- /images/cctv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/cctv.gif -------------------------------------------------------------------------------- /images/complogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/complogo.png -------------------------------------------------------------------------------- /images/creative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/creative.png -------------------------------------------------------------------------------- /images/eagle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/eagle.png -------------------------------------------------------------------------------- /images/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/email.png -------------------------------------------------------------------------------- /images/icon_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/icon_email.png -------------------------------------------------------------------------------- /images/icon_email.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | -------------------------------------------------------------------------------- /images/icon_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/icon_lock.png -------------------------------------------------------------------------------- /images/icon_lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | -------------------------------------------------------------------------------- /images/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/image.jpg -------------------------------------------------------------------------------- /images/img-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/img-1.png -------------------------------------------------------------------------------- /images/img-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/img-2.png -------------------------------------------------------------------------------- /images/img-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/img-3.png -------------------------------------------------------------------------------- /images/lock-object.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/lock.png -------------------------------------------------------------------------------- /images/login.svg: -------------------------------------------------------------------------------- 1 | access_account -------------------------------------------------------------------------------- /images/login1.svg: -------------------------------------------------------------------------------- 1 | mobile login -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/logo.png -------------------------------------------------------------------------------- /images/mail-verification.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/mail-verification.gif -------------------------------------------------------------------------------- /images/picture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/picture1.jpg -------------------------------------------------------------------------------- /images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/profile.png -------------------------------------------------------------------------------- /images/successful.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/successful.gif -------------------------------------------------------------------------------- /images/sucess.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/sucess.gif -------------------------------------------------------------------------------- /images/uploading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/uploading.gif -------------------------------------------------------------------------------- /images/vv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/vv.jpg -------------------------------------------------------------------------------- /images/washing-machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/washing-machine.png -------------------------------------------------------------------------------- /images/wh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/images/wh.jpg -------------------------------------------------------------------------------- /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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 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 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Testing 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SMHS 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 | 47 | 48 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/Hero.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'components/rounded_btn/rounded_btn.dart'; 6 | import 'methods.dart'; 7 | import 'package:gallery_saver/gallery_saver.dart'; 8 | 9 | final FirebaseAuth _auth = FirebaseAuth.instance; 10 | class HeroA extends StatefulWidget { 11 | final drinks; 12 | final index; 13 | const HeroA({Key? key, required this.drinks, required this.index}) 14 | : super(key: key); 15 | 16 | @override 17 | _HeroAState createState() => _HeroAState(); 18 | } 19 | 20 | class _HeroAState extends State { 21 | @override 22 | Widget build(BuildContext context) { 23 | var sizeheight = MediaQuery.of(context).size.height; 24 | var sizewidth = MediaQuery.of(context).size.width; 25 | return Scaffold( 26 | 27 | body: Column( 28 | children: [ 29 | SizedBox(height: sizeheight / 15), 30 | 31 | Hero( 32 | tag: this.widget.drinks["Link"], 33 | child: Material( 34 | 35 | child: 36 | 37 | Container( 38 | height: sizeheight / 3, 39 | width: sizewidth / 1, 40 | alignment: Alignment.center, 41 | decoration: BoxDecoration( 42 | borderRadius: BorderRadius.circular(8), 43 | image: DecorationImage( 44 | image: 45 | NetworkImage(this.widget.drinks["Link"]), 46 | fit: BoxFit.contain)), 47 | ), 48 | 49 | 50 | 51 | ), 52 | ), 53 | Padding( 54 | padding: const EdgeInsets.all(8.0), 55 | child: Text( 56 | this.widget.drinks["Name"], 57 | textAlign: TextAlign.center, 58 | style: TextStyle( 59 | fontWeight: FontWeight.bold, 60 | fontSize: 22, 61 | color: Color(0xfff3B324E)), 62 | ), 63 | ), 64 | Padding( 65 | padding: const EdgeInsets.all(8.0), 66 | child: Text("Date:"+ 67 | this.widget.drinks["Date"], 68 | textAlign: TextAlign.center, 69 | style: TextStyle( 70 | fontWeight: FontWeight.bold, 71 | fontSize: 22, 72 | color: Color(0xfff3B324E)), 73 | ), 74 | ), 75 | Padding( 76 | padding: const EdgeInsets.all(8.0), 77 | child: Text("Time:"+ 78 | this.widget.drinks["Time"], 79 | textAlign: TextAlign.center, 80 | style: TextStyle( 81 | fontWeight: FontWeight.bold, 82 | fontSize: 22, 83 | color: Color(0xfff3B324E)), 84 | ), 85 | ), 86 | SizedBox( 87 | height: sizeheight / 35, 88 | ), 89 | Row( 90 | children: [ 91 | Container(margin: EdgeInsets.only(left: 10),width: 120,height: 100,child: RoundedButton( 92 | circular: 20, 93 | btnText:'Download', color: Color(0xfff1877F2) ,onPressed:()=>{GallerySaver.saveImage(this.widget.drinks["Link"]),showSimpleBar(context, 'Capture Saved to Gallery')} ,)), 94 | Spacer(), 95 | Container( 96 | margin: EdgeInsets.only(right: 10), 97 | width: 120,height: 100, 98 | child: RoundedButton( 99 | circular: 20, 100 | btnText:'Delete', color: Color(0xfff1877F2) ,onPressed:() async =>{ 101 | 102 | 103 | await FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).collection('Captures').doc( this.widget.drinks["Date"]+" "+ this.widget.drinks["Time"].replaceAll(RegExp(':'), '-')).delete() 104 | ,showSimpleBar(context, 'Capture Deleted') 105 | } ,), 106 | ) 107 | ], 108 | ) , 109 | 110 | ], 111 | ), 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /lib/colors.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:ui'; 3 | 4 | var primary=Color(0xfff8d99ae); 5 | var secondary=Color(0xfffedf2f4); 6 | var tone=Color(0xfff023e8a); 7 | var toneSec=Color.fromARGB(255, 2, 44, 99); -------------------------------------------------------------------------------- /lib/common/theme_helper.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:hexcolor/hexcolor.dart'; 4 | 5 | class ThemeHelper{ 6 | 7 | InputDecoration textInputDecoration([String lableText="", String hintText = ""]){ 8 | return InputDecoration( 9 | labelText: lableText, 10 | hintText: hintText, 11 | fillColor: Colors.white, 12 | filled: true, 13 | contentPadding: EdgeInsets.fromLTRB(20, 10, 20, 10), 14 | focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(100.0), borderSide: BorderSide(color: Colors.grey)), 15 | enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(100.0), borderSide: BorderSide(color: Colors.grey.shade400)), 16 | errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(100.0), borderSide: BorderSide(color: Colors.red, width: 2.0)), 17 | focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(100.0), borderSide: BorderSide(color: Colors.red, width: 2.0)), 18 | ); 19 | } 20 | 21 | BoxDecoration inputBoxDecorationShaddow() { 22 | return BoxDecoration(boxShadow: [ 23 | BoxShadow( 24 | color: Colors.black.withOpacity(0.1), 25 | blurRadius: 20, 26 | offset: const Offset(0, 5), 27 | ) 28 | ]); 29 | } 30 | 31 | BoxDecoration buttonBoxDecoration(BuildContext context, [String color1 = "", String color2 = ""]) { 32 | Color c1 = Theme.of(context).primaryColor; 33 | Color c2 = Theme.of(context).accentColor; 34 | if (color1.isEmpty == false) { 35 | c1 = HexColor(color1); 36 | } 37 | if (color2.isEmpty == false) { 38 | c2 = HexColor(color2); 39 | } 40 | 41 | return BoxDecoration( 42 | boxShadow: [ 43 | BoxShadow(color: Colors.black26, offset: Offset(0, 4), blurRadius: 5.0) 44 | ], 45 | gradient: LinearGradient( 46 | begin: Alignment.topLeft, 47 | end: Alignment.bottomRight, 48 | stops: [0.0, 1.0], 49 | colors: [ 50 | c1, 51 | c2, 52 | ], 53 | ), 54 | color: Colors.deepPurple.shade300, 55 | borderRadius: BorderRadius.circular(30), 56 | ); 57 | } 58 | 59 | ButtonStyle buttonStyle() { 60 | return ButtonStyle( 61 | shape: MaterialStateProperty.all( 62 | RoundedRectangleBorder( 63 | borderRadius: BorderRadius.circular(30.0), 64 | ), 65 | ), 66 | minimumSize: MaterialStateProperty.all(Size(50, 50)), 67 | backgroundColor: MaterialStateProperty.all(Colors.transparent), 68 | shadowColor: MaterialStateProperty.all(Colors.transparent), 69 | ); 70 | } 71 | 72 | AlertDialog alartDialog(String title, String content, BuildContext context) { 73 | return AlertDialog( 74 | title: Text(title), 75 | content: Text(content), 76 | actions: [ 77 | TextButton( 78 | child: Text( 79 | "OK", 80 | style: TextStyle(color: Colors.white), 81 | ), 82 | style: ButtonStyle( 83 | backgroundColor: MaterialStateProperty.all(Colors.black38)), 84 | onPressed: () { 85 | Navigator.of(context).pop(); 86 | }, 87 | ), 88 | ], 89 | ); 90 | } 91 | 92 | } 93 | 94 | 95 | -------------------------------------------------------------------------------- /lib/components/rounded_btn/rounded_btn.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RoundedButton extends StatelessWidget { 4 | RoundedButton({required this.circular,required this.color, required this.btnText, required this.onPressed}); 5 | final double circular; 6 | final Color color; 7 | final String btnText; 8 | final VoidCallback onPressed; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Padding( 13 | padding: EdgeInsets.symmetric(vertical: 16.0), 14 | child: Material( 15 | elevation: 5.0, 16 | color: color, 17 | borderRadius: BorderRadius.circular(circular), 18 | child: MaterialButton( 19 | onPressed: onPressed, 20 | minWidth: 200.0, 21 | height: 60.0, 22 | child: Text( 23 | btnText, 24 | style: TextStyle(color: Colors.white), 25 | ), 26 | ), 27 | ), 28 | ); 29 | } 30 | } 31 | 32 | 33 | 34 | 35 | class RaisedGradientButton extends StatelessWidget { 36 | final Widget child; 37 | final Gradient gradient; 38 | final double width; 39 | final double height; 40 | final Function onPressed; 41 | 42 | const RaisedGradientButton({ 43 | Key? key, 44 | required this.child, 45 | required this.gradient, 46 | this.width = double.infinity, 47 | this.height = 50.0, 48 | required this.onPressed, required int circular, 49 | }) : super(key: key); 50 | 51 | @override 52 | Widget build(BuildContext context) { 53 | return Container( 54 | width: width, 55 | height: 50.0, 56 | decoration: BoxDecoration( 57 | 58 | borderRadius: BorderRadius.circular(20), 59 | gradient: gradient, boxShadow: [ 60 | BoxShadow( 61 | color: Colors.grey, 62 | offset: Offset(0.0, 1.5), 63 | blurRadius: 1.5, 64 | ), 65 | ]), 66 | child: Material( 67 | 68 | color: Colors.transparent, 69 | child: InkWell( 70 | onTap: (){ onPressed();}, 71 | child: Center( 72 | child: child, 73 | )), 74 | ), 75 | ); 76 | } 77 | } -------------------------------------------------------------------------------- /lib/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const Color primaryColor = Color(0xFF2967FF); 4 | const Color grayColor = Color(0xFF8D8D8E); 5 | 6 | const double defaultPadding = 16.0; -------------------------------------------------------------------------------- /lib/detailpage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DetailPage extends StatefulWidget { 4 | final imgPath; 5 | 6 | DetailPage({Key? key, this.imgPath}) : super(key: key); 7 | 8 | @override 9 | _DetailPageState createState() => _DetailPageState(); 10 | } 11 | 12 | class _DetailPageState extends State { 13 | 14 | bool tempValue = false; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | body: Stack( 20 | children: [ 21 | new Container( 22 | height: MediaQuery.of(context).size.height, 23 | width: MediaQuery.of(context).size.width, 24 | decoration: BoxDecoration( 25 | image: DecorationImage( 26 | image: AssetImage(widget.imgPath), fit: BoxFit.cover)), 27 | ), 28 | new Padding( 29 | padding: EdgeInsets.only(top: 25), 30 | child: new Row( 31 | children: [ 32 | new IconButton( 33 | icon: Icon( 34 | Icons.arrow_back, 35 | color: Colors.white, 36 | ), 37 | onPressed: () { 38 | Navigator.of(context).pop(); 39 | }, 40 | ), 41 | Spacer(), 42 | Container( 43 | height: 40, 44 | width: 40, 45 | decoration: BoxDecoration( 46 | borderRadius: BorderRadius.circular(20), 47 | image: DecorationImage( 48 | image: AssetImage('images/image.jpg'), 49 | fit: BoxFit.cover)), 50 | ), 51 | SizedBox(width: 15) 52 | ], 53 | ), 54 | ), 55 | new Align( 56 | alignment: Alignment.bottomCenter, 57 | child: Container( 58 | width: MediaQuery.of(context).size.width, 59 | height: 340, 60 | decoration: BoxDecoration( 61 | borderRadius: BorderRadius.only( 62 | topLeft: Radius.circular(40), 63 | topRight: Radius.circular(40), 64 | ), 65 | color: Color.fromRGBO(31, 58, 47, 1.0), 66 | ), 67 | child: new Column( 68 | children: [ 69 | SizedBox(height: 20), 70 | Row( 71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 72 | crossAxisAlignment: CrossAxisAlignment.start, 73 | children: [ 74 | listItemStats('images/creative.png',"6 Lights",true), 75 | listItemStats('images/air-conditioner.png',"Air Conditioner", false), 76 | listItemStats('images/washing-machine.png',"Washing Machine", false) 77 | ], 78 | ), 79 | Padding( 80 | padding: EdgeInsets.only(top: 10, left: 20, right: 20), 81 | child: Divider(color: Colors.white,) 82 | ), 83 | SizedBox(height: 5), 84 | Padding( 85 | padding: const EdgeInsets.only(left: 20, right: 20), 86 | child: Row( 87 | children: [ 88 | Text("Maximum Power", style: new TextStyle(color: Colors.white),), 89 | Spacer(), 90 | Text("60W", style: new TextStyle(color: Colors.white),), 91 | ], 92 | ), 93 | ), 94 | SizedBox(height: 10), 95 | Padding( 96 | padding: const EdgeInsets.only(left: 20, right: 20), 97 | child: Row( 98 | children: [ 99 | Text("Total Working Hours", style: new TextStyle(color: Colors.white),), 100 | Spacer(), 101 | Text("145", style: new TextStyle(color: Colors.white),), 102 | ], 103 | ), 104 | ), 105 | SizedBox(height: 10), 106 | Padding( 107 | padding: const EdgeInsets.only(left: 20, right: 20), 108 | child: Row( 109 | children: [ 110 | Text("Average Daily Working Hours", style: new TextStyle(color: Colors.white),), 111 | Spacer(), 112 | Text("5.6", style: new TextStyle(color: Colors.white),), 113 | ], 114 | ), 115 | ), 116 | Padding( 117 | padding: EdgeInsets.only(top: 5, left: 20, right: 20), 118 | child: Divider(color: Colors.white,) 119 | ), 120 | Padding( 121 | padding: const EdgeInsets.only(left: 20, right: 10), 122 | child: Row( 123 | children: [ 124 | Text("Day Schedule", style: new TextStyle(color: Colors.white),), 125 | Spacer(), 126 | Switch( 127 | value: tempValue, 128 | onChanged: (newVal){ 129 | setState(() { 130 | tempValue = newVal; 131 | print(newVal); 132 | }); 133 | }, 134 | activeColor: Colors.green, 135 | ) 136 | ], 137 | ), 138 | ), 139 | ], 140 | ) 141 | ), 142 | ) 143 | ], 144 | ), 145 | ); 146 | } 147 | 148 | Widget listItemStats(String imgpath, String name, bool value){ 149 | return Container( 150 | width: 110, 151 | height: 150, 152 | decoration: BoxDecoration( 153 | borderRadius: BorderRadius.circular(25), 154 | color: value == true ? Colors.white : Color.fromRGBO(75, 97, 88, 1.0) 155 | ), 156 | child: Column( 157 | children: [ 158 | SizedBox(height: 20), 159 | Image(image: AssetImage(imgpath),width: 45,height: 45, color: value == true ? Colors.black : Colors.white), 160 | SizedBox(height: 15), 161 | Text(name, style: TextStyle(fontSize: 13, color: value == true ? Colors.black : Colors.white)), 162 | SizedBox(height: 5), 163 | Switch( 164 | value: value, 165 | onChanged: (newVal){ 166 | setState(() { 167 | value = newVal; 168 | print(newVal); 169 | }); 170 | }, 171 | activeColor: Colors.green, 172 | ) 173 | ], 174 | ), 175 | ); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /lib/finerprint.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:local_auth/local_auth.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | 6 | class fingerPrintSevice { 7 | final _auth = LocalAuthentication(); 8 | 9 | Future hasBiometrics() async { 10 | try { 11 | return await _auth.canCheckBiometrics; 12 | } on PlatformException catch (e) { 13 | print(e); 14 | return false; 15 | } 16 | } 17 | 18 | Future> getBiometrics() async { 19 | try { 20 | return await _auth.getAvailableBiometrics(); 21 | } on PlatformException catch (e) { 22 | print(e); 23 | return []; 24 | } 25 | } 26 | 27 | authenticate() async { 28 | final isAvailable = await hasBiometrics(); 29 | if (!isAvailable) { 30 | return false; 31 | } 32 | 33 | try { 34 | return await _auth.authenticate( 35 | localizedReason: 'localized reason', 36 | 37 | options: const AuthenticationOptions( 38 | useErrorDialogs: true, 39 | stickyAuth: true, 40 | ), 41 | ); 42 | } on PlatformException catch (e) { 43 | print(e); 44 | return false; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/fingerpage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | import 'package:testing/colors.dart'; 4 | import 'package:testing/main.dart'; 5 | import 'package:testing/navbar.dart'; 6 | import 'package:testing/smart/login_page.dart'; 7 | 8 | 9 | 10 | import 'components/rounded_btn/rounded_btn.dart'; 11 | import 'finerprint.dart'; 12 | 13 | var contexts; 14 | bool pika=false; 15 | 16 | class FingerWndow extends StatefulWidget { 17 | const FingerWndow({Key? key}) : super(key: key); 18 | 19 | @override 20 | FfingerWndowState createState() => FfingerWndowState(); 21 | } 22 | 23 | class FfingerWndowState extends State { 24 | 25 | 26 | 27 | Future finger() async { 28 | 29 | final isAuthenticated = 30 | await fingerPrintSevice().authenticate(); 31 | if (isAuthenticated) { 32 | await getrtsp(); 33 | setState(() { 34 | pika=true; 35 | }); 36 | 37 | await Future.delayed(const Duration(milliseconds: 1750), (){}); 38 | 39 | Navigator.of(context).push( 40 | MaterialPageRoute(builder: (_) => BottomNavBarV2())); 41 | } 42 | } 43 | 44 | 45 | 46 | 47 | 48 | 49 | @override 50 | void initState() { 51 | super.initState(); 52 | pika=false; 53 | finger(); 54 | 55 | 56 | 57 | } 58 | 59 | 60 | 61 | 62 | @override 63 | Widget build(BuildContext context) { 64 | final size = MediaQuery.of(context).size; 65 | contexts=context; 66 | 67 | return Scaffold( 68 | appBar: AppBar( 69 | backgroundColor: toneSec, 70 | title: Container( 71 | alignment: Alignment.center, 72 | child: const Text( 73 | 'FingerPrint Authentication', 74 | style: TextStyle( 75 | fontSize: 16, 76 | fontWeight: FontWeight.bold, 77 | color: Colors.white), 78 | ), 79 | ), 80 | ),backgroundColor: tone, 81 | body: Container( 82 | alignment: Alignment.center, 83 | child: Column(children: [ 84 | SizedBox( 85 | height: size.height / 5, 86 | ), 87 | Container( 88 | alignment: Alignment.center, 89 | width: size.width / 1.1, 90 | height: size.height / 4, 91 | 92 | child: 93 | 94 | 95 | 96 | 97 | 98 | Column( 99 | children: [ 100 | 101 | 102 | 103 | GestureDetector( 104 | onTap: () async{ 105 | 106 | 107 | final isAuthenticated = 108 | await fingerPrintSevice().authenticate(); 109 | if (isAuthenticated) { 110 | await getrtsp(); 111 | setState(() { 112 | pika=true; 113 | }); 114 | 115 | await Future.delayed(const Duration(seconds: 2), (){}); 116 | 117 | Navigator.of(context).push( 118 | MaterialPageRoute(builder: (_) => BottomNavBarV2())); 119 | } 120 | 121 | 122 | }, 123 | child: Lottie.asset('animation/finger.json',animate: pika,repeat: false,)), 124 | 125 | ], 126 | ), 127 | ), 128 | 129 | 130 | 131 | Padding( 132 | padding: const EdgeInsets.symmetric(horizontal: 0.0), 133 | child: Text('Please Touch the FingerPrint Sensor.', 134 | style: TextStyle( 135 | color: Colors.white70, 136 | fontWeight: FontWeight.w400, 137 | fontSize: 13 138 | ), 139 | ), 140 | ), 141 | 142 | 143 | 144 | ]), 145 | 146 | )); 147 | } 148 | } 149 | 150 | buildText(String text, bool Checked) => Container( 151 | margin: EdgeInsets.symmetric(vertical: 8), 152 | child: Row( 153 | children: [ 154 | Checked 155 | ? Icon( 156 | Icons.check, 157 | color: Colors.green, 158 | ) 159 | : Icon( 160 | Icons.close, 161 | color: Colors.green, 162 | ), 163 | const SizedBox( 164 | width: 12, 165 | ), 166 | Text( 167 | text, 168 | style: TextStyle(fontSize: 24), 169 | ) 170 | ], 171 | ), 172 | ); 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /lib/home.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:flutter_vlc_player/flutter_vlc_player.dart'; 6 | import 'package:google_fonts/google_fonts.dart'; 7 | import 'package:kf_drawer/kf_drawer.dart'; 8 | import 'package:testing/colors.dart'; 9 | import 'package:testing/main.dart'; 10 | import 'package:testing/methods.dart'; 11 | import 'package:testing/notifications.dart'; 12 | import 'package:testing/smart/login_page.dart'; 13 | import 'package:testing/smart/widgets/header_widget.dart'; 14 | 15 | 16 | 17 | final FirebaseAuth _auth = FirebaseAuth.instance; 18 | class Home extends KFDrawerContent { 19 | Home({ 20 | Key? key, 21 | }); 22 | 23 | @override 24 | _HomeState createState() => _HomeState(); 25 | } 26 | 27 | class _HomeState extends State { 28 | VlcPlayerController _videoPlayerController = VlcPlayerController.network( 29 | rtspReal, 30 | hwAcc: HwAcc.auto, 31 | autoPlay: true, 32 | options: VlcPlayerOptions(), 33 | ); 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | @override 46 | void initState() { 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | super.initState(); 56 | 57 | 58 | 59 | 60 | 61 | } 62 | 63 | 64 | @override 65 | void dispose() async { 66 | super.dispose(); 67 | await _videoPlayerController.stopRendererScanning(); 68 | 69 | 70 | 71 | 72 | } 73 | 74 | 75 | bool boo1=true; 76 | bool boo2=false; 77 | 78 | 79 | 80 | @override 81 | Widget build(BuildContext context) { 82 | double swidth = MediaQuery. of(context). size. width ; 83 | double sheight = MediaQuery. of(context). size. height; 84 | double _headerHeight=150; 85 | 86 | return SafeArea( 87 | 88 | child: 89 | 90 | Column( 91 | children: [ 92 | 93 | 94 | Container( 95 | height: _headerHeight, 96 | child: HeaderWidget(_headerHeight, true, Icon(Icons.login_rounded),false,fun: (){ 97 | showDialog(context: context, builder: (context){ 98 | 99 | return Center(child: CircularProgressIndicator()); 100 | 101 | }); 102 | 103 | logout(context);}, notiText: 'HOME',), //let's create a common header widget 104 | ), 105 | 106 | ListView(shrinkWrap: true, 107 | children: [ 108 | Column( 109 | children: [ 110 | SizedBox(height: 0), 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | Container(margin: EdgeInsets.all(10),width: 350,height: 265, 119 | decoration: BoxDecoration(boxShadow: 120 | [ 121 | BoxShadow( 122 | blurRadius: 2, 123 | color: Colors.black38, 124 | offset: Offset(1, 1), 125 | )] , 126 | color: Colors.white, 127 | borderRadius: BorderRadius.circular(5)), 128 | child: Stack( 129 | children: [ 130 | 131 | 132 | 133 | Column( 134 | children: [ 135 | 136 | Padding( 137 | padding: EdgeInsets.fromLTRB(0, 10, 0,0), 138 | child: Text('STREAM FOOTAGE ONE', textAlign: TextAlign.center, 139 | style: GoogleFonts.bebasNeue( 140 | 141 | color: tone , 142 | 143 | fontSize: 28, 144 | ), 145 | ), 146 | ), 147 | 148 | 149 | SafeArea( 150 | child: Container( 151 | 152 | width: 350, 153 | height: 200, 154 | child: VlcPlayer( 155 | controller: _videoPlayerController, 156 | aspectRatio: 16 / 9, 157 | placeholder: Center(child: CircularProgressIndicator()), 158 | ), 159 | ), 160 | ), 161 | 162 | ], 163 | ), 164 | ], 165 | ), 166 | ), 167 | 168 | 169 | SizedBox(height: 5,) 170 | , 171 | 172 | Container( 173 | width: MediaQuery.of(context).size.width, 174 | height: 200, 175 | 176 | child: Row( 177 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 178 | children: [ 179 | listItemStats(Icons.trending_up,"Intrusion Line",boo1), 180 | listItemStats(Icons.face_outlined,"Face recogntion", boo2), 181 | listItemStats(Icons.timelapse_rounded,"Scheduler", false) 182 | ], 183 | ), 184 | ), 185 | ], 186 | ), 187 | ], 188 | ), 189 | ], 190 | ), 191 | 192 | ); 193 | 194 | } 195 | 196 | 197 | 198 | Widget listItemStats(IconData i, String name, bool value){ 199 | Color c1 = Theme.of(context).primaryColor; 200 | Color c2 = Theme.of(context).accentColor; 201 | 202 | return Container( 203 | width: 110, 204 | height: 150, 205 | decoration: BoxDecoration(gradient: 206 | LinearGradient( 207 | begin: Alignment.topLeft, 208 | end: Alignment.bottomRight, 209 | stops: [0.0, 1.0], 210 | colors: [ 211 | c1, 212 | c2, 213 | ], 214 | ), 215 | 216 | 217 | borderRadius: BorderRadius.circular(5), 218 | color: value ? tone : Colors.black26 219 | ), 220 | child: Column( 221 | children: [ 222 | SizedBox(height: 20), 223 | Icon(i,size: 45, color: value ? Colors.white : Colors.white), 224 | SizedBox(height: 15), 225 | Text(name, style: TextStyle(fontSize: 13, color: value ? Colors.white : Colors.white)), 226 | SizedBox(height: 5), 227 | Switch( 228 | value: value, 229 | onChanged: (newVal){ 230 | 231 | setState(() { 232 | 233 | if(name=="Intrusion Line"){boo1 = newVal; 234 | FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).update({ 235 | 'Mode': 1 236 | }); 237 | if(boo1==true){boo2=!boo1;} 238 | } 239 | else if(name=="Face recogntion"){boo2 = newVal; 240 | FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).update({ 241 | 'Mode': 2 242 | }); 243 | 244 | if(boo2==true){boo1=!boo2;} 245 | } 246 | 247 | 248 | print(newVal); 249 | print(boo1); 250 | }); 251 | }, 252 | activeColor: Colors.white, 253 | 254 | ) 255 | ], 256 | ), 257 | ); 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:firebase_messaging/firebase_messaging.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | import 'package:testing/colors.dart'; 8 | 9 | import 'package:testing/userCheck.dart'; 10 | 11 | 12 | 13 | 14 | 15 | 16 | String s=''; 17 | String token = ''; 18 | final FirebaseMessaging firebaseMessaging = FirebaseMessaging.instance; 19 | final FirebaseAuth _auth = FirebaseAuth.instance; 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Future main() async { 32 | WidgetsFlutterBinding.ensureInitialized(); 33 | await Firebase.initializeApp(); 34 | print("it is done"); 35 | 36 | 37 | 38 | 39 | runApp(MyApp()); 40 | } 41 | 42 | 43 | class MyApp extends StatelessWidget { 44 | Color _primaryColor = tone; 45 | Color _accentColor = Colors.blueAccent; 46 | // This widget is the root of your application. 47 | 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return MaterialApp( 52 | theme: ThemeData( 53 | primaryColor: _primaryColor, 54 | accentColor: _accentColor, 55 | scaffoldBackgroundColor: Colors.grey.shade100, 56 | fontFamily: 'Roboto-Regular' 57 | ), 58 | debugShowCheckedModeBanner: false, 59 | home: VerifyCheck(), 60 | ); 61 | } 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /lib/methods.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import 'package:cloud_firestore/cloud_firestore.dart'; 7 | import 'package:giffy_dialog/giffy_dialog.dart'; 8 | import 'package:testing/colors.dart'; 9 | import 'package:testing/constants.dart'; 10 | import 'package:testing/home.dart'; 11 | import 'package:testing/skelton.dart'; 12 | import 'package:testing/smart/login_page.dart'; 13 | 14 | import 'package:testing/userCheck.dart'; 15 | 16 | 17 | FirebaseAuth _auth = FirebaseAuth.instance; 18 | void showSnackBar(BuildContext context, String str) { 19 | final Scaffold = ScaffoldMessenger.of(context); 20 | Scaffold.showSnackBar(SnackBar( 21 | content: Text(str), 22 | action: SnackBarAction( 23 | label: "LOGIN", 24 | onPressed: () { 25 | Navigator.of(context) 26 | .push(MaterialPageRoute(builder: (_) => LoginPage())); 27 | }, 28 | ), 29 | )); 30 | } 31 | 32 | 33 | void showSimpleBar(BuildContext context, String str) { 34 | final Scaffold = ScaffoldMessenger.of(context); 35 | Scaffold.showSnackBar(SnackBar( 36 | content: Text(str), 37 | )); 38 | } 39 | 40 | 41 | 42 | 43 | Future createAccount(BuildContext context,String email, String password,String RSTP,String name) async { 44 | 45 | sucess() async { 46 | 47 | 48 | Navigator.of(context).pop(); 49 | alertbox(context,'Verification Email Sent', 50 | "Email Verification Sent, Please verify the Email First",'images/mail-verification.gif'); 51 | 52 | } 53 | 54 | failure(String e){ 55 | 56 | 57 | Navigator.of(context).pop(); 58 | alertbox(context, 'Signup Failed', e, 'images/alerts.gif'); 59 | return null; 60 | } 61 | 62 | 63 | 64 | 65 | 66 | try { 67 | 68 | UserCredential userCredential = await _auth.createUserWithEmailAndPassword( 69 | email: email, password: password); 70 | 71 | userCredential.user?.sendEmailVerification(); 72 | 73 | final CollectionReference users = 74 | FirebaseFirestore.instance.collection('DB'); 75 | 76 | Map g = { 77 | "email": email, 78 | "Pass": password, 79 | "RTSP":RSTP, 80 | "Name":name, 81 | "Mode":1, 82 | "Intrusion Points":"{69.33333333333333: 425.0, 286.6666666666667: 188.0, 295.3333333333333: 528.6666666666666, 77.33333333333333: 419.0}", 83 | 84 | }; 85 | users.doc(_auth.currentUser!.uid).set(g); 86 | 87 | sucess(); 88 | 89 | 90 | } on FirebaseAuthException catch (e) { 91 | print('aag'+e.toString()); 92 | 93 | failure(e.toString()); 94 | return null; 95 | } 96 | } 97 | 98 | Future signin(String email, String password) async { 99 | try { 100 | 101 | print(email+' '+password); 102 | UserCredential userCredential = await _auth.signInWithEmailAndPassword( 103 | email: email, password: password); 104 | 105 | return userCredential; 106 | } catch (e) { 107 | print(e); 108 | return null; 109 | } 110 | } 111 | 112 | reset(String email) async { 113 | FirebaseAuth _auth = FirebaseAuth.instance; 114 | await _auth.sendPasswordResetEmail(email: email); 115 | } 116 | 117 | logout(BuildContext context) async { 118 | 119 | 120 | 121 | 122 | 123 | 124 | sucess() async { 125 | 126 | 127 | 128 | 129 | Navigator.pop(context,true); 130 | await _auth.signOut(); 131 | Navigator.of(context) 132 | .push(MaterialPageRoute(builder: (context) => VerifyCheck())); 133 | 134 | } 135 | 136 | failure(){ 137 | 138 | 139 | Navigator.of(context).pop(); 140 | alertbox(context, 'Connection Failed', 'Please Check your Internet Connection', 'images/alerts.gif'); 141 | return null; 142 | } 143 | 144 | 145 | 146 | 147 | 148 | 149 | await FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).update({ 150 | 'deviceToken': '' 151 | }).then((value) => sucess()).timeout(const Duration(seconds: 10)).catchError((error, stackTrace) => failure());; 152 | 153 | } 154 | 155 | class EnterData { 156 | final String drinkName; 157 | final String drinkDesc; 158 | EnterData(this.drinkName, this.drinkDesc); 159 | 160 | final CollectionReference cartCollection = 161 | FirebaseFirestore.instance.collection(_auth.currentUser!.uid); 162 | 163 | addData() { 164 | Map g = { 165 | "Drink Name": drinkName, 166 | "Drink Desc": drinkDesc, 167 | }; 168 | 169 | cartCollection.doc().set(g); 170 | } 171 | } 172 | 173 | class GetData { 174 | final CollectionReference captures = 175 | FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).collection('Captures'); 176 | 177 | 178 | getData() async { 179 | List captureList = []; 180 | 181 | // Get docs from collection reference 182 | QuerySnapshot querySnapshot = await captures.get(); 183 | 184 | // Get data from docs and convert map to List 185 | final allData = querySnapshot.docs.map((doc) => doc.data()).toList(); 186 | captureList = allData; 187 | 188 | 189 | return captureList; 190 | 191 | 192 | } 193 | 194 | 195 | 196 | 197 | 198 | alertbox(){ 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | } 208 | 209 | 210 | 211 | } 212 | 213 | 214 | 215 | 216 | 217 | alertbox(context,text,subtext,path){ 218 | 219 | 220 | 221 | showDialog( 222 | context: context,builder: (_) => AssetGiffyDialog( 223 | buttonCancelColor: tone, 224 | onlyCancelButton: true, 225 | image: Image(image: AssetImage(path)), 226 | title: Text(text, 227 | style: TextStyle( 228 | fontSize: 22.0, fontWeight: FontWeight.w600), 229 | ), 230 | description: Text(subtext, 231 | textAlign: TextAlign.center, 232 | style: TextStyle(), 233 | ), 234 | entryAnimation: EntryAnimation.BOTTOM, 235 | buttonCancelText: Text('OK',style: TextStyle(color: Colors.white)), 236 | ) ); 237 | } 238 | 239 | 240 | 241 | shrink(){ 242 | 243 | 244 | 245 | Row( 246 | children: [ 247 | const Skeleton(height: 120, width: 120), 248 | const SizedBox(width: defaultPadding), 249 | Expanded( 250 | child: Column( 251 | crossAxisAlignment: CrossAxisAlignment.start, 252 | children: [ 253 | const Skeleton(width: 80), 254 | const SizedBox(height: defaultPadding / 2), 255 | const Skeleton(), 256 | const SizedBox(height: defaultPadding / 2), 257 | const Skeleton(), 258 | const SizedBox(height: defaultPadding / 2), 259 | Row( 260 | children: const [ 261 | Expanded( 262 | child: Skeleton(), 263 | ), 264 | SizedBox(width: defaultPadding), 265 | Expanded( 266 | child: Skeleton(), 267 | ), 268 | ], 269 | ) 270 | ], 271 | ), 272 | ) 273 | ], 274 | ); 275 | } 276 | 277 | 278 | 279 | -------------------------------------------------------------------------------- /lib/noti.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:firebase_messaging/firebase_messaging.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:testing/methods.dart'; 6 | 7 | class Noti extends StatefulWidget { 8 | @override 9 | _NotiState createState() => _NotiState(); 10 | } 11 | 12 | class _NotiState extends State { 13 | 14 | String token = ''; 15 | final FirebaseMessaging firebaseMessaging = FirebaseMessaging.instance; 16 | 17 | @override 18 | void initState() { 19 | getToken(); 20 | 21 | 22 | // workaround for onLaunch: When the app is completely closed (not in the background) and opened directly from the push notification 23 | FirebaseMessaging.onMessage.listen((RemoteMessage message) { 24 | RemoteNotification? notification = message.notification; 25 | print("onMessageData: $message"); 26 | showSimpleBar(context, message.notification.toString());}); 27 | 28 | FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) { 29 | showSimpleBar(context, message.notification.toString()); 30 | print("onMessageOpenedApp: $message");}); 31 | 32 | 33 | 34 | super.initState(); 35 | } 36 | 37 | void getToken() async { 38 | token = (await firebaseMessaging.getToken())!; 39 | } 40 | 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return Scaffold( 45 | body: Center(child: Text("Token : $token")), 46 | floatingActionButton: FloatingActionButton(onPressed: (){ 47 | print(token); 48 | }, 49 | child: Icon(Icons.print), 50 | ), 51 | ); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /lib/pages/onboarding_page.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:lottie/lottie.dart'; 4 | import 'package:testing/colors.dart'; 5 | import 'package:testing/smart/login_page.dart'; 6 | import 'package:testing/widget/card_planet.dart'; 7 | import 'package:concentric_transition/concentric_transition.dart'; 8 | 9 | 10 | 11 | class OnboardingPage extends StatelessWidget { 12 | OnboardingPage({Key? key}) : super(key: key); 13 | 14 | final data = [ 15 | CardPlanetData( 16 | title: "OutDated", 17 | subtitle: 18 | "Ain't you Sick of Old Outdated CCTV Monitoring Systems.", 19 | image: 'animation/cctv.json', 20 | backgroundColor: Colors.white, 21 | titleColor: Colors.purple, 22 | subtitleColor: const Color.fromRGBO(0, 10, 56, 1), 23 | 24 | 25 | background: LottieBuilder.asset("animation/bg-1.json"), 26 | ), 27 | CardPlanetData( 28 | title: "SMART RECOGNITION", 29 | subtitle: "Use our Smart Person Recognition to recognize People at your DoorStep.", 30 | image: 'animation/recognition.json', 31 | backgroundColor: tone, 32 | titleColor: secondary, 33 | subtitleColor: Colors.white, 34 | background: LottieBuilder.asset("animation/bg-2.json"), 35 | ), 36 | CardPlanetData( 37 | title: "Secure Your Home", 38 | subtitle: "Use Intrusion Area and Line based Detection to Hard Fence your Home.", 39 | image: 'animation/wire.json', 40 | backgroundColor: Colors.white, 41 | titleColor: Colors.purple, 42 | subtitleColor: Colors.black, 43 | background: LottieBuilder.asset("animation/bg-3.json"), 44 | ), 45 | CardPlanetData( 46 | title: "SECURED ACCESS", 47 | subtitle: "Secured App with Bultin Fingerprint and Email-based Access.", 48 | image: 'animation/privacy.json', 49 | backgroundColor: tone, 50 | titleColor: secondary, 51 | subtitleColor: Colors.white, 52 | background: LottieBuilder.asset("animation/bg-1.json"), 53 | ), 54 | 55 | ]; 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Scaffold( 60 | body: ConcentricPageView( 61 | colors: data.map((e) => e.backgroundColor).toList(), 62 | itemCount: 4, 63 | itemBuilder: (int currentIndex) { 64 | 65 | return CardPlanet(data: data[currentIndex]); 66 | 67 | }, 68 | onFinish: () { 69 | Navigator.pushReplacement( 70 | context, 71 | MaterialPageRoute(builder: (context) => LoginPage()), 72 | ); 73 | }, 74 | ), 75 | ); 76 | } 77 | } 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /lib/profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:kf_drawer/kf_drawer.dart'; 3 | 4 | class Profile extends KFDrawerContent { 5 | @override 6 | _ProfileState createState() => _ProfileState(); 7 | } 8 | 9 | class _ProfileState extends State { 10 | @override 11 | Widget build(BuildContext context) { 12 | return SafeArea( 13 | child: Center( 14 | child: Column( 15 | children: [ 16 | Row( 17 | children: [ 18 | ClipRRect( 19 | borderRadius: BorderRadius.all(Radius.circular(32.0)), 20 | child: Material( 21 | shadowColor: Colors.transparent, 22 | color: Colors.transparent, 23 | child: IconButton( 24 | icon: Icon( 25 | Icons.menu, 26 | color: Colors.black, 27 | ), 28 | onPressed: widget.onMenuPressed, 29 | ), 30 | ), 31 | ), 32 | ], 33 | ), 34 | Expanded( 35 | child: Column( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | children: [ 38 | Text('Profile'), 39 | ], 40 | ), 41 | ), 42 | ], 43 | ), 44 | ), 45 | ); 46 | 47 | } 48 | } -------------------------------------------------------------------------------- /lib/schedules.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:kf_drawer/kf_drawer.dart'; 3 | import 'package:testing/colors.dart'; 4 | import 'package:testing/dragger.dart'; 5 | 6 | class Drawers extends KFDrawerContent { 7 | Drawers({ 8 | Key? key, 9 | }); 10 | 11 | @override 12 | _DrawersState createState() => _DrawersState(); 13 | } 14 | 15 | class _DrawersState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return SafeArea( 19 | child: 20 | Stack( 21 | children: [SingleChildScrollView( 22 | physics: NeverScrollableScrollPhysics(), 23 | child: SizedBox( 24 | height: MediaQuery. of(context). size. height, 25 | child: SafeArea(child: Draw()))), 26 | ], 27 | ) 28 | ); 29 | } 30 | } -------------------------------------------------------------------------------- /lib/settings.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:giffy_dialog/giffy_dialog.dart'; 7 | import 'package:kf_drawer/kf_drawer.dart'; 8 | import 'package:testing/colors.dart'; 9 | import 'package:testing/common/theme_helper.dart'; 10 | import 'package:testing/dragger.dart'; 11 | import 'package:testing/main.dart'; 12 | import 'package:testing/methods.dart'; 13 | import 'package:testing/smart/widgets/header_widget.dart'; 14 | 15 | 16 | import 'components/rounded_btn/rounded_btn.dart'; 17 | 18 | final FirebaseAuth _auth = FirebaseAuth.instance; 19 | var chrtsp= TextEditingController(); 20 | class Settings extends KFDrawerContent { 21 | Settings({ 22 | Key? key, 23 | }); 24 | 25 | @override 26 | _SettingsState createState() => _SettingsState(); 27 | } 28 | 29 | class _SettingsState extends State { 30 | 31 | 32 | 33 | sucess(){ 34 | 35 | 36 | 37 | 38 | Navigator.of(context).pop(); 39 | 40 | 41 | 42 | alertbox(context,'RTSP CONFIRMATION','RSTP Link of the video Footage has been changed.','images/sucess.gif'); 43 | 44 | 45 | 46 | } 47 | 48 | failure(){ 49 | 50 | 51 | Navigator.of(context).pop(); 52 | alertbox(context, 'Connection Failed', 'Please Check your Internet Connection', 'images/alerts.gif'); 53 | return null; 54 | } 55 | 56 | 57 | 58 | 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | Color c1 = Theme.of(context).primaryColor; 63 | Color c2 = Theme.of(context).accentColor; 64 | return SafeArea( 65 | child: Stack( 66 | children: [ 67 | Column( 68 | children: [ 69 | Container( 70 | height: 150, 71 | child: HeaderWidget(150, true, Icon(Icons.login_rounded), false,fun: (){}, notiText: 'SETTINGS',), //let's create a common header widget 72 | ), 73 | SizedBox(height: 10,), 74 | Row( 75 | children: [ 76 | Container(width:250 ,padding: EdgeInsets.only(left: 10), 77 | child: Padding( 78 | padding: const EdgeInsets.all(0.0), 79 | child: Container( 80 | margin: EdgeInsets.symmetric(vertical: 10), 81 | child: Column( 82 | crossAxisAlignment: CrossAxisAlignment.start, 83 | children: [ 84 | 85 | SizedBox( 86 | height: 10, 87 | ), 88 | Container( 89 | child: TextFormField( 90 | controller: chrtsp, 91 | decoration: ThemeHelper().textInputDecoration("Change Facial Recognition RTSP", "Enter your camera RTSP Link "), 92 | 93 | ), 94 | decoration: ThemeHelper().inputBoxDecorationShaddow(), 95 | ), 96 | ], 97 | ), 98 | ), 99 | ), 100 | ), 101 | 102 | 103 | 104 | 105 | Container(width: 100,padding: EdgeInsets.only(top: 20), 106 | child: Padding( 107 | padding: const EdgeInsets.all(8.0), 108 | child: Center( 109 | child: 110 | 111 | 112 | 113 | 114 | 115 | 116 | RaisedGradientButton( 117 | child: Text( 118 | 'Change', 119 | style: TextStyle(color: Colors.white), 120 | ), 121 | gradient: LinearGradient( 122 | begin: Alignment.topLeft, 123 | end: Alignment.bottomRight, 124 | stops: [0.0, 1.0], 125 | colors: [ 126 | c1, 127 | c2, 128 | ], 129 | ), 130 | onPressed: (){ 131 | 132 | 133 | 134 | showDialog(context: context, builder: (context){ 135 | 136 | return Center(child: CircularProgressIndicator()); 137 | 138 | }); 139 | 140 | 141 | 142 | FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).update({ 143 | 'RTSP': chrtsp.text 144 | }).then((value) => sucess()).timeout(const Duration(seconds: 10)).catchError((error, stackTrace) => failure());; 145 | 146 | 147 | 148 | 149 | 150 | }, circular: 20, ))), 151 | ) 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | ], 162 | ), 163 | 164 | 165 | 166 | SizedBox(height: 10,), 167 | Row( 168 | children: [ 169 | Container(width:250 ,padding: EdgeInsets.only(left: 10), 170 | child: Padding( 171 | padding: const EdgeInsets.all(0.0), 172 | child: Container( 173 | margin: EdgeInsets.symmetric(vertical: 10), 174 | child: Column( 175 | crossAxisAlignment: CrossAxisAlignment.start, 176 | children: [ 177 | 178 | SizedBox( 179 | height: 10, 180 | ), 181 | Container( 182 | child: TextFormField( 183 | controller: chrtsp, 184 | decoration: ThemeHelper().textInputDecoration("Change RTSP", "Enter your camera RTSP Link "), 185 | 186 | ), 187 | decoration: ThemeHelper().inputBoxDecorationShaddow(), 188 | ), 189 | ], 190 | ), 191 | ), 192 | ), 193 | ), 194 | 195 | 196 | 197 | 198 | Container(width: 100,padding: EdgeInsets.only(top: 20), 199 | child: Padding( 200 | padding: const EdgeInsets.all(8.0), 201 | child: Center( 202 | child: 203 | 204 | 205 | 206 | 207 | 208 | 209 | RaisedGradientButton( 210 | child: Text( 211 | 'Change', 212 | style: TextStyle(color: Colors.white), 213 | ), 214 | gradient: LinearGradient( 215 | begin: Alignment.topLeft, 216 | end: Alignment.bottomRight, 217 | stops: [0.0, 1.0], 218 | colors: [ 219 | c1, 220 | c2, 221 | ], 222 | ), 223 | onPressed: (){ 224 | 225 | 226 | showDialog(context: context, builder: (context){ 227 | 228 | return Center(child: CircularProgressIndicator()); 229 | 230 | }); 231 | 232 | 233 | 234 | FirebaseFirestore.instance.collection('DB').doc(_auth.currentUser!.uid).update({ 235 | 'RTSP': chrtsp.text 236 | }).then((value) => sucess()).timeout(const Duration(seconds: 10)).catchError((error, stackTrace) => failure());; 237 | 238 | 239 | 240 | 241 | }, circular: 20, ))), 242 | ) 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | ], 253 | ), 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | ], 274 | 275 | ), 276 | 277 | ], 278 | ), 279 | 280 | ); 281 | } 282 | } -------------------------------------------------------------------------------- /lib/skelton.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:testing/constants.dart'; 3 | 4 | 5 | class Skeleton extends StatelessWidget { 6 | const Skeleton({Key? key, this.height, this.width}) : super(key: key); 7 | 8 | final double? height, width; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | height: height, 14 | width: width, 15 | padding: const EdgeInsets.all(defaultPadding / 2), 16 | decoration: BoxDecoration( 17 | color: Colors.black.withOpacity(0.04), 18 | borderRadius: 19 | const BorderRadius.all(Radius.circular(defaultPadding))), 20 | ); 21 | } 22 | } 23 | 24 | class CircleSkeleton extends StatelessWidget { 25 | const CircleSkeleton({Key? key, this.size = 24}) : super(key: key); 26 | 27 | final double? size; 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Container( 32 | height: size, 33 | width: size, 34 | decoration: BoxDecoration( 35 | color: Theme.of(context).primaryColor.withOpacity(0.04), 36 | shape: BoxShape.circle, 37 | ), 38 | ); 39 | } 40 | } -------------------------------------------------------------------------------- /lib/smart/forgot_password_page.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/gestures.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:google_fonts/google_fonts.dart'; 6 | import 'package:testing/common/theme_helper.dart'; 7 | import 'package:testing/methods.dart'; 8 | 9 | 10 | import 'login_page.dart'; 11 | import 'widgets/header_widget.dart'; 12 | var email = TextEditingController(); 13 | 14 | class ForgotPasswordPage extends StatefulWidget { 15 | const ForgotPasswordPage({Key? key}) : super(key: key); 16 | 17 | @override 18 | _ForgotPasswordPageState createState() => _ForgotPasswordPageState(); 19 | } 20 | 21 | class _ForgotPasswordPageState extends State { 22 | final _formKey = GlobalKey(); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | double _headerHeight = 300; 27 | return Scaffold( 28 | backgroundColor: Colors.white, 29 | body: SingleChildScrollView( 30 | child: Column( 31 | children: [ 32 | Container( 33 | height: _headerHeight, 34 | child: HeaderWidget(_headerHeight, true, Icon(Icons.password_rounded), false,fun: (){}, notiText: 'FORGOT?',), 35 | ), 36 | SafeArea( 37 | child: Container( 38 | margin: EdgeInsets.fromLTRB(25, 10, 25, 10), 39 | padding: EdgeInsets.fromLTRB(10, 0, 10, 0), 40 | child: Column( 41 | children: [ 42 | Container( 43 | alignment: Alignment.topLeft, 44 | margin: EdgeInsets.fromLTRB(20, 0, 20, 0), 45 | child: Column( 46 | mainAxisAlignment: MainAxisAlignment.start, 47 | crossAxisAlignment: CrossAxisAlignment.start, 48 | children: [ 49 | Text('Forgot Password?', 50 | style: GoogleFonts.bebasNeue(fontSize: 40) 51 | // textAlign: TextAlign.center, 52 | ), 53 | SizedBox(height: 10,), 54 | Text('Enter the email address associated with your account.', 55 | style: TextStyle( 56 | // fontSize: 20, 57 | fontWeight: FontWeight.bold, 58 | color: Colors.black54 59 | ), 60 | // textAlign: TextAlign.center, 61 | ), 62 | SizedBox(height: 10,), 63 | Text('We will email you a verification Email to check your authenticity.', 64 | style: TextStyle( 65 | color: Colors.black38, 66 | // fontSize: 20, 67 | ), 68 | // textAlign: TextAlign.center, 69 | ), 70 | ], 71 | ), 72 | ), 73 | SizedBox(height: 40.0), 74 | Form( 75 | key: _formKey, 76 | child: Column( 77 | children: [ 78 | Container( 79 | child: TextFormField( 80 | controller: email, 81 | decoration: ThemeHelper().textInputDecoration("Email", "Enter your email"), 82 | validator: (val){ 83 | if(val!.isEmpty){ 84 | return "Email can't be empty"; 85 | } 86 | else if(!RegExp(r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$").hasMatch(val)){ 87 | return "Enter a valid email address"; 88 | } 89 | return null; 90 | }, 91 | ), 92 | decoration: ThemeHelper().inputBoxDecorationShaddow(), 93 | ), 94 | SizedBox(height: 40.0), 95 | Container( 96 | decoration: ThemeHelper().buttonBoxDecoration(context), 97 | child: ElevatedButton( 98 | style: ThemeHelper().buttonStyle(), 99 | child: Padding( 100 | padding: const EdgeInsets.fromLTRB( 101 | 40, 10, 40, 10), 102 | child: Text( 103 | "Send".toUpperCase(), 104 | style: TextStyle( 105 | fontSize: 20, 106 | fontWeight: FontWeight.bold, 107 | color: Colors.white, 108 | ), 109 | ), 110 | ), 111 | onPressed: () async { 112 | setState(() { 113 | showSpinner = true; 114 | }); 115 | 116 | print(email.text); 117 | reset(email.text); 118 | alertbox(context, 'E-mail Sent!!', 'Forgot Email has been sent. Kinly Check your Inbox.', 'images/mail-verification.gif'); 119 | 120 | 121 | setState(() { 122 | showSpinner = false; 123 | }); 124 | 125 | // Add login code 126 | }, 127 | ), 128 | ), 129 | SizedBox(height: 75.0), 130 | Text.rich( 131 | TextSpan( 132 | children: [ 133 | TextSpan(text: "Remember your password? "), 134 | TextSpan( 135 | text: 'Login', 136 | recognizer: TapGestureRecognizer() 137 | ..onTap = () { 138 | Navigator.push( 139 | context, 140 | MaterialPageRoute(builder: (context) => LoginPage()), 141 | ); 142 | }, 143 | style: TextStyle( 144 | fontWeight: FontWeight.bold 145 | ), 146 | ), 147 | ], 148 | ), 149 | ), 150 | ], 151 | ), 152 | ) 153 | ], 154 | ), 155 | ), 156 | ) 157 | ], 158 | ), 159 | ) 160 | ); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /lib/smart/widgets/header_widget.dart: -------------------------------------------------------------------------------- 1 | // This widget will draw header section of all page. Wich you will get with the project source code. 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:google_fonts/google_fonts.dart'; 5 | import 'package:testing/methods.dart'; 6 | 7 | class HeaderWidget extends StatefulWidget { 8 | final double _height; 9 | final bool _showIcon; 10 | final bool _showImage; 11 | final Icon _icon; 12 | final Function fun; 13 | final String notiText; 14 | 15 | const HeaderWidget(this._height, this._showIcon, this._icon,this._showImage, {Key? key, required this.fun, required this.notiText, }) : super(key: key); 16 | 17 | @override 18 | _HeaderWidgetState createState() => _HeaderWidgetState(_height, _showIcon, _icon); 19 | } 20 | 21 | class _HeaderWidgetState extends State { 22 | double _height; 23 | bool _showIcon; 24 | Icon _icon; 25 | 26 | _HeaderWidgetState(this._height, this._showIcon, this._icon); 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | double width = MediaQuery 31 | .of(context) 32 | .size 33 | .width; 34 | 35 | return Container( 36 | child: Stack( 37 | children: [ 38 | ClipPath( 39 | child: Container( 40 | decoration: new BoxDecoration( 41 | gradient: new LinearGradient( 42 | colors: [ 43 | Theme.of(context).primaryColor.withOpacity(0.4), 44 | Theme.of(context).accentColor.withOpacity(0.4), 45 | ], 46 | begin: const FractionalOffset(0.0, 0.0), 47 | end: const FractionalOffset(1.0, 0.0), 48 | stops: [0.0, 1.0], 49 | tileMode: TileMode.clamp 50 | ), 51 | ), 52 | ), 53 | clipper: new ShapeClipper( 54 | [ 55 | Offset(width / 5, _height), 56 | Offset(width / 10 * 5, _height - 60), 57 | Offset(width / 5 * 4, _height + 20), 58 | Offset(width, _height - 18) 59 | ] 60 | ), 61 | ), 62 | ClipPath( 63 | child: Container( 64 | decoration: new BoxDecoration( 65 | gradient: new LinearGradient( 66 | colors: [ 67 | Theme.of(context).primaryColor.withOpacity(0.4), 68 | Theme.of(context).accentColor.withOpacity(0.4), 69 | ], 70 | begin: const FractionalOffset(0.0, 0.0), 71 | end: const FractionalOffset(1.0, 0.0), 72 | stops: [0.0, 1.0], 73 | tileMode: TileMode.clamp 74 | ), 75 | ), 76 | ), 77 | clipper: new ShapeClipper( 78 | [ 79 | Offset(width / 3, _height + 20), 80 | Offset(width / 10 * 8, _height - 60), 81 | Offset(width / 5 * 4, _height - 60), 82 | Offset(width, _height - 20) 83 | ] 84 | ), 85 | ), 86 | ClipPath( 87 | child: Container( 88 | decoration: new BoxDecoration( 89 | gradient: new LinearGradient( 90 | colors: [ 91 | Theme.of(context).primaryColor, 92 | Theme.of(context).accentColor, 93 | ], 94 | begin: const FractionalOffset(0.0, 0.0), 95 | end: const FractionalOffset(1.0, 0.0), 96 | stops: [0.0, 1.0], 97 | tileMode: TileMode.clamp 98 | ), 99 | ), 100 | ), 101 | clipper: new ShapeClipper( 102 | [ 103 | Offset(width / 5, _height), 104 | Offset(width / 2, _height - 40), 105 | Offset(width / 5 * 4, _height - 80), 106 | Offset(width, _height - 20) 107 | ] 108 | ), 109 | ), 110 | Visibility( 111 | visible: _showIcon, 112 | child: Row( 113 | children: [ 114 | Spacer(), 115 | SizedBox(width: 60,height: 130,), 116 | Text( 117 | this.widget.notiText, 118 | style: GoogleFonts.bebasNeue(fontSize: 42,color: Colors.white), 119 | ), 120 | Spacer(), 121 | Container( 122 | height: _height - 40, 123 | child: Center( 124 | child: Container( 125 | margin: EdgeInsets.all(10), 126 | padding: EdgeInsets.only( 127 | left: 25.0, 128 | top: 5.0, 129 | right: 5.0, 130 | bottom: 5.0, 131 | ), 132 | 133 | child: IconButton( 134 | 135 | color: Colors.white, 136 | iconSize: 20.0, icon: _icon, onPressed: () { 137 | 138 | 139 | this.widget.fun();}, 140 | 141 | ), 142 | ), 143 | ), 144 | ), 145 | ], 146 | ), 147 | ), 148 | 149 | 150 | 151 | 152 | 153 | 154 | ], 155 | ), 156 | ); 157 | } 158 | } 159 | 160 | class ShapeClipper extends CustomClipper { 161 | List _offsets = []; 162 | ShapeClipper(this._offsets); 163 | @override 164 | Path getClip(Size size) { 165 | var path = new Path(); 166 | 167 | path.lineTo(0.0, size.height-20); 168 | 169 | // path.quadraticBezierTo(size.width/5, size.height, size.width/2, size.height-40); 170 | // path.quadraticBezierTo(size.width/5*4, size.height-80, size.width, size.height-20); 171 | 172 | path.quadraticBezierTo(_offsets[0].dx, _offsets[0].dy, _offsets[1].dx,_offsets[1].dy); 173 | path.quadraticBezierTo(_offsets[2].dx, _offsets[2].dy, _offsets[3].dx,_offsets[3].dy); 174 | 175 | // path.lineTo(size.width, size.height-20); 176 | path.lineTo(size.width, 0.0); 177 | path.close(); 178 | 179 | 180 | return path; 181 | } 182 | 183 | @override 184 | bool shouldReclip(CustomClipper oldClipper) => false; 185 | } 186 | -------------------------------------------------------------------------------- /lib/upload.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:io'; 3 | 4 | import 'package:cloud_firestore/cloud_firestore.dart'; 5 | import 'package:firebase_auth/firebase_auth.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:google_fonts/google_fonts.dart'; 8 | import 'package:image_picker/image_picker.dart'; 9 | import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; 10 | import 'package:kf_drawer/kf_drawer.dart'; 11 | import 'package:path/path.dart'; 12 | import 'package:testing/colors.dart'; 13 | import 'package:testing/main.dart'; 14 | import 'package:testing/methods.dart'; 15 | import 'package:testing/smart/widgets/header_widget.dart'; 16 | 17 | import 'common/theme_helper.dart'; 18 | TextEditingController picname=TextEditingController(); 19 | FirebaseAuth _auth = FirebaseAuth.instance; 20 | class ImageUploads extends KFDrawerContent { 21 | ImageUploads({Key? key}) ; 22 | 23 | @override 24 | _ImageUploadsState createState() => _ImageUploadsState(); 25 | } 26 | 27 | class _ImageUploadsState extends State { 28 | firebase_storage.FirebaseStorage storage = 29 | firebase_storage.FirebaseStorage.instance; 30 | var pickedFile; 31 | 32 | File? _photo; 33 | final ImagePicker _picker = ImagePicker(); 34 | 35 | pica() async { 36 | 37 | pickedFile = await _picker.pickImage(source: ImageSource.gallery); 38 | } 39 | 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Future uploadFile() async { 53 | String? em=_auth.currentUser!.email; 54 | if (_photo == null) return; 55 | final fileName = basename(_photo!.path); 56 | final destination = em; 57 | 58 | 59 | showDialog(context: context, builder: (context){ 60 | 61 | return Center(child: CircularProgressIndicator()); 62 | 63 | }); 64 | 65 | try { 66 | final ref = firebase_storage.FirebaseStorage.instance 67 | .ref(destination) 68 | .child(picname.text+".jpg"); 69 | await ref.putFile(_photo!); 70 | Navigator.of(context).pop(); 71 | alertbox(context, 'Upload Sucessful', 'Please restart Python Server for the files to Sync', 'images/uploading.gif'); 72 | 73 | 74 | } catch (e) { 75 | Navigator.of(context).pop(); 76 | 77 | alertbox(context, 'Upload Failed', 'Please Check your Internet Connection', 'images/alerts.gif'); 78 | } 79 | } 80 | 81 | 82 | 83 | 84 | Future imgFromGallery() async { 85 | 86 | 87 | setState(() { 88 | if (pickedFile != null) { 89 | _photo = File(pickedFile.path); 90 | uploadFile(); 91 | } else { 92 | alertbox(context, 'No Image Selected', 'Please Upload a File', 'images/alerts.gif'); 93 | } 94 | }); 95 | } 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | return SafeArea( 106 | 107 | 108 | 109 | child: SingleChildScrollView( 110 | child: Column( 111 | children: [Container( 112 | height: 150, 113 | child: HeaderWidget(150, true, Icon(Icons.login_rounded), false,fun: (){}, notiText: 'Faces',), //let's create a common header widget 114 | ), 115 | 116 | Padding( 117 | padding: EdgeInsets.fromLTRB(45, 10, 40,0), 118 | child: Text('Kindly Upload the Image with the name of Person.', textAlign: TextAlign.center, 119 | style: GoogleFonts.bebasNeue( 120 | 121 | color: Colors.grey , 122 | 123 | fontSize: 20, 124 | ), 125 | ), 126 | ), 127 | 128 | SizedBox( 129 | height: 22, 130 | ), 131 | Container(padding: EdgeInsets.fromLTRB(10, 10, 10,10) , 132 | child: TextField(controller: picname, 133 | decoration: ThemeHelper().textInputDecoration('Person Name', 'Enter Name of Person in Image'), 134 | ), 135 | decoration: ThemeHelper().inputBoxDecorationShaddow(), 136 | ), 137 | SizedBox( 138 | height: 22, 139 | ), 140 | Center( 141 | child: GestureDetector( 142 | onTap: () { 143 | _showPicker(context); 144 | }, 145 | child: CircleAvatar( 146 | radius: 55, 147 | backgroundColor: Color(0xffFDCF09), 148 | child: _photo != null 149 | ? ClipRRect( 150 | borderRadius: BorderRadius.circular(50), 151 | child: Image.file( 152 | _photo!, 153 | width: 100, 154 | height: 100, 155 | fit: BoxFit.fitHeight, 156 | ), 157 | ) 158 | : Container( 159 | decoration: BoxDecoration( 160 | color: Colors.grey[200], 161 | borderRadius: BorderRadius.circular(50)), 162 | width: 100, 163 | height: 100, 164 | child: Icon( 165 | Icons.camera_alt, 166 | color: Colors.grey[800], 167 | ), 168 | ), 169 | ), 170 | ), 171 | ), 172 | SizedBox( 173 | height: 22, 174 | ), 175 | Container( 176 | decoration: ThemeHelper().buttonBoxDecoration(context), 177 | child: ElevatedButton( 178 | style: ThemeHelper().buttonStyle(), 179 | child: Padding( 180 | padding: EdgeInsets.fromLTRB(40, 10, 40, 10), 181 | child: Text('Upload'.toUpperCase(), style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),), 182 | ), 183 | onPressed: () async { 184 | try{ 185 | 186 | imgFromGallery(); 187 | 188 | } 189 | catch (e) { 190 | print(e); 191 | alertbox(context, 'Upload Failed', 'Please Check your Internet Connection', 'images/alerts.gif'); 192 | return null; 193 | } 194 | 195 | }, 196 | ), 197 | ), 198 | ], 199 | ), 200 | ), 201 | ); 202 | } 203 | 204 | void _showPicker(context) { 205 | showModalBottomSheet( 206 | context: context, 207 | builder: (BuildContext bc) { 208 | return SafeArea( 209 | child: Container( 210 | child: new Wrap( 211 | children: [ 212 | new ListTile( 213 | leading: new Icon(Icons.photo_library), 214 | title: new Text('Gallery'), 215 | onTap: () { 216 | pica(); 217 | Navigator.of(context).pop(); 218 | }), 219 | 220 | ], 221 | ), 222 | ), 223 | ); 224 | }); 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /lib/userCheck.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'package:testing/pages/onboarding_page.dart'; 6 | 7 | 8 | import 'fingerpage.dart'; 9 | 10 | 11 | class VerifyCheck extends StatelessWidget { 12 | final FirebaseAuth _auth = FirebaseAuth.instance; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | if (_auth.currentUser == null) { 17 | return OnboardingPage(); 18 | } else { 19 | return FingerWndow(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/widget/card_planet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | import 'package:lottie/lottie.dart'; 4 | 5 | class CardPlanetData { 6 | final String title; 7 | final String subtitle; 8 | final String image; 9 | final Color backgroundColor; 10 | final Color titleColor; 11 | final Color subtitleColor; 12 | final Widget? background; 13 | 14 | CardPlanetData({ 15 | required this.title, 16 | required this.subtitle, 17 | required this.image, 18 | required this.backgroundColor, 19 | required this.titleColor, 20 | required this.subtitleColor, 21 | this.background, 22 | }); 23 | } 24 | 25 | class CardPlanet extends StatelessWidget { 26 | const CardPlanet({ 27 | required this.data, 28 | Key? key, 29 | }) : super(key: key); 30 | 31 | final CardPlanetData data; 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Stack( 36 | children: [ 37 | if (data.background != null) data.background!, 38 | Padding( 39 | padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20), 40 | child: Column( 41 | mainAxisAlignment: MainAxisAlignment.center, 42 | children: [ 43 | const Spacer(flex: 3), 44 | Flexible( 45 | flex: 20, 46 | child: Lottie.asset(data.image), 47 | ), 48 | const Spacer(flex: 1), 49 | Text( 50 | data.title.toUpperCase(), 51 | style: GoogleFonts.bebasNeue( 52 | 53 | color: data.titleColor , 54 | 55 | fontSize: 38, 56 | ), 57 | maxLines: 1, 58 | ), 59 | const Spacer(flex: 1), 60 | Text( 61 | data.subtitle, 62 | style: TextStyle( 63 | color: data.subtitleColor, 64 | fontSize: 16, 65 | ), 66 | textAlign: TextAlign.center, 67 | maxLines: 2, 68 | ), 69 | const Spacer(flex: 10), 70 | ], 71 | ), 72 | ), 73 | ], 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "firebase-admin": "^10.2.0", 4 | "firebase-functions": "^3.21.2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: testing 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.16.2 <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 | kf_drawer: ^1.2.1 38 | firebase_core_web: ^1.6.3 39 | flutter_svg: ^1.0.3 40 | firebase_auth: ^3.3.18 41 | firebase_core: ^1.17.0 42 | cloud_firestore: ^3.1.15 43 | http: ^0.13.4 44 | gallery_saver: ^2.3.2 45 | firebase_messaging: ^13.0.4 46 | flutter_local_notifications: ^10.0.0-dev.1 47 | cloud_functions: ^3.2.15 48 | cloud_functions_web: ^4.2.14 49 | local_auth: ^2.1.0 50 | image_picker: ^0.8.5+3 51 | firebase_storage: ^10.3.2 52 | flutter_vlc_player: ^7.1.5 53 | gesture_x_detector: ^1.1.1 54 | giffy_dialog: ^1.8.0 55 | confetti: ^0.7.0 56 | shimmer_animation: ^2.1.0+1 57 | percent_indicator: ^4.2.2 58 | lottie: ^1.3.0 59 | concentric_transition: ^1.0.3 60 | google_fonts: ^3.0.1 61 | hexcolor: ^2.0.7 62 | font_awesome_flutter: ^10.1.0 63 | otp_text_field: ^1.1.3 64 | flutter_app_name: ^0.1.1 65 | flutter_launcher_icons: ^0.10.0 66 | flutter_ringtone_player: ^3.2.0 67 | 68 | 69 | dev_dependencies: 70 | flutter_test: 71 | sdk: flutter 72 | flutter_app_name: 73 | name: "SHSS" 74 | flutter_icons: 75 | android: "launcher_icon" 76 | ios: true 77 | image_path: "images/eagle.png" 78 | 79 | 80 | # The "flutter_lints" package below contains a set of recommended lints to 81 | # encourage good coding practices. The lint set provided by the package is 82 | # activated in the `analysis_options.yaml` file located at the root of your 83 | # package. See that file for information about deactivating specific lint 84 | # rules and activating additional ones. 85 | flutter_lints: ^2.0.1 86 | 87 | # For information on the generic Dart part of this file, see the 88 | # following page: https://dart.dev/tools/pub/pubspec 89 | 90 | # The following section is specific to Flutter. 91 | flutter: 92 | 93 | # The following line ensures that the Material Icons font is 94 | # included with your application, so that you can use the icons in 95 | # the material Icons class. 96 | uses-material-design: true 97 | 98 | # To add assets to your application, add an assets section, like this: 99 | assets: 100 | - animation/ 101 | - animation/bg-2.json 102 | - animation/bg-1.json 103 | - animation/bg-3.json 104 | - animation/cctv.json 105 | - animation/shield.json 106 | - animation/wire.json 107 | - animation/finger.json 108 | - animation/privacy.json 109 | - animation/recognition.json 110 | - images/ 111 | - images/cctv.gif 112 | - images/logo.png 113 | - images/image.jpg 114 | - images/picture1.jpg 115 | - images/air-conditioner.png 116 | - images/creative.png 117 | - images/washing-machine.png 118 | - images/Capture.jpg 119 | - images/wh.jpg 120 | - images/sucess.gif 121 | - images/cancel.gif 122 | - images/mail-verification.gif 123 | - images/successful.gif 124 | - images/alerts.gif 125 | - images/uploading.gif 126 | 127 | fonts: 128 | - family: Poppins 129 | fonts: 130 | - asset: fonts/Poppins-Regular.ttf 131 | - asset: fonts/Poppins-SemiBold.ttf 132 | - asset: fonts/Poppins-Bold.ttf 133 | - asset: fonts/Roboto-Black.ttf 134 | - asset: fonts/Roboto-Regular.ttf 135 | - asset: fonts/Flix-Normal.ttf 136 | - family: Helvetica 137 | fonts: 138 | - asset: fonts/Helvetica.ttf 139 | 140 | 141 | # An image asset can refer to one or more resolution-specific "variants", see 142 | # https://flutter.dev/assets-and-images/#resolution-aware. 143 | 144 | # For details regarding adding assets from package dependencies, see 145 | # https://flutter.dev/assets-and-images/#from-packages 146 | 147 | # To add custom fonts to your application, add a fonts section here, 148 | # in this "flutter" section. Each entry in this list should have a 149 | # "family" key with the font family name, and a "fonts" key with a 150 | # list giving the asset and other descriptors for the font. For 151 | # example: 152 | # fonts: 153 | # - family: Schyler 154 | # fonts: 155 | # - asset: fonts/Schyler-Regular.ttf 156 | # - asset: fonts/Schyler-Italic.ttf 157 | # style: italic 158 | # - family: Trajan Pro 159 | # fonts: 160 | # - asset: fonts/TrajanPro.ttf 161 | # - asset: fonts/TrajanPro_Bold.ttf 162 | # weight: 700 163 | # 164 | # For details regarding fonts from package dependencies, 165 | # see https://flutter.dev/custom-fonts/#from-packages 166 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:testing/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget( MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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 | testing 33 | 34 | 35 | 36 | 39 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testing", 3 | "short_name": "testing", 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 | cmake_minimum_required(VERSION 3.14) 2 | project(testing LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "testing") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | LocalAuthPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("LocalAuthPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /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 | local_auth_windows 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /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", "com.example" "\0" 93 | VALUE "FileDescription", "testing" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "testing" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "testing.exe" "\0" 98 | VALUE "ProductName", "testing" "\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"testing", 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/Executer13/Smart-Home-Security-System-Flutter/3032cad4fb5559a6f0e7975db5cb01effb56e6f7/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 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 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 | --------------------------------------------------------------------------------