├── .idea ├── .gitignore ├── Bus-Tracking-system.iml ├── misc.xml ├── modules.xml └── vcs.xml ├── README.md ├── docs └── CONTRIBUTING.md ├── nexus-deployment.yaml ├── pipeline.Jenkinsfile ├── prometheus.yml ├── screen images ├── IMG-20230618-WA0015.jpg ├── IMG-20230618-WA0016.jpg ├── IMG-20230618-WA0017.jpg ├── IMG-20230618-WA0018.jpg ├── IMG-20230618-WA0019.jpg ├── IMG-20230618-WA0020.jpg ├── IMG-20230618-WA0021.jpg ├── IMG-20230618-WA0022.jpg ├── IMG-20230618-WA0023.jpg ├── IMG-20230618-WA0024.jpg ├── IMG-20230618-WA0025.jpg ├── IMG-20230618-WA0026.jpg └── temp ├── src └── bus_tracking_system │ ├── .firebaserc │ ├── .gitignore │ ├── .metadata │ ├── .vscode │ └── settings.json │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ ├── google-services.json │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── flutter │ │ │ │ │ └── app │ │ │ │ │ └── FlutterMultiDexApplication.java │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── bus_tracking_system │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle │ ├── assets │ └── images │ │ ├── bus.png │ │ ├── busicon.png │ │ └── person.png │ ├── btsBuild.Jenkinsfile │ ├── database.rules.json │ ├── firebase.json │ ├── firestore.indexes.json │ ├── firestore.rules │ ├── functions │ ├── .eslintrc.js │ ├── .gitignore │ ├── index.js │ └── package.json │ ├── 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 │ ├── Constants │ │ └── constants.dart │ ├── helper │ │ └── helperFunction.dart │ ├── main.dart │ ├── screen │ │ ├── DriverLoginPage.dart │ │ ├── destination_info.dart │ │ ├── locations_page.dart │ │ ├── map_page.dart │ │ ├── maps.dart │ │ ├── profile.dart │ │ ├── splash.dart │ │ └── ui.dart │ └── services │ │ ├── authServices.dart │ │ └── databaseServices.dart │ ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ └── my_application.h │ ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ └── MainMenu.xib │ │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements │ ├── public │ └── index.html │ ├── 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 └── terraform-workspace ├── .terraform.lock.hcl ├── .terraform └── providers │ └── registry.terraform.io │ └── hashicorp │ └── google-beta │ └── 4.72.1 │ └── windows_386 │ └── terraform-provider-google-beta_v4.72.1_x5.exe ├── main.tf ├── terraform.tfstate ├── terraform.tfstate.backup └── vars.tf /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/Bus-Tracking-system.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bus Tracking System 2 | 3 | ## About the Project 4 | An app that helps track the live location of college buses with ease!!! 5 | It uses Flutter and Google Maps API to get the live location of drivers and users, 6 | and displays the estimated time the bus will take to reach the user's stop 7 | so that they can board the bus without any hassel. 8 | 9 | ## Motive 10 | To provide convenience to the students availing of the bus facility. 11 | To minimize the chances of missing a student 12 | 13 | ## Permissions Required 14 | - Location Access 15 | - Send user data to database 16 | - Notification Alert 17 | 18 | ## Tech Stack 19 | - [ ] Flutter 20 | - [ ] Firebase 21 | 22 | ## Contributors 23 | 24 | 25 | ## Functionality 26 | ### Functionality of Flutter Firebase: 27 | 28 | - Authentication: Flutter Firebase provides authentication services, allowing you to easily implement user authentication and management in your Flutter app using Firebase Authentication. 29 | 30 | - Real-time Database: Firebase Realtime Database is a cloud-hosted NoSQL database that allows you to store and sync data in real time. With Flutter Firebase, you can easily integrate Firebase Realtime Database into your Flutter app and manage real-time data updates. 31 | 32 | - Cloud Firestore: Firebase Cloud Firestore is a flexible, scalable NoSQL database for mobile, web, and server development. Flutter Firebase provides seamless integration with Cloud Firestore, allowing you to store and query structured data in your Flutter app. 33 | 34 | - Cloud Storage: Firebase Cloud Storage provides a secure and scalable solution for storing and serving user-generated content such as images, videos, and files. With Flutter Firebase, you can easily upload, download, and manage files in Firebase Cloud Storage. 35 | 36 | - Remote Config: Firebase Remote Config allows you to remotely configure and customize your app without requiring users to update the app. With Flutter Firebase, you can easily use Remote Config to define and deploy parameters that can be changed in real time. 37 | 38 | ### Functionality of Flutter Maps: 39 | 40 | - Map Display: Flutter Maps provides a variety of map display options, including interactive maps, static maps, and custom map styles. You can integrate popular map providers like Google Maps, Mapbox, and OpenStreetMap into your Flutter app. 41 | 42 | - Markers and Overlays: Flutter Maps allows you to add markers, overlays, and other visual elements to the map. You can display custom icons, info windows, polygons, polylines, and more to enhance the user experience. 43 | 44 | - User Location: Flutter Maps provides functionality to access and display the user's current location on the map. You can track the user's location in real time and display it as a marker or update the map view accordingly. 45 | 46 | - Geocoding and Reverse Geocoding: Flutter Maps supports geocoding and reverse geocoding, which allows you to convert addresses or place names into geographic coordinates (latitude and longitude) and vice versa. This enables you to search for locations, display addresses on the map, and perform location-based queries. 47 | 48 | - Routing and Directions: Flutter Maps provides routing and directions functionality, allowing you to calculate and display routes between multiple locations. You can show turn-by-turn directions, estimated travel times, and alternative routes on the map. 49 | 50 | - Gestures and Interactions: Flutter Maps supports various gestures and interactions, such as panning, zooming, rotation, and tilt. Users can interact with the map using touch gestures to explore and navigate the map view. 51 | 52 | 53 | ## How to contribute ? 54 | > Star ⭐ and fork the repository...
55 | > Clone the repository on your local machine...
56 | ```bash 57 | git clone https://github.com/upes-open/Bus-Tracking-system.git 58 | ``` 59 | > Go to the project directory
60 | > Get assigned yourself the issue you want to contribute.
61 | > Start working on the assigned issue.
62 | 63 | ### Contributions are always welcome! 64 | -------------------------------------------------------------------------------- /docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/docs/CONTRIBUTING.md -------------------------------------------------------------------------------- /nexus-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nexus-deployment 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: nexus 10 | template: 11 | metadata: 12 | labels: 13 | app: nexus 14 | spec: 15 | containers: 16 | - name: nexus 17 | image: sonatype/nexus3 18 | ports: 19 | - containerPort: 8081 20 | # volumeMounts: 21 | # - name: nexus-data 22 | # mountPath: /nexus-data 23 | # volumes: 24 | # - name: nexus-data 25 | # persistentVolumeClaim: 26 | # claimName: nexus-pvc 27 | --- 28 | apiVersion: v1 29 | kind: Service 30 | metadata: 31 | name: nexus-service 32 | spec: 33 | type: NodePort 34 | ports: 35 | - port: 8081 36 | targetPort: 8081 37 | selector: 38 | app: nexus 39 | -------------------------------------------------------------------------------- /pipeline.Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('Checkout') { 6 | steps { 7 | checkout scm 8 | } 9 | } 10 | 11 | // stage('Build and Test') { 12 | // steps { 13 | // // Set up Flutter environment (adjust paths as needed) 14 | // sh 'export PATH=$PATH:/home/ubuntu/snap/flutter/common/flutter/bin' 15 | // sh 'flutter doctor' 16 | 17 | // // Build Flutter project 18 | // dir('Bus-Tracking-system/src/bus_tracking_system/') { 19 | // sh 'flutter build apk' 20 | // } 21 | 22 | // // Run tests 23 | // sh 'flutter test' 24 | // } 25 | // } 26 | 27 | stage('Publish to Nexus') { 28 | steps { 29 | // Publish artifacts to Nexus 30 | nexusArtifactUploader( 31 | nexusVersion: 'nexus3', 32 | protocol: 'http', 33 | nexusUrl: 'http://localhost:8081/repository/Bus-Tracking-Application/', 34 | groupId: 'com.example', 35 | version: '1.0.0', 36 | repository: 'Bus-Tracking-Application', 37 | file: 'Bus-Tracking-system/src/bus_tracking_system/build/app/outputs/flutter-apk/app-release.apk', 38 | credentialsId: 'nexus-credentials' 39 | ) 40 | } 41 | } 42 | 43 | // stage('Deploy to Staging') { 44 | // steps { 45 | // // Deploy to staging environment 46 | // sh 'flutter deploy staging' 47 | // } 48 | // } 49 | 50 | // stage('Deploy to Production') { 51 | // steps { 52 | // // Deploy to production environment 53 | // sh 'flutter deploy production' 54 | // } 55 | // } 56 | 57 | // stage('Post-Deployment Test') { 58 | // steps { 59 | // // Run post-deployment tests 60 | // sh 'flutter test_integration' 61 | // } 62 | } 63 | } 64 | 65 | 66 | post { 67 | always { 68 | // Archive artifacts 69 | archiveArtifacts 'build/app/outputs/flutter-apk/*.apk' 70 | } 71 | 72 | success { 73 | // Send email notification on success 74 | emailext ( 75 | to: 'aakshitasingh786@gmail.com', 76 | subject: 'Build Successful: Bus Tracking System', 77 | body: 'The Bus Tracking System build and deployment were successful.' 78 | ) 79 | } 80 | 81 | failure { 82 | // Send email notification on failure 83 | emailext ( 84 | to: 'aakshitasingh786@gmail.com', 85 | subject: 'Build Failed: Bus Tracking System', 86 | body: 'The Bus Tracking System build and deployment failed. Please check the Jenkins logs for details.' 87 | ) 88 | } 89 | } 90 | 91 | // // Trigger the pipeline when code is pushed to the main branch 92 | // triggers { 93 | // scm('*/5 * * * *') // Poll SCM every 5 minutes 94 | // } -------------------------------------------------------------------------------- /prometheus.yml: -------------------------------------------------------------------------------- 1 | # scrape_configs: 2 | # - job_name: 'my_flutter_app' 3 | # static_configs: 4 | # - targets: [':9090'] 5 | 6 | 7 | 8 | # # add the ip form server 9 | -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0015.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0016.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0017.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0018.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0019.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0020.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0021.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0022.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0023.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0024.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0025.jpg -------------------------------------------------------------------------------- /screen images/IMG-20230618-WA0026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/IMG-20230618-WA0026.jpg -------------------------------------------------------------------------------- /screen images/temp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/screen images/temp -------------------------------------------------------------------------------- /src/bus_tracking_system/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "bustrackingsystem-62417" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/bus_tracking_system/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /src/bus_tracking_system/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 17 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 18 | - platform: android 19 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 20 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 21 | - platform: ios 22 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 23 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 24 | - platform: linux 25 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 26 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 27 | - platform: macos 28 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 29 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 30 | - platform: web 31 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 32 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 33 | - platform: windows 34 | create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 35 | base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /src/bus_tracking_system/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.configuration.updateBuildConfiguration": "disabled" 3 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/README.md: -------------------------------------------------------------------------------- 1 | # bus_tracking_system 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | apply plugin: 'com.google.gms.google-services'//id 'com.google.gms.google-services' 28 | 29 | android { 30 | compileSdkVersion flutter.compileSdkVersion 31 | ndkVersion flutter.ndkVersion 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.bus_tracking_system" 49 | // You can update the following values to match your application needs. 50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 51 | // minSdkVersion flutter.minSdkVersion 52 | minSdkVersion 20 53 | targetSdkVersion flutter.targetSdkVersion 54 | versionCode flutterVersionCode.toInteger() 55 | versionName flutterVersionName 56 | } 57 | 58 | buildTypes { 59 | release { 60 | // TODO: Add your own signing config for the release build. 61 | // Signing with the debug keys for now, so `flutter run --release` works. 62 | signingConfig signingConfigs.debug 63 | } 64 | } 65 | } 66 | 67 | flutter { 68 | source '../..' 69 | } 70 | 71 | dependencies { 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | implementation platform('com.google.firebase:firebase-bom:31.3.0') 74 | implementation 'com.google.firebase:firebase-analytics' 75 | } 76 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "826614974960", 4 | "firebase_url": "https://bustrackingsystem-62417-default-rtdb.asia-southeast1.firebasedatabase.app", 5 | "project_id": "bustrackingsystem-62417", 6 | "storage_bucket": "bustrackingsystem-62417.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:826614974960:android:a28ed6cd90ba76835a7535", 12 | "android_client_info": { 13 | "package_name": "com.example.bus_tracking_system" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "826614974960-reu5dcs437dgtmvfl0fle3148shk5qnm.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyDFv8ji8r8hnt9WHNUf3oiJ_BaLFCK8n08" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "826614974960-reu5dcs437dgtmvfl0fle3148shk5qnm.apps.googleusercontent.com", 32 | "client_type": 3 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ], 39 | "configuration_version": "1" 40 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 9 | 17 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java: -------------------------------------------------------------------------------- 1 | // Generated file. 2 | // 3 | // If you wish to remove Flutter's multidex support, delete this entire file. 4 | // 5 | // Modifications to this file should be done in a copy under a different name 6 | // as this file may be regenerated. 7 | 8 | package io.flutter.app; 9 | 10 | import android.app.Application; 11 | import android.content.Context; 12 | import androidx.annotation.CallSuper; 13 | import androidx.multidex.MultiDex; 14 | 15 | /** 16 | * Extension of {@link android.app.Application}, adding multidex support. 17 | */ 18 | public class FlutterMultiDexApplication extends Application { 19 | @Override 20 | @CallSuper 21 | protected void attachBaseContext(Context base) { 22 | super.attachBaseContext(base); 23 | MultiDex.install(this); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/kotlin/com/example/bus_tracking_system/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.bus_tracking_system 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.15' 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 | tasks.register("clean", Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /src/bus_tracking_system/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/assets/images/bus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/assets/images/bus.png -------------------------------------------------------------------------------- /src/bus_tracking_system/assets/images/busicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/assets/images/busicon.png -------------------------------------------------------------------------------- /src/bus_tracking_system/assets/images/person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/assets/images/person.png -------------------------------------------------------------------------------- /src/bus_tracking_system/btsBuild.Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('Checkout') { 6 | steps { 7 | checkout scm 8 | } 9 | } 10 | 11 | stage('Build and Test') { 12 | steps { 13 | // Set up Flutter environment (adjust paths as needed) 14 | sh 'export PATH=$PATH:/home/ubuntu/snap/flutter/common/flutter/bin' 15 | sh 'flutter doctor' 16 | 17 | // Build Flutter project 18 | sh 'flutter build apk' 19 | 20 | // Run tests 21 | sh 'flutter test' 22 | } 23 | } 24 | 25 | // stage('Publish to Nexus') { 26 | // steps { 27 | // // Publish artifacts to Nexus 28 | // nexusArtifactUploader( 29 | // nexusVersion: 'nexus3', 30 | // protocol: 'http', 31 | // nexusUrl: 'http://nexus_server_url', 32 | // groupId: 'com.example', 33 | // version: '1.0.0', 34 | // repository: 'your_repository_name', 35 | // file: 'build/app/outputs/flutter-apk/app-release.apk', 36 | // credentialsId: 'nexus_credentials' 37 | // ) 38 | // } 39 | // } 40 | 41 | stage('Deploy to Staging') { 42 | steps { 43 | // Deploy to staging environment 44 | sh 'flutter deploy staging' 45 | } 46 | } 47 | 48 | stage('Deploy to Production') { 49 | steps { 50 | // Deploy to production environment 51 | sh 'flutter deploy production' 52 | } 53 | } 54 | 55 | stage('Post-Deployment Test') { 56 | steps { 57 | // Run post-deployment tests 58 | sh 'flutter test_integration' 59 | } 60 | } 61 | } 62 | 63 | post { 64 | always { 65 | // Archive artifacts 66 | archiveArtifacts 'build/app/outputs/flutter-apk/*.apk' 67 | } 68 | 69 | success { 70 | // Send email notification on success 71 | emailext ( 72 | to: 'prathamkandari123@gmail.com', 73 | subject: 'Build Successful: Bus Tracking System', 74 | body: 'The Bus Tracking System build and deployment were successful.' 75 | ) 76 | } 77 | 78 | failure { 79 | // Send email notification on failure 80 | emailext ( 81 | to: 'prathamkandari123@gmail.com', 82 | subject: 'Build Failed: Bus Tracking System', 83 | body: 'The Bus Tracking System build and deployment failed. Please check the Jenkins logs for details.' 84 | ) 85 | } 86 | } 87 | 88 | // Trigger the pipeline when code is pushed to the main branch 89 | // triggers { 90 | // scm('*/5 * * * *') // Poll SCM every 5 minutes 91 | //   } 92 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */ 3 | "rules": { 4 | ".read": false, 5 | ".write": false 6 | } 7 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "functions": { 3 | "source": "functions" 4 | }, 5 | "hosting": { 6 | "public": "build/web", 7 | "ignore": [ 8 | "firebase.json", 9 | "**/.*", 10 | "**/node_modules/**" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/bus_tracking_system/firestore.indexes.json: -------------------------------------------------------------------------------- 1 | { 2 | "indexes": [], 3 | "fieldOverrides": [] 4 | } 5 | -------------------------------------------------------------------------------- /src/bus_tracking_system/firestore.rules: -------------------------------------------------------------------------------- 1 | rules_version = '2'; 2 | 3 | service cloud.firestore { 4 | match /databases/{database}/documents { 5 | 6 | // This rule allows anyone with your Firestore database reference to view, edit, 7 | // and delete all data in your Firestore database. It is useful for getting 8 | // started, but it is configured to expire after 30 days because it 9 | // leaves your app open to attackers. At that time, all client 10 | // requests to your Firestore database will be denied. 11 | // 12 | // Make sure to write security rules for your app before that time, or else 13 | // all client requests to your Firestore database will be denied until you Update 14 | // your rules 15 | match /{document=**} { 16 | allow read, write: if request.time < timestamp.date(2023, 8, 10); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/functions/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | es6: true, 4 | node: true, 5 | }, 6 | parserOptions: { 7 | "ecmaVersion": 2018, 8 | }, 9 | extends: [ 10 | "eslint:recommended", 11 | "google", 12 | ], 13 | rules: { 14 | "no-restricted-globals": ["error", "name", "length"], 15 | "prefer-arrow-callback": "error", 16 | "quotes": ["error", "double", {"allowTemplateLiterals": true}], 17 | }, 18 | overrides: [ 19 | { 20 | files: ["**/*.spec.*"], 21 | env: { 22 | mocha: true, 23 | }, 24 | rules: {}, 25 | }, 26 | ], 27 | globals: {}, 28 | }; 29 | -------------------------------------------------------------------------------- /src/bus_tracking_system/functions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /src/bus_tracking_system/functions/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Import function triggers from their respective submodules: 3 | * 4 | * const {onCall} = require("firebase-functions/v2/https"); 5 | * const {onDocumentWritten} = require("firebase-functions/v2/firestore"); 6 | * 7 | * See a full list of supported triggers at https://firebase.google.com/docs/functions 8 | */ 9 | 10 | const {onRequest} = require("firebase-functions/v2/https"); 11 | const logger = require("firebase-functions/logger"); 12 | 13 | // Create and deploy your first functions 14 | // https://firebase.google.com/docs/functions/get-started 15 | 16 | // exports.helloWorld = onRequest((request, response) => { 17 | // logger.info("Hello logs!", {structuredData: true}); 18 | // response.send("Hello from Firebase!"); 19 | // }); 20 | -------------------------------------------------------------------------------- /src/bus_tracking_system/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "lint": "eslint .", 6 | "serve": "firebase emulators:start --only functions", 7 | "shell": "firebase functions:shell", 8 | "start": "npm run shell", 9 | "deploy": "firebase deploy --only functions", 10 | "logs": "firebase functions:log" 11 | }, 12 | "engines": { 13 | "node": "18" 14 | }, 15 | "main": "index.js", 16 | "dependencies": { 17 | "firebase-admin": "^11.8.0", 18 | "firebase-functions": "^4.3.1" 19 | }, 20 | "devDependencies": { 21 | "eslint": "^8.15.0", 22 | "eslint-config-google": "^0.14.0", 23 | "firebase-functions-test": "^3.1.0" 24 | }, 25 | "private": true 26 | } 27 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import UserNotifications 4 | 5 | @UIApplicationMain 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | if #available(iOS 10.0, *) { 12 | UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate 13 | let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] 14 | UNUserNotificationCenter.current().requestAuthorization( 15 | options: authOptions, 16 | completionHandler: {_, _ in }) 17 | } else { 18 | let settings: UIUserNotificationSettings = 19 | UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) 20 | application.registerUserNotificationSettings(settings) 21 | } 22 | 23 | application.registerForRemoteNotifications() 24 | 25 | GeneratedPluginRegistrant.register(with: self) 26 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 27 | } 28 | @available(iOS 10, *) 29 | func userNotificationCenter(_ center: UNUserNotificationCenter, 30 | willPresent notification: UNNotification, 31 | withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { 32 | completionHandler([.alert, .badge, .sound]) 33 | } 34 | 35 | @available(iOS 10, *) 36 | func userNotificationCenter(_ center: UNUserNotificationCenter, 37 | didReceive response: UNNotificationResponse, 38 | withCompletionHandler completionHandler: @escaping () -> Void) { 39 | completionHandler() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /src/bus_tracking_system/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. -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSLocationWhenInUseUsageDescription 6 | App needs access to location when open. 7 | NSLocationAlwaysUsageDescription 8 | App needs access to location always. 9 | NSLocationAlwaysAndWhenInUseUsageDescription 10 | App needs access to location always and when in use. 11 | CFBundleDevelopmentRegion 12 | $(DEVELOPMENT_LANGUAGE) 13 | CFBundleDisplayName 14 | Bus Tracking System 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIdentifier 18 | $(PRODUCT_BUNDLE_IDENTIFIER) 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | bus_tracking_system 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | $(FLUTTER_BUILD_NAME) 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | $(FLUTTER_BUILD_NUMBER) 31 | LSRequiresIPhoneOS 32 | 33 | UILaunchStoryboardName 34 | LaunchScreen 35 | UIMainStoryboardFile 36 | Main 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | CADisableMinimumFrameDurationOnPhone 53 | 54 | UIApplicationSupportsIndirectInputEvents 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/bus_tracking_system/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/Constants/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const String orsapikey = 4 | "5b3ce3597851110001cf62486114402a56174aa9b0294c6ade29f118"; //Enter the required API 5 | const Color primaryColor = Color.fromARGB(15, 97, 150, 255); 6 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/helper/helperFunction.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class HelperFunctions { 4 | //class used in ui.dart 5 | 6 | static String userLoggedInKey = "LOGGEDINKEY"; 7 | static String usernameKey = "USERNAMEKEY"; 8 | 9 | ///to save name 10 | static String userEmailKey = "USEREMAILKEY"; 11 | // saving the data in shared preferences 12 | static Future savedUserLoggedInStatus(bool isUserloggedIn) async { 13 | SharedPreferences sf = await SharedPreferences.getInstance(); 14 | return await sf.setBool(userLoggedInKey, 15 | isUserloggedIn); //setBool= sets the new value true/false 16 | } 17 | 18 | static Future savedUserNameSF(String userName) async { 19 | SharedPreferences sf = await SharedPreferences.getInstance(); 20 | return await sf.setString(usernameKey, userName); 21 | } 22 | 23 | static Future savedUserEmailSF(String userEmail) async { 24 | SharedPreferences sf = await SharedPreferences.getInstance(); 25 | return await sf.setString(userEmailKey, userEmail); 26 | } 27 | // getting the data from shared preferences 28 | 29 | static Future getUserLoggedInStatus() async { 30 | SharedPreferences sf = await SharedPreferences.getInstance(); 31 | return sf.getBool(userLoggedInKey); //tells if the user is logged in 32 | } 33 | 34 | static Future getUserEmailFromSF() async { 35 | SharedPreferences sf = await SharedPreferences.getInstance(); 36 | return sf.getString(userEmailKey); //gives emailid 37 | } 38 | 39 | static Future getUserNamefromSF() async { 40 | SharedPreferences sf = await SharedPreferences.getInstance(); 41 | return sf.getString(usernameKey); // 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:bus_tracking_system/screen/splash.dart'; 2 | import 'package:firebase_core/firebase_core.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:bus_tracking_system/screen/ui.dart'; 5 | 6 | void main() async { 7 | WidgetsFlutterBinding.ensureInitialized(); // initialize app 8 | await Firebase.initializeApp(); // initialize Firebase 9 | runApp(MyApp()); // run app 10 | } 11 | 12 | class MyApp extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | return MaterialApp( 16 | theme: ThemeData(), 17 | home: splash(), 18 | ); 19 | } 20 | } 21 | 22 | class LoginPage extends StatefulWidget { 23 | @override 24 | _LoginPageState createState() => _LoginPageState(); 25 | } 26 | 27 | class _LoginPageState extends State { 28 | bool isStudent = true; 29 | 30 | void toggleLoginOption() { 31 | setState(() { 32 | isStudent = !isStudent; 33 | }); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return UI(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/DriverLoginPage.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:app_settings/app_settings.dart'; 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:firebase_database/firebase_database.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_map/flutter_map.dart'; 7 | import 'package:http/http.dart' as http; 8 | import 'package:latlong2/latlong.dart'; 9 | import 'package:geolocator/geolocator.dart'; 10 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 11 | import '../Constants/constants.dart'; 12 | import 'package:bus_tracking_system/screen/profile.dart'; 13 | import 'package:bus_tracking_system/screen/locations_page.dart'; 14 | 15 | class DriverLoginPage extends StatefulWidget { 16 | @override 17 | _DriverLoginPageState createState() => _DriverLoginPageState(); 18 | } 19 | 20 | class _DriverLoginPageState extends State { 21 | final isLoading = false; 22 | LatLng DestinationLocation = LatLng(0, 0); // Initialize with default values 23 | // late LatLng destinationLocation = LatLng( 24 | // 30.3253, //For driver location 25 | // 78.0413); 26 | List polylinePoints = []; // Initialize with an empty list 27 | final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = 28 | FlutterLocalNotificationsPlugin(); 29 | late DatabaseReference dbRef; 30 | 31 | @override 32 | void initState() { 33 | super.initState(); 34 | requestPermission(); 35 | 36 | dbRef = FirebaseDatabase.instance.ref().child('DestinationLocation'); 37 | } 38 | 39 | Future requestPermission() async { 40 | LocationPermission permission = await Geolocator.requestPermission(); 41 | if (permission == LocationPermission.denied || 42 | permission == LocationPermission.deniedForever) { 43 | showDialog( 44 | context: context, 45 | builder: (BuildContext context) => AlertDialog( 46 | title: Text('Location Permission Required'), 47 | content: 48 | Text('This app needs to access your location to work properly.'), 49 | actions: [ 50 | TextButton( 51 | child: Text('Cancel'), 52 | onPressed: () => Navigator.of(context).pop(), 53 | ), 54 | TextButton( 55 | child: Text('Settings'), 56 | onPressed: () => AppSettings.openAppSettings(), 57 | ), 58 | ], 59 | ), 60 | ); 61 | } else { 62 | getCurrentLocation(); 63 | } 64 | } 65 | 66 | Future getCurrentLocation() async { 67 | Position position = await Geolocator.getCurrentPosition( 68 | desiredAccuracy: LocationAccuracy.high); 69 | setState(() { 70 | DestinationLocation = LatLng(position.latitude, position.longitude); 71 | }); 72 | } 73 | 74 | @override 75 | Widget build(BuildContext context) { 76 | return Scaffold( 77 | body: Center( 78 | child: ElevatedButton( 79 | onPressed: () { 80 | isLoading 81 | ? null 82 | : requestPermission().then((value) { 83 | Map values = { 84 | 'latitude': DestinationLocation.latitude, 85 | 'longitude': DestinationLocation.longitude, 86 | }; 87 | dbRef.push().set(values); 88 | }); 89 | }, 90 | child: Text("Request Location Permission"), 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/destination_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:latlong2/latlong.dart'; 2 | 3 | class DestinationInfo { 4 | final LatLng destinationLocation; 5 | 6 | DestinationInfo(this.destinationLocation); 7 | } 8 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/locations_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bus_tracking_system/screen/maps.dart'; 3 | import 'package:bus_tracking_system/screen/profile.dart'; 4 | 5 | class LocationsPage extends StatefulWidget { 6 | @override 7 | _LocationsPageState createState() => _LocationsPageState(); 8 | } 9 | 10 | class _LocationsPageState extends State { 11 | List _locations = [ 12 | 'Prem Nagar UPES', 13 | 'Clock Tower', 14 | 'Dehradun ISBT', 15 | 'Bidholi', 16 | 'Kandholi', 17 | ]; 18 | 19 | void _showLogoutConfirmationDialog() { 20 | showDialog( 21 | context: context, 22 | builder: (BuildContext context) { 23 | return AlertDialog( 24 | title: Text('Logout'), 25 | content: Text('Do you want to log out?'), 26 | actions: [ 27 | TextButton( 28 | onPressed: () { 29 | // Perform logout operation 30 | Navigator.of(context).pop(); 31 | // Add your logout logic here 32 | }, 33 | child: Text('Yes'), 34 | ), 35 | TextButton( 36 | onPressed: () { 37 | Navigator.of(context).pop(); 38 | }, 39 | child: Text('No'), 40 | ), 41 | ], 42 | ); 43 | }, 44 | ); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return Scaffold( 50 | appBar: AppBar( 51 | backgroundColor: Colors.white, 52 | title: Text( 53 | 'Select Route', 54 | style: TextStyle(color: Colors.black), 55 | ), 56 | leading: Builder( 57 | builder: (BuildContext context) { 58 | return IconButton( 59 | icon: Icon(Icons.menu), 60 | color: Colors.black, 61 | onPressed: () { 62 | Scaffold.of(context).openDrawer(); 63 | }, 64 | ); 65 | }, 66 | ), 67 | ), 68 | drawer: Drawer( 69 | child: ListView( 70 | padding: EdgeInsets.zero, 71 | children: [ 72 | DrawerHeader( 73 | decoration: BoxDecoration( 74 | color: Colors.blue, 75 | ), 76 | child: Text( 77 | 'Menu', 78 | style: TextStyle( 79 | color: Colors.white, 80 | fontSize: 24, 81 | ), 82 | ), 83 | ), 84 | ListTile( 85 | title: Text('Select Route'), 86 | onTap: () { 87 | Navigator.push( 88 | context, 89 | MaterialPageRoute( 90 | builder: (context) => LocationsPage(), 91 | ), 92 | ); 93 | }, 94 | ), 95 | ListTile( 96 | title: Text('Profile'), 97 | onTap: () { 98 | Navigator.push( 99 | context, 100 | MaterialPageRoute( 101 | builder: (context) => ProfilePage(), 102 | ), 103 | ); 104 | }, 105 | ), 106 | ListTile( 107 | title: Text('Logout'), 108 | onTap: _showLogoutConfirmationDialog, 109 | ), 110 | ], 111 | ), 112 | ), 113 | body: ListView.builder( 114 | itemCount: _locations.length, 115 | itemBuilder: (BuildContext context, int index) { 116 | return GestureDetector( 117 | onTap: () { 118 | Navigator.push( 119 | context, 120 | MaterialPageRoute( 121 | builder: (context) => BusTracking(), 122 | ), 123 | ); 124 | }, 125 | child: Card( 126 | margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), 127 | child: Padding( 128 | padding: EdgeInsets.all(20), 129 | child: Column( 130 | crossAxisAlignment: CrossAxisAlignment.start, 131 | children: [ 132 | Text( 133 | _locations[index], 134 | style: TextStyle( 135 | fontWeight: FontWeight.bold, 136 | fontSize: 16, 137 | color: Colors.black, 138 | ), 139 | ), 140 | SizedBox(height: 5), 141 | Text( 142 | 'Driver: John Doe', 143 | style: TextStyle( 144 | fontWeight: FontWeight.normal, 145 | fontSize: 12, 146 | ), 147 | ), 148 | SizedBox(height: 5), 149 | Text( 150 | 'Phone: +91-7894521642', 151 | style: TextStyle( 152 | fontSize: 12, 153 | fontWeight: FontWeight.normal, 154 | ), 155 | ), 156 | SizedBox(height: 10), 157 | ElevatedButton( 158 | onPressed: () { 159 | Navigator.push( 160 | context, 161 | MaterialPageRoute( 162 | builder: (context) => BusTracking(), 163 | ), 164 | ); 165 | }, 166 | child: Text( 167 | 'Track in Map', 168 | style: TextStyle(color: Colors.white), 169 | ), 170 | style: ElevatedButton.styleFrom( 171 | primary: Colors.blue, 172 | padding: EdgeInsets.symmetric( 173 | horizontal: 50, 174 | vertical: 15, 175 | ), 176 | shape: RoundedRectangleBorder( 177 | borderRadius: BorderRadius.circular(30), 178 | ), 179 | ), 180 | ), 181 | ], 182 | ), 183 | ), 184 | ), 185 | ); 186 | }, 187 | ), 188 | ); 189 | } 190 | } -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/map_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:bus_tracking_system/screen/maps.dart'; 2 | import 'package:flutter/material.dart'; 3 | // import 'package:bus_tracking_system/screen/select_routes.dart'; 4 | 5 | class MapPage extends StatelessWidget { 6 | final String location; 7 | 8 | MapPage({required this.location}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | Size size = MediaQuery.of(context).size; 13 | return Scaffold( 14 | appBar: AppBar( 15 | title: Text('Map - $location'), 16 | ), 17 | body: Center( 18 | child: Column( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | Text('Map of $location'), 22 | SizedBox(height: 20), 23 | ElevatedButton( 24 | child: Text('Select Route'), 25 | style: ElevatedButton.styleFrom( 26 | primary: Colors.pink, 27 | padding: EdgeInsets.symmetric(horizontal: 50, vertical: 15), 28 | shape: RoundedRectangleBorder( 29 | borderRadius: BorderRadius.circular(30), 30 | ), 31 | ), 32 | onPressed: () { 33 | Navigator.push( 34 | context, 35 | MaterialPageRoute( 36 | builder: (BuildContext context) { 37 | return BusTracking(); 38 | }, 39 | ), 40 | ); 41 | }, 42 | ), 43 | ], 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProfilePage extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text('Profile'), 9 | ), 10 | body: Center( 11 | child: Column( 12 | mainAxisAlignment: MainAxisAlignment.center, 13 | children: [ 14 | CircleAvatar( 15 | backgroundColor: Colors.black, 16 | radius: 95, 17 | child: Container( 18 | alignment: Alignment.center, 19 | child: Icon( 20 | Icons.person, 21 | size: 120, 22 | color: Colors.white, 23 | ), 24 | ), 25 | ), 26 | SizedBox(height: 20), 27 | Text( 28 | 'Email: xyz@gmail.com', 29 | style: TextStyle( 30 | fontSize: 16, 31 | fontWeight: FontWeight.bold, 32 | ), 33 | ), 34 | Spacer(), 35 | TextButton( 36 | onPressed: () { 37 | // Show dialog for changing password 38 | showDialog( 39 | context: context, 40 | builder: (BuildContext context) { 41 | return AlertDialog( 42 | title: Text('Change Password'), 43 | content: Column( 44 | mainAxisSize: MainAxisSize.min, 45 | children: [ 46 | TextField( 47 | decoration: InputDecoration( 48 | labelText: 'New Password', 49 | ), 50 | ), 51 | SizedBox(height: 10), 52 | TextField( 53 | decoration: InputDecoration( 54 | labelText: 'Re-enter Password', 55 | ), 56 | ), 57 | ], 58 | ), 59 | actions: [ 60 | TextButton( 61 | onPressed: () { 62 | // Handle password change 63 | Navigator.of(context).pop(); 64 | }, 65 | child: Text('Save'), 66 | ), 67 | TextButton( 68 | onPressed: () { 69 | // Close the dialog 70 | Navigator.of(context).pop(); 71 | }, 72 | child: Text('Cancel'), 73 | ), 74 | ], 75 | ); 76 | }, 77 | ); 78 | }, 79 | child: Text('Change Password'), 80 | ), 81 | ], 82 | ), 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/splash.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../main.dart'; 3 | 4 | class splash extends StatefulWidget { 5 | const splash({super.key}); 6 | 7 | @override 8 | State createState() => _splashState(); 9 | } 10 | 11 | class _splashState extends State { 12 | @override 13 | void initState() { 14 | super.initState(); 15 | _navigatetohome(); 16 | } 17 | 18 | _navigatetohome() async { 19 | await Future.delayed(Duration(milliseconds: 2000), () {}); 20 | Navigator.pushReplacement( 21 | context, MaterialPageRoute(builder: (context) => LoginPage())); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | body: Center( 28 | child: Container( 29 | width: double.infinity, 30 | height: double.infinity, 31 | decoration: BoxDecoration(color: Color(0xfff6f8f4)), 32 | child: Column( 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | children: [ 35 | Center( 36 | child:Image.asset( 37 | 'assets/images/bus.png', 38 | ), 39 | ), 40 | Text( 41 | " UPES BUS TARCKER", 42 | style: TextStyle( 43 | height: 5, 44 | color: Colors.blueAccent, 45 | fontWeight: FontWeight.bold, 46 | fontSize: 30.0, 47 | ), 48 | ), 49 | CircularProgressIndicator(), 50 | ], 51 | )), 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/screen/ui.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:bus_tracking_system/Constants/constants.dart'; 3 | import 'package:bus_tracking_system/helper/helperFunction.dart'; 4 | import 'package:bus_tracking_system/screen/splash.dart'; 5 | import 'package:bus_tracking_system/services/authServices.dart'; 6 | import 'package:bus_tracking_system/services/databaseServices.dart'; 7 | import 'package:cloud_firestore/cloud_firestore.dart'; 8 | import 'package:firebase_database/firebase_database.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/material.dart'; 11 | import 'package:bus_tracking_system/screen/locations_page.dart'; 12 | import 'package:firebase_auth/firebase_auth.dart'; 13 | import 'package:firebase_core/firebase_core.dart'; 14 | import 'package:bus_tracking_system/screen/DriverLoginPage.dart'; 15 | // import 'package:location/location.dart'; 16 | 17 | class UI extends StatefulWidget { 18 | //is a 19 | @override 20 | State createState() => _UIState(); 21 | } 22 | 23 | class _UIState extends State { 24 | AuthService _auth = AuthService(); 25 | bool isStudent = true; 26 | late final String email; 27 | late final String password; 28 | final _formfield = GlobalKey(); 29 | TextEditingController emailController = TextEditingController(); 30 | TextEditingController passController = TextEditingController(); 31 | bool passToggle = true; 32 | 33 | late DatabaseReference dbRef; 34 | 35 | void toggleLoginOption() { 36 | setState(() { 37 | isStudent = !isStudent; 38 | }); 39 | } 40 | 41 | @override 42 | void initState() { 43 | super.initState(); 44 | dbRef = FirebaseDatabase.instance.ref().child('Students'); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return Scaffold( 50 | appBar: AppBar( 51 | centerTitle: true, 52 | title: Text( 53 | 'BUS TRACKER', 54 | ), 55 | ), 56 | body: Center( 57 | child: Padding( 58 | padding: EdgeInsets.symmetric(horizontal: 20, vertical: 60), 59 | child: Form( 60 | key: _formfield, 61 | child: SingleChildScrollView( 62 | child: Column( 63 | crossAxisAlignment: CrossAxisAlignment.center, 64 | mainAxisAlignment: MainAxisAlignment.center, 65 | children: [ 66 | Text( 67 | isStudent ? 'LOGIN' : 'LOGIN', 68 | style: TextStyle( 69 | fontSize: 24, 70 | fontWeight: FontWeight.bold, 71 | ), 72 | ), 73 | SizedBox(height: 20), 74 | TextFormField( 75 | keyboardType: TextInputType.emailAddress, 76 | controller: emailController, 77 | decoration: InputDecoration( 78 | labelText: "Email", 79 | border: OutlineInputBorder(), 80 | prefixIcon: Icon(Icons.email), 81 | ), 82 | validator: (value) { 83 | bool emailValid = RegExp( 84 | r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-z0-9]+\.[a-zA-Z]+") 85 | .hasMatch(value!); 86 | 87 | if (value.isEmpty) { 88 | return "Enter Email"; 89 | } else if (!emailValid) { 90 | return "Enter valid Email"; 91 | } 92 | }, 93 | ), 94 | SizedBox(height: 10), 95 | TextFormField( 96 | keyboardType: TextInputType.emailAddress, 97 | controller: passController, 98 | obscureText: passToggle, 99 | decoration: InputDecoration( 100 | labelText: "Password", 101 | border: OutlineInputBorder(), 102 | prefixIcon: Icon(Icons.lock), 103 | suffixIcon: InkWell( 104 | onTap: () { 105 | setState(() { 106 | passToggle = !passToggle; 107 | }); 108 | }, 109 | child: Icon(passToggle 110 | ? Icons.visibility_off 111 | : Icons.visibility)), 112 | ), 113 | validator: (value) { 114 | if (value!.isEmpty) { 115 | return 'Enter Password'; 116 | } else if (passController.text.length < 9) { 117 | return "Password length should be more than 9 characters"; 118 | } 119 | }, 120 | ), 121 | SizedBox(height: 20), 122 | InkWell( 123 | onTap: () { 124 | Map Students = { 125 | 'email': emailController.text, 126 | 'password': passController.text, 127 | }; 128 | 129 | dbRef.push().set(Students); 130 | 131 | FirebaseAuth.instance 132 | .signInWithEmailAndPassword( 133 | email: emailController.text, 134 | password: passController.text) 135 | .then((value) { 136 | Navigator.push( 137 | context, 138 | MaterialPageRoute(builder: (BuildContext context) { 139 | return LocationsPage(); 140 | }), 141 | ); 142 | }); 143 | }, 144 | child: Container( 145 | height: 50, 146 | decoration: BoxDecoration( 147 | color: Colors.blueAccent, 148 | borderRadius: BorderRadius.circular(5), 149 | ), 150 | child: Center( 151 | child: Text( 152 | "Login", 153 | style: TextStyle( 154 | color: Colors.white, 155 | fontSize: 20, 156 | fontWeight: FontWeight.bold, 157 | ), 158 | ), 159 | ), 160 | ), 161 | ), 162 | SizedBox(height: 10), 163 | TextButton( 164 | onPressed: () { 165 | if (isStudent) { 166 | Navigator.push( 167 | context, 168 | MaterialPageRoute(builder: (context) => DriverLoginPage()), 169 | ); 170 | } else { 171 | Navigator.push( 172 | context, 173 | MaterialPageRoute(builder: (context) => LocationsPage()), 174 | ); 175 | } 176 | }, 177 | child: Text( 178 | isStudent ? 'Log in as Driver' : 'Log in as Student', 179 | style: TextStyle(fontSize: 20), 180 | ), 181 | ), 182 | ], 183 | ))), 184 | ), 185 | ), 186 | ); 187 | } 188 | 189 | @override 190 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 191 | super.debugFillProperties(properties); 192 | properties.add(StringProperty('password', password)); 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/services/authServices.dart: -------------------------------------------------------------------------------- 1 | //import 'package:chat_app/helper/helper_function.dart'; 2 | import 'package:bus_tracking_system/services/databaseServices.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class AuthService { 7 | final FirebaseAuth firebaseAuth = FirebaseAuth.instance; 8 | 9 | //login 10 | Future loginWithUserEmailandPassword(String email, String password) async { 11 | try { 12 | User user = (await firebaseAuth.signInWithEmailAndPassword( 13 | //firebase class=User 14 | //signinwithemailandpass 15 | email: email, 16 | password: password)) 17 | .user!; 18 | 19 | if (user != null) { 20 | return true; 21 | } 22 | } on FirebaseAuthException catch (e) { 23 | return e.message; 24 | } 25 | } 26 | 27 | //register 28 | Future registerUserWithEmailandPassword( 29 | String fullName, String email, String password) async { 30 | try { 31 | User user = (await firebaseAuth.createUserWithEmailAndPassword( 32 | email: email, password: password)) 33 | .user!; 34 | 35 | if (user != null) { 36 | await DatabaseService(uid: user.uid).savingUserData(fullName, email); 37 | return true; 38 | } 39 | } on FirebaseAuthException catch (e) { 40 | return e.message; 41 | } 42 | } 43 | 44 | //sign out 45 | /*Future signOut() async { 46 | try { 47 | await HelperFunctions.savedUserLoggedInStatus(false);//helperfunction is a file with shared preference 48 | await HelperFunctions.savedUserEmailSF(""); 49 | await HelperFunctions.savedUserNameSF(""); 50 | await firebaseAuth.signOut(); 51 | } catch (e) { 52 | return null; 53 | } 54 | }*/ 55 | } 56 | -------------------------------------------------------------------------------- /src/bus_tracking_system/lib/services/databaseServices.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | 3 | class DatabaseService { 4 | final String uid; 5 | DatabaseService({required this.uid}); 6 | 7 | final CollectionReference userCollection = 8 | FirebaseFirestore.instance.collection("users"); 9 | 10 | // saving user data 11 | Future savingUserData(String fullName, String email) async { 12 | return await userCollection.doc(uid).set({ 13 | "fullName": fullName, 14 | "email": email, 15 | "groups": [], 16 | "profilePic": "", 17 | "uid": uid, 18 | }); 19 | } 20 | 21 | // gettimg user data 22 | Future getUserData(String email) async { 23 | QuerySnapshot snapshot = 24 | await userCollection.where("email", isEqualTo: email).get(); 25 | return snapshot; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "bus_tracking_system") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.example.bus_tracking_system") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "bus_tracking_system"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "bus_tracking_system"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /src/bus_tracking_system/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import cloud_firestore 9 | import firebase_auth 10 | import firebase_core 11 | import firebase_database 12 | import flutter_local_notifications 13 | import geolocator_apple 14 | import shared_preferences_foundation 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 18 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 19 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 20 | FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin")) 21 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 22 | GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) 23 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = bus_tracking_system 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.busTrackingSystem 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/bus_tracking_system/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/bus_tracking_system/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Welcome to Firebase Hosting 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 40 | 41 | 42 |
43 |

Welcome

44 |

Firebase Hosting Setup Complete

45 |

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

46 | Open Hosting Documentation 47 |
48 |

Firebase SDK Loading…

49 | 50 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /src/bus_tracking_system/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: bus_tracking_system 2 | description: A new Flutter project. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=2.19.5 <3.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | # ui: ^0.0.1 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | cupertino_icons: ^1.0.2 39 | firebase_database: ^10.2.2 40 | #adding auth and firebase core 41 | firebase_core: ^2.13.1 42 | firebase_auth: ^4.6.2 43 | cloud_firestore: ^4.5.2 44 | shared_preferences: ^2.0.17 45 | flutter_map: ^5.0.0 46 | geolocator: ^9.0.2 47 | latlong2: ^0.9.0 48 | http: ^1.0.0 49 | app_settings: ^4.2.0 50 | flutter_local_notifications: ^14.0.0 51 | 52 | dev_dependencies: 53 | flutter_test: 54 | sdk: flutter 55 | 56 | # The "flutter_lints" package below contains a set of recommended lints to 57 | # encourage good coding practices. The lint set provided by the package is 58 | # activated in the `analysis_options.yaml` file located at the root of your 59 | # package. See that file for information about deactivating specific lint 60 | # rules and activating additional ones. 61 | flutter_lints: ^2.0.0 62 | 63 | # For information on the generic Dart part of this file, see the 64 | # following page: https://dart.dev/tools/pub/pubspec 65 | 66 | # The following section is specific to Flutter packages. 67 | flutter: 68 | 69 | # The following line ensures that the Material Icons font is 70 | # included with your application, so that you can use the icons in 71 | # the material Icons class. 72 | uses-material-design: true 73 | 74 | # To add assets to your application, add an assets section, like this: 75 | assets: 76 | - assets/images/ 77 | 78 | # An image asset can refer to one or more resolution-specific "variants", see 79 | # https://flutter.dev/assets-and-images/#resolution-aware 80 | 81 | # For details regarding adding assets from package dependencies, see 82 | # https://flutter.dev/assets-and-images/#from-packages 83 | 84 | # To add custom fonts to your application, add a fonts section here, 85 | # in this "flutter" section. Each entry in this list should have a 86 | # "family" key with the font family name, and a "fonts" key with a 87 | # list giving the asset and other descriptors for the font. For 88 | # example: 89 | # fonts: 90 | # - family: Schyler 91 | # fonts: 92 | # - asset: fonts/Schyler-Regular.ttf 93 | # - asset: fonts/Schyler-Italic.ttf 94 | # style: italic 95 | # - family: Trajan Pro 96 | # fonts: 97 | # - asset: fonts/TrajanPro.ttf 98 | # - asset: fonts/TrajanPro_Bold.ttf 99 | # weight: 700 100 | # 101 | # For details regarding fonts from package dependencies, 102 | # see https://flutter.dev/custom-fonts/#from-packages 103 | -------------------------------------------------------------------------------- /src/bus_tracking_system/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/web/favicon.png -------------------------------------------------------------------------------- /src/bus_tracking_system/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/web/icons/Icon-192.png -------------------------------------------------------------------------------- /src/bus_tracking_system/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/web/icons/Icon-512.png -------------------------------------------------------------------------------- /src/bus_tracking_system/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /src/bus_tracking_system/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /src/bus_tracking_system/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | bus_tracking_system 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/bus_tracking_system/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bus_tracking_system", 3 | "short_name": "bus_tracking_system", 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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(bus_tracking_system LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "bus_tracking_system") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void RegisterPlugins(flutter::PluginRegistry* registry) { 13 | FirebaseCorePluginCApiRegisterWithRegistrar( 14 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 15 | GeolocatorWindowsRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("GeolocatorWindows")); 17 | } 18 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | firebase_core 7 | geolocator_windows 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "bus_tracking_system" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "bus_tracking_system" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "bus_tracking_system.exe" "\0" 98 | VALUE "ProductName", "bus_tracking_system" "\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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"bus_tracking_system", 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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/src/bus_tracking_system/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /src/bus_tracking_system/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 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "resource.h" 7 | 8 | namespace { 9 | 10 | /// Window attribute that enables dark mode window decorations. 11 | /// 12 | /// Redefined in case the developer's machine has a Windows SDK older than 13 | /// version 10.0.22000.0. 14 | /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute 15 | #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE 16 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 17 | #endif 18 | 19 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 20 | 21 | /// Registry key for app theme preference. 22 | /// 23 | /// A value of 0 indicates apps should use dark mode. A non-zero or missing 24 | /// value indicates apps should use light mode. 25 | constexpr const wchar_t kGetPreferredBrightnessRegKey[] = 26 | L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; 27 | constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; 28 | 29 | // The number of Win32Window objects that currently exist. 30 | static int g_active_window_count = 0; 31 | 32 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 33 | 34 | // Scale helper to convert logical scaler values to physical using passed in 35 | // scale factor 36 | int Scale(int source, double scale_factor) { 37 | return static_cast(source * scale_factor); 38 | } 39 | 40 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 41 | // This API is only needed for PerMonitor V1 awareness mode. 42 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 43 | HMODULE user32_module = LoadLibraryA("User32.dll"); 44 | if (!user32_module) { 45 | return; 46 | } 47 | auto enable_non_client_dpi_scaling = 48 | reinterpret_cast( 49 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 50 | if (enable_non_client_dpi_scaling != nullptr) { 51 | enable_non_client_dpi_scaling(hwnd); 52 | } 53 | FreeLibrary(user32_module); 54 | } 55 | 56 | } // namespace 57 | 58 | // Manages the Win32Window's window class registration. 59 | class WindowClassRegistrar { 60 | public: 61 | ~WindowClassRegistrar() = default; 62 | 63 | // Returns the singleton registar instance. 64 | static WindowClassRegistrar* GetInstance() { 65 | if (!instance_) { 66 | instance_ = new WindowClassRegistrar(); 67 | } 68 | return instance_; 69 | } 70 | 71 | // Returns the name of the window class, registering the class if it hasn't 72 | // previously been registered. 73 | const wchar_t* GetWindowClass(); 74 | 75 | // Unregisters the window class. Should only be called if there are no 76 | // instances of the window. 77 | void UnregisterWindowClass(); 78 | 79 | private: 80 | WindowClassRegistrar() = default; 81 | 82 | static WindowClassRegistrar* instance_; 83 | 84 | bool class_registered_ = false; 85 | }; 86 | 87 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 88 | 89 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 90 | if (!class_registered_) { 91 | WNDCLASS window_class{}; 92 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 93 | window_class.lpszClassName = kWindowClassName; 94 | window_class.style = CS_HREDRAW | CS_VREDRAW; 95 | window_class.cbClsExtra = 0; 96 | window_class.cbWndExtra = 0; 97 | window_class.hInstance = GetModuleHandle(nullptr); 98 | window_class.hIcon = 99 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 100 | window_class.hbrBackground = 0; 101 | window_class.lpszMenuName = nullptr; 102 | window_class.lpfnWndProc = Win32Window::WndProc; 103 | RegisterClass(&window_class); 104 | class_registered_ = true; 105 | } 106 | return kWindowClassName; 107 | } 108 | 109 | void WindowClassRegistrar::UnregisterWindowClass() { 110 | UnregisterClass(kWindowClassName, nullptr); 111 | class_registered_ = false; 112 | } 113 | 114 | Win32Window::Win32Window() { 115 | ++g_active_window_count; 116 | } 117 | 118 | Win32Window::~Win32Window() { 119 | --g_active_window_count; 120 | Destroy(); 121 | } 122 | 123 | bool Win32Window::Create(const std::wstring& title, 124 | const Point& origin, 125 | const Size& size) { 126 | Destroy(); 127 | 128 | const wchar_t* window_class = 129 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 130 | 131 | const POINT target_point = {static_cast(origin.x), 132 | static_cast(origin.y)}; 133 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 134 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 135 | double scale_factor = dpi / 96.0; 136 | 137 | HWND window = CreateWindow( 138 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW, 139 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 140 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 141 | nullptr, nullptr, GetModuleHandle(nullptr), this); 142 | 143 | if (!window) { 144 | return false; 145 | } 146 | 147 | UpdateTheme(window); 148 | 149 | return OnCreate(); 150 | } 151 | 152 | bool Win32Window::Show() { 153 | return ShowWindow(window_handle_, SW_SHOWNORMAL); 154 | } 155 | 156 | // static 157 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 158 | UINT const message, 159 | WPARAM const wparam, 160 | LPARAM const lparam) noexcept { 161 | if (message == WM_NCCREATE) { 162 | auto window_struct = reinterpret_cast(lparam); 163 | SetWindowLongPtr(window, GWLP_USERDATA, 164 | reinterpret_cast(window_struct->lpCreateParams)); 165 | 166 | auto that = static_cast(window_struct->lpCreateParams); 167 | EnableFullDpiSupportIfAvailable(window); 168 | that->window_handle_ = window; 169 | } else if (Win32Window* that = GetThisFromHandle(window)) { 170 | return that->MessageHandler(window, message, wparam, lparam); 171 | } 172 | 173 | return DefWindowProc(window, message, wparam, lparam); 174 | } 175 | 176 | LRESULT 177 | Win32Window::MessageHandler(HWND hwnd, 178 | UINT const message, 179 | WPARAM const wparam, 180 | LPARAM const lparam) noexcept { 181 | switch (message) { 182 | case WM_DESTROY: 183 | window_handle_ = nullptr; 184 | Destroy(); 185 | if (quit_on_close_) { 186 | PostQuitMessage(0); 187 | } 188 | return 0; 189 | 190 | case WM_DPICHANGED: { 191 | auto newRectSize = reinterpret_cast(lparam); 192 | LONG newWidth = newRectSize->right - newRectSize->left; 193 | LONG newHeight = newRectSize->bottom - newRectSize->top; 194 | 195 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 196 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 197 | 198 | return 0; 199 | } 200 | case WM_SIZE: { 201 | RECT rect = GetClientArea(); 202 | if (child_content_ != nullptr) { 203 | // Size and position the child window. 204 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 205 | rect.bottom - rect.top, TRUE); 206 | } 207 | return 0; 208 | } 209 | 210 | case WM_ACTIVATE: 211 | if (child_content_ != nullptr) { 212 | SetFocus(child_content_); 213 | } 214 | return 0; 215 | 216 | case WM_DWMCOLORIZATIONCOLORCHANGED: 217 | UpdateTheme(hwnd); 218 | return 0; 219 | } 220 | 221 | return DefWindowProc(window_handle_, message, wparam, lparam); 222 | } 223 | 224 | void Win32Window::Destroy() { 225 | OnDestroy(); 226 | 227 | if (window_handle_) { 228 | DestroyWindow(window_handle_); 229 | window_handle_ = nullptr; 230 | } 231 | if (g_active_window_count == 0) { 232 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 233 | } 234 | } 235 | 236 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 237 | return reinterpret_cast( 238 | GetWindowLongPtr(window, GWLP_USERDATA)); 239 | } 240 | 241 | void Win32Window::SetChildContent(HWND content) { 242 | child_content_ = content; 243 | SetParent(content, window_handle_); 244 | RECT frame = GetClientArea(); 245 | 246 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 247 | frame.bottom - frame.top, true); 248 | 249 | SetFocus(child_content_); 250 | } 251 | 252 | RECT Win32Window::GetClientArea() { 253 | RECT frame; 254 | GetClientRect(window_handle_, &frame); 255 | return frame; 256 | } 257 | 258 | HWND Win32Window::GetHandle() { 259 | return window_handle_; 260 | } 261 | 262 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 263 | quit_on_close_ = quit_on_close; 264 | } 265 | 266 | bool Win32Window::OnCreate() { 267 | // No-op; provided for subclasses. 268 | return true; 269 | } 270 | 271 | void Win32Window::OnDestroy() { 272 | // No-op; provided for subclasses. 273 | } 274 | 275 | void Win32Window::UpdateTheme(HWND const window) { 276 | DWORD light_mode; 277 | DWORD light_mode_size = sizeof(light_mode); 278 | LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, 279 | kGetPreferredBrightnessRegValue, 280 | RRF_RT_REG_DWORD, nullptr, &light_mode, 281 | &light_mode_size); 282 | 283 | if (result == ERROR_SUCCESS) { 284 | BOOL enable_dark_mode = light_mode == 0; 285 | DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, 286 | &enable_dark_mode, sizeof(enable_dark_mode)); 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /src/bus_tracking_system/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responsponds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | -------------------------------------------------------------------------------- /terraform-workspace/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/google-beta" { 5 | version = "4.72.1" 6 | constraints = "~> 4.0" 7 | hashes = [ 8 | "h1:AecDucmio/FnjamReWlyJgD2NzdYnZAbR0YvxtmBRzM=", 9 | "zh:1b76513478499b6be65305e79dc0c365aa462fe903e872a0079baf6570e2b249", 10 | "zh:35e69a18abd29f3734db00880f3928b885b0c6911d0beb0ade9e72d163bc0063", 11 | "zh:38fc8da473c1d948fee5a402935041d2a3b29ae6bd19a0ca54c58c0d32dbe1f7", 12 | "zh:3ed48b3d5f0a994db7d3b5ba6cbd3039170b7a8349d6fbee0d2d003c7fc2ff1e", 13 | "zh:456ae1fdb87655e176fe049169a69c715b29cb06980e0723767543dbc3db99e0", 14 | "zh:6fbe27ec4ce6d14ffce089d0e29a122a7228552b38a021e1c1755ae4d2a52527", 15 | "zh:7d83b4c1da7238692976f9a845c2bf3967597c9beb28571579a72b8b188dd3b7", 16 | "zh:b6de671776b17cb565581700bf31c4903b4e95189dca20b0342b596457c80a59", 17 | "zh:c3dc171877e29ad0a5dab980d019dd3f8b1b8e4ef455e2631b80608625f14138", 18 | "zh:da2b74594198e407af9ff023b1e82ab064d3347a0660d7b22a2389e62fbc8f17", 19 | "zh:f523d5a5ad712b00dc5dc287c6100da27357496bef8aa547f1f148c2a3cbe5af", 20 | "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /terraform-workspace/.terraform/providers/registry.terraform.io/hashicorp/google-beta/4.72.1/windows_386/terraform-provider-google-beta_v4.72.1_x5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upes-open/Bus-Tracking-system/f58d8228cccbba735eb90d145bdff12b2bff9937/terraform-workspace/.terraform/providers/registry.terraform.io/hashicorp/google-beta/4.72.1/windows_386/terraform-provider-google-beta_v4.72.1_x5.exe -------------------------------------------------------------------------------- /terraform-workspace/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | google-beta = { 4 | source = "hashicorp/google-beta" 5 | version = "~> 4.0" 6 | } 7 | } 8 | } 9 | 10 | # Configures the provider to not use the resource block's specified project for quota checks. 11 | # This provider should only be used during project creation and initializing services. 12 | provider "google-beta" { 13 | alias = "no_user_project_override" 14 | user_project_override = false 15 | } 16 | 17 | 18 | resource "google_project" "default" { 19 | provider = google-beta.no_user_project_override 20 | 21 | name = "Project Display Name" 22 | project_id = "bustrackingapplication9876" 23 | 24 | labels = { 25 | "firebase" = "enabled" 26 | } 27 | } 28 | 29 | 30 | # Enables required APIs. 31 | resource "google_project_service" "default" { 32 | provider = google-beta.no_user_project_override 33 | project = google_project.default.project_id 34 | for_each = toset([ 35 | "cloudbilling.googleapis.com", 36 | "cloudresourcemanager.googleapis.com", 37 | "firebase.googleapis.com", 38 | "serviceusage.googleapis.com", 39 | ]) 40 | service = each.key 41 | 42 | # Don't disable the service if the resource block is removed by accident. 43 | disable_on_destroy = false 44 | } 45 | 46 | # Enables Firebase services for the new project created above. 47 | resource "google_firebase_project" "default" { 48 | provider = google-beta 49 | project = google_project.default.project_id 50 | 51 | # Waits for the required APIs to be enabled. 52 | depends_on = [ 53 | google_project_service.default 54 | ] 55 | } 56 | 57 | # Creates a Firebase Android App in the new project created above. 58 | resource "google_firebase_android_app" "default" { 59 | provider = google-beta 60 | 61 | project = google_project.default.project_id 62 | display_name = "My Awesome Android app" 63 | package_name = "awesome.package.name" 64 | 65 | # Wait for Firebase to be enabled in the Google Cloud project before creating this App. 66 | depends_on = [ 67 | google_firebase_project.default, 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /terraform-workspace/terraform.tfstate: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "1.5.2", 4 | "serial": 9, 5 | "lineage": "c81755f6-7e6d-abc1-1364-1c6f5af9a13d", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "google_firebase_android_app", 11 | "name": "default", 12 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"]", 13 | "instances": [ 14 | { 15 | "schema_version": 0, 16 | "attributes": { 17 | "app_id": "1:656663048854:android:525eea347777179352c8b7", 18 | "deletion_policy": "DELETE", 19 | "display_name": "My Awesome Android app", 20 | "etag": "1_232313a8-89eb-4fc3-878d-244b23f425f3", 21 | "id": "projects/bustrackingapplication9876/androidApps/1:656663048854:android:525eea347777179352c8b7", 22 | "name": "projects/bustrackingapplication9876/androidApps/1:656663048854:android:525eea347777179352c8b7", 23 | "package_name": "awesome.package.name", 24 | "project": "bustrackingapplication9876", 25 | "sha1_hashes": null, 26 | "sha256_hashes": null, 27 | "timeouts": null 28 | }, 29 | "sensitive_attributes": [], 30 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", 31 | "dependencies": [ 32 | "google_firebase_project.default", 33 | "google_project.default", 34 | "google_project_service.default" 35 | ] 36 | } 37 | ] 38 | }, 39 | { 40 | "mode": "managed", 41 | "type": "google_firebase_project", 42 | "name": "default", 43 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"]", 44 | "instances": [ 45 | { 46 | "schema_version": 0, 47 | "attributes": { 48 | "display_name": "Project Display Name", 49 | "id": "projects/bustrackingapplication9876", 50 | "project": "bustrackingapplication9876", 51 | "project_number": "656663048854", 52 | "timeouts": null 53 | }, 54 | "sensitive_attributes": [], 55 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDB9fQ==", 56 | "dependencies": [ 57 | "google_project.default", 58 | "google_project_service.default" 59 | ] 60 | } 61 | ] 62 | }, 63 | { 64 | "mode": "managed", 65 | "type": "google_project", 66 | "name": "default", 67 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"].no_user_project_override", 68 | "instances": [ 69 | { 70 | "schema_version": 1, 71 | "attributes": { 72 | "auto_create_network": true, 73 | "billing_account": null, 74 | "folder_id": null, 75 | "id": "projects/bustrackingapplication9876", 76 | "labels": { 77 | "firebase": "enabled" 78 | }, 79 | "name": "Project Display Name", 80 | "number": "656663048854", 81 | "org_id": null, 82 | "project_id": "bustrackingapplication9876", 83 | "skip_delete": null, 84 | "timeouts": null 85 | }, 86 | "sensitive_attributes": [], 87 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDAsInVwZGF0ZSI6NjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=" 88 | } 89 | ] 90 | }, 91 | { 92 | "mode": "managed", 93 | "type": "google_project_service", 94 | "name": "default", 95 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"].no_user_project_override", 96 | "instances": [ 97 | { 98 | "index_key": "cloudbilling.googleapis.com", 99 | "schema_version": 0, 100 | "attributes": { 101 | "disable_dependent_services": null, 102 | "disable_on_destroy": false, 103 | "id": "bustrackingapplication9876/cloudbilling.googleapis.com", 104 | "project": "bustrackingapplication9876", 105 | "service": "cloudbilling.googleapis.com", 106 | "timeouts": null 107 | }, 108 | "sensitive_attributes": [], 109 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=", 110 | "dependencies": [ 111 | "google_project.default" 112 | ] 113 | }, 114 | { 115 | "index_key": "cloudresourcemanager.googleapis.com", 116 | "schema_version": 0, 117 | "attributes": { 118 | "disable_dependent_services": null, 119 | "disable_on_destroy": false, 120 | "id": "bustrackingapplication9876/cloudresourcemanager.googleapis.com", 121 | "project": "bustrackingapplication9876", 122 | "service": "cloudresourcemanager.googleapis.com", 123 | "timeouts": null 124 | }, 125 | "sensitive_attributes": [], 126 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=", 127 | "dependencies": [ 128 | "google_project.default" 129 | ] 130 | }, 131 | { 132 | "index_key": "firebase.googleapis.com", 133 | "schema_version": 0, 134 | "attributes": { 135 | "disable_dependent_services": null, 136 | "disable_on_destroy": false, 137 | "id": "bustrackingapplication9876/firebase.googleapis.com", 138 | "project": "bustrackingapplication9876", 139 | "service": "firebase.googleapis.com", 140 | "timeouts": null 141 | }, 142 | "sensitive_attributes": [], 143 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=", 144 | "dependencies": [ 145 | "google_project.default" 146 | ] 147 | }, 148 | { 149 | "index_key": "serviceusage.googleapis.com", 150 | "schema_version": 0, 151 | "attributes": { 152 | "disable_dependent_services": null, 153 | "disable_on_destroy": false, 154 | "id": "bustrackingapplication9876/serviceusage.googleapis.com", 155 | "project": "bustrackingapplication9876", 156 | "service": "serviceusage.googleapis.com", 157 | "timeouts": null 158 | }, 159 | "sensitive_attributes": [], 160 | "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=", 161 | "dependencies": [ 162 | "google_project.default" 163 | ] 164 | } 165 | ] 166 | } 167 | ], 168 | "check_results": null 169 | } 170 | -------------------------------------------------------------------------------- /terraform-workspace/terraform.tfstate.backup: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "1.5.2", 4 | "serial": 1, 5 | "lineage": "c81755f6-7e6d-abc1-1364-1c6f5af9a13d", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "google_firebase_android_app", 11 | "name": "default", 12 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"]", 13 | "instances": [] 14 | }, 15 | { 16 | "mode": "managed", 17 | "type": "google_firebase_project", 18 | "name": "default", 19 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"]", 20 | "instances": [] 21 | }, 22 | { 23 | "mode": "managed", 24 | "type": "google_project_service", 25 | "name": "default", 26 | "provider": "provider[\"registry.terraform.io/hashicorp/google-beta\"].no_user_project_override", 27 | "instances": [] 28 | } 29 | ], 30 | "check_results": null 31 | } 32 | -------------------------------------------------------------------------------- /terraform-workspace/vars.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" { 2 | description = "bustrackingsystem-62417" 3 | type = string 4 | default = "bustrackingsystem-62417" 5 | } --------------------------------------------------------------------------------