diff --git a/deprecated/.gitignore b/deprecated/.gitignore deleted file mode 100644 index a5cf671..0000000 --- a/deprecated/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -# Flutter / Dart -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ -/coverage/ -**/doc/api/ -**/ios/Flutter/.last_build_id - -# IDE / editor -.idea/ -.vscode/ -*.iml -*.ipr -*.iws - -# OS files -.DS_Store -*.swp - -# Environment and secrets -.env -.env.* -!.env.example - -# Generated and platform artifacts -android/key.properties -android/app/debug -android/app/profile -android/app/release - -# Logs and temp files -*.log -*.tmp - -# Symbolication / obfuscation -*.symbols -*.map.json - -# Legacy migration note -legacy_windows_xp_plan.md - diff --git a/deprecated/.metadata b/deprecated/.metadata deleted file mode 100644 index 79dc3aa..0000000 --- a/deprecated/.metadata +++ /dev/null @@ -1,45 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "00b0c91f06209d9e4a41f71b7a512d6eb3b9c694" - channel: "stable" - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: android - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: ios - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: linux - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: macos - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: web - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - platform: windows - create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/deprecated/analysis_options.yaml b/deprecated/analysis_options.yaml deleted file mode 100644 index 129a305..0000000 --- a/deprecated/analysis_options.yaml +++ /dev/null @@ -1,5 +0,0 @@ -analyzer: - errors: - deprecated_member_use: ignore - use_build_context_synchronously: ignore -include: package:flutter_lints/flutter.yaml diff --git a/deprecated/android/.gitignore b/deprecated/android/.gitignore deleted file mode 100644 index be3943c..0000000 --- a/deprecated/android/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java -.cxx/ - -# Remember to never publicly share your keystore. -# See https://flutter.dev/to/reference-keystore -key.properties -**/*.keystore -**/*.jks diff --git a/deprecated/android/app/build.gradle.kts b/deprecated/android/app/build.gradle.kts deleted file mode 100644 index df7f4da..0000000 --- a/deprecated/android/app/build.gradle.kts +++ /dev/null @@ -1,44 +0,0 @@ -plugins { - id("com.android.application") - id("kotlin-android") - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id("dev.flutter.flutter-gradle-plugin") -} - -android { - namespace = "com.example.bus_terminal" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.bus_terminal" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.getByName("debug") - } - } -} - -flutter { - source = "../.." -} diff --git a/deprecated/android/app/src/debug/AndroidManifest.xml b/deprecated/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 399f698..0000000 --- a/deprecated/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/deprecated/android/app/src/main/AndroidManifest.xml b/deprecated/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index a812ae5..0000000 --- a/deprecated/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/android/app/src/main/kotlin/com/example/bus_terminal/MainActivity.kt b/deprecated/android/app/src/main/kotlin/com/example/bus_terminal/MainActivity.kt deleted file mode 100644 index f004c55..0000000 --- a/deprecated/android/app/src/main/kotlin/com/example/bus_terminal/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.bus_terminal - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity : FlutterActivity() diff --git a/deprecated/android/app/src/main/res/drawable-v21/launch_background.xml b/deprecated/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/deprecated/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/deprecated/android/app/src/main/res/drawable/launch_background.xml b/deprecated/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/deprecated/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/deprecated/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/deprecated/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/deprecated/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/deprecated/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/deprecated/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/deprecated/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/deprecated/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/deprecated/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/deprecated/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/deprecated/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/deprecated/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/deprecated/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/deprecated/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/deprecated/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/deprecated/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/deprecated/android/app/src/main/res/values-night/styles.xml b/deprecated/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be..0000000 --- a/deprecated/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/deprecated/android/app/src/main/res/values/styles.xml b/deprecated/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef88..0000000 --- a/deprecated/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/deprecated/android/app/src/profile/AndroidManifest.xml b/deprecated/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 399f698..0000000 --- a/deprecated/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/deprecated/android/build.gradle.kts b/deprecated/android/build.gradle.kts deleted file mode 100644 index dbee657..0000000 --- a/deprecated/android/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -val newBuildDir: Directory = - rootProject.layout.buildDirectory - .dir("../../build") - .get() -rootProject.layout.buildDirectory.value(newBuildDir) - -subprojects { - val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) - project.layout.buildDirectory.value(newSubprojectBuildDir) -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean") { - delete(rootProject.layout.buildDirectory) -} diff --git a/deprecated/android/gradle.properties b/deprecated/android/gradle.properties deleted file mode 100644 index fbee1d8..0000000 --- a/deprecated/android/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -android.useAndroidX=true diff --git a/deprecated/android/gradle/wrapper/gradle-wrapper.properties b/deprecated/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e4ef43f..0000000 --- a/deprecated/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/deprecated/android/settings.gradle.kts b/deprecated/android/settings.gradle.kts deleted file mode 100644 index ca7fe06..0000000 --- a/deprecated/android/settings.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -pluginManagement { - val flutterSdkPath = - run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.11.1" apply false - id("org.jetbrains.kotlin.android") version "2.2.20" apply false -} - -include(":app") diff --git a/deprecated/devtools_options.yaml b/deprecated/devtools_options.yaml deleted file mode 100644 index fa0b357..0000000 --- a/deprecated/devtools_options.yaml +++ /dev/null @@ -1,3 +0,0 @@ -description: This file stores settings for Dart & Flutter DevTools. -documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states -extensions: diff --git a/deprecated/ios/.gitignore b/deprecated/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/deprecated/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/deprecated/ios/Flutter/AppFrameworkInfo.plist b/deprecated/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 391a902..0000000 --- a/deprecated/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - diff --git a/deprecated/ios/Flutter/Debug.xcconfig b/deprecated/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/deprecated/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/deprecated/ios/Flutter/Release.xcconfig b/deprecated/ios/Flutter/Release.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/deprecated/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/deprecated/ios/Runner.xcodeproj/project.pbxproj b/deprecated/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5d66d34..0000000 --- a/deprecated/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,620 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/deprecated/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/deprecated/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/deprecated/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/deprecated/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index e3773d4..0000000 --- a/deprecated/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/ios/Runner.xcworkspace/contents.xcworkspacedata b/deprecated/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a1..0000000 --- a/deprecated/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/deprecated/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/deprecated/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/deprecated/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/deprecated/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/deprecated/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/deprecated/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/deprecated/ios/Runner/AppDelegate.swift b/deprecated/ios/Runner/AppDelegate.swift deleted file mode 100644 index c30b367..0000000 --- a/deprecated/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,16 +0,0 @@ -import Flutter -import UIKit - -@main -@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } - - func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { - GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) - } -} diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 7353c41..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 797d452..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index 6ed2d93..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cd7b00..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index fe73094..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index 321773c..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 797d452..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index 502f463..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index 0ec3034..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index 0ec3034..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index e9f5fea..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index 84ac32a..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 8953cba..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 0467bf1..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/deprecated/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -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. \ No newline at end of file diff --git a/deprecated/ios/Runner/Base.lproj/LaunchScreen.storyboard b/deprecated/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/deprecated/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/ios/Runner/Base.lproj/Main.storyboard b/deprecated/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/deprecated/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/ios/Runner/Info.plist b/deprecated/ios/Runner/Info.plist deleted file mode 100644 index 38dcd24..0000000 --- a/deprecated/ios/Runner/Info.plist +++ /dev/null @@ -1,74 +0,0 @@ - - - - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Bus Terminal - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - bus_terminal - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneClassName - UIWindowScene - UISceneConfigurationName - flutter - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSLocationWhenInUseUsageDescription - We need your location to show the bus route on the map and navigate you through your scheduled stops. - NSLocationAlwaysAndWhenInUseUsageDescription - We need your location to show the bus route on the map and navigate you through your scheduled stops. - - diff --git a/deprecated/ios/Runner/Runner-Bridging-Header.h b/deprecated/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a5..0000000 --- a/deprecated/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/deprecated/ios/Runner/SceneDelegate.swift b/deprecated/ios/Runner/SceneDelegate.swift deleted file mode 100644 index b9ce8ea..0000000 --- a/deprecated/ios/Runner/SceneDelegate.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Flutter -import UIKit - -class SceneDelegate: FlutterSceneDelegate { - -} diff --git a/deprecated/ios/RunnerTests/RunnerTests.swift b/deprecated/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index 86a7c3b..0000000 --- a/deprecated/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Flutter -import UIKit -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/deprecated/lib/main.dart b/deprecated/lib/main.dart deleted file mode 100644 index af82419..0000000 --- a/deprecated/lib/main.dart +++ /dev/null @@ -1,94 +0,0 @@ -import 'dart:async'; -import 'dart:ui'; - -import 'package:flutter/material.dart'; -import 'screens/login_screen.dart'; -import 'screens/schedule_overview_screen.dart'; -import 'services/auth_service.dart'; -import 'theme/app_theme.dart'; -import 'services/app_navigator.dart'; -import 'services/error_log_service.dart'; - -void main() { - WidgetsFlutterBinding.ensureInitialized(); - - FlutterError.onError = (details) { - FlutterError.presentError(details); - void report() => ErrorLogService.report( - service: 'deprecated', - partOfService: 'FlutterError.onError', - error: details.exceptionAsString(), - ); - // ignore: unawaited_futures - report(); - }; - - PlatformDispatcher.instance.onError = (error, stack) { - // ignore: unawaited_futures - ErrorLogService.report( - service: 'deprecated', - partOfService: 'PlatformDispatcher.onError', - error: '$error\n$stack', - ); - return true; - }; - - runZonedGuarded( - () { - runApp(const MainApp()); - }, - (error, stack) { - // ignore: unawaited_futures - ErrorLogService.report( - service: 'deprecated', - partOfService: 'runZonedGuarded', - error: '$error\n$stack', - ); - }, - ); -} - -class MainApp extends StatelessWidget { - const MainApp({super.key}); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Bus Terminal', - navigatorKey: navigatorKey, - scaffoldMessengerKey: messengerKey, - theme: AppTheme.lightTheme(), - darkTheme: AppTheme.darkTheme(), - themeMode: ThemeMode.system, - routes: { - '/login': (context) => const LoginScreen(), - '/schedule': (context) => const ScheduleOverviewScreen(), - }, - home: const _InitialRoute(), - ); - } -} - -/// Initial route checks if user is logged in -class _InitialRoute extends StatelessWidget { - const _InitialRoute(); - - @override - Widget build(BuildContext context) { - return FutureBuilder( - future: AuthService().isLoggedIn(), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Scaffold( - body: Center(child: CircularProgressIndicator()), - ); - } - - // If logged in, go to schedule; otherwise go to login - return snapshot.data == true - ? const ScheduleOverviewScreen() - : const LoginScreen(); - }, - ); - } -} diff --git a/deprecated/lib/models/.gitkeep b/deprecated/lib/models/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated/lib/models/navigation.dart b/deprecated/lib/models/navigation.dart deleted file mode 100644 index d0ae054..0000000 --- a/deprecated/lib/models/navigation.dart +++ /dev/null @@ -1,211 +0,0 @@ -import 'package:latlong2/latlong.dart'; - -/// Navigation route point -class NavigationPoint { - final double latitude; - final double longitude; - final String? name; - - NavigationPoint({ - required this.latitude, - required this.longitude, - this.name, - }); - - LatLng toLatLng() => LatLng(latitude, longitude); - - factory NavigationPoint.fromLatLng(LatLng latlng, {String? name}) { - return NavigationPoint( - latitude: latlng.latitude, - longitude: latlng.longitude, - name: name, - ); - } - - Map toJson() { - return { - 'latitude': latitude, - 'longitude': longitude, - 'name': name, - }; - } - - factory NavigationPoint.fromJson(Map json) { - return NavigationPoint( - latitude: json['latitude'] as double, - longitude: json['longitude'] as double, - name: json['name'] as String?, - ); - } -} - -/// Route leg with distance and duration -class RouteLeg { - final List points; - final double distance; // in meters - final int duration; // in seconds - final String summary; - - RouteLeg({ - required this.points, - required this.distance, - required this.duration, - required this.summary, - }); - - String getDistanceKm() => (distance / 1000).toStringAsFixed(1); - String getDurationMinutes() => (duration ~/ 60).toString(); - - factory RouteLeg.fromCoordinates( - List coordinates, { - double distance = 0.0, - int duration = 0, - String summary = 'Route', - }) { - return RouteLeg( - points: coordinates - .map((coord) { - if (coord is List && coord.length >= 2) { - return NavigationPoint( - latitude: (coord[1] as num).toDouble(), - longitude: (coord[0] as num).toDouble(), - ); - } - return null; - }) - .whereType() - .toList(), - distance: distance, - duration: duration, - summary: summary, - ); - } - - factory RouteLeg.fromPoints({ - required List points, - required double distance, - required int duration, - String summary = 'Route', - }) { - return RouteLeg( - points: points, - distance: distance, - duration: duration, - summary: summary, - ); - } - - factory RouteLeg.fromJson(Map json) { - final geometry = json['geometry'] as Map?; - final coordinates = geometry?['coordinates'] as List? ?? []; - - return RouteLeg( - points: coordinates - .map((coord) { - if (coord is List && coord.length >= 2) { - return NavigationPoint( - latitude: (coord[1] as num).toDouble(), - longitude: (coord[0] as num).toDouble(), - ); - } - return null; - }) - .whereType() - .toList(), - distance: (json['distance'] as num?)?.toDouble() ?? 0.0, - duration: (json['duration'] as num?)?.toInt() ?? 0, - summary: (json['summary'] as String?) ?? 'Route', - ); - } -} - -/// Complete navigation route from start to end -class NavigationRoute { - final NavigationPoint start; - final NavigationPoint end; - final List legs; - final double totalDistance; // in meters - final int totalDuration; // in seconds - - NavigationRoute({ - required this.start, - required this.end, - required this.legs, - required this.totalDistance, - required this.totalDuration, - }); - - String getTotalDistanceKm() => (totalDistance / 1000).toStringAsFixed(1); - String getTotalDurationMinutes() => (totalDuration ~/ 60).toString(); - String getTotalDurationHM() { - final hours = totalDuration ~/ 3600; - final minutes = (totalDuration % 3600) ~/ 60; - if (hours > 0) { - return '${hours}h ${minutes}m'; - } - return '${minutes}m'; - } - - List getAllPoints() { - final allPoints = []; - for (final leg in legs) { - allPoints.addAll(leg.points); - } - return allPoints; - } - - factory NavigationRoute.fromJson(Map json) { - final routes = json['routes'] as List?; - if (routes == null || routes.isEmpty) { - throw Exception('No route found in response'); - } - - final routeData = routes[0] as Map?; - if (routeData == null) { - throw Exception('Invalid route data'); - } - - return NavigationRoute.fromOsrmRouteData( - routeData, - start: NavigationPoint(latitude: 0, longitude: 0), - end: NavigationPoint(latitude: 0, longitude: 0), - ); - } - - factory NavigationRoute.fromOsrmRouteData( - Map routeData, { - required NavigationPoint start, - required NavigationPoint end, - }) { - final geometry = routeData['geometry'] as Map?; - final coordinates = geometry?['coordinates'] as List? ?? []; - final distance = (routeData['distance'] as num?)?.toDouble() ?? 0.0; - final duration = (routeData['duration'] as num?)?.toInt() ?? 0; - - final leg = RouteLeg.fromCoordinates( - coordinates, - distance: distance, - duration: duration, - summary: (routeData['summary'] as String?) ?? 'Route', - ); - - return NavigationRoute( - start: start, - end: end, - legs: [leg], - totalDistance: distance, - totalDuration: duration, - ); - } -} - -/// Result of an optimized trip calculation with reordered stops. -class OptimizedRouteResult { - final NavigationRoute route; - final List orderedStops; - - OptimizedRouteResult({ - required this.route, - required this.orderedStops, - }); -} diff --git a/deprecated/lib/models/schedule.dart b/deprecated/lib/models/schedule.dart deleted file mode 100644 index 766c200..0000000 --- a/deprecated/lib/models/schedule.dart +++ /dev/null @@ -1,222 +0,0 @@ -import 'dart:convert'; - -/// Bus Line model -class BusLine { - final int id; - final int lineNumber; - final String startStop; - final String endStop; - final int estimatedDuration; // in minutes - final String? description; - - BusLine({ - required this.id, - required this.lineNumber, - required this.startStop, - required this.endStop, - required this.estimatedDuration, - this.description, - }); - - factory BusLine.fromJson(Map json) { - return BusLine( - id: json['id'] as int, - lineNumber: json['lineNumber'] as int, - startStop: json['startStop'] as String, - endStop: json['endStop'] as String, - estimatedDuration: json['estimatedDuration'] as int, - description: json['description'] as String?, - ); - } - - Map toJson() { - return { - 'id': id, - 'lineNumber': lineNumber, - 'startStop': startStop, - 'endStop': endStop, - 'estimatedDuration': estimatedDuration, - 'description': description, - }; - } -} - -/// Bus type model -class BusType { - final int id; - final String name; - final int seatCapacity; - final String licensePlate; - - BusType({ - required this.id, - required this.name, - required this.seatCapacity, - required this.licensePlate, - }); - - factory BusType.fromJson(Map json) { - return BusType( - id: json['id'] as int, - name: json['name'] as String, - seatCapacity: json['seatCapacity'] as int, - licensePlate: json['licensePlate'] as String, - ); - } - - Map toJson() { - return { - 'id': id, - 'name': name, - 'seatCapacity': seatCapacity, - 'licensePlate': licensePlate, - }; - } -} - -/// Route model for daily schedule -class Route { - final int id; - final BusLine busLine; - final BusType busType; - final DateTime startTime; - final DateTime? endTime; - final String status; // scheduled, in_progress, completed, cancelled - - Route({ - required this.id, - required this.busLine, - required this.busType, - required this.startTime, - this.endTime, - required this.status, - }); - - factory Route.fromJson(Map json) { - return Route( - id: json['id'] as int, - busLine: BusLine.fromJson(json['busLine'] as Map), - busType: BusType.fromJson(json['busType'] as Map), - startTime: DateTime.parse(json['startTime'] as String), - endTime: - json['endTime'] != null ? DateTime.parse(json['endTime'] as String) : null, - status: json['status'] as String, - ); - } - - Map toJson() { - return { - 'id': id, - 'busLine': busLine.toJson(), - 'busType': busType.toJson(), - 'startTime': startTime.toIso8601String(), - 'endTime': endTime?.toIso8601String(), - 'status': status, - }; - } -} - -/// Daily schedule model -class DailySchedule { - final List routes; - final DateTime date; - - DailySchedule({ - required this.routes, - required this.date, - }); - - factory DailySchedule.fromJson(Map json) { - return DailySchedule( - routes: (json['routes'] as List) - .map((r) => Route.fromJson(r as Map)) - .toList(), - date: DateTime.parse(json['date'] as String), - ); - } - - Map toJson() { - return { - 'routes': routes.map((r) => r.toJson()).toList(), - 'date': date.toIso8601String(), - }; - } -} - -/// Stop model for the new schedule system. -class ScheduleStop { - final int id; - final int order; - final String name; - final double latitude; - final double longitude; - final int estimatedArrivalMinutes; - - ScheduleStop({ - required this.id, - required this.order, - required this.name, - required this.latitude, - required this.longitude, - required this.estimatedArrivalMinutes, - }); - - factory ScheduleStop.fromJson(Map json) { - return ScheduleStop( - id: (json['id'] as num).toInt(), - order: (json['order'] as num).toInt(), - name: (json['name'] ?? json['stopName'] ?? '') as String, - latitude: (json['latitude'] as num).toDouble(), - longitude: (json['longitude'] as num).toDouble(), - estimatedArrivalMinutes: (json['estimatedArrivalMinutes'] as num?)?.toInt() ?? 0, - ); - } -} - -/// Schedule model for the new public schedule API. -class ServiceSchedule { - final int id; - final int busLineId; - final int busId; - final DateTime startTime; - final DateTime endTime; - final String status; - final int lineNumber; - final String busName; - final List weekdays; - - ServiceSchedule({ - required this.id, - required this.busLineId, - required this.busId, - required this.startTime, - required this.endTime, - required this.status, - required this.lineNumber, - required this.busName, - required this.weekdays, - }); - - factory ServiceSchedule.fromJson(Map json) { - final rawWeekdays = json['weekdays']; - final weekdays = rawWeekdays is List - ? rawWeekdays.map((day) => (day as num).toInt()).toList() - : rawWeekdays is String - ? (jsonDecode(rawWeekdays) as List).map((day) => (day as num).toInt()).toList() - : []; - - return ServiceSchedule( - id: (json['id'] as num).toInt(), - busLineId: (json['busLineId'] as num).toInt(), - busId: (json['busId'] as num).toInt(), - startTime: DateTime.parse(json['startTime'] as String), - endTime: DateTime.parse(json['endTime'] as String), - status: (json['status'] ?? 'planned') as String, - lineNumber: (json['lineNumber'] as num).toInt(), - busName: (json['busName'] ?? '') as String, - weekdays: weekdays, - ); - } - - bool get isRecurring => weekdays.isNotEmpty; -} diff --git a/deprecated/lib/models/user.dart b/deprecated/lib/models/user.dart deleted file mode 100644 index 1de7a49..0000000 --- a/deprecated/lib/models/user.dart +++ /dev/null @@ -1,85 +0,0 @@ -/// User model -class User { - final int id; - final int userCode; - final String? job; - - User({ - required this.id, - required this.userCode, - this.job, - }); - - factory User.fromJson(Map json) { - // userCode may be provided as 'userCode' or 'usercode' and may be int or string - final dynamic rawUserCode = json['userCode'] ?? json['usercode'] ?? json['user_code']; - int parsedUserCode; - if (rawUserCode is int) { - parsedUserCode = rawUserCode; - } else if (rawUserCode is String) { - parsedUserCode = int.tryParse(rawUserCode) ?? (throw FormatException('Invalid userCode')); - } else { - // If the backend doesn't return a userCode, treat as unknown (-1) - parsedUserCode = -1; - } - - return User( - id: json['id'] as int, - userCode: parsedUserCode, - job: json['job'] as String?, - ); - } - - Map toJson() { - return { - 'id': id, - 'userCode': userCode, - 'job': job, - }; - } -} - -/// Login response model -class AuthResponse { - final String token; - final User? user; - - AuthResponse({ - required this.token, - this.user, - }); - - factory AuthResponse.fromJson(Map json) { - final dynamic rawToken = json['token'] ?? json['Token'] ?? json['authToken']; - final token = rawToken?.toString(); - if (token == null || token.isEmpty) throw FormatException('Missing token in auth response'); - - // Determine if a user object exists and appears valid - Map? userMap; - if (json.containsKey('user') && json['user'] is Map) { - userMap = json['user'] as Map; - } else { - // maybe user fields are top-level (id, userCode, job) - final hasUserFields = json.containsKey('id') || json.containsKey('userCode') || json.containsKey('usercode') || json.containsKey('user_code'); - if (hasUserFields) { - // treat whole json as user map - userMap = json.cast(); - } - } - - User? parsedUser; - if (userMap != null) { - try { - parsedUser = User.fromJson(userMap); - } catch (e) { - // If parsing user fails, ignore user but keep token - parsedUser = null; - } - } - - return AuthResponse( - token: token, - user: parsedUser, - ); - } -} diff --git a/deprecated/lib/screens/.gitkeep b/deprecated/lib/screens/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated/lib/screens/daily_schedule_screen.dart b/deprecated/lib/screens/daily_schedule_screen.dart deleted file mode 100644 index 4eb253d..0000000 --- a/deprecated/lib/screens/daily_schedule_screen.dart +++ /dev/null @@ -1,371 +0,0 @@ -import 'package:flutter/material.dart'; -import '../models/schedule.dart' as schedule; -import '../services/schedule_service.dart'; -import '../services/auth_service.dart'; -import '../services/exceptions.dart'; -import '../widgets/route_card.dart'; - -class DailyScheduleScreen extends StatefulWidget { - const DailyScheduleScreen({super.key}); - - @override - State createState() => _DailyScheduleScreenState(); -} - -class _DailyScheduleScreenState extends State { - final _scheduleService = ScheduleService(); - final _authService = AuthService(); - late Future _scheduleFuture; - DateTime _selectedDate = DateTime.now(); - - @override - void initState() { - super.initState(); - _scheduleFuture = _scheduleService.getTodaySchedule(); - } - - Future _handleLogout() async { - await _authService.logout(); - if (mounted) { - Navigator.of(context).pushReplacementNamed('/login'); - } - } - - Future _refreshSchedule() async { - setState(() { - _scheduleFuture = _scheduleService.getDailySchedule(_selectedDate); - }); - } - - Future _selectDate() async { - final colorScheme = Theme.of(context).colorScheme; - final picked = await showDatePicker( - context: context, - initialDate: _selectedDate, - firstDate: DateTime.now().subtract(const Duration(days: 7)), - lastDate: DateTime.now().add(const Duration(days: 30)), - builder: (context, child) { - return Theme( - data: Theme.of(context).copyWith( - dialogBackgroundColor: colorScheme.surface, - ), - child: child!, - ); - }, - ); - - if (picked != null && picked != _selectedDate) { - setState(() { - _selectedDate = picked; - }); - _refreshSchedule(); - } - } - - // Group routes by hour for better visual organization - Map> _groupByHour(List routes) { - final grouped = >{}; - for (final route in routes) { - final hour = route.startTime.hour; - grouped.putIfAbsent(hour, () => []).add(route); - } - return grouped; - } - - void _moveDay(int deltaDays) { - setState(() { - _selectedDate = _selectedDate.add(Duration(days: deltaDays)); - _scheduleFuture = _scheduleService.getDailySchedule(_selectedDate); - }); - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - final dateStr = - '${_selectedDate.year}-${_selectedDate.month.toString().padLeft(2, '0')}-${_selectedDate.day.toString().padLeft(2, '0')}'; - final today = DateTime.now(); - final isToday = DateTime(_selectedDate.year, _selectedDate.month, _selectedDate.day) == - DateTime(today.year, today.month, today.day); - - return Scaffold( - appBar: AppBar( - title: const Text('Today on the Road'), - elevation: 0, - actions: [ - IconButton( - icon: const Icon(Icons.logout), - tooltip: 'Logout', - onPressed: _handleLogout, - ), - ], - ), - body: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: Theme.of(context).brightness == Brightness.dark - ? const [Color(0xFF0B1220), Color(0xFF111827)] - : const [Color(0xFFF1F5F9), Color(0xFFE2E8F0)], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - ), - ), - child: Column( - children: [ - Container( - margin: const EdgeInsets.fromLTRB(16, 16, 16, 12), - padding: const EdgeInsets.all(18), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [Color(0xFF0F172A), Color(0xFF1D4ED8)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(24), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.16), - blurRadius: 22, - offset: const Offset(0, 10), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - isToday ? 'Vandaag' : 'Geplande datum', - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Colors.white.withOpacity(0.78), - ), - ), - const SizedBox(height: 6), - Text( - dateStr, - style: Theme.of(context).textTheme.headlineMedium?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 6), - Text( - 'Routes, stops en status in één overzicht', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Colors.white.withOpacity(0.84), - ), - ), - const SizedBox(height: 14), - Align( - alignment: Alignment.centerRight, - child: Wrap( - spacing: 8, - runSpacing: 8, - alignment: WrapAlignment.end, - children: [ - SizedBox( - height: 48, - child: OutlinedButton.icon( - onPressed: () => _moveDay(-1), - icon: const Icon(Icons.chevron_left, size: 18), - label: const Text('Vorige dag'), - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide(color: Colors.white.withOpacity(0.28)), - padding: const EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - SizedBox( - height: 48, - child: OutlinedButton.icon( - onPressed: _selectDate, - icon: const Icon(Icons.calendar_today, size: 18), - label: const Text('Kies datum'), - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide(color: Colors.white.withOpacity(0.28)), - padding: const EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - SizedBox( - height: 48, - child: OutlinedButton.icon( - onPressed: () => _moveDay(1), - icon: const Icon(Icons.chevron_right, size: 18), - label: const Text('Volgende dag'), - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide(color: Colors.white.withOpacity(0.28)), - padding: const EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - child: FutureBuilder( - future: _scheduleFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - - if (snapshot.hasError) { - // Auto-logout on session expiry - if (snapshot.error is UnauthorizedException) { - WidgetsBinding.instance.addPostFrameCallback((_) { - _handleLogout(); - }); - } - - return Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.error_outline, - size: 64, - color: colorScheme.error, - ), - const SizedBox(height: 16), - Text( - snapshot.error is UnauthorizedException - ? 'Session Expired' - : 'Failed to load schedule', - style: Theme.of(context).textTheme.titleMedium, - ), - const SizedBox(height: 8), - Text( - snapshot.error is UnauthorizedException - ? 'Redirecting to login...' - : snapshot.error.toString(), - style: Theme.of(context).textTheme.bodySmall, - textAlign: TextAlign.center, - ), - if (snapshot.error is! UnauthorizedException) ...[ - const SizedBox(height: 24), - FilledButton.icon( - onPressed: _refreshSchedule, - icon: const Icon(Icons.refresh), - label: const Text('Retry'), - ), - ], - ], - ), - ), - ); - } - - if (!snapshot.hasData || snapshot.data!.routes.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.calendar_today, - size: 64, - color: colorScheme.outline, - ), - const SizedBox(height: 16), - Text( - 'Geen actieve ritten', - style: Theme.of(context).textTheme.titleMedium, - ), - const SizedBox(height: 8), - Text( - 'Je hebt geen geplande ritten voor deze dag', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - textAlign: TextAlign.center, - ), - ], - ), - ), - ); - } - - final routes = [...snapshot.data!.routes] - ..sort((a, b) => a.startTime.compareTo(b.startTime)); - final scheduledRoutes = routes.where((r) => r.status == 'scheduled').toList(); - final inProgressRoutes = routes.where((r) => r.status == 'in_progress').toList(); - - // Merge and group by hour - final allActiveRoutes = [...inProgressRoutes, ...scheduledRoutes] - ..sort((a, b) => a.startTime.compareTo(b.startTime)); - final hourGroups = _groupByHour(allActiveRoutes); - final sortedHours = hourGroups.keys.toList()..sort(); - - return RefreshIndicator( - onRefresh: _refreshSchedule, - child: ListView( - padding: const EdgeInsets.only(bottom: 16), - children: [ - if (allActiveRoutes.isEmpty) - Center( - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 32), - child: Text( - 'Geen actieve ritten voor deze dag', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - ), - ) - else - ...sortedHours.map((hour) { - final routesForHour = hourGroups[hour] ?? []; - return Column( - children: [ - Padding( - padding: const EdgeInsets.only(left: 16, top: 16, bottom: 8), - child: Row( - children: [ - Text( - '${hour.toString().padLeft(2, '0')}:00 uur', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, - color: colorScheme.primary, - ), - ), - const SizedBox(width: 12), - Expanded( - child: Container( - height: 1, - color: colorScheme.outlineVariant, - ), - ), - ], - ), - ), - ...routesForHour.map((route) => Padding( - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - child: RouteCard(route: route, onTap: () {}), - )), - const SizedBox(height: 4), - ], - ); - }), - const SizedBox(height: 8), - ], - ), - ); - }, - ), - ), - ], - ), - ), - ); - } -} diff --git a/deprecated/lib/screens/login_screen.dart b/deprecated/lib/screens/login_screen.dart deleted file mode 100644 index 4bc55a1..0000000 --- a/deprecated/lib/screens/login_screen.dart +++ /dev/null @@ -1,314 +0,0 @@ -import 'package:flutter/material.dart'; -import '../services/auth_service.dart'; -import '../services/error_log_service.dart'; -import '../widgets/custom_input_field.dart'; - -class LoginScreen extends StatefulWidget { - const LoginScreen({super.key}); - - @override - State createState() => _LoginScreenState(); -} - -class _LoginScreenState extends State { - final _formKey = GlobalKey(); - final _userCodeController = TextEditingController(); - final _passwordController = TextEditingController(); - final _authService = AuthService(); - - bool _isLoading = false; - String? _errorMessage; - - @override - void dispose() { - _userCodeController.dispose(); - _passwordController.dispose(); - super.dispose(); - } - - Future _handleLogin() async { - if (!_formKey.currentState!.validate()) return; - - setState(() { - _isLoading = true; - _errorMessage = null; - }); - - try { - final input = _userCodeController.text.trim(); - final parsedUserCode = int.tryParse(input); - if (parsedUserCode == null) { - await ErrorLogService.report( - service: 'bus_terminal', - partOfService: 'LoginScreen._handleLogin', - error: 'User code must be a number', - ); - if (mounted) { - setState(() { - _errorMessage = 'User code must be a number'; - }); - } - return; - } - - await _authService.login( - userCode: parsedUserCode, - password: _passwordController.text, - ); - - if (mounted) { - // Navigate to daily schedule screen - Navigator.of(context).pushReplacementNamed('/schedule'); - } - } catch (e) { - await ErrorLogService.report( - service: 'bus_terminal', - partOfService: 'LoginScreen._handleLogin.catch', - error: e.toString(), - ); - if (mounted) { - setState(() { - _errorMessage = e.toString().replaceAll('Exception: ', ''); - }); - } - } finally { - if (mounted) { - setState(() => _isLoading = false); - } - } - } - - String? _validateUserCode(String? value) { - final v = value?.trim(); - if (v?.isEmpty ?? true) { - return 'User code is required'; - } - if (int.tryParse(v!) == null) { - return 'User code must be a number'; - } - return null; - } - - String? _validatePassword(String? value) { - if (value?.isEmpty ?? true) { - return 'Password is required'; - } - if ((value?.length ?? 0) < 3) { - return 'Password must be at least 3 characters'; - } - return null; - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - - return Scaffold( - body: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: Theme.of(context).brightness == Brightness.dark - ? const [Color(0xFF0B1220), Color(0xFF111827), Color(0xFF1D4ED8)] - : const [Color(0xFFF1F5F9), Color(0xFFE2E8F0), Color(0xFFBAE6FD)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - ), - child: SafeArea( - child: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Form( - key: _formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox(height: 24), - Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [Color(0xFF0F172A), Color(0xFF1D4ED8)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(24), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.18), - blurRadius: 24, - offset: const Offset(0, 12), - ), - ], - ), - child: Row( - children: [ - Container( - width: 56, - height: 56, - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.16), - shape: BoxShape.circle, - ), - child: const Icon( - Icons.directions_bus, - color: Colors.white, - size: 30, - ), - ), - const SizedBox(width: 16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Bus Terminal', - style: Theme.of(context).textTheme.titleLarge?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 4), - Text( - 'Driver access dashboard', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Colors.white.withOpacity(0.82), - ), - ), - ], - ), - ), - ], - ), - ), - const SizedBox(height: 18), - Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - color: colorScheme.surface.withOpacity(0.92), - borderRadius: BorderRadius.circular(24), - border: Border.all(color: colorScheme.outline.withOpacity(0.14)), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.08), - blurRadius: 22, - offset: const Offset(0, 10), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - 'Driver Login', - style: Theme.of(context).textTheme.headlineMedium?.copyWith( - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 8), - Text( - 'Sign in to view your route, stops and live navigation.', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - const SizedBox(height: 28), - - if (_errorMessage != null) ...[ - Container( - padding: const EdgeInsets.all(14), - decoration: BoxDecoration( - color: colorScheme.error.withOpacity(0.12), - border: Border.all(color: colorScheme.error.withOpacity(0.35)), - borderRadius: BorderRadius.circular(16), - ), - child: Row( - children: [ - Icon(Icons.error_outline, color: colorScheme.error), - const SizedBox(width: 10), - Expanded( - child: Text( - _errorMessage!, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colorScheme.onSurface, - ), - ), - ), - ], - ), - ), - const SizedBox(height: 20), - ], - - CustomInputField( - label: 'User Code', - hint: 'Enter your user code', - controller: _userCodeController, - validator: _validateUserCode, - ), - const SizedBox(height: 20), - CustomInputField( - label: 'Password', - hint: 'Enter your password', - controller: _passwordController, - obscureText: true, - validator: _validatePassword, - ), - const SizedBox(height: 28), - - FilledButton( - onPressed: _isLoading ? null : _handleLogin, - child: _isLoading - ? SizedBox( - height: 24, - width: 24, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(colorScheme.onPrimary), - ), - ) - : const Text('Login'), - ), - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _statusPill(Icons.shield_outlined, 'Secure access'), - const SizedBox(width: 10), - _statusPill(Icons.route_outlined, 'Live route data'), - ], - ), - ], - ), - ), - ], - ), - ), - ), - ), - ), - ), - ); - } - - Widget _statusPill(IconData icon, String label) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surfaceContainerHighest.withOpacity(0.72), - borderRadius: BorderRadius.circular(999), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(icon, size: 16), - const SizedBox(width: 6), - Text( - label, - style: Theme.of(context).textTheme.labelMedium, - ), - ], - ), - ); - } -} diff --git a/deprecated/lib/screens/navigation_screen.dart b/deprecated/lib/screens/navigation_screen.dart deleted file mode 100644 index 5a1d473..0000000 --- a/deprecated/lib/screens/navigation_screen.dart +++ /dev/null @@ -1,913 +0,0 @@ -// ignore_for_file: deprecated_member_use - -import 'dart:math'; -import 'package:flutter/material.dart'; -import 'package:flutter_map/flutter_map.dart'; -import 'package:latlong2/latlong.dart'; -import '../models/navigation.dart'; -import '../models/schedule.dart' as schedule; -import '../services/navigation_service.dart'; -import '../services/schedule_service.dart'; - -class NavigationScreen extends StatefulWidget { - final schedule.Route route; - final List? initialStops; - - const NavigationScreen({ - super.key, - required this.route, - this.initialStops, - }); - - @override - State createState() => _NavigationScreenState(); -} - -class _NavigationScreenState extends State { - final _navigationService = NavigationService(); - final _scheduleService = ScheduleService(); - late MapController _mapController; - - NavigationRoute? _currentRoute; - NavigationPoint? _currentLocation; - bool _isLoading = false; - String? _errorMessage; - List? _alternativeRoutes; - List? _stops; - String? _stopsFetchError; - int _currentStopIndex = 0; - final Set _completedStops = {}; - - @override - void initState() { - super.initState(); - _mapController = MapController(); - _initializeNavigation(); - } - - Future _initializeNavigation() async { - setState(() { - _isLoading = true; - _errorMessage = null; - }); - - try { - // Get current location - final currentLoc = await _navigationService.getCurrentLocation(); - setState(() => _currentLocation = currentLoc); - - // Use provided initial stops when available, otherwise fetch from API - if (widget.initialStops != null) { - _stops = widget.initialStops; - _stopsFetchError = null; - } else { - try { - _stops = await _scheduleService.getStops(widget.route.busLine.id); - _stopsFetchError = null; - } catch (e) { - _stops = []; - _stopsFetchError = e.toString().replaceAll('Exception: ', ''); - } - } - - // Defensive: filter out invalid stops (missing/NaN coordinates) and deduplicate - if (_stops != null) { - _stops = _stops! - .where((s) => s.latitude.isFinite && s.longitude.isFinite) - .toList(); - - // Remove exact duplicates by lat/lon - final seen = {}; - _stops = _stops!.where((s) { - final key = '${s.latitude.toStringAsFixed(6)}|${s.longitude.toStringAsFixed(6)}'; - if (seen.contains(key)) return false; - seen.add(key); - return true; - }).toList(); - } - - // Determine start and end points: prefer stop locations if available. - // If no stops are returned from the API, geocode the stop names. - late NavigationPoint startPoint; - late NavigationPoint endPoint; - - if (_stops != null && _stops!.length >= 2) { - final hasScheduleStops = widget.initialStops != null; - - if (!hasScheduleStops) { - final optimized = await _navigationService.getOptimizedRouteThroughStops(stops: _stops!); - _stops = optimized.orderedStops; - if (mounted) { - setState(() { - _currentRoute = optimized.route; - _alternativeRoutes = null; - _isLoading = false; - }); - WidgetsBinding.instance.addPostFrameCallback((_) => _fitMapToRoute(optimized.route)); - } - return; - } - - final navRoute = await _navigationService.getRouteThroughStops(stops: _stops!); - startPoint = _stops!.first; - endPoint = _stops!.last; - - if (mounted) { - setState(() { - _currentRoute = navRoute; - _alternativeRoutes = null; - _isLoading = false; - }); - - WidgetsBinding.instance.addPostFrameCallback((_) => _fitMapToRoute(navRoute)); - } - - return; - } else if (_stops != null && _stops!.length == 1) { - // With exactly one linked stop, force that stop into the route as start - // so the marker is guaranteed to be in-view. - startPoint = _stops!.first; - - try { - endPoint = await _navigationService.geocodePlace(widget.route.busLine.endStop); - } catch (_) { - endPoint = NavigationPoint( - latitude: startPoint.latitude + 0.01, - longitude: startPoint.longitude + 0.01, - name: widget.route.busLine.endStop, - ); - } - } else { - // Try geocoding names; fall back to conservative defaults on failure - try { - startPoint = await _navigationService.geocodePlace(widget.route.busLine.startStop); - } catch (_) { - startPoint = NavigationPoint( - latitude: 52.5200, - longitude: 13.4050, - name: widget.route.busLine.startStop, - ); - } - - try { - endPoint = await _navigationService.geocodePlace(widget.route.busLine.endStop); - } catch (_) { - endPoint = NavigationPoint( - latitude: 52.5300, - longitude: 13.4150, - name: widget.route.busLine.endStop, - ); - } - } - - // Get route without waypoints - final navRoute = await _navigationService.getRoute(start: startPoint, end: endPoint); - - // Get alternative routes (but cap to a small number) - final alternatives = await _navigationService.getMultipleRoutes(start: startPoint, end: endPoint); - - if (mounted) { - setState(() { - _currentRoute = navRoute; - _alternativeRoutes = alternatives.take(2).toList(); - _isLoading = false; - }); - - // Fit map to route bounds after first frame so MapController is attached - WidgetsBinding.instance.addPostFrameCallback((_) => _fitMapToRoute(navRoute)); - } - } catch (e) { - if (mounted) { - setState(() { - _errorMessage = e.toString().replaceAll('Exception: ', ''); - _isLoading = false; - }); - } - } - } - - void _fitMapToRoute(NavigationRoute route) { - // Build list of points to include in bounds, filter invalids - final allPoints = []; - allPoints.addAll(route.getAllPoints().where((p) => p.latitude.isFinite && p.longitude.isFinite).map((point) => LatLng(point.latitude, point.longitude))); - allPoints.addAll((_stops ?? []).where((s) => s.latitude.isFinite && s.longitude.isFinite).map((stop) => LatLng(stop.latitude, stop.longitude))); - if (_currentLocation != null && _currentLocation!.latitude.isFinite && _currentLocation!.longitude.isFinite) { - allPoints.add(LatLng(_currentLocation!.latitude, _currentLocation!.longitude)); - } - - if (allPoints.isEmpty) return; - - double minLat = allPoints.first.latitude; - double maxLat = allPoints.first.latitude; - double minLon = allPoints.first.longitude; - double maxLon = allPoints.first.longitude; - - for (final point in allPoints) { - minLat = min(minLat, point.latitude); - maxLat = max(maxLat, point.latitude); - minLon = min(minLon, point.longitude); - maxLon = max(maxLon, point.longitude); - } - - // Clamp bounds to a reasonable maximum span to avoid huge map tiles requests - const double maxSpanDegrees = 2.0; // ~222km lat span per degree ~111km; 2 degrees ~222km - final latSpan = maxLat - minLat; - final lonSpan = maxLon - minLon; - - double centerLat = (minLat + maxLat) / 2.0; - double centerLon = (minLon + maxLon) / 2.0; - - double halfLat = latSpan / 2.0; - double halfLon = lonSpan / 2.0; - - if (latSpan > maxSpanDegrees) halfLat = maxSpanDegrees / 2.0; - if (lonSpan > maxSpanDegrees) halfLon = maxSpanDegrees / 2.0; - - final clampedMinLat = centerLat - halfLat; - final clampedMaxLat = centerLat + halfLat; - final clampedMinLon = centerLon - halfLon; - final clampedMaxLon = centerLon + halfLon; - - final bounds = LatLngBounds( - LatLng(clampedMinLat, clampedMinLon), - LatLng(clampedMaxLat, clampedMaxLon), - ); - - _mapController.fitBounds( - bounds, - options: const FitBoundsOptions(padding: EdgeInsets.all(100)), - ); - } - - int _nextUncompletedStopIndex([int startIndex = 0]) { - if (_stops == null || _stops!.isEmpty) return 0; - - for (var index = startIndex; index < _stops!.length; index++) { - if (!_completedStops.contains(index)) { - return index; - } - } - - return _stops!.length - 1; - } - - Future _refreshRouteFromIndex(int index) async { - if (_stops == null || _stops!.isEmpty) return; - if (index < 0 || index >= _stops!.length) return; - - setState(() { - _isLoading = true; - _errorMessage = null; - _currentStopIndex = index; - }); - - try { - final remainingStops = _stops!.sublist(index); - final navRoute = remainingStops.length >= 2 - ? await _navigationService.getRouteThroughStops(stops: remainingStops) - : _currentRoute; - - if (mounted) { - setState(() { - if (navRoute != null) { - _currentRoute = navRoute; - } - _alternativeRoutes = null; - _isLoading = false; - }); - - if (navRoute != null) { - WidgetsBinding.instance.addPostFrameCallback((_) => _fitMapToRoute(navRoute)); - } - } - } catch (e) { - if (mounted) { - setState(() { - _errorMessage = e.toString().replaceAll('Exception: ', ''); - _isLoading = false; - }); - } - } - } - - Future _focusStop(int index) async { - if (_stops == null || _stops!.isEmpty) return; - if (index < 0 || index >= _stops!.length) return; - await _refreshRouteFromIndex(index); - } - - Future _markStopCompleted(int index) async { - if (_stops == null || _stops!.isEmpty) return; - if (index < 0 || index >= _stops!.length) return; - - // When this screen is opened from schedule overview, route.id maps to scheduleId. - if (widget.initialStops != null) { - try { - await _scheduleService.markScheduleStopPassed( - scheduleId: widget.route.id, - stopOrder: index + 1, - actualPassedAt: DateTime.now(), - ); - } catch (e) { - if (mounted) { - setState(() { - _errorMessage = 'Stop update mislukt: ${e.toString().replaceAll('Exception: ', '')}'; - }); - } - } - } - - setState(() { - _completedStops.add(index); - }); - - final nextIndex = _nextUncompletedStopIndex(index + 1); - await _refreshRouteFromIndex(nextIndex); - } - - double get _routeProgress { - if (_stops == null || _stops!.isEmpty) return 0; - if (_stops!.length == 1) return 1; - return _currentStopIndex / (_stops!.length - 1); - } - - Color get _routeColor => Color.lerp(Colors.blue, Colors.orange, _routeProgress) ?? Colors.blue; - - Color _stopColor(int index) { - if (_completedStops.contains(index) || index < _currentStopIndex) return Colors.green; - if (index == _currentStopIndex) return Colors.orange; - return Colors.blueGrey; - } - - IconData _stopIcon(int index) { - if (_completedStops.contains(index) || index < _currentStopIndex) return Icons.check_circle; - if (index == _currentStopIndex) return Icons.radio_button_checked; - return Icons.location_on; - } - - bool _isStopCompleted(int index) => _completedStops.contains(index) || index < _currentStopIndex; - - bool _hasStopNearPoint(NavigationPoint point, {double threshold = 0.00005}) { - if (_stops == null || _stops!.isEmpty) return false; - - for (final stop in _stops!) { - final latDiff = (stop.latitude - point.latitude).abs(); - final lonDiff = (stop.longitude - point.longitude).abs(); - if (latDiff <= threshold && lonDiff <= threshold) { - return true; - } - } - return false; - } - - NavigationPoint? get _currentStopPoint { - if (_stops == null || _stops!.isEmpty) return null; - return _stops![_currentStopIndex.clamp(0, _stops!.length - 1)]; - } - - NavigationPoint? get _nextStopPoint { - if (_stops == null || _stops!.isEmpty) return null; - final nextIndex = _nextUncompletedStopIndex(_currentStopIndex + 1); - return _stops![nextIndex.clamp(0, _stops!.length - 1)]; - } - - double get _completionRatio { - if (_stops == null || _stops!.isEmpty) return 0; - return _completedStops.length / _stops!.length; - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Route ${widget.route.busLine.lineNumber} Navigation'), - elevation: 0, - ), - body: Row( - children: [ - // Map area (left pane) - Expanded( - flex: 6, - child: _currentRoute != null - ? FlutterMap( - mapController: _mapController, - options: MapOptions( - initialCenter: LatLng( - _currentRoute!.start.latitude, - _currentRoute!.start.longitude, - ), - initialZoom: 13.0, - ), - children: [ - TileLayer( - urlTemplate: - 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', - userAgentPackageName: 'com.example.bus_terminal', - ), - MarkerLayer( - markers: [ - ...(_stops ?? []).asMap().entries.map((entry) { - final index = entry.key; - final stop = entry.value; - final color = _stopColor(index); - - return Marker( - point: LatLng(stop.latitude, stop.longitude), - width: 46, - height: 46, - child: Container( - decoration: BoxDecoration( - color: color, - shape: BoxShape.circle, - border: Border.all( - color: Colors.white, - width: 3, - ), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.22), - blurRadius: 10, - offset: const Offset(0, 4), - ), - ], - ), - child: Stack( - alignment: Alignment.center, - children: [ - Icon( - _stopIcon(index), - color: Colors.white, - size: 20, - ), - Positioned( - bottom: 4, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 1), - decoration: BoxDecoration( - color: Colors.black.withOpacity(0.35), - borderRadius: BorderRadius.circular(999), - ), - child: Text( - '${index + 1}', - style: const TextStyle( - color: Colors.white, - fontSize: 9, - fontWeight: FontWeight.w800, - ), - ), - ), - ), - ], - ), - ), - ); - }), - // Start marker - if (!_hasStopNearPoint(_currentRoute!.start)) - Marker( - point: LatLng( - _currentRoute!.start.latitude, - _currentRoute!.start.longitude, - ), - width: 40, - height: 40, - child: Container( - decoration: BoxDecoration( - color: Colors.green, - shape: BoxShape.circle, - border: Border.all( - color: Colors.white, - width: 2, - ), - ), - child: const Icon( - Icons.location_on, - color: Colors.white, - size: 20, - ), - ), - ), - // End marker - if (!_hasStopNearPoint(_currentRoute!.end)) - Marker( - point: LatLng( - _currentRoute!.end.latitude, - _currentRoute!.end.longitude, - ), - width: 40, - height: 40, - child: Container( - decoration: BoxDecoration( - color: Colors.red, - shape: BoxShape.circle, - border: Border.all( - color: Colors.white, - width: 2, - ), - ), - child: const Icon( - Icons.location_on, - color: Colors.white, - size: 20, - ), - ), - ), - // Current location marker - if (_currentLocation != null) - Marker( - point: LatLng( - _currentLocation!.latitude, - _currentLocation!.longitude, - ), - width: 30, - height: 30, - child: Container( - decoration: BoxDecoration( - color: Colors.blue, - shape: BoxShape.circle, - border: Border.all( - color: Colors.white, - width: 2, - ), - ), - child: const Icon( - Icons.directions_bus, - color: Colors.white, - size: 16, - ), - ), - ), - ], - ), - PolylineLayer( - polylines: [ - // Main route - Polyline( - points: _currentRoute! - .getAllPoints() - .map((p) => LatLng(p.latitude, p.longitude)) - .toList(), - color: _routeColor, - strokeWidth: 5, - ), - // Alternative routes (lighter) - if (_alternativeRoutes != null) - ...List.generate( - _alternativeRoutes!.length, - (i) => Polyline( - points: _alternativeRoutes![i] - .getAllPoints() - .map((p) => LatLng(p.latitude, p.longitude)) - .toList(), - color: Colors.grey.withOpacity(0.5), - strokeWidth: 2, - ), - ), - ], - ), - ], - ) - : (_isLoading - ? const Center(child: CircularProgressIndicator()) - : Center( - child: _errorMessage != null - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.error_outline, - size: 64, - color: Colors.red[300], - ), - const SizedBox(height: 16), - Text( - 'Failed to load route', - style: - Theme.of(context).textTheme.titleMedium, - ), - const SizedBox(height: 8), - Text( - _errorMessage!, - style: Theme.of(context).textTheme.bodySmall, - textAlign: TextAlign.center, - ), - ], - ) - : const Text('No route'))), - ), - - // Vertical divider - Container(width: 1, color: Colors.grey[200]), - - // Stops / Info panel (right pane) - Expanded( - flex: 4, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(16), - bottomLeft: Radius.circular(16), - ), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.1), - blurRadius: 10, - offset: const Offset(-2, 0), - ), - ], - ), - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [Color(0xFF0F172A), Color(0xFF1D4ED8)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(18), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.12), - blurRadius: 18, - offset: const Offset(0, 8), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 42, - height: 42, - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.18), - shape: BoxShape.circle, - ), - child: const Icon( - Icons.route, - color: Colors.white, - ), - ), - const SizedBox(width: 12), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Route ${widget.route.busLine.lineNumber}', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 2), - Text( - '${widget.route.busLine.startStop} → ${widget.route.busLine.endStop}', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Colors.white.withOpacity(0.85), - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ], - ), - ), - ], - ), - const SizedBox(height: 16), - ClipRRect( - borderRadius: BorderRadius.circular(999), - child: LinearProgressIndicator( - minHeight: 10, - value: _completionRatio, - backgroundColor: Colors.white.withOpacity(0.12), - valueColor: const AlwaysStoppedAnimation(Colors.amberAccent), - ), - ), - const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '${(_completionRatio * 100).round()}% afgerond', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w600, - ), - ), - Text( - '${_completedStops.length}/${_stops?.length ?? 0} stops', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Colors.white.withOpacity(0.85), - ), - ), - ], - ), - const SizedBox(height: 12), - Row( - children: [ - Expanded( - child: _buildSummaryPill( - 'Huidig', - _currentStopPoint?.name ?? 'Geen stop', - Icons.radio_button_checked, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildSummaryPill( - 'Volgend', - _nextStopPoint?.name ?? 'Einde route', - Icons.skip_next, - ), - ), - ], - ), - const SizedBox(height: 12), - SizedBox( - width: double.infinity, - child: ElevatedButton.icon( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - foregroundColor: const Color(0xFF0F172A), - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(14), - ), - ), - onPressed: _stops == null || _stops!.isEmpty || _isStopCompleted(_currentStopIndex) - ? null - : () => _markStopCompleted(_currentStopIndex), - icon: const Icon(Icons.check_circle_outline), - label: const Text('Markeer huidige stop afgerond'), - ), - ), - ], - ), - ), - const SizedBox(height: 14), - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10), - decoration: BoxDecoration( - color: Colors.grey[100], - borderRadius: BorderRadius.circular(12), - ), - child: Row( - children: [ - _legendDot(Colors.green, 'Afgerond'), - const SizedBox(width: 12), - _legendDot(Colors.orange, 'Actief'), - const SizedBox(width: 12), - _legendDot(Colors.blueGrey, 'Te doen'), - ], - ), - ), - if (_stopsFetchError != null) ...[ - const SizedBox(height: 10), - Container( - width: double.infinity, - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.red.withOpacity(0.08), - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.red.withOpacity(0.25)), - ), - child: Text( - 'Stops konden niet geladen worden voor buslijn ${widget.route.busLine.id}: $_stopsFetchError', - style: Theme.of(context).textTheme.bodySmall, - ), - ), - ], - const SizedBox(height: 12), - Text( - 'Stops', - style: Theme.of(context) - .textTheme - .titleMedium - ?.copyWith(fontWeight: FontWeight.bold), - ), - const SizedBox(height: 8), - Expanded( - child: _stops == null || _stops!.isEmpty - ? Center( - child: Text( - 'No stops available for this line', - style: Theme.of(context).textTheme.bodySmall, - ), - ) - : ListView.separated( - itemCount: _stops!.length, - separatorBuilder: (context, index) => const Divider(), - itemBuilder: (context, index) { - final s = _stops![index]; - final color = _stopColor(index); - final completed = _isStopCompleted(index); - final isCurrent = index == _currentStopIndex; - return ListTile( - leading: CircleAvatar( - radius: 14, - backgroundColor: color, - child: Icon( - _stopIcon(index), - color: Colors.white, - size: 16, - ), - ), - title: Text(s.name ?? 'Stop ${index + 1}'), - subtitle: Text('${s.latitude.toStringAsFixed(5)}, ${s.longitude.toStringAsFixed(5)}'), - trailing: completed - ? const Chip( - label: Text('Afgerond'), - visualDensity: VisualDensity.compact, - ) - : TextButton.icon( - onPressed: () => _markStopCompleted(index), - icon: const Icon(Icons.check, size: 18), - label: Text(isCurrent ? 'Afronden' : 'Klaarzetten'), - ), - onTap: () => _focusStop(index), - ); - }, - ), - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - Widget _legendDot(Color color, String label) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - width: 10, - height: 10, - decoration: BoxDecoration( - color: color, - shape: BoxShape.circle, - ), - ), - const SizedBox(width: 6), - Text( - label, - style: Theme.of(context).textTheme.bodySmall, - ), - ], - ); - } - - Widget _buildSummaryPill(String title, String value, IconData icon) { - return Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.12), - borderRadius: BorderRadius.circular(14), - border: Border.all(color: Colors.white.withOpacity(0.16)), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(icon, color: Colors.white, size: 18), - const SizedBox(width: 8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Colors.white.withOpacity(0.75), - letterSpacing: 0.2, - ), - ), - const SizedBox(height: 4), - Text( - value, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w600, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ], - ), - ), - ], - ), - ); - } -} diff --git a/deprecated/lib/screens/recurring_schedules_screen.dart b/deprecated/lib/screens/recurring_schedules_screen.dart deleted file mode 100644 index 83620d7..0000000 --- a/deprecated/lib/screens/recurring_schedules_screen.dart +++ /dev/null @@ -1,332 +0,0 @@ -// ignore_for_file: use_build_context_synchronously - -import 'package:flutter/material.dart'; -import '../models/schedule.dart' as sched; -import '../services/schedule_service.dart'; - -class RecurringSchedulesScreen extends StatefulWidget { - const RecurringSchedulesScreen({super.key}); - - @override - State createState() => _RecurringSchedulesScreenState(); -} - -class _RecurringSchedulesScreenState extends State { - final _scheduleService = ScheduleService(); - late Future> _schedulesFuture; - String _selectedSortBy = 'line'; // 'line', 'time', 'weekday' - final Set _expandedLineIds = {}; - - @override - void initState() { - super.initState(); - _loadRecurringSchedules(); - } - - void _loadRecurringSchedules() { - _schedulesFuture = _scheduleService.getRecurringSchedules(); - } - - String _formatWeekdays(List weekdays) { - const dayLabels = ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za']; - if (weekdays.isEmpty) return 'Eenmalig'; - if (weekdays.length == 7) return 'Dagelijks'; - - final sorted = weekdays.toSet().toList()..sort((a, b) => a.compareTo(b)); - return sorted.map((d) => dayLabels[d]).join(', '); - } - - String _formatTime(DateTime dt) { - return '${dt.hour.toString().padLeft(2, '0')}:${dt.minute.toString().padLeft(2, '0')}'; - } - - List _sortSchedules(List schedules) { - final sorted = List.from(schedules); - - switch (_selectedSortBy) { - case 'line': - sorted.sort((a, b) => a.lineNumber.compareTo(b.lineNumber)); - break; - case 'time': - sorted.sort((a, b) => a.startTime.compareTo(b.startTime)); - break; - case 'weekday': - sorted.sort((a, b) { - final aFirst = a.weekdays.isEmpty ? 7 : a.weekdays.first; - final bFirst = b.weekdays.isEmpty ? 7 : b.weekdays.first; - return aFirst.compareTo(bFirst); - }); - break; - } - - return sorted; - } - - Map> _groupByLine(List schedules) { - final grouped = >{}; - for (final schedule in schedules) { - grouped.putIfAbsent(schedule.lineNumber, () => []).add(schedule); - } - return grouped; - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - - return Scaffold( - appBar: AppBar( - title: const Text('Vaste Diensten'), - centerTitle: true, - actions: [ - PopupMenuButton( - onSelected: (value) { - setState(() => _selectedSortBy = value); - }, - itemBuilder: (context) => [ - PopupMenuItem( - value: 'line', - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.sort_by_alpha, color: _selectedSortBy == 'line' ? colorScheme.primary : null), - const SizedBox(width: 8), - const Text('Lijn'), - ], - ), - ), - PopupMenuItem( - value: 'time', - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.schedule, color: _selectedSortBy == 'time' ? colorScheme.primary : null), - const SizedBox(width: 8), - const Text('Tijd'), - ], - ), - ), - PopupMenuItem( - value: 'weekday', - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.calendar_today, color: _selectedSortBy == 'weekday' ? colorScheme.primary : null), - const SizedBox(width: 8), - const Text('Weekdag'), - ], - ), - ), - ], - child: const Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: Icon(Icons.filter_list), - ), - ), - ], - ), - body: FutureBuilder>( - future: _schedulesFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - - if (snapshot.hasError) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.error_outline, size: 48, color: colorScheme.error), - const SizedBox(height: 16), - Text( - 'Fout bij laden: ${snapshot.error}', - textAlign: TextAlign.center, - ), - const SizedBox(height: 16), - FilledButton( - onPressed: () { - setState(() => _loadRecurringSchedules()); - }, - child: const Text('Opnieuw proberen'), - ), - ], - ), - ); - } - - final allSchedules = snapshot.data ?? []; - // Filter to show only truly recurring schedules (with weekdays > 0) - final schedules = allSchedules.where((s) => s.weekdays.isNotEmpty).toList(); - - if (schedules.isEmpty) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.event_note_outlined, size: 48, color: colorScheme.outline), - const SizedBox(height: 16), - Text( - 'Geen herhaalde diensten gevonden', - style: Theme.of(context).textTheme.titleMedium, - ), - const SizedBox(height: 8), - Text( - 'Herhaalde diensten worden hier weergegeven', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - ], - ), - ); - } - - final sortedSchedules = _sortSchedules(schedules); - final groupedByLine = _groupByLine(sortedSchedules); - - return ListView.builder( - padding: const EdgeInsets.fromLTRB(12, 12, 12, 24), - itemCount: groupedByLine.length, - itemBuilder: (context, lineIndex) { - final lineNumber = groupedByLine.keys.toList()[lineIndex]; - final lineSchedules = groupedByLine[lineNumber] ?? []; - final isExpanded = _expandedLineIds.contains(lineNumber); - - return Column( - children: [ - Card( - child: InkWell( - onTap: () { - setState(() { - if (isExpanded) { - _expandedLineIds.remove(lineNumber); - } else { - _expandedLineIds.add(lineNumber); - } - }); - }, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Lijn $lineNumber', - style: Theme.of(context).textTheme.titleLarge?.copyWith( - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 4), - Text( - '${lineSchedules.length} diensten', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.outline, - ), - ), - ], - ), - Icon( - isExpanded ? Icons.expand_less : Icons.expand_more, - color: colorScheme.primary, - ), - ], - ), - ), - ), - ), - if (isExpanded) - Padding( - padding: const EdgeInsets.only(top: 8), - child: ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: lineSchedules.length, - separatorBuilder: (_, _) => const SizedBox(height: 8), - itemBuilder: (context, scheduleIndex) { - final schedule = lineSchedules[scheduleIndex]; - return _ScheduleCard(schedule: schedule, formatTime: _formatTime, formatWeekdays: _formatWeekdays); - }, - ), - ), - const SizedBox(height: 8), - ], - ); - }, - ); - }, - ), - ); - } -} - -class _ScheduleCard extends StatelessWidget { - final sched.ServiceSchedule schedule; - final String Function(DateTime) formatTime; - final String Function(List) formatWeekdays; - - const _ScheduleCard({ - required this.schedule, - required this.formatTime, - required this.formatWeekdays, - }); - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - - return Card( - elevation: 1, - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${formatTime(schedule.startTime)} - ${formatTime(schedule.endTime)}', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 4), - Text( - schedule.busName, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.outline, - ), - ), - ], - ), - ), - ], - ), - const SizedBox(height: 8), - Wrap( - spacing: 8, - runSpacing: 8, - children: [ - Chip( - label: Text( - formatWeekdays(schedule.weekdays), - style: Theme.of(context).textTheme.labelSmall, - ), - avatar: const Icon(Icons.calendar_today, size: 16), - visualDensity: VisualDensity.compact, - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/deprecated/lib/screens/schedule_overview_screen.dart b/deprecated/lib/screens/schedule_overview_screen.dart deleted file mode 100644 index d512cba..0000000 --- a/deprecated/lib/screens/schedule_overview_screen.dart +++ /dev/null @@ -1,674 +0,0 @@ -// ignore_for_file: use_build_context_synchronously - -import 'package:flutter/material.dart'; -import '../models/schedule.dart' as sched; -import '../models/navigation.dart'; -import '../services/auth_service.dart'; -import '../services/schedule_service.dart'; -import '../screens/navigation_screen.dart'; -import '../screens/recurring_schedules_screen.dart'; - -class ScheduleOverviewScreen extends StatefulWidget { - const ScheduleOverviewScreen({super.key}); - - @override - State createState() => _ScheduleOverviewScreenState(); -} - -class _ScheduleOverviewScreenState extends State with TickerProviderStateMixin { - final _scheduleService = ScheduleService(); - final _authService = AuthService(); - - late Future> _scheduleFuture; - DateTime _selectedDate = DateTime.now(); - late TabController _tabController; - - @override - void initState() { - super.initState(); - _scheduleFuture = _scheduleService.getSchedules(_selectedDate); - _tabController = TabController(length: 3, vsync: this); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - Future _handleLogout() async { - await _authService.logout(); - if (mounted) { - Navigator.of(context).pushReplacementNamed('/login'); - } - } - - Future _refreshSchedules() async { - setState(() { - _scheduleFuture = _scheduleService.getSchedules(_selectedDate); - }); - } - - Future _selectDate() async { - final colorScheme = Theme.of(context).colorScheme; - final picked = await showDatePicker( - context: context, - initialDate: _selectedDate, - firstDate: DateTime.now().subtract(const Duration(days: 7)), - lastDate: DateTime.now().add(const Duration(days: 30)), - builder: (context, child) { - return Theme( - data: Theme.of(context).copyWith( - dialogBackgroundColor: colorScheme.surface, - ), - child: child!, - ); - }, - ); - - if (picked != null && picked != _selectedDate) { - setState(() { - _selectedDate = picked; - }); - _refreshSchedules(); - } - } - - Future _showScheduleDetails(sched.ServiceSchedule svc) async { - try { - final stops = await _scheduleService.getScheduleStops(svc.id); - if (!mounted) return; - - await showModalBottomSheet( - context: context, - isScrollControlled: true, - showDragHandle: true, - builder: (sheetContext) { - return DraggableScrollableSheet( - expand: false, - initialChildSize: 0.75, - minChildSize: 0.45, - maxChildSize: 0.95, - builder: (context, scrollController) { - return ListView( - controller: scrollController, - padding: const EdgeInsets.fromLTRB(20, 8, 20, 24), - children: [ - Text( - 'Lijn ${svc.lineNumber}', - style: Theme.of(context).textTheme.headlineSmall?.copyWith( - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 8), - Text( - svc.busName, - style: Theme.of(context).textTheme.titleMedium, - ), - const SizedBox(height: 4), - Text( - '${_formatTime(svc.startTime)} - ${_formatTime(svc.endTime)}', - style: Theme.of(context).textTheme.bodyMedium, - ), - const SizedBox(height: 12), - Wrap( - spacing: 8, - runSpacing: 8, - children: [ - _InfoChip(label: svc.status), - _InfoChip(label: svc.isRecurring ? _weekdayLabel(svc.weekdays) : 'Eenmalig'), - ], - ), - const SizedBox(height: 20), - SizedBox( - width: double.infinity, - child: FilledButton.icon( - onPressed: () async { - try { - await _scheduleService.updateScheduleStatus( - svc.id, - 'in_progress', - date: svc.startTime, - ); - if (!mounted) return; - Navigator.of(sheetContext).pop(); - - final routeObj = sched.Route( - id: svc.id, - busLine: sched.BusLine( - id: svc.busLineId, - lineNumber: svc.lineNumber, - startStop: '', - endStop: '', - estimatedDuration: 0, - ), - busType: sched.BusType( - id: svc.busId, - name: svc.busName, - seatCapacity: 0, - licensePlate: '', - ), - startTime: svc.startTime, - endTime: svc.endTime, - status: 'in_progress', - ); - - final navStops = stops - .map((s) => NavigationPoint( - latitude: s.latitude, - longitude: s.longitude, - name: s.name, - )) - .toList(); - - try { - await Navigator.of(context).push( - MaterialPageRoute( - builder: (_) => NavigationScreen(route: routeObj, initialStops: navStops), - ), - ); - } catch (navErr) { - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Navigatiefout: ${navErr.toString()}')), - ); - } - } catch (e) { - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Status bijwerken mislukt: $e')), - ); - } - }, - icon: const Icon(Icons.navigation), - label: const Text('Start route'), - ), - ), - Text( - 'Haltes', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.w700, - ), - ), - const SizedBox(height: 12), - if (stops.isEmpty) - Text( - 'Geen haltes gekoppeld aan deze dienst.', - style: Theme.of(context).textTheme.bodyMedium, - ) - else - ...stops.map((stop) { - final departureTime = svc.startTime.add( - Duration(minutes: stop.estimatedArrivalMinutes), - ); - return Card( - child: ListTile( - dense: true, - title: Text('${stop.order}. ${stop.name}'), - subtitle: Text('${stop.estimatedArrivalMinutes} min na vertrek'), - trailing: Text(_formatTime(departureTime)), - ), - ); - }), - ], - ); - }, - ); - }, - ); - } catch (e) { - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Kon dienstdetails niet laden: $e')), - ); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Diensten'), - centerTitle: true, - elevation: 0, - bottom: TabBar( - controller: _tabController, - tabs: const [ - Tab(icon: Icon(Icons.calendar_today), text: 'Dagschema'), - Tab(icon: Icon(Icons.repeat), text: 'Vaste diensten'), - Tab(icon: Icon(Icons.timeline), text: 'Voortgang'), - ], - ), - actions: [ - IconButton( - icon: const Icon(Icons.logout), - tooltip: 'Logout', - onPressed: _handleLogout, - ), - ], - ), - body: TabBarView( - controller: _tabController, - children: [ - _DailyScheduleTab( - scheduleService: _scheduleService, - selectedDate: _selectedDate, - onSelectDate: _selectDate, - onRefresh: _refreshSchedules, - onShowDetails: _showScheduleDetails, - scheduleFuture: _scheduleFuture, - ), - const RecurringSchedulesScreen(), - _ProgressTab( - scheduleService: _scheduleService, - selectedDate: _selectedDate, - scheduleFuture: _scheduleFuture, - ), - ], - ), - ); - } -} - -class _ProgressTab extends StatelessWidget { - final ScheduleService scheduleService; - final DateTime selectedDate; - final Future> scheduleFuture; - - const _ProgressTab({ - required this.scheduleService, - required this.selectedDate, - required this.scheduleFuture, - }); - - @override - Widget build(BuildContext context) { - final dateStr = '${selectedDate.year}-${selectedDate.month.toString().padLeft(2, '0')}-${selectedDate.day.toString().padLeft(2, '0')}'; - - return Column( - children: [ - Container( - padding: const EdgeInsets.all(16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('Voortgang voor $dateStr', style: Theme.of(context).textTheme.titleLarge), - IconButton( - onPressed: () async { - // refresh handled by parent via reselecting date; show a simple feedback - ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Ververs de datum in Dagschema-tab om andere datum te laden'))); - }, - icon: const Icon(Icons.info_outline), - ), - ], - ), - ), - Expanded( - child: FutureBuilder>( - future: scheduleFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) return const Center(child: CircularProgressIndicator()); - if (snapshot.hasError) return Center(child: Text('Fout bij laden: ${snapshot.error}')); - - final schedules = snapshot.data ?? []; - if (schedules.isEmpty) return Center(child: Text('Geen diensten op $dateStr')); - - return ListView.builder( - padding: const EdgeInsets.all(12), - itemCount: schedules.length, - itemBuilder: (context, index) { - final svc = schedules[index]; - return Card( - child: ListTile( - title: Text('Lijn ${svc.lineNumber} — ${svc.busName}'), - subtitle: Text(_formatTime(svc.startTime)), - trailing: TextButton( - onPressed: () async { - try { - final progress = await scheduleService.getScheduleProgress(svc.id, selectedDate); - if (!context.mounted) return; - await showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (ctx) { - final stops = (progress['stops'] as List?) ?? []; - return Padding( - padding: const EdgeInsets.fromLTRB(16, 16, 16, 32), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Voortgang — Lijn ${svc.lineNumber}', style: Theme.of(ctx).textTheme.headlineSmall), - const SizedBox(height: 8), - Text('Status: ${progress['schedule']?['status'] ?? 'onbekend'}'), - Text('Driver state: ${progress['driverState'] ?? 'onbekend'}'), - Text('Passed: ${progress['passedStopCount'] ?? 0} / ${progress['totalStopCount'] ?? 0}'), - const SizedBox(height: 12), - const Text('Haltes:'), - const SizedBox(height: 8), - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: stops.length, - itemBuilder: (c, i) { - final s = stops[i] as Map; - return ListTile( - dense: true, - title: Text('${s['stopOrder']}. ${s['stopName']}'), - subtitle: Text('Scheduled: ${s['scheduledPassedAt'] ?? '-'}\nActual: ${s['actualPassedAt'] ?? '-'}'), - ); - }, - ), - ), - ], - ), - ); - }, - ); - } catch (e) { - if (!context.mounted) return; - ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Kon voortgang niet laden: $e'))); - } - }, - child: const Text('Bekijk voortgang'), - ), - ), - ); - }, - ); - }, - ), - ), - ], - ); - } -} - -class _DailyScheduleTab extends StatelessWidget { - final ScheduleService scheduleService; - final DateTime selectedDate; - final VoidCallback onSelectDate; - final VoidCallback onRefresh; - final Function(sched.ServiceSchedule) onShowDetails; - final Future> scheduleFuture; - - const _DailyScheduleTab({ - required this.scheduleService, - required this.selectedDate, - required this.onSelectDate, - required this.onRefresh, - required this.onShowDetails, - required this.scheduleFuture, - }); - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - final dateStr = - '${selectedDate.year}-${selectedDate.month.toString().padLeft(2, '0')}-${selectedDate.day.toString().padLeft(2, '0')}'; - - return Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: Theme.of(context).brightness == Brightness.dark - ? const [Color(0xFF0B1220), Color(0xFF111827)] - : const [Color(0xFFF1F5F9), Color(0xFFE2E8F0)], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - ), - ), - child: Column( - children: [ - Container( - margin: const EdgeInsets.fromLTRB(16, 16, 16, 12), - padding: const EdgeInsets.all(18), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [Color(0xFF0F172A), Color(0xFF1D4ED8)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(24), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.16), - blurRadius: 22, - offset: const Offset(0, 10), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Geplande diensten', - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Colors.white.withOpacity(0.78), - ), - ), - const SizedBox(height: 6), - Text( - dateStr, - style: Theme.of(context).textTheme.headlineMedium?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 6), - Text( - 'Automatisch berekende eindtijden, haltes en herhalende weekdagen', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Colors.white.withOpacity(0.84), - ), - ), - const SizedBox(height: 14), - Align( - alignment: Alignment.centerRight, - child: SizedBox( - height: 48, - child: OutlinedButton.icon( - onPressed: onSelectDate, - icon: const Icon(Icons.calendar_today, size: 18), - label: const Text('Wijzig datum'), - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide(color: Colors.white.withOpacity(0.28)), - padding: const EdgeInsets.symmetric(horizontal: 16), - ), - ), - ), - ), - ], - ), - ), - Expanded( - child: FutureBuilder>( - future: scheduleFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - - if (snapshot.hasError) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.error_outline, size: 48, color: colorScheme.error), - const SizedBox(height: 16), - Text('Fout bij laden: ${snapshot.error}', textAlign: TextAlign.center), - const SizedBox(height: 16), - FilledButton( - onPressed: onRefresh, - child: const Text('Opnieuw proberen'), - ), - ], - ), - ); - } - - final schedules = snapshot.data ?? []; - if (schedules.isEmpty) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.event_available_outlined, size: 48, color: colorScheme.outline), - const SizedBox(height: 16), - Text('Geen diensten op $dateStr', style: Theme.of(context).textTheme.titleMedium), - ], - ), - ); - } - - return RefreshIndicator( - onRefresh: () async => onRefresh(), - child: ListView.builder( - padding: const EdgeInsets.fromLTRB(0, 12, 0, 24), - itemCount: schedules.length, - itemBuilder: (context, index) { - final schedule = schedules[index]; - return _ScheduleSummaryCard( - schedule: schedule, - onTap: () => onShowDetails(schedule), - ); - }, - ), - ); - }, - ), - ), - ], - ), - ); - } -} - -class _ScheduleSummaryCard extends StatelessWidget { - final sched.ServiceSchedule schedule; - final VoidCallback onTap; - - const _ScheduleSummaryCard({ - required this.schedule, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - - return Card( - margin: const EdgeInsets.fromLTRB(16, 8, 16, 8), - elevation: 0, - color: colorScheme.surface, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: InkWell( - borderRadius: BorderRadius.circular(20), - onTap: onTap, - child: Padding( - padding: const EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [colorScheme.primary, colorScheme.tertiary], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(8), - ), - child: Text( - 'Line ${schedule.lineNumber}', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - ), - // Only show status for one-time schedules; recurring schedules have no fixed status - if (!schedule.isRecurring) - _InfoChip(label: schedule.status), - ], - ), - const SizedBox(height: 16), - Text( - schedule.busName, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.w700, - ), - ), - const SizedBox(height: 4), - Text( - '${_formatTime(schedule.startTime)} - ${_formatTime(schedule.endTime)}', - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - const SizedBox(height: 12), - Text( - schedule.isRecurring ? _weekdayLabel(schedule.weekdays) : 'Eenmalige dienst', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerRight, - child: TextButton.icon( - onPressed: onTap, - icon: const Icon(Icons.list_alt, size: 18), - label: const Text('Haltes'), - ), - ), - ], - ), - ), - ), - ); - } -} - -class _InfoChip extends StatelessWidget { - final String label; - - const _InfoChip({required this.label}); - - @override - Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primaryContainer, - borderRadius: BorderRadius.circular(20), - ), - child: Text( - label, - style: Theme.of(context).textTheme.labelMedium?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - ); - } -} - -String _formatTime(DateTime time) { - return '${time.hour.toString().padLeft(2, '0')}:${time.minute.toString().padLeft(2, '0')}'; -} - -String _weekdayLabel(List weekdays) { - const labels = ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za']; - if (weekdays.isEmpty) { - return 'Eenmalige dienst'; - } - if (weekdays.length == 7) { - return 'Dagelijks'; - } - return weekdays.where((day) => day >= 0 && day < labels.length).map((day) => labels[day]).join(', '); -} diff --git a/deprecated/lib/services/.gitkeep b/deprecated/lib/services/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated/lib/services/app_navigator.dart b/deprecated/lib/services/app_navigator.dart deleted file mode 100644 index c28be33..0000000 --- a/deprecated/lib/services/app_navigator.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/material.dart'; -import 'auth_service.dart'; - -/// Global navigator and messenger keys so services can navigate/logout -final GlobalKey navigatorKey = GlobalKey(); -final GlobalKey messengerKey = GlobalKey(); - -/// Handle expired authentication: clear stored token and navigate to login. -Future handleAuthExpired({String? message}) async { - try { - await AuthService().logout(); - } catch (_) {} - - // Show a message if possible - try { - final messenger = messengerKey.currentState; - if (messenger != null && message != null) { - messenger.showSnackBar(SnackBar(content: Text(message))); - } - } catch (_) {} - - // Navigate to login, removing all previous routes - try { - final nav = navigatorKey.currentState; - if (nav != null) { - nav.pushNamedAndRemoveUntil('/login', (r) => false); - } - } catch (_) {} -} diff --git a/deprecated/lib/services/auth_service.dart b/deprecated/lib/services/auth_service.dart deleted file mode 100644 index dd4aed9..0000000 --- a/deprecated/lib/services/auth_service.dart +++ /dev/null @@ -1,95 +0,0 @@ -import 'dart:convert'; -import 'package:http/http.dart' as http; -import 'package:shared_preferences/shared_preferences.dart'; -import '../models/user.dart'; -import 'error_log_service.dart'; - -/// Authentication Service -class AuthService { - static const String _apiBaseUrl = 'https://transit.xtransit.testinstance.nl'; - static const String _tokenKey = 'auth_token'; - - late SharedPreferences _prefs; - - Future _reportError(String partOfService, Object error) { - return ErrorLogService.report( - service: 'bus_terminal', - partOfService: partOfService, - error: error.toString(), - ); - } - - Future _initPrefs() async { - _prefs = await SharedPreferences.getInstance(); - } - - /// Login with userCode and password - Future login({ - required int userCode, - required String password, - }) async { - await _initPrefs(); - - try { - final response = await http.post( - Uri.parse('$_apiBaseUrl/login'), - headers: {'Content-Type': 'application/json'}, - body: jsonEncode({ - 'userCode': userCode, - 'password': password, - }), - ); - - if (response.statusCode == 200) { - final body = response.body; - try { - final data = jsonDecode(body) as Map; - final authResponse = AuthResponse.fromJson(data); - - // Store token - await _prefs.setString(_tokenKey, authResponse.token); - - return authResponse; - } catch (e) { - await _reportError('AuthService.login.parse', e); - // Surface the response body to help debug backend field names / formats - throw Exception('Login parse error: $e -- response body: $body'); - } - } else if (response.statusCode == 401) { - throw Exception('Invalid credentials'); - } else { - throw Exception('Login failed: ${response.statusCode}'); - } - } catch (e) { - await _reportError('AuthService.login', e); - throw Exception('Login error: $e'); - } - } - - /// Get stored token - Future getToken() async { - await _initPrefs(); - return _prefs.getString(_tokenKey); - } - - /// Check if user is logged in - Future isLoggedIn() async { - final token = await getToken(); - return token != null; - } - - /// Logout - Future logout() async { - await _initPrefs(); - await _prefs.remove(_tokenKey); - } - - /// Get Authorization header - Future> getAuthHeaders() async { - final token = await getToken(); - return { - 'Authorization': 'Bearer $token', - 'Content-Type': 'application/json', - }; - } -} diff --git a/deprecated/lib/services/error_log_service.dart b/deprecated/lib/services/error_log_service.dart deleted file mode 100644 index 6765842..0000000 --- a/deprecated/lib/services/error_log_service.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'dart:convert'; -import 'package:http/http.dart' as http; - -class ErrorLogService { - static const String _apiBaseUrl = 'https://transit.xtransit.testinstance.nl'; - - static Future report({ - required String service, - required String partOfService, - required String error, - }) async { - try { - await http.post( - Uri.parse('$_apiBaseUrl/error_log'), - headers: {'Content-Type': 'application/json'}, - body: jsonEncode({ - 'service': service, - 'partOfService': partOfService, - 'error': error, - }), - ); - } catch (_) { - // Intentionally ignore logging failures. - } - } -} diff --git a/deprecated/lib/services/exceptions.dart b/deprecated/lib/services/exceptions.dart deleted file mode 100644 index 46e4aac..0000000 --- a/deprecated/lib/services/exceptions.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Custom exception for authentication errors -import 'app_navigator.dart'; - -class UnauthorizedException implements Exception { - final String message; - - UnauthorizedException(this.message) { - // Trigger centralized logout/navigation asynchronously - try { - handleAuthExpired(message: message); - } catch (_) {} - } - - @override - String toString() => message; -} diff --git a/deprecated/lib/services/navigation_service.dart b/deprecated/lib/services/navigation_service.dart deleted file mode 100644 index 9c7bb3f..0000000 --- a/deprecated/lib/services/navigation_service.dart +++ /dev/null @@ -1,378 +0,0 @@ -import 'dart:convert'; -import 'package:geolocator/geolocator.dart'; -import 'package:http/http.dart' as http; -import 'package:latlong2/latlong.dart'; -import 'error_log_service.dart'; -import '../models/navigation.dart'; - -/// Navigation Service using OpenStreetMap -class NavigationService { - // OSRM (OpenStreetMap Routing Machine) - free public service - static const String _osrmBaseUrl = 'https://router.project-osrm.org/route/v1/driving'; - - /// Get current device location - Future _reportError(String partOfService, Object error) { - return ErrorLogService.report( - service: 'bus_terminal', - partOfService: partOfService, - error: error.toString(), - ); - } - Future getCurrentLocation() async { - try { - final permission = await Geolocator.checkPermission(); - if (permission == LocationPermission.denied) { - await Geolocator.requestPermission(); - } - - final position = await Geolocator.getCurrentPosition( - desiredAccuracy: LocationAccuracy.high, - ); - - return NavigationPoint( - latitude: position.latitude, - longitude: position.longitude, - name: 'Current Location', - ); - } catch (e) { - await _reportError('NavigationService.getCurrentLocation', e); - throw Exception('Failed to get location: $e'); - } - } - - /// Get route between two points - /// Uses OSRM for open routing without API key - Future getRoute({ - required NavigationPoint start, - required NavigationPoint end, - }) async { - try { - bool validCoord(double lat, double lon) { - return lat.isFinite && lon.isFinite && lat >= -90 && lat <= 90 && lon >= -180 && lon <= 180; - } - - if (!validCoord(start.latitude, start.longitude) || !validCoord(end.latitude, end.longitude)) { - throw Exception('Invalid coordinates for routing: start=(${start.latitude},${start.longitude}) end=(${end.latitude},${end.longitude})'); - } - // OSRM format: /route/v1/driving/lon1,lat1;lon2,lat2 - final coordinates = - '${start.longitude},${start.latitude};${end.longitude},${end.latitude}'; - final url = - '$_osrmBaseUrl/$coordinates?overview=full&steps=true&geometries=geojson'; - - final response = await http.get(Uri.parse(url)); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map?; - if (data == null) { - throw Exception('Empty response from routing service'); - } - - if (data['code'] != 'Ok') { - throw Exception('Route not found: ${data['message'] ?? 'Unknown error'}'); - } - - final routes = data['routes'] as List?; - if (routes == null || routes.isEmpty) { - throw Exception('No route found in response'); - } - - final routeData = routes.first as Map; - return NavigationRoute.fromOsrmRouteData( - routeData, - start: start, - end: end, - ); - } else if (response.statusCode == 400) { - // Bad request: OSRM couldn't parse coordinates. Fall back to a simple straight-line route. - try { - final distanceMeters = calculateDistance(start, end); - final durationSec = (distanceMeters / 11.111111).toInt(); // assume ~40 km/h -> 11.11 m/s - final leg = RouteLeg.fromPoints(points: [start, end], distance: distanceMeters, duration: durationSec, summary: 'Direct'); - return NavigationRoute(start: start, end: end, legs: [leg], totalDistance: distanceMeters, totalDuration: durationSec); - } catch (e) { - throw Exception('Failed to get route (400) and fallback failed: ${e.toString()}'); - } - } else { - throw Exception('Failed to get route: ${response.statusCode} -- response body: ${response.body}'); - } - } catch (e) { - await _reportError('NavigationService.getRoute', e); - throw Exception('Navigation error: $e'); - } - } - - /// Get a route that passes through the provided stops in the given order. - Future getRouteThroughStops({ - required List stops, - }) async { - try { - if (stops.length < 2) { - throw Exception('At least two stops are required'); - } - - final coordinates = stops - .map((stop) => '${stop.longitude},${stop.latitude}') - .join(';'); - final url = - '$_osrmBaseUrl/$coordinates?overview=full&steps=true&geometries=geojson&source=first&destination=last'; - - final response = await http.get(Uri.parse(url)); - - if (response.statusCode != 200) { - if (response.statusCode == 400) { - final distanceMeters = _sumDistancesBetween(stops); - final durationSec = (distanceMeters / 11.111111).toInt(); - final leg = RouteLeg.fromPoints( - points: stops, - distance: distanceMeters, - duration: durationSec, - summary: 'Direct fallback', - ); - return NavigationRoute( - start: stops.first, - end: stops.last, - legs: [leg], - totalDistance: distanceMeters, - totalDuration: durationSec, - ); - } - - throw Exception('Failed to get route: ${response.statusCode} -- response body: ${response.body}'); - } - - final data = jsonDecode(response.body) as Map?; - if (data == null) { - throw Exception('Empty response from routing service'); - } - - if (data['code'] != 'Ok') { - throw Exception('Route not found: ${data['message'] ?? 'Unknown error'}'); - } - - final routes = data['routes'] as List?; - if (routes == null || routes.isEmpty) { - throw Exception('No route found in response'); - } - - final routeData = routes.first as Map; - return NavigationRoute.fromOsrmRouteData( - routeData, - start: stops.first, - end: stops.last, - ); - } catch (e) { - await _reportError('NavigationService.getRouteThroughStops', e); - throw Exception('Navigation error: $e'); - } - } - - /// Get an optimized trip through multiple stops. - /// Keeps the first and last stops fixed and lets OSRM order the intermediates. - Future getOptimizedRouteThroughStops({ - required List stops, - }) async { - try { - if (stops.length < 2) { - throw Exception('At least two stops are required'); - } - - final coordinates = stops - .map((stop) => '${stop.longitude},${stop.latitude}') - .join(';'); - final url = - 'https://router.project-osrm.org/trip/v1/driving/$coordinates?overview=full&steps=true&geometries=geojson&source=first&destination=last&roundtrip=false'; - - final response = await http.get(Uri.parse(url)); - - if (response.statusCode != 200) { - if (response.statusCode == 400) { - // fallback: return simple ordered stops route - final distanceMeters = _sumDistancesBetween(stops); - final durationSec = (distanceMeters / 11.111111).toInt(); - final leg = RouteLeg.fromPoints(points: stops, distance: distanceMeters, duration: durationSec, summary: 'Fallback optimized trip'); - final route = NavigationRoute(start: stops.first, end: stops.last, legs: [leg], totalDistance: distanceMeters, totalDuration: durationSec); - return OptimizedRouteResult(route: route, orderedStops: stops); - } - throw Exception('Failed to get optimized route: ${response.statusCode} -- response body: ${response.body}'); - } - - final data = jsonDecode(response.body) as Map?; - if (data == null) { - throw Exception('Empty response from routing service'); - } - - if (data['code'] != 'Ok') { - throw Exception('Optimized route not found: ${data['message'] ?? 'Unknown error'}'); - } - - final trips = data['trips'] as List?; - if (trips == null || trips.isEmpty) { - throw Exception('No optimized trip found'); - } - - final trip = trips.first as Map; - final geometry = trip['geometry'] as Map?; - final coordinatesData = geometry?['coordinates'] as List? ?? []; - final points = coordinatesData - .map((coord) { - if (coord is List && coord.length >= 2) { - return NavigationPoint( - latitude: (coord[1] as num).toDouble(), - longitude: (coord[0] as num).toDouble(), - ); - } - return null; - }) - .whereType() - .toList(); - - final waypointItems = (data['waypoints'] as List?) ?? []; - final orderedPairs = >[]; - - for (var i = 0; i < waypointItems.length && i < stops.length; i++) { - final waypoint = waypointItems[i]; - if (waypoint is! Map) continue; - final index = waypoint['waypoint_index'] as num?; - if (index == null) continue; - orderedPairs.add(MapEntry(index.toInt(), stops[i])); - } - - orderedPairs.sort((a, b) => a.key.compareTo(b.key)); - final orderedStops = orderedPairs.isNotEmpty - ? orderedPairs.map((entry) => entry.value).toList() - : stops; - - final route = NavigationRoute( - start: orderedStops.first, - end: orderedStops.last, - legs: [ - RouteLeg.fromPoints( - points: points, - distance: (trip['distance'] as num?)?.toDouble() ?? 0.0, - duration: (trip['duration'] as num?)?.toInt() ?? 0, - summary: 'Optimized trip', - ), - ], - totalDistance: (trip['distance'] as num?)?.toDouble() ?? 0.0, - totalDuration: (trip['duration'] as num?)?.toInt() ?? 0, - ); - - return OptimizedRouteResult( - route: route, - orderedStops: orderedStops.isNotEmpty ? orderedStops : stops, - ); - } catch (e) { - await _reportError('NavigationService.getOptimizedRouteThroughStops', e); - throw Exception('Navigation error: $e'); - } - } - - /// Get multiple routes (alternatives) - Future> getMultipleRoutes({ - required NavigationPoint start, - required NavigationPoint end, - int alternatives = 2, - }) async { - try { - final coordinates = - '${start.longitude},${start.latitude};${end.longitude},${end.latitude}'; - final url = - '$_osrmBaseUrl/$coordinates?overview=full&steps=true&geometries=geojson&alternatives=$alternatives'; - - final response = await http.get(Uri.parse(url)); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map?; - if (data == null) { - throw Exception('Empty response from routing service'); - } - - if (data['code'] != 'Ok') { - throw Exception('Routes not found: ${data['message'] ?? 'Unknown error'}'); - } - - final routesData = data['routes'] as List?; - if (routesData == null || routesData.isEmpty) { - throw Exception('No routes found in response'); - } - - final routes = routesData - .map((routeData) { - if (routeData is! Map) return null; - return NavigationRoute.fromOsrmRouteData( - routeData, - start: start, - end: end, - ); - }) - .whereType() - .toList(); - - return routes; - } else if (response.statusCode == 400) { - // fallback: single straight-line route - final distanceMeters = calculateDistance(start, end); - final durationSec = (distanceMeters / 11.111111).toInt(); - final leg = RouteLeg.fromPoints(points: [start, end], distance: distanceMeters, duration: durationSec, summary: 'Direct'); - return [NavigationRoute(start: start, end: end, legs: [leg], totalDistance: distanceMeters, totalDuration: durationSec)]; - } else { - throw Exception('Failed to get routes: ${response.statusCode} -- response body: ${response.body}'); - } - } catch (e) { - await _reportError('NavigationService.getMultipleRoutes', e); - throw Exception('Navigation error: $e'); - } - } - - double _sumDistancesBetween(List points) { - var total = 0.0; - for (var i = 0; i < points.length - 1; i++) { - total += calculateDistance(points[i], points[i + 1]); - } - return total; - } - - /// Calculate straight-line distance between two points - double calculateDistance(NavigationPoint p1, NavigationPoint p2) { - const distance = Distance(); - return distance( - LatLng(p1.latitude, p1.longitude), - LatLng(p2.latitude, p2.longitude), - ); - } - - /// Geocode a place name to coordinates using Nominatim (OpenStreetMap) - Future geocodePlace(String name) async { - try { - final uri = Uri.https('nominatim.openstreetmap.org', '/search', { - 'q': name, - 'format': 'json', - 'limit': '1', - }); - - final response = await http.get(uri, headers: { - 'User-Agent': 'bus-terminal-app', - }); - - if (response.statusCode != 200) { - throw Exception('Geocoding failed: ${response.statusCode}'); - } - - final list = jsonDecode(response.body) as List?; - if (list == null || list.isEmpty) { - throw Exception('No geocoding result for "$name"'); - } - - final item = list[0] as Map; - final lat = double.parse(item['lat'] as String); - final lon = double.parse(item['lon'] as String); - final display = item['display_name'] as String? ?? name; - - return NavigationPoint(latitude: lat, longitude: lon, name: display); - } catch (e) { - await _reportError('NavigationService.geocodePlace', e); - throw Exception('Geocode error: $e'); - } - } -} diff --git a/deprecated/lib/services/schedule_service.dart b/deprecated/lib/services/schedule_service.dart deleted file mode 100644 index 0157bca..0000000 --- a/deprecated/lib/services/schedule_service.dart +++ /dev/null @@ -1,323 +0,0 @@ -import 'dart:convert'; -import 'package:http/http.dart' as http; -import '../models/schedule.dart'; -import '../models/navigation.dart'; -import 'auth_service.dart'; -import 'error_log_service.dart'; -import 'exceptions.dart'; - -/// Schedule/Route Service -class ScheduleService { - static const String _apiBaseUrl = 'https://transit.xtransit.testinstance.nl'; - final _authService = AuthService(); - - Future _reportError(String partOfService, Object error) { - return ErrorLogService.report( - service: 'bus_terminal', - partOfService: partOfService, - error: error.toString(), - ); - } - - /// Get public schedule overview for a specific date. - Future> getSchedules(DateTime date, {int? lineId}) async { - try { - final dateStr = '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; - final queryParameters = {'date': dateStr}; - if (lineId != null) { - queryParameters['lineId'] = lineId.toString(); - } - - final uri = Uri.parse('$_apiBaseUrl/schedules/overview').replace(queryParameters: queryParameters); - final response = await http.get(uri); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - return (data['schedules'] as List? ?? []) - .map((schedule) => schedule as Map) - .map(ServiceSchedule.fromJson) - .toList(); - } - - throw Exception('Failed to load schedules: ${response.statusCode}'); - } catch (e) { - await _reportError('ScheduleService.getSchedules', e); - throw Exception('Schedule error: $e'); - } - } - - /// Get all recurring schedule templates, independent of a specific date. - Future> getRecurringSchedules({int? lineId}) async { - try { - final queryParameters = {}; - if (lineId != null) { - queryParameters['lineId'] = lineId.toString(); - } - - final uri = Uri.parse('$_apiBaseUrl/schedules/recurring').replace(queryParameters: queryParameters); - final response = await http.get(uri); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - return (data['schedules'] as List? ?? []) - .map((schedule) => schedule as Map) - .map(ServiceSchedule.fromJson) - .toList(); - } - - throw Exception('Failed to load recurring schedules: ${response.statusCode}'); - } catch (e) { - await _reportError('ScheduleService.getRecurringSchedules', e); - throw Exception('Recurring schedule error: $e'); - } - } - - /// Get stop list for a specific schedule. - Future> getScheduleStops(int scheduleId) async { - try { - final response = await http.get(Uri.parse('$_apiBaseUrl/schedules/$scheduleId/stops')); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - return (data['stops'] as List? ?? []) - .map((stop) => stop as Map) - .map(ScheduleStop.fromJson) - .toList(); - } - - throw Exception('Failed to load schedule stops: ${response.statusCode}'); - } catch (e) { - await _reportError('ScheduleService.getScheduleStops', e); - throw Exception('Schedule stops error: $e'); - } - } - - /// Get daily schedule for a specific date (includes recurring schedules) - Future getDailySchedule(DateTime date) async { - try { - final dateStr = '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; - - // Call /schedules/overview which includes both one-time and recurring schedules for the date - final uri = Uri.parse('$_apiBaseUrl/schedules/overview').replace( - queryParameters: {'date': dateStr} - ); - final response = await http.get(uri); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - final schedules = (data['schedules'] as List? ?? []) - .map((s) => s as Map) - .map(ServiceSchedule.fromJson) - .toList(); - - // Convert ServiceSchedule to Route objects for display - final routes = schedules.map((schedule) { - return Route( - id: schedule.id, - busLine: BusLine( - id: schedule.busLineId, - lineNumber: schedule.lineNumber, - startStop: '', - endStop: '', - estimatedDuration: 60, - description: '', - ), - busType: BusType( - id: schedule.busId, - name: schedule.busName, - seatCapacity: 0, - licensePlate: '', - ), - startTime: schedule.startTime, - endTime: schedule.endTime, - status: schedule.status, - ); - }).toList(); - - return DailySchedule( - routes: routes, - date: date, - ); - } else { - throw Exception('Failed to load schedule: ${response.statusCode}'); - } - } catch (e) { - await _reportError('ScheduleService.getDailySchedule', e); - throw Exception('Schedule error: $e'); - } - } - - /// Get today's schedule - Future getTodaySchedule() async { - return getDailySchedule(DateTime.now()); - } - - /// Get per-date progress for a schedule occurrence (public endpoint) - Future> getScheduleProgress(int scheduleId, DateTime date) async { - try { - final dateStr = '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; - final uri = Uri.parse('$_apiBaseUrl/public/schedules/$scheduleId/progress').replace(queryParameters: {'date': dateStr}); - final response = await http.get(uri); - - if (response.statusCode == 200) { - return jsonDecode(response.body) as Map; - } - - throw Exception('Failed to load progress: ${response.statusCode}'); - } catch (e) { - await _reportError('ScheduleService.getScheduleProgress', e); - throw Exception('Schedule progress error: $e'); - } - } - - /// Get route details - Future getRouteDetails(int routeId) async { - try { - final headers = await _authService.getAuthHeaders(); - - final response = await http.get( - Uri.parse('$_apiBaseUrl/routes/$routeId'), - headers: headers, - ); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - return Route.fromJson(data); - } else if (response.statusCode == 401 || response.statusCode == 403) { - throw UnauthorizedException('Session expired - Please login again'); - } else { - final body = response.body; - throw Exception('Failed to load route: ${response.statusCode} -- response body: $body'); - } - } catch (e) { - if (e is UnauthorizedException) rethrow; - await _reportError('ScheduleService.getRouteDetails', e); - throw Exception('Route error: $e'); - } - } - - /// Update route status - Future updateRouteStatus(int routeId, String status) async { - try { - final headers = await _authService.getAuthHeaders(); - - // Transit API updates status at /routes/:routeId/status - final response = await http.patch( - Uri.parse('$_apiBaseUrl/routes/$routeId/status'), - headers: headers, - body: jsonEncode({'status': status}), - ); - - if (response.statusCode == 401 || response.statusCode == 403) { - throw UnauthorizedException('Session expired - Please login again'); - } else if (response.statusCode != 200) { - throw Exception('Failed to update status: ${response.statusCode}'); - } - } catch (e) { - if (e is UnauthorizedException) rethrow; - await _reportError('ScheduleService.updateRouteStatus', e); - throw Exception('Status update error: $e'); - } - } - - /// Update schedule status for driver-facing schedule workflows. - Future updateScheduleStatus(int scheduleId, String status, {DateTime? date}) async { - try { - final headers = await _authService.getAuthHeaders(); - - final body = {'status': status}; - if (date != null) { - final dateStr = '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; - body['date'] = dateStr; - } - - final response = await http.patch( - Uri.parse('$_apiBaseUrl/driver/schedules/$scheduleId/status'), - headers: headers, - body: jsonEncode(body), - ); - - if (response.statusCode == 401 || response.statusCode == 403) { - throw UnauthorizedException('Session expired - Please login again'); - } else if (response.statusCode != 200) { - throw Exception('Failed to update schedule status: ${response.statusCode}'); - } - } catch (e) { - if (e is UnauthorizedException) rethrow; - await _reportError('ScheduleService.updateScheduleStatus', e); - throw Exception('Schedule status update error: $e'); - } - } - - /// Get stops for a bus line - Future> getStops(int busLineId) async { - try { - final headers = await _authService.getAuthHeaders(); - - final response = await http.get( - Uri.parse('$_apiBaseUrl/bus-lines/$busLineId/stops'), - headers: headers, - ); - - if (response.statusCode == 200) { - final data = jsonDecode(response.body) as Map; - final raw = data['stops'] as List? ?? []; - final stops = raw.map((s) => s as Map).map((s) { - final lat = (s['latitude'] ?? s['lat']) as num?; - final lon = (s['longitude'] ?? s['lon']) as num?; - final name = (s['name'] ?? s['stop_name'] ?? s['stopName']) as String?; - if (lat == null || lon == null) return null; - return NavigationPoint( - latitude: lat.toDouble(), - longitude: lon.toDouble(), - name: name, - ); - }).whereType().toList(); - - return stops; - } else if (response.statusCode == 401 || response.statusCode == 403) { - throw UnauthorizedException('Session expired - Please login again'); - } else { - final body = response.body; - throw Exception('Failed to load stops: ${response.statusCode} -- response body: $body'); - } - } catch (e) { - if (e is UnauthorizedException) rethrow; - await _reportError('ScheduleService.getStops', e); - throw Exception('Get stops error: $e'); - } - } - - /// Mark a schedule stop as passed by the driver. - Future markScheduleStopPassed({ - required int scheduleId, - required int stopOrder, - DateTime? actualPassedAt, - }) async { - try { - final headers = await _authService.getAuthHeaders(); - - final body = {}; - if (actualPassedAt != null) body['actualPassedAt'] = actualPassedAt.toIso8601String(); - - final response = await http.post( - Uri.parse('$_apiBaseUrl/driver/schedules/$scheduleId/stops/$stopOrder/passed'), - headers: headers, - body: jsonEncode(body), - ); - - if (response.statusCode == 401 || response.statusCode == 403) { - await _authService.logout(); - throw UnauthorizedException('Session expired - Please login again'); - } - - if (response.statusCode < 200 || response.statusCode >= 300) { - throw Exception('Failed to mark stop as passed: ${response.statusCode}'); - } - } catch (e) { - if (e is UnauthorizedException) rethrow; - await _reportError('ScheduleService.markScheduleStopPassed', e); - throw Exception('Mark stop passed error: $e'); - } - } -} diff --git a/deprecated/lib/theme/app_theme.dart b/deprecated/lib/theme/app_theme.dart deleted file mode 100644 index 45b3e88..0000000 --- a/deprecated/lib/theme/app_theme.dart +++ /dev/null @@ -1,206 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Material 3 Theme configuratie voor bus_terminal -class AppTheme { - static const Color _navy = Color(0xFF0F172A); - static const Color _surface = Color(0xFFF8FAFC); - static const Color _surfaceDark = Color(0xFF111827); - static const Color _amber = Color(0xFFF59E0B); - static const Color _cyan = Color(0xFF38BDF8); - static const Color _success = Color(0xFF22C55E); - static const Color _error = Color(0xFFEF4444); - - static TextTheme _textTheme(ColorScheme colorScheme) { - return TextTheme( - displayLarge: const TextStyle(fontSize: 46, fontWeight: FontWeight.w800, letterSpacing: -1.2), - displayMedium: const TextStyle(fontSize: 38, fontWeight: FontWeight.w800, letterSpacing: -0.9), - headlineLarge: const TextStyle(fontSize: 30, fontWeight: FontWeight.w800, letterSpacing: -0.4), - headlineMedium: const TextStyle(fontSize: 24, fontWeight: FontWeight.w700, letterSpacing: -0.3), - titleLarge: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700), - titleMedium: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700), - titleSmall: const TextStyle(fontSize: 14, fontWeight: FontWeight.w700), - bodyLarge: TextStyle(fontSize: 16, height: 1.45, color: colorScheme.onSurface), - bodyMedium: TextStyle(fontSize: 14, height: 1.45, color: colorScheme.onSurfaceVariant), - bodySmall: TextStyle(fontSize: 12, height: 1.35, color: colorScheme.onSurfaceVariant), - labelLarge: const TextStyle(fontSize: 14, fontWeight: FontWeight.w700), - labelMedium: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600), - labelSmall: const TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: 0.25), - ); - } - - static ColorScheme _buildLightScheme() { - return ColorScheme.fromSeed( - seedColor: _cyan, - brightness: Brightness.light, - primary: _navy, - secondary: _amber, - tertiary: _cyan, - surface: _surface, - onSurface: _navy, - error: _error, - ).copyWith( - surfaceContainerHighest: const Color(0xFFE2E8F0), - outline: const Color(0xFF94A3B8), - ); - } - - static ColorScheme _buildDarkScheme() { - return ColorScheme.fromSeed( - seedColor: _cyan, - brightness: Brightness.dark, - primary: _cyan, - secondary: _amber, - tertiary: _success, - surface: _surfaceDark, - onSurface: Colors.white, - error: _error, - ).copyWith( - surfaceContainerHighest: const Color(0xFF1F2937), - outline: const Color(0xFF334155), - ); - } - - static ThemeData lightTheme() { - final colorScheme = _buildLightScheme(); - return ThemeData( - useMaterial3: true, - brightness: Brightness.light, - colorScheme: colorScheme, - scaffoldBackgroundColor: const Color(0xFFF1F5F9), - materialTapTargetSize: MaterialTapTargetSize.padded, - textTheme: _textTheme(colorScheme), - appBarTheme: AppBarTheme( - backgroundColor: colorScheme.surface, - foregroundColor: colorScheme.onSurface, - elevation: 0, - centerTitle: false, - titleTextStyle: _textTheme(colorScheme).titleLarge?.copyWith(color: colorScheme.onSurface), - ), - cardTheme: CardThemeData( - color: colorScheme.surface, - elevation: 0, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - margin: EdgeInsets.zero, - ), - dividerTheme: DividerThemeData(color: colorScheme.outline.withOpacity(0.18), thickness: 1), - inputDecorationTheme: InputDecorationTheme( - filled: true, - fillColor: Colors.white, - border: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.outline.withOpacity(0.25))), - enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.outline.withOpacity(0.25))), - focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.primary, width: 2)), - errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.error)), - contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18), - labelStyle: TextStyle(color: colorScheme.onSurfaceVariant), - hintStyle: TextStyle(color: colorScheme.onSurfaceVariant.withOpacity(0.8)), - ), - filledButtonTheme: FilledButtonThemeData( - style: FilledButton.styleFrom( - backgroundColor: colorScheme.primary, - foregroundColor: Colors.white, - minimumSize: const Size.fromHeight(56), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700), - ), - ), - elevatedButtonTheme: ElevatedButtonThemeData( - style: ElevatedButton.styleFrom( - backgroundColor: colorScheme.secondary, - foregroundColor: colorScheme.onSecondary, - minimumSize: const Size.fromHeight(52), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w700), - ), - ), - outlinedButtonTheme: OutlinedButtonThemeData( - style: OutlinedButton.styleFrom( - foregroundColor: colorScheme.onSurface, - minimumSize: const Size.fromHeight(52), - side: BorderSide(color: colorScheme.outline.withOpacity(0.35)), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - ), - ), - chipTheme: ChipThemeData( - backgroundColor: colorScheme.surfaceContainerHighest, - labelStyle: TextStyle(color: colorScheme.onSurface, fontWeight: FontWeight.w600), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(999)), - ), - progressIndicatorTheme: ProgressIndicatorThemeData( - color: colorScheme.primary, - linearTrackColor: colorScheme.primary.withOpacity(0.12), - ), - ); - } - - static ThemeData darkTheme() { - final colorScheme = _buildDarkScheme(); - return ThemeData( - useMaterial3: true, - brightness: Brightness.dark, - colorScheme: colorScheme, - scaffoldBackgroundColor: const Color(0xFF0B1220), - materialTapTargetSize: MaterialTapTargetSize.padded, - textTheme: _textTheme(colorScheme).apply(bodyColor: Colors.white, displayColor: Colors.white), - appBarTheme: AppBarTheme( - backgroundColor: const Color(0xFF0B1220), - foregroundColor: Colors.white, - elevation: 0, - centerTitle: false, - titleTextStyle: _textTheme(colorScheme).titleLarge?.copyWith(color: Colors.white), - ), - cardTheme: CardThemeData( - color: const Color(0xFF111827), - elevation: 0, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - margin: EdgeInsets.zero, - ), - dividerTheme: const DividerThemeData(color: Color(0xFF243244), thickness: 1), - inputDecorationTheme: InputDecorationTheme( - filled: true, - fillColor: const Color(0xFF111827), - border: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: const BorderSide(color: Color(0xFF334155))), - enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: const BorderSide(color: Color(0xFF334155))), - focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.primary, width: 2)), - errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: colorScheme.error)), - contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18), - labelStyle: const TextStyle(color: Color(0xFFCBD5E1)), - hintStyle: const TextStyle(color: Color(0xFF94A3B8)), - ), - filledButtonTheme: FilledButtonThemeData( - style: FilledButton.styleFrom( - backgroundColor: colorScheme.primary, - foregroundColor: Colors.black, - minimumSize: const Size.fromHeight(56), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700), - ), - ), - elevatedButtonTheme: ElevatedButtonThemeData( - style: ElevatedButton.styleFrom( - backgroundColor: colorScheme.secondary, - foregroundColor: Colors.black, - minimumSize: const Size.fromHeight(52), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w700), - ), - ), - outlinedButtonTheme: OutlinedButtonThemeData( - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - minimumSize: const Size.fromHeight(52), - side: const BorderSide(color: Color(0xFF334155)), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - ), - ), - chipTheme: ChipThemeData( - backgroundColor: const Color(0xFF1E293B), - labelStyle: const TextStyle(color: Colors.white, fontWeight: FontWeight.w600), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(999)), - ), - progressIndicatorTheme: ProgressIndicatorThemeData( - color: colorScheme.primary, - linearTrackColor: colorScheme.primary.withOpacity(0.16), - ), - ); - } -} diff --git a/deprecated/lib/widgets/.gitkeep b/deprecated/lib/widgets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/deprecated/lib/widgets/custom_input_field.dart b/deprecated/lib/widgets/custom_input_field.dart deleted file mode 100644 index d1ec8af..0000000 --- a/deprecated/lib/widgets/custom_input_field.dart +++ /dev/null @@ -1,105 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Custom input field optimized for bus drivers -/// - Large touch targets (40+ height) -/// - Clear visibility -/// - Accessible design -class CustomInputField extends StatefulWidget { - final String label; - final String hint; - final TextEditingController controller; - final bool obscureText; - final TextInputType keyboardType; - final String? Function(String?)? validator; - - const CustomInputField({ - super.key, - required this.label, - required this.hint, - required this.controller, - this.obscureText = false, - this.keyboardType = TextInputType.text, - this.validator, - }); - - @override - State createState() => _CustomInputFieldState(); -} - -class _CustomInputFieldState extends State { - late bool _obscureText; - - @override - void initState() { - super.initState(); - _obscureText = widget.obscureText; - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.label, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 8), - TextFormField( - controller: widget.controller, - obscureText: _obscureText, - keyboardType: widget.keyboardType, - validator: widget.validator, - decoration: InputDecoration( - hintText: widget.hint, - hintStyle: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 16, // Larger vertical padding for touch targets - ), - prefixIcon: Icon( - widget.obscureText ? Icons.lock_outline : Icons.badge_outlined, - color: colorScheme.primary, - ), - filled: true, - fillColor: colorScheme.surface, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(16), - borderSide: BorderSide(color: colorScheme.outline.withOpacity(0.25)), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(16), - borderSide: BorderSide(color: colorScheme.outline.withOpacity(0.25)), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(16), - borderSide: BorderSide(color: colorScheme.primary, width: 2), - ), - suffixIcon: widget.obscureText - ? IconButton( - tooltip: _obscureText ? 'Toon wachtwoord' : 'Verberg wachtwoord', - onPressed: () { - setState(() => _obscureText = !_obscureText); - }, - icon: Icon( - _obscureText ? Icons.visibility_off : Icons.visibility, - size: 28, // Larger icon for accessibility - color: colorScheme.primary, - ), - splashRadius: 24, - constraints: const BoxConstraints(minWidth: 48, minHeight: 48), - ) - : null, - ), - style: Theme.of(context).textTheme.bodyLarge, - ), - ], - ); - } -} diff --git a/deprecated/lib/widgets/route_card.dart b/deprecated/lib/widgets/route_card.dart deleted file mode 100644 index 012759f..0000000 --- a/deprecated/lib/widgets/route_card.dart +++ /dev/null @@ -1,245 +0,0 @@ -// ignore_for_file: use_build_context_synchronously - -import 'package:flutter/material.dart'; -import '../models/schedule.dart' as schedule; -import '../screens/navigation_screen.dart'; -import '../services/schedule_service.dart'; - -/// Route card widget showing route details -class RouteCard extends StatelessWidget { - final schedule.Route route; - final VoidCallback onTap; - - const RouteCard({ - super.key, - required this.route, - required this.onTap, - }); - - Color _getStatusColor(String status) { - switch (status) { - case 'scheduled': - return Colors.blue; - case 'in_progress': - return Colors.orange; - case 'completed': - return Colors.green; - case 'cancelled': - return Colors.red; - default: - return Colors.grey; - } - } - - String _getStatusLabel(String status) { - switch (status) { - case 'scheduled': - return 'Planned'; - case 'in_progress': - return 'In Progress'; - case 'completed': - return 'Completed'; - case 'cancelled': - return 'Cancelled'; - default: - return status; - } - } - - String _formatTime(DateTime time) { - return '${time.hour.toString().padLeft(2, '0')}:${time.minute.toString().padLeft(2, '0')}'; - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - final statusColor = _getStatusColor(route.status); - final startTimeStr = _formatTime(route.startTime); - - return Material( - color: Colors.transparent, - child: InkWell( - onTap: () async { - try { - final scheduleService = ScheduleService(); - await scheduleService.updateRouteStatus(route.id, 'in_progress'); - } catch (_) { - // Ignore status update errors here; navigation should still open. - } - - try { - await Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => NavigationScreen(route: route), - ), - ); - } catch (e) { - // Surface navigation errors to the user so they can report/log. - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Navigatiefout: ${e.toString()}')), - ); - } - }, - borderRadius: BorderRadius.circular(20), - splashFactory: InkSparkle.splashFactory, - child: Card( - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - elevation: 0, - color: colorScheme.surface, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: Padding( - padding: const EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Header: Line number + Status - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Line number - Large and prominent - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [colorScheme.primary, colorScheme.tertiary], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(8), - ), - child: Text( - 'Line ${route.busLine.lineNumber}', - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - ), - // Status badge - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - decoration: BoxDecoration( - color: statusColor.withOpacity(0.14), - border: Border.all(color: statusColor), - borderRadius: BorderRadius.circular(20), - ), - child: Text( - _getStatusLabel(route.status), - style: TextStyle( - color: statusColor, - fontWeight: FontWeight.w600, - fontSize: 12, - ), - ), - ), - ], - ), - const SizedBox(height: 16), - - // Route info: Start -> End - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'From', - style: Theme.of(context).textTheme.labelSmall, - ), - Text( - route.busLine.startStop, - style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - ], - ), - ), - Icon( - Icons.arrow_forward, - color: colorScheme.outline, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - 'To', - style: Theme.of(context).textTheme.labelSmall, - ), - Text( - route.busLine.endStop, - style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - ], - ), - ), - ], - ), - const SizedBox(height: 16), - - // Bus info and time - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Bus type - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Bus', - style: Theme.of(context).textTheme.labelSmall, - ), - Text( - '${route.busType.name} (${route.busType.seatCapacity} seats)', - style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 4), - Text( - route.busType.licensePlate, - style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - ], - ), - // Start time - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - 'Start Time', - style: Theme.of(context).textTheme.labelSmall, - ), - Text( - startTimeStr, - style: Theme.of(context).textTheme.headlineSmall?.copyWith( - fontWeight: FontWeight.bold, - color: colorScheme.primary, - ), - ), - const SizedBox(height: 4), - Text( - '${route.busLine.estimatedDuration} min duration', - style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - ], - ), - ], - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/deprecated/linux/.gitignore b/deprecated/linux/.gitignore deleted file mode 100644 index d3896c9..0000000 --- a/deprecated/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -flutter/ephemeral diff --git a/deprecated/linux/CMakeLists.txt b/deprecated/linux/CMakeLists.txt deleted file mode 100644 index c970f7f..0000000 --- a/deprecated/linux/CMakeLists.txt +++ /dev/null @@ -1,128 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "bus_terminal") -# The unique GTK application identifier for this application. See: -# https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.bus_terminal") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Load bundled libraries from the lib/ directory relative to the binary. -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Define build configuration options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) - -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) - install(FILES "${bundled_library}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endforeach(bundled_library) - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() diff --git a/deprecated/linux/flutter/CMakeLists.txt b/deprecated/linux/flutter/CMakeLists.txt deleted file mode 100644 index d5bd016..0000000 --- a/deprecated/linux/flutter/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) diff --git a/deprecated/linux/flutter/generated_plugin_registrant.cc b/deprecated/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index e71a16d..0000000 --- a/deprecated/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - - -void fl_register_plugins(FlPluginRegistry* registry) { -} diff --git a/deprecated/linux/flutter/generated_plugin_registrant.h b/deprecated/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47..0000000 --- a/deprecated/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/deprecated/linux/flutter/generated_plugins.cmake b/deprecated/linux/flutter/generated_plugins.cmake deleted file mode 100644 index 2e1de87..0000000 --- a/deprecated/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/deprecated/linux/runner/CMakeLists.txt b/deprecated/linux/runner/CMakeLists.txt deleted file mode 100644 index e97dabc..0000000 --- a/deprecated/linux/runner/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the application ID. -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/deprecated/linux/runner/main.cc b/deprecated/linux/runner/main.cc deleted file mode 100644 index e7c5c54..0000000 --- a/deprecated/linux/runner/main.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} diff --git a/deprecated/linux/runner/my_application.cc b/deprecated/linux/runner/my_application.cc deleted file mode 100644 index 02b8a15..0000000 --- a/deprecated/linux/runner/my_application.cc +++ /dev/null @@ -1,148 +0,0 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Called when first Flutter frame received. -static void first_frame_cb(MyApplication* self, FlView* view) { - gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); -} - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "bus_terminal"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "bus_terminal"); - } - - gtk_window_set_default_size(window, 1280, 720); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments( - project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - GdkRGBA background_color; - // Background defaults to black, override it here if necessary, e.g. #00000000 - // for transparent. - gdk_rgba_parse(&background_color, "#000000"); - fl_view_set_background_color(view, &background_color); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - // Show the window when Flutter renders. - // Requires the view to be realized so we can start rendering. - g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), - self); - gtk_widget_realize(GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, - gchar*** arguments, - int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GApplication::startup. -static void my_application_startup(GApplication* application) { - // MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application startup. - - G_APPLICATION_CLASS(my_application_parent_class)->startup(application); -} - -// Implements GApplication::shutdown. -static void my_application_shutdown(GApplication* application) { - // MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application shutdown. - - G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = - my_application_local_command_line; - G_APPLICATION_CLASS(klass)->startup = my_application_startup; - G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - // Set the program name to the application ID, which helps various systems - // like GTK and desktop environments map this running application to its - // corresponding .desktop file. This ensures better integration by allowing - // the application to be recognized beyond its binary name. - g_set_prgname(APPLICATION_ID); - - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, "flags", - G_APPLICATION_NON_UNIQUE, nullptr)); -} diff --git a/deprecated/linux/runner/my_application.h b/deprecated/linux/runner/my_application.h deleted file mode 100644 index db16367..0000000 --- a/deprecated/linux/runner/my_application.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, - my_application, - MY, - APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/deprecated/macos/.gitignore b/deprecated/macos/.gitignore deleted file mode 100644 index 746adbb..0000000 --- a/deprecated/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/deprecated/macos/Flutter/Flutter-Debug.xcconfig b/deprecated/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index c2efd0b..0000000 --- a/deprecated/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/deprecated/macos/Flutter/Flutter-Release.xcconfig b/deprecated/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index c2efd0b..0000000 --- a/deprecated/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/deprecated/macos/Flutter/GeneratedPluginRegistrant.swift b/deprecated/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index de906b1..0000000 --- a/deprecated/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import geolocator_apple -import shared_preferences_foundation - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) -} diff --git a/deprecated/macos/Runner.xcodeproj/project.pbxproj b/deprecated/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 061bc68..0000000 --- a/deprecated/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,705 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC10EC2044A3C60003C045; - remoteInfo = Runner; - }; - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* bus_terminal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "bus_terminal.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331C80D2294CF70F00263BE5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C80D6294CF71000263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C80D7294CF71000263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 331C80D6294CF71000263BE5 /* RunnerTests */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* bus_terminal.app */, - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C80D4294CF70F00263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C80D1294CF70F00263BE5 /* Sources */, - 331C80D2294CF70F00263BE5 /* Frameworks */, - 331C80D3294CF70F00263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C80DA294CF71000263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* bus_terminal.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C80D4294CF70F00263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 33CC10EC2044A3C60003C045; - }; - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 331C80D4294CF70F00263BE5 /* RunnerTests */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C80D3294CF70F00263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C80D1294CF70F00263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC10EC2044A3C60003C045 /* Runner */; - targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; - }; - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 331C80DB294CF71000263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bus_terminal.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bus_terminal"; - }; - name = Debug; - }; - 331C80DC294CF71000263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bus_terminal.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bus_terminal"; - }; - name = Release; - }; - 331C80DD294CF71000263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bus_terminal.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bus_terminal"; - }; - name = Profile; - }; - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C80DB294CF71000263BE5 /* Debug */, - 331C80DC294CF71000263BE5 /* Release */, - 331C80DD294CF71000263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/deprecated/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/deprecated/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/deprecated/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/deprecated/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/deprecated/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index acae325..0000000 --- a/deprecated/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/macos/Runner.xcworkspace/contents.xcworkspacedata b/deprecated/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a1..0000000 --- a/deprecated/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/deprecated/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/deprecated/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/deprecated/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/deprecated/macos/Runner/AppDelegate.swift b/deprecated/macos/Runner/AppDelegate.swift deleted file mode 100644 index b3c1761..0000000 --- a/deprecated/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Cocoa -import FlutterMacOS - -@main -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } - - override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { - return true - } -} diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f..0000000 --- a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 82b6f9d..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index 13b35eb..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 0a3f5fa..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bdb5722..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index f083318..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index 326c0e7..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 2f1632c..0000000 Binary files a/deprecated/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/deprecated/macos/Runner/Base.lproj/MainMenu.xib b/deprecated/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 80e867a..0000000 --- a/deprecated/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated/macos/Runner/Configs/AppInfo.xcconfig b/deprecated/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index 800b60b..0000000 --- a/deprecated/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = bus_terminal - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.busTerminal - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved. diff --git a/deprecated/macos/Runner/Configs/Debug.xcconfig b/deprecated/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd9..0000000 --- a/deprecated/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/deprecated/macos/Runner/Configs/Release.xcconfig b/deprecated/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f49..0000000 --- a/deprecated/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/deprecated/macos/Runner/Configs/Warnings.xcconfig b/deprecated/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf4..0000000 --- a/deprecated/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/deprecated/macos/Runner/DebugProfile.entitlements b/deprecated/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index dddb8a3..0000000 --- a/deprecated/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/deprecated/macos/Runner/Info.plist b/deprecated/macos/Runner/Info.plist deleted file mode 100644 index 4789daa..0000000 --- a/deprecated/macos/Runner/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/deprecated/macos/Runner/MainFlutterWindow.swift b/deprecated/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index 3cc05eb..0000000 --- a/deprecated/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/deprecated/macos/Runner/Release.entitlements b/deprecated/macos/Runner/Release.entitlements deleted file mode 100644 index 852fa1a..0000000 --- a/deprecated/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/deprecated/macos/RunnerTests/RunnerTests.swift b/deprecated/macos/RunnerTests/RunnerTests.swift deleted file mode 100644 index 61f3bd1..0000000 --- a/deprecated/macos/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Cocoa -import FlutterMacOS -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/deprecated/pubspec.lock b/deprecated/pubspec.lock deleted file mode 100644 index 2c8b1dd..0000000 --- a/deprecated/pubspec.lock +++ /dev/null @@ -1,514 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 - url: "https://pub.dev" - source: hosted - version: "2.13.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - characters: - dependency: transitive - description: - name: characters - sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b - url: "https://pub.dev" - source: hosted - version: "1.4.1" - clock: - dependency: transitive - description: - name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://pub.dev" - source: hosted - version: "1.1.2" - collection: - dependency: transitive - description: - name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.dev" - source: hosted - version: "1.19.1" - crypto: - dependency: transitive - description: - name: crypto - sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf - url: "https://pub.dev" - source: hosted - version: "3.0.7" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" - url: "https://pub.dev" - source: hosted - version: "1.3.3" - ffi: - dependency: transitive - description: - name: ffi - sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.dev" - source: hosted - version: "7.0.1" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" - source: hosted - version: "1.1.1" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" - url: "https://pub.dev" - source: hosted - version: "6.0.0" - flutter_map: - dependency: "direct main" - description: - name: flutter_map - sha256: "87cc8349b8fa5dccda5af50018c7374b6645334a0d680931c1fe11bce88fa5bb" - url: "https://pub.dev" - source: hosted - version: "6.2.1" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - geolocator: - dependency: "direct main" - description: - name: geolocator - sha256: f4efb8d3c4cdcad2e226af9661eb1a0dd38c71a9494b22526f9da80ab79520e5 - url: "https://pub.dev" - source: hosted - version: "10.1.1" - geolocator_android: - dependency: transitive - description: - name: geolocator_android - sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d - url: "https://pub.dev" - source: hosted - version: "4.6.2" - geolocator_apple: - dependency: transitive - description: - name: geolocator_apple - sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 - url: "https://pub.dev" - source: hosted - version: "2.3.13" - geolocator_platform_interface: - dependency: transitive - description: - name: geolocator_platform_interface - sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" - url: "https://pub.dev" - source: hosted - version: "4.2.6" - geolocator_web: - dependency: transitive - description: - name: geolocator_web - sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece" - url: "https://pub.dev" - source: hosted - version: "2.2.1" - geolocator_windows: - dependency: transitive - description: - name: geolocator_windows - sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" - url: "https://pub.dev" - source: hosted - version: "0.2.5" - http: - dependency: "direct main" - description: - name: http - sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" - url: "https://pub.dev" - source: hosted - version: "1.6.0" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.dev" - source: hosted - version: "4.1.2" - intl: - dependency: transitive - description: - name: intl - sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" - url: "https://pub.dev" - source: hosted - version: "0.20.2" - latlong2: - dependency: "direct main" - description: - name: latlong2 - sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" - url: "https://pub.dev" - source: hosted - version: "0.9.1" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" - url: "https://pub.dev" - source: hosted - version: "11.0.2" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" - url: "https://pub.dev" - source: hosted - version: "3.0.10" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - lints: - dependency: transitive - description: - name: lints - sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" - url: "https://pub.dev" - source: hosted - version: "6.1.0" - lists: - dependency: transitive - description: - name: lists - sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - logger: - dependency: transitive - description: - name: logger - sha256: "25aee487596a6257655a1e091ec2ae66bc30e7af663592cc3a27e6591e05035c" - url: "https://pub.dev" - source: hosted - version: "2.7.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 - url: "https://pub.dev" - source: hosted - version: "0.12.19" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" - url: "https://pub.dev" - source: hosted - version: "0.13.0" - meta: - dependency: transitive - description: - name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" - url: "https://pub.dev" - source: hosted - version: "1.17.0" - mgrs_dart: - dependency: transitive - description: - name: mgrs_dart - sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - path: - dependency: transitive - description: - name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" - source: hosted - version: "2.3.0" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.dev" - source: hosted - version: "3.1.6" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - polylabel: - dependency: transitive - description: - name: polylabel - sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - proj4dart: - dependency: transitive - description: - name: proj4dart - sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e - url: "https://pub.dev" - source: hosted - version: "2.1.0" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf - url: "https://pub.dev" - source: hosted - version: "2.5.5" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: e8d4762b1e2e8578fc4d0fd548cebf24afd24f49719c08974df92834565e2c53 - url: "https://pub.dev" - source: hosted - version: "2.4.23" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" - url: "https://pub.dev" - source: hosted - version: "2.5.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" - url: "https://pub.dev" - source: hosted - version: "2.4.2" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.dev" - source: hosted - version: "2.4.3" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - source_span: - dependency: transitive - description: - name: source_span - sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" - url: "https://pub.dev" - source: hosted - version: "1.10.2" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.dev" - source: hosted - version: "1.12.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.dev" - source: hosted - version: "1.4.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.dev" - source: hosted - version: "1.2.2" - test_api: - dependency: transitive - description: - name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" - url: "https://pub.dev" - source: hosted - version: "0.7.10" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - unicode: - dependency: transitive - description: - name: unicode - sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" - url: "https://pub.dev" - source: hosted - version: "0.3.1" - uuid: - dependency: transitive - description: - name: uuid - sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" - url: "https://pub.dev" - source: hosted - version: "4.5.3" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b - url: "https://pub.dev" - source: hosted - version: "2.2.0" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" - url: "https://pub.dev" - source: hosted - version: "15.2.0" - web: - dependency: transitive - description: - name: web - sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - wkt_parser: - dependency: transitive - description: - name: wkt_parser - sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.dev" - source: hosted - version: "1.1.0" -sdks: - dart: ">=3.11.5 <4.0.0" - flutter: ">=3.35.0" diff --git a/deprecated/pubspec.yaml b/deprecated/pubspec.yaml deleted file mode 100644 index 40aa161..0000000 --- a/deprecated/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: deprecated -description: "Deprecated legacy transit terminal retained for reference during migration." -publish_to: "none" -version: 0.1.0+1 - -environment: - sdk: ^3.11.5 - -dependencies: - flutter: - sdk: flutter - http: ^1.1.0 - shared_preferences: ^2.2.2 - flutter_map: ^6.1.0 - latlong2: ^0.9.1 - geolocator: ^10.0.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^6.0.0 - -flutter: - uses-material-design: true diff --git a/deprecated/web/favicon.png b/deprecated/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/deprecated/web/favicon.png and /dev/null differ diff --git a/deprecated/web/icons/Icon-192.png b/deprecated/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/deprecated/web/icons/Icon-192.png and /dev/null differ diff --git a/deprecated/web/icons/Icon-512.png b/deprecated/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/deprecated/web/icons/Icon-512.png and /dev/null differ diff --git a/deprecated/web/icons/Icon-maskable-192.png b/deprecated/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d7..0000000 Binary files a/deprecated/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/deprecated/web/icons/Icon-maskable-512.png b/deprecated/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c566..0000000 Binary files a/deprecated/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/deprecated/web/index.html b/deprecated/web/index.html deleted file mode 100644 index 91c79e0..0000000 --- a/deprecated/web/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - bus_terminal - - - - - - - diff --git a/deprecated/web/manifest.json b/deprecated/web/manifest.json deleted file mode 100644 index ea456ca..0000000 --- a/deprecated/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "deprecated", - "short_name": "deprecated", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "Deprecated legacy transit terminal retained for reference during migration.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/deprecated/windows/.gitignore b/deprecated/windows/.gitignore deleted file mode 100644 index d492d0d..0000000 --- a/deprecated/windows/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ diff --git a/deprecated/windows/CMakeLists.txt b/deprecated/windows/CMakeLists.txt deleted file mode 100644 index 3760811..0000000 --- a/deprecated/windows/CMakeLists.txt +++ /dev/null @@ -1,108 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.14) -project(deprecated LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "deprecated") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(VERSION 3.14...3.25) - -# Define build configuration option. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() -# Define settings for the Profile build mode. -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) diff --git a/deprecated/windows/flutter/CMakeLists.txt b/deprecated/windows/flutter/CMakeLists.txt deleted file mode 100644 index 903f489..0000000 --- a/deprecated/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# Set fallback configurations for older versions of the flutter tool. -if (NOT DEFINED FLUTTER_TARGET_PLATFORM) - set(FLUTTER_TARGET_PLATFORM "windows-x64") -endif() - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - ${FLUTTER_TARGET_PLATFORM} $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) diff --git a/deprecated/windows/flutter/generated_plugin_registrant.cc b/deprecated/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 1ece8f2..0000000 --- a/deprecated/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - GeolocatorWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("GeolocatorWindows")); -} diff --git a/deprecated/windows/flutter/generated_plugin_registrant.h b/deprecated/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d8..0000000 --- a/deprecated/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/deprecated/windows/flutter/generated_plugins.cmake b/deprecated/windows/flutter/generated_plugins.cmake deleted file mode 100644 index 7f101a7..0000000 --- a/deprecated/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - geolocator_windows -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/deprecated/windows/runner/CMakeLists.txt b/deprecated/windows/runner/CMakeLists.txt deleted file mode 100644 index 394917c..0000000 --- a/deprecated/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the build version. -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - -# Disable Windows macros that collide with C++ standard library functions. -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") - -# Add dependency libraries and include directories. Add any application-specific -# dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/deprecated/windows/runner/Runner.rc b/deprecated/windows/runner/Runner.rc deleted file mode 100644 index d098a10..0000000 --- a/deprecated/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) -#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD -#else -#define VERSION_AS_NUMBER 1,0,0,0 -#endif - -#if defined(FLUTTER_VERSION) -#define VERSION_AS_STRING FLUTTER_VERSION -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "deprecated" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "deprecated" "\0" - VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "deprecated.exe" "\0" - VALUE "ProductName", "deprecated" "\0" - VALUE "ProductVersion", VERSION_AS_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/deprecated/windows/runner/flutter_window.cpp b/deprecated/windows/runner/flutter_window.cpp deleted file mode 100644 index 955ee30..0000000 --- a/deprecated/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - - flutter_controller_->engine()->SetNextFrameCallback([&]() { - this->Show(); - }); - - // Flutter can complete the first frame before the "show window" callback is - // registered. The following call ensures a frame is pending to ensure the - // window is shown. It is a no-op if the first frame hasn't completed yet. - flutter_controller_->ForceRedraw(); - - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} diff --git a/deprecated/windows/runner/flutter_window.h b/deprecated/windows/runner/flutter_window.h deleted file mode 100644 index 6da0652..0000000 --- a/deprecated/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/deprecated/windows/runner/main.cpp b/deprecated/windows/runner/main.cpp deleted file mode 100644 index a35647c..0000000 --- a/deprecated/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.Create(L"deprecated", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} diff --git a/deprecated/windows/runner/resource.h b/deprecated/windows/runner/resource.h deleted file mode 100644 index 66a65d1..0000000 --- a/deprecated/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/deprecated/windows/runner/resources/app_icon.ico b/deprecated/windows/runner/resources/app_icon.ico deleted file mode 100644 index c04e20c..0000000 Binary files a/deprecated/windows/runner/resources/app_icon.ico and /dev/null differ diff --git a/deprecated/windows/runner/runner.exe.manifest b/deprecated/windows/runner/runner.exe.manifest deleted file mode 100644 index 153653e..0000000 --- a/deprecated/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,14 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - diff --git a/deprecated/windows/runner/utils.cpp b/deprecated/windows/runner/utils.cpp deleted file mode 100644 index 3a0b465..0000000 --- a/deprecated/windows/runner/utils.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - unsigned int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); - std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { - return utf8_string; - } - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - input_length, utf8_string.data(), target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/deprecated/windows/runner/utils.h b/deprecated/windows/runner/utils.h deleted file mode 100644 index 3879d54..0000000 --- a/deprecated/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/deprecated/windows/runner/win32_window.cpp b/deprecated/windows/runner/win32_window.cpp deleted file mode 100644 index 60608d0..0000000 --- a/deprecated/windows/runner/win32_window.cpp +++ /dev/null @@ -1,288 +0,0 @@ -#include "win32_window.h" - -#include -#include - -#include "resource.h" - -namespace { - -/// Window attribute that enables dark mode window decorations. -/// -/// Redefined in case the developer's machine has a Windows SDK older than -/// version 10.0.22000.0. -/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute -#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE -#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 -#endif - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -/// Registry key for app theme preference. -/// -/// A value of 0 indicates apps should use dark mode. A non-zero or missing -/// value indicates apps should use light mode. -constexpr const wchar_t kGetPreferredBrightnessRegKey[] = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; -constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - } - FreeLibrary(user32_module); -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registrar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::Create(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - UpdateTheme(window); - - return OnCreate(); -} - -bool Win32Window::Show() { - return ShowWindow(window_handle_, SW_SHOWNORMAL); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - - case WM_DWMCOLORIZATIONCOLORCHANGED: - UpdateTheme(hwnd); - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} - -void Win32Window::UpdateTheme(HWND const window) { - DWORD light_mode; - DWORD light_mode_size = sizeof(light_mode); - LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, - kGetPreferredBrightnessRegValue, - RRF_RT_REG_DWORD, nullptr, &light_mode, - &light_mode_size); - - if (result == ERROR_SUCCESS) { - BOOL enable_dark_mode = light_mode == 0; - DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, - &enable_dark_mode, sizeof(enable_dark_mode)); - } -} diff --git a/deprecated/windows/runner/win32_window.h b/deprecated/windows/runner/win32_window.h deleted file mode 100644 index e901dde..0000000 --- a/deprecated/windows/runner/win32_window.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates a win32 window with |title| that is positioned and sized using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size this function will scale the inputted width and height as - // as appropriate for the default monitor. The window is invisible until - // |Show| is called. Returns true if the window was created successfully. - bool Create(const std::wstring& title, const Point& origin, const Size& size); - - // Show the current window. Returns true if the window was successfully shown. - bool Show(); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - // Update the window frame's theme to match the system theme. - static void UpdateTheme(HWND const window); - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_