diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f0d006 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..89db5de --- /dev/null +++ b/.metadata @@ -0,0 +1,45 @@ +# 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: "ff37bef603469fb030f2b72995ab929ccfc227f0" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: android + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: ios + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: linux + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: macos + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: web + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + - platform: windows + create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0 + + # 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/README.md b/README.md index b80c95b..eab9936 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ -# OTMovilGasfiter +# SMoya Gasfiter -Aplicación Flutter para registrar órdenes de trabajo de mantenimiento sin depender de conexión a internet. \ No newline at end of file +Aplicación Flutter para registrar órdenes de trabajo de mantenimiento sin +depender de conexión a internet. + +## Funcionalidades + +- Creación y edición de órdenes como borrador. +- Varias tareas por orden, cada una con su observación. +- Varias fotografías antes y después por tarea, desde cámara o galería. +- Persistencia local mediante SQLite y archivos privados de la aplicación. +- Validación de evidencia antes de finalizar una orden. +- Informe PDF con el detalle completo y las fotografías. +- Correo preparado con resumen y PDF adjunto mediante la aplicación de correo + configurada en el dispositivo. +- Consulta, reenvío de correo y eliminación de órdenes guardadas. + +## Ejecutar + +```bash +flutter pub get +flutter run +``` + +Para usar cámara, galería y correo se recomienda ejecutar en un teléfono real. +En Android debe existir una aplicación de correo configurada. En iOS debe haber +una cuenta disponible para el compositor nativo de Mail. + +## Verificar + +```bash +flutter analyze +flutter test +``` + +La información se guarda dentro del espacio privado de la aplicación. Al +desinstalarla, el sistema operativo puede eliminar la base de datos, las fotos y +los PDF generados. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..d4e0f0c --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..c908258 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +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/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..a31fb92 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +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 = "cl.otmovil.ot_movil" + 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 = "cl.otmovil.ot_movil" + // 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/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7868557 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/cl/otmovil/ot_movil/MainActivity.kt b/android/app/src/main/kotlin/cl/otmovil/ot_movil/MainActivity.kt new file mode 100644 index 0000000..a7cf6fa --- /dev/null +++ b/android/app/src/main/kotlin/cl/otmovil/ot_movil/MainActivity.kt @@ -0,0 +1,5 @@ +package cl.otmovil.ot_movil + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..73d0455 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a5c9848 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..1cb7aa2 --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..3cd3068 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..db30ca5 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..22fb1bf Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..8403758 --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..c0be12a --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..606fdae Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..72cf1c6 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..1d864ae Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..9acef51 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..e51583c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..360a160 --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c5d5899 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..5fac679 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..1f88145 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +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/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..21dbfa5 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..db3f453 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +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/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..4dcef4b --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,26 @@ +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/assets/icon/app_icon.png b/assets/icon/app_icon.png new file mode 100644 index 0000000..96f9955 Binary files /dev/null and b/assets/icon/app_icon.png differ diff --git a/assets/pdf/simon_moya_report_logo.png b/assets/pdf/simon_moya_report_logo.png new file mode 100644 index 0000000..a281476 Binary files /dev/null and b/assets/pdf/simon_moya_report_logo.png differ diff --git a/assets/pdf/simon_moya_signature.png b/assets/pdf/simon_moya_signature.png new file mode 100644 index 0000000..b7312e7 Binary files /dev/null and b/assets/pdf/simon_moya_signature.png differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..ad322bc --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/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/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..256cf28 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,24 @@ + + + + + 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/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5e32de8 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,620 @@ +// !$*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 = cl.otmovil.otMovil; + 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 = cl.otmovil.otMovil.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 = cl.otmovil.otMovil.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 = cl.otmovil.otMovil.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 = AppIcon; + 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 = AppIcon; + 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 = cl.otmovil.otMovil; + 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 = cl.otmovil.otMovil; + 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/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c4b79bd --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..bbabc4e --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..59c6d39 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..ed1c097 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,16 @@ +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/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d0d98aa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1 @@ +{"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":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"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":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@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"}} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..1289f14 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..45e84d2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..09b1b67 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..a59ed5a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..1c068a5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..16d9f4c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..d3de4d2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..09b1b67 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..8965df9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..d224a75 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..6ddb9f8 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..c0f6c0e Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..27561c2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..0f86f36 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..d224a75 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..d435bc8 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..606fdae Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..9acef51 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..5b08069 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..28fda22 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..20778a1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..d08a4de --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "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/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..65a94b5 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# 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/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..497371e --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bbb83ca --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..ecd2df6 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,78 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + SMoya Gasfiter + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SMoya Gasfiter + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + NSCameraUsageDescription + SMoya Gasfiter necesita la cámara para registrar evidencia antes y después de la mantención. + NSMicrophoneUsageDescription + SMoya Gasfiter necesita el micrófono para dictar las observaciones de las tareas. + NSPhotoLibraryUsageDescription + SMoya Gasfiter necesita acceso a tus fotos para adjuntar evidencia a la orden de trabajo. + NSSpeechRecognitionUsageDescription + SMoya Gasfiter necesita convertir el dictado en texto para completar las observaciones. + 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 + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..fae207f --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/Runner/SceneDelegate.swift b/ios/Runner/SceneDelegate.swift new file mode 100644 index 0000000..b79be9b --- /dev/null +++ b/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..4d206de --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +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/lib/data/app_database.dart b/lib/data/app_database.dart new file mode 100644 index 0000000..ed87d6c --- /dev/null +++ b/lib/data/app_database.dart @@ -0,0 +1,283 @@ +import 'package:path/path.dart' as p; +import 'package:sqflite/sqflite.dart'; + +import '../models/work_order.dart'; + +class AppDatabase { + AppDatabase._(); + + static final AppDatabase instance = AppDatabase._(); + + Database? _database; + + Future get database async { + if (_database != null) return _database!; + + final databasePath = await getDatabasesPath(); + _database = await openDatabase( + p.join(databasePath, 'ot_movil.db'), + version: 6, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + }, + onCreate: (database, version) async { + await database.execute(''' + CREATE TABLE work_orders ( + id TEXT PRIMARY KEY, + title TEXT NOT NULL, + status TEXT NOT NULL, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL, + completed_at TEXT, + client TEXT NOT NULL DEFAULT '', + phone TEXT NOT NULL DEFAULT '', + address TEXT NOT NULL DEFAULT '', + labor_cost INTEGER NOT NULL DEFAULT 0, + recipient_email TEXT, + pdf_path TEXT + ) + '''); + await database.execute(''' + CREATE TABLE work_tasks ( + id TEXT PRIMARY KEY, + work_order_id TEXT NOT NULL, + title TEXT NOT NULL, + observation TEXT NOT NULL, + position INTEGER NOT NULL, + FOREIGN KEY (work_order_id) + REFERENCES work_orders (id) ON DELETE CASCADE + ) + '''); + await database.execute(''' + CREATE TABLE task_photos ( + id TEXT PRIMARY KEY, + task_id TEXT NOT NULL, + kind TEXT NOT NULL, + path TEXT NOT NULL, + FOREIGN KEY (task_id) + REFERENCES work_tasks (id) ON DELETE CASCADE + ) + '''); + await database.execute(''' + CREATE TABLE task_parts ( + id TEXT PRIMARY KEY, + task_id TEXT NOT NULL, + name TEXT NOT NULL, + price INTEGER NOT NULL, + position INTEGER NOT NULL, + FOREIGN KEY (task_id) + REFERENCES work_tasks (id) ON DELETE CASCADE + ) + '''); + await database.execute( + 'CREATE INDEX idx_tasks_order ON work_tasks(work_order_id)', + ); + await database.execute( + 'CREATE INDEX idx_photos_task ON task_photos(task_id)', + ); + await database.execute( + 'CREATE INDEX idx_parts_task ON task_parts(task_id)', + ); + }, + onUpgrade: (database, oldVersion, newVersion) async { + if (oldVersion < 2) { + await database.execute( + "ALTER TABLE work_orders " + "ADD COLUMN client TEXT NOT NULL DEFAULT ''", + ); + await database.execute( + "ALTER TABLE work_orders " + "ADD COLUMN address TEXT NOT NULL DEFAULT ''", + ); + } + if (oldVersion < 3) { + await database.execute(''' + CREATE TABLE task_parts ( + id TEXT PRIMARY KEY, + task_id TEXT NOT NULL, + name TEXT NOT NULL, + price INTEGER NOT NULL, + position INTEGER NOT NULL, + FOREIGN KEY (task_id) + REFERENCES work_tasks (id) ON DELETE CASCADE + ) + '''); + await database.execute( + 'CREATE INDEX idx_parts_task ON task_parts(task_id)', + ); + } + if (oldVersion < 4) { + await database.execute( + 'ALTER TABLE work_orders ' + 'ADD COLUMN labor_cost INTEGER NOT NULL DEFAULT 0', + ); + } + if (oldVersion < 5) { + await database.execute( + "ALTER TABLE work_orders " + "ADD COLUMN phone TEXT NOT NULL DEFAULT ''", + ); + } + }, + ); + return _database!; + } + + Future> getWorkOrders() async { + final db = await database; + final rows = await db.query('work_orders', orderBy: 'updated_at DESC'); + + final orders = []; + for (final row in rows) { + orders.add(await _workOrderFromRow(db, row)); + } + return orders; + } + + Future getWorkOrder(String id) async { + final db = await database; + final rows = await db.query( + 'work_orders', + where: 'id = ?', + whereArgs: [id], + limit: 1, + ); + if (rows.isEmpty) return null; + return _workOrderFromRow(db, rows.first); + } + + Future _workOrderFromRow( + DatabaseExecutor db, + Map row, + ) async { + final orderId = row['id']! as String; + final taskRows = await db.query( + 'work_tasks', + where: 'work_order_id = ?', + whereArgs: [orderId], + orderBy: 'position ASC', + ); + + final tasks = []; + for (final taskRow in taskRows) { + final taskId = taskRow['id']! as String; + final photoRows = await db.query( + 'task_photos', + where: 'task_id = ?', + whereArgs: [taskId], + orderBy: 'rowid ASC', + ); + final partRows = await db.query( + 'task_parts', + where: 'task_id = ?', + whereArgs: [taskId], + orderBy: 'position ASC', + ); + tasks.add( + WorkTask( + id: taskId, + title: taskRow['title']! as String, + observation: taskRow['observation']! as String, + position: taskRow['position']! as int, + photos: photoRows + .map( + (photoRow) => TaskPhoto( + id: photoRow['id']! as String, + path: photoRow['path']! as String, + kind: PhotoKind.fromDatabase(photoRow['kind']! as String), + ), + ) + .toList(), + parts: partRows + .map( + (partRow) => TaskPart( + id: partRow['id']! as String, + name: partRow['name']! as String, + price: partRow['price']! as int, + ), + ) + .toList(), + ), + ); + } + + return WorkOrder( + id: orderId, + title: row['title']! as String, + status: WorkOrderStatus.fromDatabase(row['status']! as String), + createdAt: DateTime.parse(row['created_at']! as String), + updatedAt: DateTime.parse(row['updated_at']! as String), + completedAt: row['completed_at'] == null + ? null + : DateTime.parse(row['completed_at']! as String), + details: WorkOrderDetails( + client: row['client']! as String, + phone: row['phone']! as String, + address: row['address']! as String, + ), + laborCost: row['labor_cost']! as int, + recipientEmail: row['recipient_email'] as String?, + pdfPath: row['pdf_path'] as String?, + tasks: tasks, + ); + } + + Future saveWorkOrder(WorkOrder order) async { + final db = await database; + await db.transaction((transaction) async { + await transaction.insert('work_orders', { + 'id': order.id, + 'title': order.title, + 'status': order.status.databaseValue, + 'created_at': order.createdAt.toIso8601String(), + 'updated_at': order.updatedAt.toIso8601String(), + 'completed_at': order.completedAt?.toIso8601String(), + 'client': order.details.client, + 'phone': order.details.phone, + 'address': order.details.address, + 'labor_cost': order.laborCost, + 'recipient_email': order.recipientEmail, + 'pdf_path': order.pdfPath, + }, conflictAlgorithm: ConflictAlgorithm.replace); + + await transaction.delete( + 'work_tasks', + where: 'work_order_id = ?', + whereArgs: [order.id], + ); + + for (final task in order.tasks) { + await transaction.insert('work_tasks', { + 'id': task.id, + 'work_order_id': order.id, + 'title': task.title, + 'observation': task.observation, + 'position': task.position, + }); + for (final photo in task.photos) { + await transaction.insert('task_photos', { + 'id': photo.id, + 'task_id': task.id, + 'kind': photo.kind.databaseValue, + 'path': photo.path, + }); + } + for (var index = 0; index < task.parts.length; index++) { + final part = task.parts[index]; + await transaction.insert('task_parts', { + 'id': part.id, + 'task_id': task.id, + 'name': part.name, + 'price': part.price, + 'position': index, + }); + } + } + }); + } + + Future deleteWorkOrder(String id) async { + final db = await database; + await db.delete('work_orders', where: 'id = ?', whereArgs: [id]); + } +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..ca582d6 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.dart'; + +import 'screens/home_screen.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + runApp(const OtMovilApp()); +} + +class OtMovilApp extends StatelessWidget { + const OtMovilApp({super.key}); + + static const primary = Color(0xFF0B5C5E); + static const accent = Color(0xFFF4B740); + static const ink = Color(0xFF163334); + static const canvas = Color(0xFFF5F8F7); + + @override + Widget build(BuildContext context) { + final colorScheme = ColorScheme.fromSeed( + seedColor: primary, + brightness: Brightness.light, + primary: primary, + secondary: accent, + surface: Colors.white, + ); + + return MaterialApp( + debugShowCheckedModeBanner: false, + title: 'SMoya Gasfiter', + theme: ThemeData( + useMaterial3: true, + colorScheme: colorScheme, + scaffoldBackgroundColor: canvas, + appBarTheme: const AppBarTheme( + backgroundColor: canvas, + foregroundColor: ink, + elevation: 0, + centerTitle: false, + titleTextStyle: TextStyle( + color: ink, + fontSize: 20, + fontWeight: FontWeight.w700, + ), + ), + cardTheme: CardThemeData( + color: Colors.white, + elevation: 0, + margin: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18), + side: const BorderSide(color: Color(0xFFDCE7E5)), + ), + ), + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: Colors.white, + alignLabelWithHint: true, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: Color(0xFFD4E1DF)), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: Color(0xFFD4E1DF)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: primary, width: 1.8), + ), + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 15, + ), + ), + filledButtonTheme: FilledButtonThemeData( + style: FilledButton.styleFrom( + minimumSize: const Size(0, 50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + ), + textStyle: const TextStyle(fontWeight: FontWeight.w700), + ), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + minimumSize: const Size(0, 48), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14), + ), + side: const BorderSide(color: Color(0xFFB8CFCC)), + textStyle: const TextStyle(fontWeight: FontWeight.w700), + ), + ), + snackBarTheme: SnackBarThemeData( + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + home: const HomeScreen(), + ); + } +} diff --git a/lib/models/work_order.dart b/lib/models/work_order.dart new file mode 100644 index 0000000..0b396d2 --- /dev/null +++ b/lib/models/work_order.dart @@ -0,0 +1,155 @@ +enum WorkOrderStatus { + open, + completed; + + String get databaseValue => name; + + static WorkOrderStatus fromDatabase(String value) { + return WorkOrderStatus.values.firstWhere( + (status) => status.name == value, + orElse: () => WorkOrderStatus.open, + ); + } +} + +enum PhotoKind { + before, + after; + + String get databaseValue => name; + + static PhotoKind fromDatabase(String value) { + return value == PhotoKind.after.name ? PhotoKind.after : PhotoKind.before; + } +} + +class TaskPhoto { + const TaskPhoto({required this.id, required this.path, required this.kind}); + + final String id; + final String path; + final PhotoKind kind; +} + +class TaskPart { + const TaskPart({required this.id, required this.name, required this.price}); + + final String id; + final String name; + final int price; +} + +class WorkTask { + const WorkTask({ + required this.id, + required this.title, + required this.observation, + required this.position, + this.photos = const [], + this.parts = const [], + }); + + final String id; + final String title; + final String observation; + final int position; + final List photos; + final List parts; + + List get beforePhotos => + photos.where((photo) => photo.kind == PhotoKind.before).toList(); + + List get afterPhotos => + photos.where((photo) => photo.kind == PhotoKind.after).toList(); + + int get partsTotal => parts.fold(0, (total, part) => total + part.price); +} + +class WorkOrderDetails { + const WorkOrderDetails({ + this.client = '', + this.phone = '', + this.address = '', + }); + + final String client; + final String phone; + final String address; + + bool get isComplete => + client.trim().isNotEmpty && + phone.trim().isNotEmpty && + address.trim().isNotEmpty; + + WorkOrderDetails copyWith({String? client, String? phone, String? address}) { + return WorkOrderDetails( + client: client ?? this.client, + phone: phone ?? this.phone, + address: address ?? this.address, + ); + } +} + +class WorkOrder { + const WorkOrder({ + required this.id, + required this.title, + required this.createdAt, + required this.updatedAt, + required this.status, + this.details = const WorkOrderDetails(), + this.laborCost = 0, + this.completedAt, + this.recipientEmail, + this.pdfPath, + this.tasks = const [], + }); + + final String id; + final String title; + final DateTime createdAt; + final DateTime updatedAt; + final DateTime? completedAt; + final WorkOrderStatus status; + final WorkOrderDetails details; + final int laborCost; + final String? recipientEmail; + final String? pdfPath; + final List tasks; + + bool get isCompleted => status == WorkOrderStatus.completed; + + int get totalPhotos => + tasks.fold(0, (total, task) => total + task.photos.length); + + int get totalPartsCost => + tasks.fold(0, (total, task) => total + task.partsTotal); + + int get totalCost => laborCost + totalPartsCost; + + WorkOrder copyWith({ + String? title, + DateTime? updatedAt, + DateTime? completedAt, + WorkOrderStatus? status, + WorkOrderDetails? details, + int? laborCost, + String? recipientEmail, + String? pdfPath, + List? tasks, + }) { + return WorkOrder( + id: id, + title: title ?? this.title, + createdAt: createdAt, + updatedAt: updatedAt ?? this.updatedAt, + completedAt: completedAt ?? this.completedAt, + status: status ?? this.status, + details: details ?? this.details, + laborCost: laborCost ?? this.laborCost, + recipientEmail: recipientEmail ?? this.recipientEmail, + pdfPath: pdfPath ?? this.pdfPath, + tasks: tasks ?? this.tasks, + ); + } +} diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart new file mode 100644 index 0000000..0d69241 --- /dev/null +++ b/lib/screens/home_screen.dart @@ -0,0 +1,596 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +import '../data/app_database.dart'; +import '../models/work_order.dart'; +import '../services/image_storage_service.dart'; +import 'work_order_details_screen.dart'; +import 'work_order_screen.dart'; + +enum _OrderFilter { all, open, completed } + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + final _database = AppDatabase.instance; + final _imageStorage = ImageStorageService(); + + List _orders = const []; + _OrderFilter _filter = _OrderFilter.all; + bool _loading = true; + String? _error; + + @override + void initState() { + super.initState(); + _loadOrders(); + } + + Future _loadOrders() async { + setState(() { + _loading = true; + _error = null; + }); + try { + final orders = await _database.getWorkOrders(); + if (!mounted) return; + setState(() { + _orders = orders; + _loading = false; + }); + } catch (_) { + if (!mounted) return; + setState(() { + _loading = false; + _error = 'No fue posible leer las órdenes guardadas.'; + }); + } + } + + List get _visibleOrders { + return switch (_filter) { + _OrderFilter.all => _orders, + _OrderFilter.open => + _orders.where((order) => !order.isCompleted).toList(), + _OrderFilter.completed => + _orders.where((order) => order.isCompleted).toList(), + }; + } + + Future _openOrder([WorkOrder? order]) async { + final details = await Navigator.of(context).push( + MaterialPageRoute(builder: (_) => WorkOrderDetailsScreen(order: order)), + ); + if (!mounted || details == null) return; + await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => WorkOrderScreen(order: order, details: details), + ), + ); + await _loadOrders(); + } + + Future _deleteOrder(WorkOrder order) async { + final confirmed = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Eliminar orden'), + content: Text( + 'Se eliminará “${order.title}” junto con sus fotos y su informe. ' + 'Esta acción no se puede deshacer.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Cancelar'), + ), + FilledButton( + style: FilledButton.styleFrom( + backgroundColor: Theme.of(context).colorScheme.error, + ), + onPressed: () => Navigator.pop(context, true), + child: const Text('Eliminar'), + ), + ], + ), + ); + if (confirmed != true) return; + + try { + await _database.deleteWorkOrder(order.id); + await _imageStorage.deleteWorkOrderImages(order.id); + final pdfPath = order.pdfPath; + if (pdfPath != null) { + final report = File(pdfPath); + if (await report.exists()) await report.delete(); + } + await _loadOrders(); + if (!mounted) return; + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Orden eliminada.'))); + } catch (_) { + if (!mounted) return; + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('No fue posible eliminar la orden.')), + ); + } + } + + @override + Widget build(BuildContext context) { + final visibleOrders = _visibleOrders; + return Scaffold( + appBar: AppBar( + toolbarHeight: 72, + title: const _Brand(), + actions: [ + IconButton( + tooltip: 'Actualizar', + onPressed: _loading ? null : _loadOrders, + icon: const Icon(Icons.refresh_rounded), + ), + const SizedBox(width: 8), + ], + ), + body: RefreshIndicator( + onRefresh: _loadOrders, + child: CustomScrollView( + physics: const AlwaysScrollableScrollPhysics(), + slivers: [ + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Órdenes de trabajo', + style: Theme.of(context).textTheme.headlineMedium + ?.copyWith( + color: const Color(0xFF163334), + fontWeight: FontWeight.w800, + letterSpacing: -.5, + ), + ), + const SizedBox(height: 6), + Text( + 'Registra el mantenimiento y conserva su evidencia.', + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + color: const Color(0xFF627372), + ), + ), + const SizedBox(height: 20), + _SummaryStrip(orders: _orders), + const SizedBox(height: 18), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SegmentedButton<_OrderFilter>( + showSelectedIcon: false, + segments: const [ + ButtonSegment( + value: _OrderFilter.all, + label: Text('Todas'), + ), + ButtonSegment( + value: _OrderFilter.open, + label: Text('Borradores'), + ), + ButtonSegment( + value: _OrderFilter.completed, + label: Text('Finalizadas'), + ), + ], + selected: {_filter}, + onSelectionChanged: (selection) { + setState(() => _filter = selection.first); + }, + ), + ), + ], + ), + ), + ), + if (_loading) + const SliverFillRemaining( + hasScrollBody: false, + child: Center(child: CircularProgressIndicator()), + ) + else if (_error != null) + SliverFillRemaining( + hasScrollBody: false, + child: _MessageState( + icon: Icons.cloud_off_rounded, + title: 'No pudimos cargar las órdenes', + message: _error!, + buttonLabel: 'Reintentar', + onPressed: _loadOrders, + ), + ) + else if (visibleOrders.isEmpty) + SliverFillRemaining( + hasScrollBody: false, + child: _MessageState( + icon: Icons.assignment_outlined, + title: _orders.isEmpty + ? 'Aún no hay órdenes' + : 'No hay órdenes en este estado', + message: _orders.isEmpty + ? 'Crea tu primera OT y agrega las tareas del mantenimiento.' + : 'Prueba seleccionando otro filtro.', + ), + ) + else + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 110), + sliver: SliverList.separated( + itemCount: visibleOrders.length, + separatorBuilder: (_, _) => const SizedBox(height: 12), + itemBuilder: (context, index) { + final order = visibleOrders[index]; + return _OrderCard( + order: order, + onTap: () => _openOrder(order), + onDelete: () => _deleteOrder(order), + ); + }, + ), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () => _openOrder(), + backgroundColor: const Color(0xFF0B5C5E), + foregroundColor: Colors.white, + icon: const Icon(Icons.add_rounded), + label: const Text( + 'Nueva OT', + style: TextStyle(fontWeight: FontWeight.w700), + ), + ), + ); + } +} + +class _Brand extends StatelessWidget { + const _Brand(); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: const Color(0xFF0B5C5E), + borderRadius: BorderRadius.circular(12), + ), + child: const Icon( + Icons.handyman_rounded, + color: Colors.white, + size: 22, + ), + ), + const SizedBox(width: 11), + const Text('SMoya Gasfiter'), + ], + ); + } +} + +class _SummaryStrip extends StatelessWidget { + const _SummaryStrip({required this.orders}); + + final List orders; + + @override + Widget build(BuildContext context) { + final completed = orders.where((order) => order.isCompleted).length; + return Row( + children: [ + Expanded( + child: _SummaryItem( + value: '${orders.length - completed}', + label: 'Borradores', + icon: Icons.edit_note_rounded, + color: const Color(0xFFF4B740), + ), + ), + const SizedBox(width: 10), + Expanded( + child: _SummaryItem( + value: '$completed', + label: 'Finalizadas', + icon: Icons.task_alt_rounded, + color: const Color(0xFF2E8B70), + ), + ), + ], + ); + } +} + +class _SummaryItem extends StatelessWidget { + const _SummaryItem({ + required this.value, + required this.label, + required this.icon, + required this.color, + }); + + final String value; + final String label; + final IconData icon; + final Color color; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: const Color(0xFFDCE7E5)), + ), + child: Row( + children: [ + Container( + width: 38, + height: 38, + decoration: BoxDecoration( + color: color.withValues(alpha: .15), + borderRadius: BorderRadius.circular(11), + ), + child: Icon(icon, color: color, size: 21), + ), + const SizedBox(width: 11), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + value, + style: const TextStyle( + color: Color(0xFF163334), + fontWeight: FontWeight.w800, + fontSize: 20, + height: 1, + ), + ), + const SizedBox(height: 4), + Text( + label, + style: const TextStyle(color: Color(0xFF627372), fontSize: 12), + ), + ], + ), + ], + ), + ); + } +} + +class _OrderCard extends StatelessWidget { + const _OrderCard({ + required this.order, + required this.onTap, + required this.onDelete, + }); + + final WorkOrder order; + final VoidCallback onTap; + final VoidCallback onDelete; + + @override + Widget build(BuildContext context) { + final statusColor = order.isCompleted + ? const Color(0xFF2E8B70) + : const Color(0xFFB77800); + final statusBackground = order.isCompleted + ? const Color(0xFFE4F3ED) + : const Color(0xFFFFF3D8); + + return Card( + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(18), + child: Padding( + padding: const EdgeInsets.fromLTRB(17, 17, 8, 17), + child: Row( + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: const Color(0xFFE7F1F0), + borderRadius: BorderRadius.circular(14), + ), + child: const Icon( + Icons.assignment_outlined, + color: Color(0xFF0B5C5E), + ), + ), + const SizedBox(width: 14), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text( + order.title, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: Color(0xFF163334), + fontSize: 16, + fontWeight: FontWeight.w700, + ), + ), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 9, + vertical: 5, + ), + decoration: BoxDecoration( + color: statusBackground, + borderRadius: BorderRadius.circular(20), + ), + child: Text( + order.isCompleted ? 'Finalizada' : 'Borrador', + style: TextStyle( + color: statusColor, + fontSize: 11, + fontWeight: FontWeight.w700, + ), + ), + ), + ], + ), + const SizedBox(height: 8), + if (order.details.client.isNotEmpty) ...[ + _OrderCardDetail( + icon: Icons.person_outline_rounded, + text: order.details.client, + ), + const SizedBox(height: 4), + ], + if (order.details.address.isNotEmpty) ...[ + _OrderCardDetail( + icon: Icons.location_on_outlined, + text: order.details.address, + ), + const SizedBox(height: 7), + ], + Text( + '${order.tasks.length} tarea(s) · ' + '${order.totalPhotos} foto(s) · ' + '${DateFormat('dd/MM/yyyy').format(order.updatedAt.toLocal())}', + style: const TextStyle( + color: Color(0xFF6A7A79), + fontSize: 12, + ), + ), + ], + ), + ), + PopupMenuButton( + tooltip: 'Más opciones', + onSelected: (value) { + if (value == 'delete') onDelete(); + }, + itemBuilder: (context) => const [ + PopupMenuItem( + value: 'delete', + child: Row( + children: [ + Icon(Icons.delete_outline_rounded), + SizedBox(width: 10), + Text('Eliminar'), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} + +class _OrderCardDetail extends StatelessWidget { + const _OrderCardDetail({required this.icon, required this.text}); + + final IconData icon; + final String text; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Icon(icon, size: 15, color: const Color(0xFF0B5C5E)), + const SizedBox(width: 6), + Expanded( + child: Text( + text, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle(color: Color(0xFF526665), fontSize: 12), + ), + ), + ], + ); + } +} + +class _MessageState extends StatelessWidget { + const _MessageState({ + required this.icon, + required this.title, + required this.message, + this.buttonLabel, + this.onPressed, + }); + + final IconData icon; + final String title; + final String message; + final String? buttonLabel; + final VoidCallback? onPressed; + + @override + Widget build(BuildContext context) { + return Center( + child: Padding( + padding: const EdgeInsets.fromLTRB(32, 20, 32, 100), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 74, + height: 74, + decoration: const BoxDecoration( + color: Color(0xFFE7F1F0), + shape: BoxShape.circle, + ), + child: Icon(icon, size: 34, color: const Color(0xFF0B5C5E)), + ), + const SizedBox(height: 20), + Text( + title, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.titleLarge?.copyWith( + color: const Color(0xFF163334), + fontWeight: FontWeight.w800, + ), + ), + const SizedBox(height: 8), + Text( + message, + textAlign: TextAlign.center, + style: const TextStyle(color: Color(0xFF627372), height: 1.45), + ), + if (buttonLabel != null) ...[ + const SizedBox(height: 20), + FilledButton(onPressed: onPressed, child: Text(buttonLabel!)), + ], + ], + ), + ), + ); + } +} diff --git a/lib/screens/pdf_preview_screen.dart b/lib/screens/pdf_preview_screen.dart new file mode 100644 index 0000000..4edbe16 --- /dev/null +++ b/lib/screens/pdf_preview_screen.dart @@ -0,0 +1,42 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:pdf/pdf.dart'; +import 'package:printing/printing.dart'; + +class PdfPreviewScreen extends StatelessWidget { + const PdfPreviewScreen({ + required this.pdfPath, + required this.title, + super.key, + }); + + final String pdfPath; + final String title; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Informe PDF')), + body: PdfPreview( + build: (_) => File(pdfPath).readAsBytes(), + initialPageFormat: PdfPageFormat.a4, + pdfFileName: '$title.pdf', + canChangeOrientation: false, + canChangePageFormat: false, + allowPrinting: true, + allowSharing: true, + loadingWidget: const Center(child: CircularProgressIndicator()), + onError: (context, error) => Center( + child: Padding( + padding: const EdgeInsets.all(24), + child: Text( + 'No fue posible abrir el informe.\n$error', + textAlign: TextAlign.center, + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/work_order_details_screen.dart b/lib/screens/work_order_details_screen.dart new file mode 100644 index 0000000..aa84518 --- /dev/null +++ b/lib/screens/work_order_details_screen.dart @@ -0,0 +1,188 @@ +import 'package:flutter/material.dart'; + +import '../models/work_order.dart'; + +class WorkOrderDetailsScreen extends StatefulWidget { + const WorkOrderDetailsScreen({this.order, super.key}); + + final WorkOrder? order; + + @override + State createState() => _WorkOrderDetailsScreenState(); +} + +class _WorkOrderDetailsScreenState extends State { + final _formKey = GlobalKey(); + late final TextEditingController _clientController; + late final TextEditingController _phoneController; + late final TextEditingController _addressController; + + bool get _readOnly => widget.order?.isCompleted ?? false; + + @override + void initState() { + super.initState(); + final details = widget.order?.details ?? const WorkOrderDetails(); + _clientController = TextEditingController(text: details.client); + _phoneController = TextEditingController(text: details.phone); + _addressController = TextEditingController(text: details.address); + } + + @override + void dispose() { + _clientController.dispose(); + _phoneController.dispose(); + _addressController.dispose(); + super.dispose(); + } + + Future _continue() async { + if (!_readOnly && !_formKey.currentState!.validate()) return; + + final details = WorkOrderDetails( + client: _clientController.text.trim(), + phone: _phoneController.text.trim(), + address: _addressController.text.trim(), + ); + Navigator.of(context).pop(details); + } + + String? _requiredField(String? value, String message) { + if (value == null || value.trim().isEmpty) return message; + return null; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(_readOnly ? 'Datos de la OT' : 'Completar datos de la OT'), + ), + body: Form( + key: _formKey, + child: ListView( + padding: const EdgeInsets.fromLTRB(20, 12, 20, 120), + children: [ + Container( + padding: const EdgeInsets.all(18), + decoration: BoxDecoration( + color: const Color(0xFFE7F1F0), + borderRadius: BorderRadius.circular(18), + ), + child: const Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(Icons.assignment_ind_outlined, color: Color(0xFF0B5C5E)), + SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Encabezado de la orden', + style: TextStyle( + color: Color(0xFF163334), + fontSize: 17, + fontWeight: FontWeight.w800, + ), + ), + SizedBox(height: 5), + Text( + 'Estos datos identificarán al cliente antes de ' + 'registrar el trabajo y las tareas.', + style: TextStyle( + color: Color(0xFF526665), + height: 1.35, + ), + ), + ], + ), + ), + ], + ), + ), + const SizedBox(height: 26), + TextFormField( + key: const Key('client-field'), + controller: _clientController, + readOnly: _readOnly, + autofocus: !_readOnly, + textCapitalization: TextCapitalization.words, + textInputAction: TextInputAction.next, + decoration: const InputDecoration( + labelText: 'Cliente', + hintText: 'Nombre del cliente', + prefixIcon: Icon(Icons.person_outline_rounded), + ), + validator: _readOnly + ? null + : (value) => + _requiredField(value, 'Ingresa el nombre del cliente'), + ), + const SizedBox(height: 16), + TextFormField( + key: const Key('phone-field'), + controller: _phoneController, + readOnly: _readOnly, + keyboardType: TextInputType.phone, + textInputAction: TextInputAction.next, + autofillHints: const [AutofillHints.telephoneNumber], + decoration: const InputDecoration( + labelText: 'Teléfono', + hintText: '+56 9 1234 5678', + prefixIcon: Icon(Icons.phone_outlined), + ), + validator: _readOnly + ? null + : (value) => _requiredField( + value, + 'Ingresa el teléfono del cliente', + ), + ), + const SizedBox(height: 16), + TextFormField( + key: const Key('address-field'), + controller: _addressController, + readOnly: _readOnly, + textCapitalization: TextCapitalization.sentences, + textInputAction: TextInputAction.done, + maxLines: 2, + decoration: const InputDecoration( + labelText: 'Dirección', + hintText: 'Calle, número, comuna o referencia', + prefixIcon: Icon(Icons.location_on_outlined), + ), + validator: _readOnly + ? null + : (value) => _requiredField( + value, + 'Ingresa la dirección del trabajo', + ), + onFieldSubmitted: (_) => _continue(), + ), + ], + ), + ), + bottomNavigationBar: SafeArea( + top: false, + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 10, 20, 16), + child: FilledButton.icon( + key: const Key('continue-button'), + onPressed: _continue, + icon: Icon( + _readOnly + ? Icons.visibility_outlined + : Icons.arrow_forward_rounded, + ), + label: Text( + _readOnly + ? 'Ver trabajo y tareas' + : 'Continuar a trabajo y tareas', + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/work_order_screen.dart b/lib/screens/work_order_screen.dart new file mode 100644 index 0000000..ea7e0de --- /dev/null +++ b/lib/screens/work_order_screen.dart @@ -0,0 +1,2147 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:intl/intl.dart'; +import 'package:uuid/uuid.dart'; + +import '../data/app_database.dart'; +import '../models/work_order.dart'; +import '../services/email_service.dart'; +import '../services/dictation_text_accumulator.dart'; +import '../services/image_storage_service.dart'; +import '../services/pdf_service.dart'; +import '../services/speech_dictation_service.dart'; +import 'pdf_preview_screen.dart'; + +const _predefinedWorkOrderTitles = [ + 'Instalación Básica', + 'Mantención Preventiva', + 'Mantención Correctiva', + 'Reubicación Equipo', +]; + +const _predefinedTaskTitles = [ + 'Cambiar mecanismos del estanque del WC', + 'Cambiar sifones y desagües', + 'Cambiar válvulas, flexibles y conexiones', + 'Conectar cocinas, hornos o calefont', + 'Detectar fugas de gas', + 'Instalar lavamanos, lavaplatos o lavaderos', + 'Instalar o cambiar calefont', + 'Instalar puntos adicionales de agua', + 'Instalar termos eléctricos', + 'Instalar y cambiar llaves de paso', + 'Instalar y reparar inodoros', + 'Mantención de calefont', + 'Realizar mantenimiento preventivo', + 'Reparar tuberías y conexiones de gas', + 'Reparar WC que pierde agua o no descarga', +]; + +enum _TitleInputMode { manual, predefined } + +final _clpFormat = NumberFormat.decimalPattern('es_CL'); + +String _formatClp(int value) => '\$${_clpFormat.format(value)}'; + +int _parsePrice(String value) { + return int.tryParse(value.replaceAll(RegExp(r'[^0-9]'), '')) ?? 0; +} + +class WorkOrderScreen extends StatefulWidget { + const WorkOrderScreen({required this.details, this.order, super.key}); + + final WorkOrderDetails details; + final WorkOrder? order; + + @override + State createState() => _WorkOrderScreenState(); +} + +class _WorkOrderScreenState extends State { + final _database = AppDatabase.instance; + final _imagePicker = ImagePicker(); + final _imageStorage = ImageStorageService(); + final _pdfService = PdfService(); + final _emailService = EmailService(); + final _dictationService = SpeechDictationService.instance; + final _dictationText = DictationTextAccumulator(); + final _uuid = const Uuid(); + final _formKey = GlobalKey(); + + late final String _workOrderId; + late final TextEditingController _titleController; + late final TextEditingController _laborCostController; + late _TitleInputMode _titleInputMode; + late String _manualTitle; + String? _selectedPredefinedTitle; + late List<_TaskDraft> _tasks; + late Set _originalImagePaths; + + final Set _newImagePaths = {}; + WorkOrder? _order; + String? _dictatingTaskId; + bool _dictationButtonHeld = false; + bool _dictationStarting = false; + bool _dictationRestarting = false; + bool _suppressDictationRestart = false; + bool _dirty = false; + bool _busy = false; + + bool get _readOnly => _order?.isCompleted ?? false; + + @override + void initState() { + super.initState(); + _order = widget.order; + _dirty = + widget.order != null && + (widget.order!.details.client != widget.details.client || + widget.order!.details.phone != widget.details.phone || + widget.order!.details.address != widget.details.address); + _workOrderId = widget.order?.id ?? _uuid.v4(); + final initialTitle = widget.order?.title ?? ''; + _selectedPredefinedTitle = _predefinedWorkOrderTitles.contains(initialTitle) + ? initialTitle + : null; + _titleInputMode = initialTitle.isEmpty || _selectedPredefinedTitle != null + ? _TitleInputMode.predefined + : _TitleInputMode.manual; + _manualTitle = _titleInputMode == _TitleInputMode.manual + ? initialTitle + : ''; + _titleController = TextEditingController(text: initialTitle); + _titleController.addListener(_onTitleChanged); + final initialLaborCost = widget.order?.laborCost ?? 0; + _laborCostController = TextEditingController( + text: initialLaborCost > 0 ? initialLaborCost.toString() : '', + ); + _laborCostController.addListener(_markDirty); + _tasks = + widget.order?.tasks + .map((task) => _TaskDraft.fromTask(task, _markDirty)) + .toList() ?? + [_TaskDraft.empty(_uuid.v4(), _markDirty)]; + _originalImagePaths = + widget.order?.tasks + .expand((task) => task.photos) + .map((photo) => photo.path) + .toSet() ?? + {}; + } + + @override + void dispose() { + unawaited(_dictationService.endSession()); + _titleController.removeListener(_onTitleChanged); + _titleController.dispose(); + _laborCostController.removeListener(_markDirty); + _laborCostController.dispose(); + for (final task in _tasks) { + task.dispose(); + } + super.dispose(); + } + + void _markDirty() { + if (!_readOnly && mounted && !_dirty) { + setState(() => _dirty = true); + } + } + + void _onTitleChanged() { + if (_titleInputMode == _TitleInputMode.manual) { + _manualTitle = _titleController.text; + } + _markDirty(); + } + + void _changeTitleInputMode(_TitleInputMode mode) { + if (mode == _titleInputMode) return; + + final nextTitle = mode == _TitleInputMode.manual + ? _manualTitle + : _selectedPredefinedTitle ?? ''; + setState(() => _titleInputMode = mode); + _titleController.text = nextTitle; + } + + void _toggleTitleInputMode() { + _changeTitleInputMode( + _titleInputMode == _TitleInputMode.predefined + ? _TitleInputMode.manual + : _TitleInputMode.predefined, + ); + } + + void _selectPredefinedTitle(String? title) { + if (title == null) return; + setState(() => _selectedPredefinedTitle = title); + _titleController.text = title; + } + + Future _startDictation(_TaskDraft task) async { + if (_dictationStarting) return; + _dictationButtonHeld = true; + _dictationStarting = true; + if (mounted) { + setState(() => _dictatingTaskId = task.id); + } + try { + if (_dictationService.isListening) { + _suppressDictationRestart = true; + try { + await _dictationService.stop(); + } finally { + _suppressDictationRestart = false; + } + } + + final available = await _dictationService.initialize( + onStatusChanged: _handleDictationStatus, + onError: _handleDictationError, + ); + if (!available) { + _dictationButtonHeld = false; + if (mounted) setState(() => _dictatingTaskId = null); + _showMessage( + 'El dictado no está disponible. Revisa el permiso del micrófono.', + ); + return; + } + if (!_dictationButtonHeld || !mounted) { + if (mounted) setState(() => _dictatingTaskId = null); + return; + } + + _dictationText.begin(task.observationController.text); + setState(() => _dictatingTaskId = task.id); + await _dictationService.listen(onResult: _handleDictationResult); + } catch (_) { + if (!mounted) return; + _dictationButtonHeld = false; + setState(() => _dictatingTaskId = null); + _showMessage('No fue posible iniciar el dictado.'); + } finally { + _dictationStarting = false; + } + } + + Future _stopDictation() async { + _dictationButtonHeld = false; + if (_dictationService.isListening) { + await _dictationService.stop(); + } + if (mounted && _dictatingTaskId != null) { + setState(() => _dictatingTaskId = null); + } + } + + void _handleDictationResult(String words, bool isFinalResult) { + final taskId = _dictatingTaskId; + final recognizedWords = words.trim(); + if (taskId == null || recognizedWords.isEmpty) return; + + _TaskDraft? activeTask; + for (final task in _tasks) { + if (task.id == taskId) { + activeTask = task; + break; + } + } + if (activeTask == null) return; + + final updatedText = _dictationText.addResult(recognizedWords); + activeTask.observationController.value = TextEditingValue( + text: updatedText, + selection: TextSelection.collapsed(offset: updatedText.length), + ); + } + + void _handleDictationStatus(bool isListening) { + if (isListening || !mounted) return; + final taskId = _dictatingTaskId; + if (taskId == null) return; + + if (_dictationButtonHeld && !_suppressDictationRestart) { + unawaited(_restartDictationAfterPause(taskId)); + } + } + + Future _restartDictationAfterPause(String taskId) async { + if (_dictationRestarting) return; + _dictationRestarting = true; + try { + await Future.delayed(const Duration(milliseconds: 800)); + if (!_dictationButtonHeld || !mounted || _dictatingTaskId != taskId) { + return; + } + + _TaskDraft? activeTask; + for (final task in _tasks) { + if (task.id == taskId) { + activeTask = task; + break; + } + } + if (activeTask == null) return; + + _dictationText.begin(activeTask.observationController.text); + await _dictationService.listen(onResult: _handleDictationResult); + } catch (_) { + if (!mounted) return; + _dictationButtonHeld = false; + setState(() => _dictatingTaskId = null); + _showMessage( + 'El dictado se interrumpió. Mantén presionado para intentar nuevamente.', + ); + } finally { + _dictationRestarting = false; + } + } + + void _handleDictationError(String errorCode) { + if (!mounted) return; + final transientError = + errorCode == 'error_no_match' || errorCode == 'error_speech_timeout'; + if (transientError && _dictationButtonHeld && _dictatingTaskId != null) { + return; + } + + _dictationButtonHeld = false; + if (_dictatingTaskId != null) { + setState(() => _dictatingTaskId = null); + } + + final message = switch (errorCode) { + 'error_permission' || 'error_permission_denied' => + 'Autoriza el micrófono para usar el dictado.', + 'error_no_match' || + 'error_speech_timeout' => 'No se detectó una opción. Intenta nuevamente.', + _ => 'El dictado se interrumpió. Intenta nuevamente.', + }; + _showMessage(message); + } + + void _addTask() { + setState(() { + _tasks.add(_TaskDraft.empty(_uuid.v4(), _markDirty)); + _dirty = true; + }); + } + + Future _removeTask(int index) async { + final task = _tasks[index]; + final hasContent = + task.titleController.text.trim().isNotEmpty || + task.observationController.text.trim().isNotEmpty || + task.photos.isNotEmpty || + task.parts.isNotEmpty; + if (hasContent) { + final confirmed = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Quitar tarea'), + content: const Text( + 'La tarea y sus fotografías se quitarán de esta orden.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Cancelar'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, true), + child: const Text('Quitar'), + ), + ], + ), + ); + if (confirmed != true) return; + } + if (_dictatingTaskId == task.id) { + await _stopDictation(); + if (!mounted) return; + } + setState(() { + final removed = _tasks.removeAt(index); + removed.dispose(); + _dirty = true; + }); + } + + Future _choosePhotos(_TaskDraft task, PhotoKind kind) async { + final source = await showModalBottomSheet( + context: context, + showDragHandle: true, + builder: (context) => SafeArea( + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 20), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Agregar evidencia', + style: TextStyle(fontSize: 19, fontWeight: FontWeight.w800), + ), + const SizedBox(height: 6), + const Text( + 'Puedes tomar una foto o seleccionar varias desde la galería.', + style: TextStyle(color: Color(0xFF627372)), + ), + const SizedBox(height: 16), + ListTile( + contentPadding: EdgeInsets.zero, + leading: const _SourceIcon(icon: Icons.photo_camera_outlined), + title: const Text('Tomar fotografía'), + subtitle: const Text('Usar la cámara del dispositivo'), + onTap: () => Navigator.pop(context, ImageSource.camera), + ), + ListTile( + contentPadding: EdgeInsets.zero, + leading: const _SourceIcon(icon: Icons.photo_library_outlined), + title: const Text('Elegir de la galería'), + subtitle: const Text('Seleccionar una o varias imágenes'), + onTap: () => Navigator.pop(context, ImageSource.gallery), + ), + ], + ), + ), + ), + ); + if (source == null) return; + + try { + setState(() => _busy = true); + final selected = []; + if (source == ImageSource.camera) { + final photo = await _imagePicker.pickImage( + source: source, + maxWidth: 1920, + imageQuality: 82, + ); + if (photo != null) selected.add(photo); + } else { + selected.addAll( + await _imagePicker.pickMultiImage(maxWidth: 1920, imageQuality: 82), + ); + } + + for (final sourceFile in selected) { + final storedPath = await _imageStorage.storeImage( + sourcePath: sourceFile.path, + workOrderId: _workOrderId, + taskId: task.id, + ); + _newImagePaths.add(storedPath); + final photo = TaskPhoto(id: _uuid.v4(), path: storedPath, kind: kind); + if (kind == PhotoKind.before) { + task.beforePhotos.add(photo); + } else { + task.afterPhotos.add(photo); + } + } + if (!mounted) return; + setState(() { + if (selected.isNotEmpty) _dirty = true; + _busy = false; + }); + } catch (_) { + if (!mounted) return; + setState(() => _busy = false); + _showMessage('No fue posible agregar las fotografías.'); + } + } + + void _removePhoto(_TaskDraft task, TaskPhoto photo) { + setState(() { + task.beforePhotos.removeWhere((item) => item.id == photo.id); + task.afterPhotos.removeWhere((item) => item.id == photo.id); + _dirty = true; + }); + } + + void _addPart(_TaskDraft task) { + setState(() { + task.parts.add(_PartDraft.empty(_uuid.v4(), _markDirty)); + _dirty = true; + }); + } + + void _removePart(_TaskDraft task, _PartDraft part) { + setState(() { + task.parts.remove(part); + part.dispose(); + _dirty = true; + }); + } + + bool _validateDraft() { + if (!_formKey.currentState!.validate()) return false; + if (_tasks.isEmpty) { + _showMessage('Agrega al menos una tarea.'); + return false; + } + for (var index = 0; index < _tasks.length; index++) { + final task = _tasks[index]; + if (task.titleController.text.trim().isEmpty) { + _showMessage('Escribe el nombre de la tarea ${index + 1}.'); + return false; + } + for (var partIndex = 0; partIndex < task.parts.length; partIndex++) { + final part = task.parts[partIndex]; + if (part.nameController.text.trim().isEmpty) { + _showMessage( + 'Escribe el nombre del repuesto ${partIndex + 1} ' + 'de la tarea ${index + 1}.', + ); + return false; + } + if (_parsePrice(part.priceController.text) <= 0) { + _showMessage( + 'Ingresa un precio válido para el repuesto ${partIndex + 1} ' + 'de la tarea ${index + 1}.', + ); + return false; + } + } + } + return true; + } + + bool _validateCompletion() { + if (!_validateDraft()) return false; + for (var index = 0; index < _tasks.length; index++) { + final task = _tasks[index]; + if (task.observationController.text.trim().isEmpty) { + _showMessage('Registra la observación de la tarea ${index + 1}.'); + return false; + } + if (task.beforePhotos.isEmpty) { + _showMessage('Agrega una foto “antes” en la tarea ${index + 1}.'); + return false; + } + if (task.afterPhotos.isEmpty) { + _showMessage('Agrega una foto “después” en la tarea ${index + 1}.'); + return false; + } + } + return true; + } + + WorkOrder _buildOrder({ + required WorkOrderStatus status, + String? recipientEmail, + String? pdfPath, + DateTime? completedAt, + }) { + final now = DateTime.now(); + return WorkOrder( + id: _workOrderId, + title: _titleController.text.trim(), + createdAt: _order?.createdAt ?? now, + updatedAt: now, + completedAt: completedAt ?? _order?.completedAt, + status: status, + details: widget.details, + laborCost: _parsePrice(_laborCostController.text), + recipientEmail: recipientEmail ?? _order?.recipientEmail, + pdfPath: pdfPath ?? _order?.pdfPath, + tasks: [ + for (var index = 0; index < _tasks.length; index++) + WorkTask( + id: _tasks[index].id, + title: _tasks[index].titleController.text.trim(), + observation: _tasks[index].observationController.text.trim(), + position: index, + photos: _tasks[index].photos, + parts: [ + for (final part in _tasks[index].parts) + TaskPart( + id: part.id, + name: part.nameController.text.trim(), + price: _parsePrice(part.priceController.text), + ), + ], + ), + ], + ); + } + + Future _saveDraft({bool showConfirmation = true}) async { + if (!_validateDraft()) return null; + final draft = _buildOrder(status: WorkOrderStatus.open); + try { + setState(() => _busy = true); + await _database.saveWorkOrder(draft); + await _cleanupUnusedImages(); + if (!mounted) return null; + setState(() { + _order = draft; + _dirty = false; + _busy = false; + }); + if (showConfirmation) { + _showMessage('Borrador guardado en el dispositivo.'); + } + return draft; + } catch (_) { + if (!mounted) return null; + setState(() => _busy = false); + _showMessage('No fue posible guardar el borrador.'); + return null; + } + } + + Future _finalize() async { + if (!_validateCompletion()) return; + final reportType = await _requestPdfReportType(); + if (reportType == null || !mounted) return; + final recipient = await _requestEmail(_order?.recipientEmail); + if (recipient == null || !mounted) return; + + setState(() => _busy = true); + try { + final completionTime = DateTime.now(); + final reportOrder = _buildOrder( + status: WorkOrderStatus.completed, + recipientEmail: recipient, + completedAt: completionTime, + ); + final pdfPath = await _pdfService.generate(reportOrder, type: reportType); + final completedOrder = reportOrder.copyWith( + updatedAt: DateTime.now(), + pdfPath: pdfPath, + ); + await _database.saveWorkOrder(completedOrder); + await _cleanupUnusedImages(); + if (!mounted) return; + setState(() { + _order = completedOrder; + _dirty = false; + }); + + try { + await _emailService.sendReport( + order: completedOrder, + recipient: recipient, + pdfPath: pdfPath, + reportType: reportType, + ); + if (!mounted) return; + _showMessage('OT finalizada. El correo quedó listo para enviar.'); + } catch (_) { + if (!mounted) return; + _showMessage( + 'La OT y el PDF se guardaron, pero no se encontró una aplicación ' + 'de correo configurada.', + ); + } + } catch (_) { + if (!mounted) return; + _showMessage('No fue posible finalizar la orden ni crear el PDF.'); + } finally { + if (mounted) setState(() => _busy = false); + } + } + + Future _ensurePdf(PdfReportType reportType) async { + final order = _order; + if (order == null) return null; + final existingPath = order.pdfPath; + if (existingPath != null && + _pdfService.isCurrentReport(existingPath, type: reportType) && + await File(existingPath).exists()) { + return existingPath; + } + + final path = await _pdfService.generate(order, type: reportType); + final updatedOrder = order.copyWith( + updatedAt: DateTime.now(), + pdfPath: path, + ); + await _database.saveWorkOrder(updatedOrder); + if (mounted) setState(() => _order = updatedOrder); + return path; + } + + Future _openPdf() async { + final reportType = await _requestPdfReportType(); + if (reportType == null || !mounted) return; + try { + setState(() => _busy = true); + final path = await _ensurePdf(reportType); + if (!mounted || path == null) return; + setState(() => _busy = false); + await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => PdfPreviewScreen( + pdfPath: path, + title: '${_order!.title} - ${reportType.label}', + ), + ), + ); + } catch (_) { + if (!mounted) return; + _showMessage('No fue posible abrir el informe PDF.'); + } finally { + if (mounted) setState(() => _busy = false); + } + } + + Future _sendExistingReport() async { + final currentOrder = _order; + if (currentOrder == null) return; + final reportType = await _requestPdfReportType(); + if (reportType == null || !mounted) return; + final recipient = await _requestEmail(currentOrder.recipientEmail); + if (recipient == null || !mounted) return; + + try { + setState(() => _busy = true); + final path = await _ensurePdf(reportType); + if (path == null) return; + final updatedOrder = _order!.copyWith( + updatedAt: DateTime.now(), + recipientEmail: recipient, + ); + await _database.saveWorkOrder(updatedOrder); + if (mounted) setState(() => _order = updatedOrder); + await _emailService.sendReport( + order: updatedOrder, + recipient: recipient, + pdfPath: path, + reportType: reportType, + ); + if (!mounted) return; + _showMessage('El correo quedó listo para enviar.'); + } catch (_) { + if (!mounted) return; + _showMessage( + 'No se pudo abrir el correo. Verifica que exista una cuenta configurada.', + ); + } finally { + if (mounted) setState(() => _busy = false); + } + } + + Future _requestEmail(String? initialValue) async { + return showDialog( + context: context, + builder: (context) => EmailRecipientDialog(initialValue: initialValue), + ); + } + + Future _requestPdfReportType() { + return showDialog( + context: context, + builder: (context) => const PdfReportTypeDialog(), + ); + } + + Future _cleanupUnusedImages() async { + final currentPaths = _tasks + .expand((task) => task.photos) + .map((photo) => photo.path) + .toSet(); + final unusedPaths = { + ..._originalImagePaths.difference(currentPaths), + ..._newImagePaths.difference(currentPaths), + }; + await _imageStorage.deleteFiles(unusedPaths); + _originalImagePaths = currentPaths; + _newImagePaths.clear(); + } + + Future _handleUnsavedExit() async { + final action = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Cambios sin guardar'), + content: const Text( + 'Puedes guardar la orden como borrador para continuar más tarde.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, 'cancel'), + child: const Text('Seguir editando'), + ), + TextButton( + onPressed: () => Navigator.pop(context, 'discard'), + child: const Text('Descartar'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, 'save'), + child: const Text('Guardar'), + ), + ], + ), + ); + if (!mounted) return; + if (action == 'discard') { + await _imageStorage.deleteFiles(_newImagePaths); + if (mounted) Navigator.pop(context); + } else if (action == 'save') { + final saved = await _saveDraft(showConfirmation: false); + if (saved != null && mounted) Navigator.pop(context); + } + } + + void _showMessage(String message) { + ScaffoldMessenger.of(context) + ..hideCurrentSnackBar() + ..showSnackBar(SnackBar(content: Text(message))); + } + + @override + Widget build(BuildContext context) { + return PopScope( + canPop: !_dirty || _readOnly, + onPopInvokedWithResult: (didPop, result) { + if (!didPop) _handleUnsavedExit(); + }, + child: Scaffold( + appBar: AppBar( + title: Text( + _readOnly + ? 'Detalle de la OT' + : widget.order == null + ? 'Nueva orden' + : 'Editar orden', + ), + actions: [ + if (!_readOnly) + IconButton( + tooltip: 'Guardar borrador', + onPressed: _busy ? null : _saveDraft, + icon: const Icon(Icons.save_outlined), + ), + const SizedBox(width: 6), + ], + bottom: _busy + ? const PreferredSize( + preferredSize: Size.fromHeight(3), + child: LinearProgressIndicator(minHeight: 3), + ) + : null, + ), + body: AbsorbPointer( + absorbing: _busy, + child: Form( + key: _formKey, + child: ListView( + padding: const EdgeInsets.fromLTRB(20, 12, 20, 32), + children: [ + if (_readOnly) ...[ + _CompletedBanner(order: _order!), + const SizedBox(height: 24), + ], + _OrderDetailsHeader(details: widget.details), + const SizedBox(height: 24), + if (_readOnly) + TextFormField( + controller: _titleController, + readOnly: true, + textCapitalization: TextCapitalization.sentences, + textInputAction: TextInputAction.next, + decoration: const InputDecoration( + hintText: 'Ej. Mantención preventiva bomba N.º 2', + ), + validator: (value) => (value?.trim().isEmpty ?? true) + ? 'Ingresa el título de la orden' + : null, + ) + else + Row( + children: [ + Expanded( + child: _titleInputMode == _TitleInputMode.predefined + ? DropdownButtonFormField( + initialValue: _selectedPredefinedTitle, + isExpanded: true, + decoration: const InputDecoration( + hintText: 'Selecciona una opción', + ), + items: [ + for (final title + in _predefinedWorkOrderTitles) + DropdownMenuItem( + value: title, + child: Text(title), + ), + ], + onChanged: _selectPredefinedTitle, + validator: (value) => value == null + ? 'Selecciona una opción para el título' + : null, + ) + : TextFormField( + controller: _titleController, + autofocus: true, + textCapitalization: + TextCapitalization.sentences, + textInputAction: TextInputAction.next, + decoration: const InputDecoration( + hintText: 'Escribe el título de la orden', + ), + validator: (value) => + (value?.trim().isEmpty ?? true) + ? 'Ingresa el título de la orden' + : null, + ), + ), + const SizedBox(width: 6), + IconButton.filledTonal( + tooltip: _titleInputMode == _TitleInputMode.predefined + ? 'Escribir título de la orden' + : 'Usar una opción predefinida', + onPressed: _toggleTitleInputMode, + icon: Icon( + _titleInputMode == _TitleInputMode.predefined + ? Icons.edit_outlined + : Icons.format_quote_rounded, + ), + ), + ], + ), + const SizedBox(height: 28), + Row( + children: [ + const Expanded( + child: _FieldLabel( + title: 'Tareas', + subtitle: 'Documenta cada actividad por separado.', + ), + ), + if (!_readOnly) + TextButton.icon( + onPressed: _addTask, + icon: const Icon(Icons.add_rounded), + label: const Text('Agregar'), + ), + ], + ), + const SizedBox(height: 12), + for (var index = 0; index < _tasks.length; index++) ...[ + _TaskCard( + key: ValueKey(_tasks[index].id), + number: index + 1, + task: _tasks[index], + readOnly: _readOnly, + isDictating: _dictatingTaskId == _tasks[index].id, + canDelete: !_readOnly, + onDelete: () => _removeTask(index), + onStartDictation: () => _startDictation(_tasks[index]), + onStopDictation: _stopDictation, + onAddPhotos: (kind) => _choosePhotos(_tasks[index], kind), + onRemovePhoto: (photo) => + _removePhoto(_tasks[index], photo), + onAddPart: () => _addPart(_tasks[index]), + onRemovePart: (part) => _removePart(_tasks[index], part), + ), + const SizedBox(height: 16), + ], + if (!_readOnly) + OutlinedButton.icon( + onPressed: _addTask, + icon: const Icon(Icons.add_task_rounded), + label: const Text('Agregar otra tarea'), + ), + const SizedBox(height: 24), + const Divider(color: Color(0xFFE2EAE9)), + const SizedBox(height: 16), + TextFormField( + key: const Key('labor-cost-field'), + controller: _laborCostController, + readOnly: _readOnly, + keyboardType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + ), + decoration: const InputDecoration( + labelText: 'Costo de mano de obra', + helperText: 'Monto total asociado a toda la OT.', + prefixText: r'$ ', + prefixIcon: Icon(Icons.payments_outlined), + ), + validator: (value) => _parsePrice(value ?? '') <= 0 + ? 'Ingresa un costo de mano de obra válido' + : null, + ), + ], + ), + ), + ), + bottomNavigationBar: _BottomActions( + readOnly: _readOnly, + busy: _busy, + onSave: _saveDraft, + onFinalize: _finalize, + onOpenPdf: _openPdf, + onSendEmail: _sendExistingReport, + ), + ), + ); + } +} + +class _OrderDetailsHeader extends StatelessWidget { + const _OrderDetailsHeader({required this.details}); + + final WorkOrderDetails details; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: const Color(0xFFE7F1F0), + borderRadius: BorderRadius.circular(16), + ), + child: Column( + children: [ + _detailRow( + icon: Icons.person_outline_rounded, + label: 'Cliente', + value: details.client, + ), + ], + ), + ); + } + + Widget _detailRow({ + required IconData icon, + required String label, + required String value, + }) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, size: 21, color: const Color(0xFF0B5C5E)), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label.toUpperCase(), + style: const TextStyle( + color: Color(0xFF627372), + fontSize: 10, + fontWeight: FontWeight.w800, + letterSpacing: .7, + ), + ), + const SizedBox(height: 3), + Text( + value.isEmpty ? 'No informado' : value, + style: const TextStyle( + color: Color(0xFF163334), + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + ), + ], + ); + } +} + +class _TaskDraft { + _TaskDraft({ + required this.id, + required this.titleController, + required this.observationController, + required this.beforePhotos, + required this.afterPhotos, + required this.parts, + required VoidCallback onChanged, + }) : _onChanged = onChanged { + titleController.addListener(_onChanged); + observationController.addListener(_onChanged); + } + + factory _TaskDraft.empty(String id, VoidCallback onChanged) { + return _TaskDraft( + id: id, + titleController: TextEditingController(), + observationController: TextEditingController(), + beforePhotos: [], + afterPhotos: [], + parts: [], + onChanged: onChanged, + ); + } + + factory _TaskDraft.fromTask(WorkTask task, VoidCallback onChanged) { + return _TaskDraft( + id: task.id, + titleController: TextEditingController(text: task.title), + observationController: TextEditingController(text: task.observation), + beforePhotos: List.of(task.beforePhotos), + afterPhotos: List.of(task.afterPhotos), + parts: task.parts + .map((part) => _PartDraft.fromPart(part, onChanged)) + .toList(), + onChanged: onChanged, + ); + } + + final String id; + final TextEditingController titleController; + final TextEditingController observationController; + final List beforePhotos; + final List afterPhotos; + final List<_PartDraft> parts; + final VoidCallback _onChanged; + + List get photos => [...beforePhotos, ...afterPhotos]; + + void dispose() { + titleController + ..removeListener(_onChanged) + ..dispose(); + observationController + ..removeListener(_onChanged) + ..dispose(); + for (final part in parts) { + part.dispose(); + } + } +} + +class _PartDraft { + _PartDraft({ + required this.id, + required this.nameController, + required this.priceController, + required VoidCallback onChanged, + }) : _onChanged = onChanged { + nameController.addListener(_onChanged); + priceController.addListener(_onChanged); + } + + factory _PartDraft.empty(String id, VoidCallback onChanged) { + return _PartDraft( + id: id, + nameController: TextEditingController(), + priceController: TextEditingController(), + onChanged: onChanged, + ); + } + + factory _PartDraft.fromPart(TaskPart part, VoidCallback onChanged) { + return _PartDraft( + id: part.id, + nameController: TextEditingController(text: part.name), + priceController: TextEditingController(text: part.price.toString()), + onChanged: onChanged, + ); + } + + final String id; + final TextEditingController nameController; + final TextEditingController priceController; + final VoidCallback _onChanged; + + int get price => _parsePrice(priceController.text); + + void dispose() { + nameController + ..removeListener(_onChanged) + ..dispose(); + priceController + ..removeListener(_onChanged) + ..dispose(); + } +} + +class _CompletedBanner extends StatelessWidget { + const _CompletedBanner({required this.order}); + + final WorkOrder order; + + @override + Widget build(BuildContext context) { + final date = order.completedAt ?? order.updatedAt; + return _StatusBanner( + icon: Icons.task_alt_rounded, + color: const Color(0xFF24755E), + background: const Color(0xFFE4F3ED), + title: 'Orden finalizada', + message: + '${DateFormat('dd/MM/yyyy HH:mm').format(date.toLocal())} · ' + '${order.tasks.length} tarea(s) · ${order.totalPhotos} foto(s)', + ); + } +} + +class _StatusBanner extends StatelessWidget { + const _StatusBanner({ + required this.icon, + required this.color, + required this.background, + required this.title, + required this.message, + }); + + final IconData icon; + final Color color; + final Color background; + final String title; + final String message; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: background, + borderRadius: BorderRadius.circular(16), + ), + child: Row( + children: [ + Icon(icon, color: color, size: 27), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(color: color, fontWeight: FontWeight.w800), + ), + const SizedBox(height: 3), + Text( + message, + style: const TextStyle( + color: Color(0xFF4E6260), + height: 1.35, + fontSize: 12, + ), + ), + ], + ), + ), + ], + ), + ); + } +} + +class _FieldLabel extends StatelessWidget { + const _FieldLabel({required this.title, required this.subtitle}); + + final String title; + final String subtitle; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + color: Color(0xFF163334), + fontSize: 17, + fontWeight: FontWeight.w800, + ), + ), + const SizedBox(height: 3), + Text( + subtitle, + style: const TextStyle(color: Color(0xFF6A7A79), fontSize: 12), + ), + ], + ); + } +} + +class _TaskTitleField extends StatefulWidget { + const _TaskTitleField({required this.task, required this.readOnly}); + + final _TaskDraft task; + final bool readOnly; + + @override + State<_TaskTitleField> createState() => _TaskTitleFieldState(); +} + +class _TaskTitleFieldState extends State<_TaskTitleField> { + late _TitleInputMode _inputMode; + late String _manualTitle; + String? _selectedPredefinedTitle; + + @override + void initState() { + super.initState(); + final initialTitle = widget.task.titleController.text; + _selectedPredefinedTitle = _predefinedTaskTitles.contains(initialTitle) + ? initialTitle + : null; + _inputMode = initialTitle.isEmpty || _selectedPredefinedTitle != null + ? _TitleInputMode.predefined + : _TitleInputMode.manual; + _manualTitle = _inputMode == _TitleInputMode.manual ? initialTitle : ''; + } + + void _toggleInputMode() { + final nextMode = _inputMode == _TitleInputMode.predefined + ? _TitleInputMode.manual + : _TitleInputMode.predefined; + final nextTitle = nextMode == _TitleInputMode.manual + ? _manualTitle + : _selectedPredefinedTitle ?? ''; + setState(() => _inputMode = nextMode); + widget.task.titleController.text = nextTitle; + } + + void _selectPredefinedTitle(String? title) { + if (title == null) return; + setState(() => _selectedPredefinedTitle = title); + widget.task.titleController.text = title; + } + + @override + Widget build(BuildContext context) { + if (widget.readOnly) { + return TextFormField( + controller: widget.task.titleController, + readOnly: true, + decoration: const InputDecoration(labelText: 'Tarea realizada'), + ); + } + + return Row( + children: [ + Expanded( + child: _inputMode == _TitleInputMode.predefined + ? DropdownButtonFormField( + initialValue: _selectedPredefinedTitle, + isExpanded: true, + decoration: const InputDecoration( + hintText: 'Selecciona una opción', + ), + items: [ + for (final title in _predefinedTaskTitles) + DropdownMenuItem(value: title, child: Text(title)), + ], + onChanged: _selectPredefinedTitle, + ) + : TextFormField( + controller: widget.task.titleController, + autofocus: true, + textCapitalization: TextCapitalization.sentences, + onChanged: (value) => _manualTitle = value, + decoration: const InputDecoration( + hintText: 'Escribe el título de la tarea', + ), + ), + ), + const SizedBox(width: 6), + IconButton.filledTonal( + tooltip: _inputMode == _TitleInputMode.predefined + ? 'Escribir título de la tarea' + : 'Usar una opción predefinida', + onPressed: _toggleInputMode, + icon: Icon( + _inputMode == _TitleInputMode.predefined + ? Icons.edit_outlined + : Icons.format_quote_rounded, + ), + ), + ], + ); + } +} + +class _HoldToDictateButton extends StatelessWidget { + const _HoldToDictateButton({ + required this.isDictating, + required this.onStart, + required this.onStop, + }); + + final bool isDictating; + final VoidCallback onStart; + final VoidCallback onStop; + + @override + Widget build(BuildContext context) { + return Semantics( + button: true, + label: 'Mantén presionado para dictar la observación', + child: Listener( + behavior: HitTestBehavior.opaque, + onPointerDown: (_) => onStart(), + onPointerUp: (_) => onStop(), + onPointerCancel: (_) => onStop(), + child: SizedBox( + width: 48, + height: 48, + child: AnimatedContainer( + duration: const Duration(milliseconds: 150), + decoration: BoxDecoration( + color: isDictating + ? const Color(0xFFFFDAD6) + : const Color(0xFFD9EEEE), + shape: BoxShape.circle, + ), + alignment: Alignment.center, + child: Icon( + Icons.mic_rounded, + color: isDictating + ? const Color(0xFFB3261E) + : const Color(0xFF0B5C5E), + ), + ), + ), + ), + ); + } +} + +class _TaskCard extends StatelessWidget { + const _TaskCard({ + required this.number, + required this.task, + required this.readOnly, + required this.isDictating, + required this.canDelete, + required this.onDelete, + required this.onStartDictation, + required this.onStopDictation, + required this.onAddPhotos, + required this.onRemovePhoto, + required this.onAddPart, + required this.onRemovePart, + super.key, + }); + + final int number; + final _TaskDraft task; + final bool readOnly; + final bool isDictating; + final bool canDelete; + final VoidCallback onDelete; + final VoidCallback onStartDictation; + final VoidCallback onStopDictation; + final ValueChanged onAddPhotos; + final ValueChanged onRemovePhoto; + final VoidCallback onAddPart; + final ValueChanged<_PartDraft> onRemovePart; + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 32, + height: 32, + alignment: Alignment.center, + decoration: const BoxDecoration( + color: Color(0xFF0B5C5E), + shape: BoxShape.circle, + ), + child: Text( + '$number', + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.w800, + ), + ), + ), + const SizedBox(width: 10), + const Expanded( + child: Text( + 'Tarea', + style: TextStyle( + color: Color(0xFF163334), + fontSize: 16, + fontWeight: FontWeight.w800, + ), + ), + ), + if (canDelete) + IconButton( + tooltip: 'Quitar tarea', + onPressed: onDelete, + color: const Color(0xFF8C4A43), + icon: const Icon(Icons.delete_outline_rounded), + ), + ], + ), + const SizedBox(height: 14), + _TaskTitleField(task: task, readOnly: readOnly), + const SizedBox(height: 13), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: TextFormField( + controller: task.observationController, + readOnly: readOnly, + textCapitalization: TextCapitalization.sentences, + keyboardType: TextInputType.multiline, + autocorrect: true, + enableSuggestions: true, + spellCheckConfiguration: const SpellCheckConfiguration(), + minLines: 3, + maxLines: 5, + decoration: const InputDecoration( + labelText: 'Observación', + hintText: 'Describe el hallazgo y el trabajo ejecutado', + ), + ), + ), + if (!readOnly) ...[ + const SizedBox(width: 8), + Padding( + padding: const EdgeInsets.only(top: 8), + child: _HoldToDictateButton( + isDictating: isDictating, + onStart: onStartDictation, + onStop: onStopDictation, + ), + ), + ], + ], + ), + const SizedBox(height: 20), + const Divider(color: Color(0xFFE2EAE9)), + const SizedBox(height: 12), + _PartsSection( + parts: task.parts, + readOnly: readOnly, + onAdd: onAddPart, + onRemove: onRemovePart, + ), + const SizedBox(height: 20), + const Divider(color: Color(0xFFE2EAE9)), + const SizedBox(height: 12), + _PhotoSection( + title: 'Antes de la mantención', + hint: 'Estado inicial', + icon: Icons.history_rounded, + photos: task.beforePhotos, + readOnly: readOnly, + onAdd: () => onAddPhotos(PhotoKind.before), + onRemove: onRemovePhoto, + ), + const SizedBox(height: 20), + _PhotoSection( + title: 'Después de la mantención', + hint: 'Resultado final', + icon: Icons.auto_awesome_rounded, + photos: task.afterPhotos, + readOnly: readOnly, + onAdd: () => onAddPhotos(PhotoKind.after), + onRemove: onRemovePhoto, + ), + ], + ), + ), + ); + } +} + +class _PartsSection extends StatelessWidget { + const _PartsSection({ + required this.parts, + required this.readOnly, + required this.onAdd, + required this.onRemove, + }); + + final List<_PartDraft> parts; + final bool readOnly; + final VoidCallback onAdd; + final ValueChanged<_PartDraft> onRemove; + + int get _subtotal => parts.fold(0, (total, part) => total + part.price); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Icon( + Icons.inventory_2_outlined, + color: Color(0xFF0B5C5E), + size: 20, + ), + const SizedBox(width: 8), + const Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Repuestos utilizados', + style: TextStyle( + color: Color(0xFF163334), + fontSize: 18, + fontWeight: FontWeight.w700, + ), + ), + Text( + 'Registra cada repuesto y su precio en pesos.', + style: TextStyle(color: Color(0xFF71807F), fontSize: 11), + ), + ], + ), + ), + if (!readOnly) + IconButton.filledTonal( + key: const Key('add-part-button'), + tooltip: 'Agregar repuesto', + onPressed: onAdd, + icon: const Icon(Icons.add_rounded, size: 21), + ), + ], + ), + if (parts.isEmpty) + Container( + width: double.infinity, + margin: const EdgeInsets.only(top: 10), + padding: const EdgeInsets.symmetric(vertical: 18), + decoration: BoxDecoration( + color: const Color(0xFFF5F8F7), + borderRadius: BorderRadius.circular(12), + border: Border.all(color: const Color(0xFFDCE7E5)), + ), + child: const Text( + 'Sin repuestos registrados', + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xFF7A8988), fontSize: 12), + ), + ) + else ...[ + const SizedBox(height: 12), + for (var index = 0; index < parts.length; index++) ...[ + _PartInputRow( + key: ValueKey(parts[index].id), + number: index + 1, + part: parts[index], + readOnly: readOnly, + onRemove: () => onRemove(parts[index]), + ), + if (index < parts.length - 1) const SizedBox(height: 10), + ], + const SizedBox(height: 12), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 10), + decoration: BoxDecoration( + color: const Color(0xFFE7F1F0), + borderRadius: BorderRadius.circular(11), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Subtotal de repuestos', + style: TextStyle( + color: Color(0xFF526665), + fontWeight: FontWeight.w700, + ), + ), + AnimatedBuilder( + animation: Listenable.merge( + parts.map((part) => part.priceController), + ), + builder: (context, _) => Text( + _formatClp(_subtotal), + style: const TextStyle( + color: Color(0xFF0B5C5E), + fontSize: 16, + fontWeight: FontWeight.w900, + ), + ), + ), + ], + ), + ), + ], + ], + ); + } +} + +class _PartInputRow extends StatelessWidget { + const _PartInputRow({ + required this.number, + required this.part, + required this.readOnly, + required this.onRemove, + super.key, + }); + + final int number; + final _PartDraft part; + final bool readOnly; + final VoidCallback onRemove; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: TextFormField( + key: Key('part-name-${part.id}'), + controller: part.nameController, + readOnly: readOnly, + textCapitalization: TextCapitalization.sentences, + textInputAction: TextInputAction.next, + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w400, + ), + decoration: InputDecoration( + labelText: 'Repuesto $number', + hintText: 'Nombre del repuesto', + ), + validator: (value) { + if (value == null || value.trim().isEmpty) { + return 'Ingresa el nombre'; + } + return null; + }, + ), + ), + if (!readOnly) ...[ + const SizedBox(width: 4), + IconButton( + tooltip: 'Quitar repuesto', + onPressed: onRemove, + color: const Color(0xFF8C4A43), + icon: const Icon(Icons.remove_circle_outline_rounded), + ), + ], + ], + ), + const SizedBox(height: 8), + TextFormField( + key: Key('part-price-${part.id}'), + controller: part.priceController, + readOnly: readOnly, + keyboardType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700), + decoration: const InputDecoration( + labelText: 'Precio', + prefixText: r'$ ', + ), + validator: (value) { + if (_parsePrice(value ?? '') <= 0) { + return 'Precio inválido'; + } + return null; + }, + ), + ], + ); + } +} + +class _PhotoSection extends StatelessWidget { + const _PhotoSection({ + required this.title, + required this.hint, + required this.icon, + required this.photos, + required this.readOnly, + required this.onAdd, + required this.onRemove, + }); + + final String title; + final String hint; + final IconData icon; + final List photos; + final bool readOnly; + final VoidCallback onAdd; + final ValueChanged onRemove; + + void _preview(BuildContext context, TaskPhoto photo) { + showDialog( + context: context, + builder: (context) => Dialog( + backgroundColor: Colors.black, + insetPadding: const EdgeInsets.all(12), + child: Stack( + children: [ + InteractiveViewer( + minScale: .8, + maxScale: 4, + child: Image.file( + File(photo.path), + width: double.infinity, + height: MediaQuery.sizeOf(context).height * .72, + fit: BoxFit.contain, + errorBuilder: (_, _, _) => const SizedBox( + height: 260, + child: Center( + child: Text( + 'Imagen no disponible', + style: TextStyle(color: Colors.white), + ), + ), + ), + ), + ), + Positioned( + right: 8, + top: 8, + child: IconButton.filled( + onPressed: () => Navigator.pop(context), + icon: const Icon(Icons.close_rounded), + ), + ), + ], + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(icon, color: const Color(0xFF0B5C5E), size: 20), + const SizedBox(width: 8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + color: Color(0xFF163334), + fontWeight: FontWeight.w700, + ), + ), + Text( + '$hint · ${photos.length} foto(s)', + style: const TextStyle( + color: Color(0xFF71807F), + fontSize: 11, + ), + ), + ], + ), + ), + if (!readOnly) + IconButton.filledTonal( + tooltip: 'Agregar fotografías', + onPressed: onAdd, + icon: const Icon(Icons.add_a_photo_outlined, size: 20), + ), + ], + ), + if (photos.isEmpty) + Container( + width: double.infinity, + margin: const EdgeInsets.only(top: 10), + padding: const EdgeInsets.symmetric(vertical: 18), + decoration: BoxDecoration( + color: const Color(0xFFF5F8F7), + borderRadius: BorderRadius.circular(12), + border: Border.all(color: const Color(0xFFDCE7E5)), + ), + child: const Text( + 'Sin fotografías', + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xFF7A8988), fontSize: 12), + ), + ) + else + GridView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: const EdgeInsets.only(top: 10), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 8, + mainAxisSpacing: 8, + ), + itemCount: photos.length, + itemBuilder: (context, index) { + final photo = photos[index]; + return InkWell( + onTap: () => _preview(context, photo), + borderRadius: BorderRadius.circular(11), + child: ClipRRect( + borderRadius: BorderRadius.circular(11), + child: Stack( + fit: StackFit.expand, + children: [ + Image.file( + File(photo.path), + fit: BoxFit.cover, + errorBuilder: (_, _, _) => Container( + color: const Color(0xFFE7EEED), + child: const Icon(Icons.broken_image_outlined), + ), + ), + if (!readOnly) + Positioned( + right: 4, + top: 4, + child: InkWell( + onTap: () => onRemove(photo), + borderRadius: BorderRadius.circular(20), + child: Container( + padding: const EdgeInsets.all(4), + decoration: const BoxDecoration( + color: Color(0xCC172221), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.close_rounded, + color: Colors.white, + size: 16, + ), + ), + ), + ), + ], + ), + ), + ); + }, + ), + ], + ); + } +} + +class _SourceIcon extends StatelessWidget { + const _SourceIcon({required this.icon}); + + final IconData icon; + + @override + Widget build(BuildContext context) { + return Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: const Color(0xFFE7F1F0), + borderRadius: BorderRadius.circular(12), + ), + child: Icon(icon, color: const Color(0xFF0B5C5E)), + ); + } +} + +@visibleForTesting +class PdfReportTypeDialog extends StatelessWidget { + const PdfReportTypeDialog({super.key}); + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: const Text('Tipo de informe'), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Selecciona quién recibirá este informe.'), + const SizedBox(height: 14), + for (final type in PdfReportType.values) ...[ + Card( + margin: EdgeInsets.zero, + clipBehavior: Clip.antiAlias, + child: ListTile( + key: Key('report-type-${type.fileSegment}'), + leading: Icon( + type == PdfReportType.client + ? Icons.person_outline_rounded + : Icons.verified_user_outlined, + ), + title: Text(type.label), + subtitle: Text(type.description), + trailing: const Icon(Icons.chevron_right_rounded), + onTap: () => Navigator.pop(context, type), + ), + ), + if (type != PdfReportType.values.last) const SizedBox(height: 10), + ], + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancelar'), + ), + ], + ); + } +} + +@visibleForTesting +class EmailRecipientDialog extends StatefulWidget { + const EmailRecipientDialog({this.initialValue, super.key}); + + final String? initialValue; + + @override + State createState() => _EmailRecipientDialogState(); +} + +class _EmailRecipientDialogState extends State { + final _formKey = GlobalKey(); + late final TextEditingController _controller; + + @override + void initState() { + super.initState(); + _controller = TextEditingController(text: widget.initialValue ?? ''); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + void _submit() { + if (_formKey.currentState!.validate()) { + Navigator.pop(context, _controller.text.trim()); + } + } + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: const Text('Enviar informe'), + content: Form( + key: _formKey, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'El PDF se adjuntará al correo con el resumen del trabajo.', + ), + const SizedBox(height: 16), + TextFormField( + controller: _controller, + autofocus: true, + keyboardType: TextInputType.emailAddress, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + labelText: 'Correo destinatario', + hintText: 'nombre@empresa.cl', + prefixIcon: Icon(Icons.alternate_email_rounded), + ), + validator: (value) { + final email = value?.trim() ?? ''; + final valid = RegExp( + r'^[^@\s]+@[^@\s]+\.[^@\s]+$', + ).hasMatch(email); + return valid ? null : 'Ingresa un correo válido'; + }, + onFieldSubmitted: (_) => _submit(), + ), + ], + ), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancelar'), + ), + FilledButton.icon( + onPressed: _submit, + icon: const Icon(Icons.mail_outline_rounded), + label: const Text('Continuar'), + ), + ], + ); + } +} + +class _BottomActions extends StatelessWidget { + const _BottomActions({ + required this.readOnly, + required this.busy, + required this.onSave, + required this.onFinalize, + required this.onOpenPdf, + required this.onSendEmail, + }); + + final bool readOnly; + final bool busy; + final VoidCallback onSave; + final VoidCallback onFinalize; + final VoidCallback onOpenPdf; + final VoidCallback onSendEmail; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.fromLTRB( + 20, + 12, + 20, + 12 + MediaQuery.paddingOf(context).bottom, + ), + decoration: const BoxDecoration( + color: Colors.white, + border: Border(top: BorderSide(color: Color(0xFFDCE7E5))), + ), + child: Row( + children: [ + Expanded( + child: OutlinedButton.icon( + onPressed: busy ? null : (readOnly ? onOpenPdf : onSave), + icon: Icon( + readOnly ? Icons.picture_as_pdf_outlined : Icons.save_outlined, + ), + label: Text(readOnly ? 'Ver PDF' : 'Guardar'), + ), + ), + const SizedBox(width: 12), + Expanded( + child: FilledButton.icon( + onPressed: busy ? null : (readOnly ? onSendEmail : onFinalize), + icon: Icon( + readOnly ? Icons.mail_outline_rounded : Icons.task_alt_rounded, + ), + label: Text(readOnly ? 'Enviar' : 'Finalizar OT'), + ), + ), + ], + ), + ); + } +} diff --git a/lib/services/dictation_text_accumulator.dart b/lib/services/dictation_text_accumulator.dart new file mode 100644 index 0000000..a096c0f --- /dev/null +++ b/lib/services/dictation_text_accumulator.dart @@ -0,0 +1,89 @@ +class DictationTextAccumulator { + String _baseText = ''; + String _recognizedText = ''; + + String get text => + [_baseText, _recognizedText].where((part) => part.isNotEmpty).join(' '); + + void begin(String existingText) { + _baseText = existingText.trimRight(); + _recognizedText = ''; + } + + String addResult(String words) { + final nextText = words.trim().replaceAll(RegExp(r'\s+'), ' '); + if (nextText.isEmpty) return text; + + _recognizedText = _mergeWithoutDeleting(_recognizedText, nextText); + return text; + } + + String _mergeWithoutDeleting(String previousText, String nextText) { + if (previousText.isEmpty) return nextText; + + final previousWords = _words(previousText); + final nextWords = _words(nextText); + + if (_startsWith(nextWords, previousWords)) return nextText; + if (_startsWith(previousWords, nextWords)) return previousText; + + final commonPrefixLength = _commonPrefixLength(previousWords, nextWords); + if (commonPrefixLength > 0) { + if (nextWords.length > previousWords.length) return nextText; + if (nextWords.length < previousWords.length) return previousText; + return nextText.length >= previousText.length ? nextText : previousText; + } + + final overlapLength = _suffixPrefixOverlap(previousWords, nextWords); + if (overlapLength > 0) { + final originalNextWords = nextText.split(' '); + final remainingWords = originalNextWords.skip(overlapLength).join(' '); + return remainingWords.isEmpty + ? previousText + : '$previousText $remainingWords'; + } + + return '$previousText $nextText'; + } + + List _words(String value) { + return value + .toLowerCase() + .replaceAll(RegExp(r'[.,;:!?¿¡]'), '') + .split(RegExp(r'\s+')) + .where((word) => word.isNotEmpty) + .toList(); + } + + bool _startsWith(List words, List prefix) { + if (prefix.length > words.length) return false; + for (var index = 0; index < prefix.length; index++) { + if (words[index] != prefix[index]) return false; + } + return true; + } + + int _commonPrefixLength(List first, List second) { + final limit = first.length < second.length ? first.length : second.length; + var commonWords = 0; + while (commonWords < limit && first[commonWords] == second[commonWords]) { + commonWords++; + } + return commonWords; + } + + int _suffixPrefixOverlap(List previous, List next) { + final limit = previous.length < next.length ? previous.length : next.length; + for (var overlap = limit; overlap > 0; overlap--) { + var matches = true; + for (var index = 0; index < overlap; index++) { + if (previous[previous.length - overlap + index] != next[index]) { + matches = false; + break; + } + } + if (matches) return overlap; + } + return 0; + } +} diff --git a/lib/services/email_service.dart b/lib/services/email_service.dart new file mode 100644 index 0000000..26a1346 --- /dev/null +++ b/lib/services/email_service.dart @@ -0,0 +1,65 @@ +import 'package:flutter_email_sender/flutter_email_sender.dart'; +import 'package:intl/intl.dart'; + +import '../models/work_order.dart'; +import 'pdf_service.dart'; + +class EmailService { + Future sendReport({ + required WorkOrder order, + required String recipient, + required String pdfPath, + required PdfReportType reportType, + }) async { + final priceFormat = NumberFormat.decimalPattern('es_CL'); + String formatPrice(int value) => '\$${priceFormat.format(value)}'; + final buffer = StringBuffer() + ..writeln('Orden de trabajo: ${order.title}') + ..writeln('Cliente: ${order.details.client}') + ..writeln('Dirección: ${order.details.address}') + ..writeln() + ..writeln('Resumen del trabajo realizado:'); + + for (var index = 0; index < order.tasks.length; index++) { + final task = order.tasks[index]; + buffer + ..writeln() + ..writeln('${index + 1}. ${task.title}') + ..writeln('Observación: ${task.observation}') + ..writeln( + 'Evidencia: ${task.beforePhotos.length} foto(s) antes y ' + '${task.afterPhotos.length} foto(s) después.', + ); + if (reportType == PdfReportType.client && task.parts.isNotEmpty) { + buffer.writeln('Repuestos utilizados:'); + for (final part in task.parts) { + buffer.writeln('- ${part.name}: ${formatPrice(part.price)}'); + } + buffer.writeln( + 'Subtotal de repuestos: ${formatPrice(task.partsTotal)}', + ); + } + } + if (reportType == PdfReportType.client) { + buffer + ..writeln() + ..writeln('Costo de mano de obra: ${formatPrice(order.laborCost)}') + ..writeln('Total de repuestos: ${formatPrice(order.totalPartsCost)}') + ..writeln('Valor total de la OT: ${formatPrice(order.totalCost)}'); + } + buffer + ..writeln() + ..writeln('El informe PDF adjunto contiene el detalle y las fotografías.') + ..writeln() + ..writeln('Enviado desde SMoya Gasfiter.'); + + final email = Email( + body: buffer.toString(), + subject: 'Informe para ${reportType.label.toLowerCase()}: ${order.title}', + recipients: [recipient], + attachmentPaths: [pdfPath], + isHTML: false, + ); + await FlutterEmailSender.send(email); + } +} diff --git a/lib/services/image_storage_service.dart b/lib/services/image_storage_service.dart new file mode 100644 index 0000000..c4aa784 --- /dev/null +++ b/lib/services/image_storage_service.dart @@ -0,0 +1,51 @@ +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:path_provider/path_provider.dart'; +import 'package:uuid/uuid.dart'; + +class ImageStorageService { + ImageStorageService({Uuid? uuid}) : _uuid = uuid ?? const Uuid(); + + final Uuid _uuid; + + Future storeImage({ + required String sourcePath, + required String workOrderId, + required String taskId, + }) async { + final documents = await getApplicationDocumentsDirectory(); + final destinationDirectory = Directory( + p.join(documents.path, 'ot_movil', 'images', workOrderId, taskId), + ); + await destinationDirectory.create(recursive: true); + + final sourceExtension = p.extension(sourcePath).toLowerCase(); + final extension = sourceExtension.isEmpty ? '.jpg' : sourceExtension; + final destinationPath = p.join( + destinationDirectory.path, + '${_uuid.v4()}$extension', + ); + await File(sourcePath).copy(destinationPath); + return destinationPath; + } + + Future deleteFiles(Iterable paths) async { + for (final path in paths) { + final file = File(path); + if (await file.exists()) { + await file.delete(); + } + } + } + + Future deleteWorkOrderImages(String workOrderId) async { + final documents = await getApplicationDocumentsDirectory(); + final directory = Directory( + p.join(documents.path, 'ot_movil', 'images', workOrderId), + ); + if (await directory.exists()) { + await directory.delete(recursive: true); + } + } +} diff --git a/lib/services/pdf_service.dart b/lib/services/pdf_service.dart new file mode 100644 index 0000000..8771c41 --- /dev/null +++ b/lib/services/pdf_service.dart @@ -0,0 +1,794 @@ +import 'dart:io'; + +import 'package:flutter/services.dart'; +import 'package:intl/intl.dart'; +import 'package:path/path.dart' as p; +import 'package:path_provider/path_provider.dart'; +import 'package:pdf/pdf.dart'; +import 'package:pdf/widgets.dart' as pw; + +import '../models/work_order.dart'; + +enum PdfReportType { + client( + label: 'Cliente', + description: 'Incluye mano de obra, repuestos y valores.', + fileSegment: 'cliente', + ), + certifier( + label: 'Empresa certificadora', + description: 'Omite repuestos y toda la información económica.', + fileSegment: 'certificadora', + ); + + const PdfReportType({ + required this.label, + required this.description, + required this.fileSegment, + }); + + final String label; + final String description; + final String fileSegment; +} + +class PdfService { + static const _reportFilePrefix = 'OT_v12_'; + + bool isCurrentReport(String filePath, {PdfReportType? type}) { + final expectedPrefix = type == null + ? _reportFilePrefix + : '$_reportFilePrefix${type.fileSegment}_'; + return p.basename(filePath).startsWith(expectedPrefix); + } + + Future generate( + WorkOrder order, { + required PdfReportType type, + }) async { + final reportBytes = await build(order, type: type); + final documents = await getApplicationDocumentsDirectory(); + final reportDirectory = Directory( + p.join(documents.path, 'ot_movil', 'reports'), + ); + await reportDirectory.create(recursive: true); + final shortId = order.id.replaceAll('-', '').substring(0, 8); + final reportPath = p.join( + reportDirectory.path, + '$_reportFilePrefix${type.fileSegment}_' + '${DateFormat('yyyyMMdd_HHmm').format(DateTime.now())}_$shortId.pdf', + ); + await File(reportPath).writeAsBytes(reportBytes, flush: true); + return reportPath; + } + + Future build( + WorkOrder order, { + required PdfReportType type, + }) async { + final document = pw.Document( + title: 'Orden de trabajo - ${order.title}', + author: 'SMoya Gasfiter', + subject: 'Informe de mantenimiento para ${type.label.toLowerCase()}', + ); + final logoData = await rootBundle.load( + 'assets/pdf/simon_moya_report_logo.png', + ); + final logo = pw.MemoryImage( + logoData.buffer.asUint8List( + logoData.offsetInBytes, + logoData.lengthInBytes, + ), + ); + final signatureData = await rootBundle.load( + 'assets/pdf/simon_moya_signature.png', + ); + final signature = pw.MemoryImage( + signatureData.buffer.asUint8List( + signatureData.offsetInBytes, + signatureData.lengthInBytes, + ), + ); + final taskPhotos = {}; + for (final task in order.tasks) { + taskPhotos[task.id] = await _loadTaskImages(task); + } + + const primary = PdfColor.fromInt(0xFF0B5C5E); + const dark = PdfColor.fromInt(0xFF163334); + const muted = PdfColor.fromInt(0xFF5F6F70); + const pale = PdfColor.fromInt(0xFFE7F1F0); + final dateFormat = DateFormat('dd/MM/yyyy HH:mm'); + final priceFormat = NumberFormat.decimalPattern('es_CL'); + + document.addPage( + pw.MultiPage( + pageTheme: pw.PageTheme( + pageFormat: PdfPageFormat.a4, + margin: const pw.EdgeInsets.fromLTRB(38, 42, 38, 42), + ), + header: (context) => _reportHeader( + order, + logo, + type: type, + primary: primary, + dark: dark, + muted: muted, + ), + footer: (context) => _reportFooter(context, muted), + build: (context) => [ + pw.SizedBox(height: 12), + pw.Text( + order.title, + style: pw.TextStyle( + color: dark, + fontSize: 21, + fontWeight: pw.FontWeight.bold, + ), + ), + pw.SizedBox(height: 6), + pw.Text( + 'Orden de trabajo finalizada', + style: const pw.TextStyle(color: primary, fontSize: 9), + ), + pw.SizedBox(height: 15), + pw.Container( + padding: const pw.EdgeInsets.symmetric(horizontal: 10, vertical: 9), + decoration: pw.BoxDecoration( + color: pale, + borderRadius: pw.BorderRadius.circular(7), + ), + child: pw.Row( + children: [ + _summaryItem( + 'Creada', + dateFormat.format(order.createdAt.toLocal()), + dark, + muted, + ), + _summaryDivider(), + _summaryItem( + 'Finalizada', + dateFormat.format( + (order.completedAt ?? order.updatedAt).toLocal(), + ), + dark, + muted, + ), + _summaryDivider(), + _summaryItem( + 'Contenido', + '${order.tasks.length} tareas - ${order.totalPhotos} fotos', + dark, + muted, + ), + if (type == PdfReportType.client) ...[ + _summaryDivider(), + _summaryItem( + 'Total OT', + '\$${priceFormat.format(order.totalCost)}', + dark, + muted, + ), + ], + ], + ), + ), + pw.SizedBox(height: 20), + ...order.tasks.expand( + (task) => _taskWidgets( + task, + taskPhotos[task.id]!, + primary: primary, + dark: dark, + muted: muted, + pale: pale, + priceFormat: priceFormat, + includeParts: type == PdfReportType.client, + ), + ), + if (type == PdfReportType.client) ...[ + pw.SizedBox(height: 2), + _costSummary( + order, + primary: primary, + dark: dark, + muted: muted, + pale: pale, + priceFormat: priceFormat, + ), + ], + pw.SizedBox(height: 8), + _signatureBlock(signature, dark: dark, muted: muted), + ], + ), + ); + + return document.save(); + } + + pw.Widget _reportHeader( + WorkOrder order, + pw.ImageProvider logo, { + required PdfReportType type, + required PdfColor primary, + required PdfColor dark, + required PdfColor muted, + }) { + return pw.Container( + height: 78, + padding: const pw.EdgeInsets.only(bottom: 10), + decoration: pw.BoxDecoration( + border: pw.Border(bottom: pw.BorderSide(color: primary, width: 1.5)), + ), + child: pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.SizedBox( + width: 175, + height: 67, + child: pw.Image( + logo, + fit: pw.BoxFit.cover, + alignment: pw.Alignment.center, + ), + ), + pw.SizedBox( + width: 245, + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.end, + children: [ + pw.Text( + 'Informe para ${type.label.toLowerCase()}', + style: pw.TextStyle(color: muted, fontSize: 9), + ), + pw.SizedBox(height: 7), + _headerDetail( + 'Cliente', + order.details.client.isEmpty + ? 'No informado' + : order.details.client, + dark, + muted, + ), + pw.SizedBox(height: 3), + _headerDetail( + 'Dirección', + order.details.address.isEmpty + ? 'No informada' + : order.details.address, + dark, + muted, + ), + ], + ), + ), + ], + ), + ); + } + + pw.Widget _reportFooter(pw.Context context, PdfColor muted) { + return pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.Text( + 'Generado por SMoya Gasfiter', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + pw.Text( + 'Página ${context.pageNumber} de ${context.pagesCount}', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + ], + ); + } + + pw.Widget _headerDetail( + String label, + String value, + PdfColor dark, + PdfColor muted, + ) { + return pw.RichText( + textAlign: pw.TextAlign.right, + text: pw.TextSpan( + children: [ + pw.TextSpan( + text: '${label.toUpperCase()}: ', + style: pw.TextStyle( + color: muted, + fontSize: 6.5, + fontWeight: pw.FontWeight.bold, + letterSpacing: .35, + ), + ), + pw.TextSpan( + text: value, + style: pw.TextStyle( + color: dark, + fontSize: 7.5, + fontWeight: pw.FontWeight.bold, + ), + ), + ], + ), + ); + } + + pw.Widget _summaryItem( + String label, + String value, + PdfColor dark, + PdfColor muted, + ) { + return pw.Expanded( + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.start, + children: [ + pw.Text( + label.toUpperCase(), + style: pw.TextStyle( + color: muted, + fontSize: 6.5, + fontWeight: pw.FontWeight.bold, + letterSpacing: .55, + ), + ), + pw.SizedBox(height: 3), + pw.Text( + value, + style: pw.TextStyle( + color: dark, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + ), + ), + ], + ), + ); + } + + pw.Widget _summaryDivider() { + return pw.Container( + height: 24, + margin: const pw.EdgeInsets.symmetric(horizontal: 8), + decoration: const pw.BoxDecoration( + border: pw.Border( + left: pw.BorderSide(color: PdfColor.fromInt(0xFFB8CFCD)), + ), + ), + ); + } + + List _taskWidgets( + WorkTask task, + _TaskImages images, { + required PdfColor primary, + required PdfColor dark, + required PdfColor muted, + required PdfColor pale, + required NumberFormat priceFormat, + required bool includeParts, + }) { + return [ + pw.NewPage(freeSpace: includeParts && task.parts.isNotEmpty ? 220 : 145), + pw.Container( + padding: const pw.EdgeInsets.symmetric(horizontal: 12, vertical: 10), + decoration: pw.BoxDecoration( + color: dark, + borderRadius: pw.BorderRadius.circular(5), + ), + child: pw.Row( + children: [ + pw.Container( + width: 23, + height: 23, + alignment: pw.Alignment.center, + decoration: pw.BoxDecoration( + color: primary, + shape: pw.BoxShape.circle, + ), + child: pw.Text( + '${task.position + 1}', + style: pw.TextStyle( + color: PdfColors.white, + fontSize: 10, + fontWeight: pw.FontWeight.bold, + ), + ), + ), + pw.SizedBox(width: 9), + pw.Expanded( + child: pw.Text( + task.title, + style: pw.TextStyle( + color: PdfColors.white, + fontSize: 13, + fontWeight: pw.FontWeight.bold, + ), + ), + ), + ], + ), + ), + pw.SizedBox(height: 10), + pw.Text( + 'OBSERVACIÓN', + style: pw.TextStyle( + color: primary, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + letterSpacing: .8, + ), + ), + pw.SizedBox(height: 4), + pw.Container( + width: double.infinity, + padding: const pw.EdgeInsets.all(11), + decoration: pw.BoxDecoration( + color: pale, + borderRadius: pw.BorderRadius.circular(4), + ), + child: pw.Text( + task.observation, + style: pw.TextStyle(color: dark, fontSize: 10, lineSpacing: 3), + ), + ), + if (includeParts && task.parts.isNotEmpty) ...[ + pw.SizedBox(height: 13), + ..._partsWidgets( + task.parts, + task.partsTotal, + primary: primary, + dark: dark, + muted: muted, + pale: pale, + priceFormat: priceFormat, + ), + ], + pw.SizedBox(height: 15), + ..._photoSection( + 'ANTES DE LA MANTENCIÓN', + images.before, + primary: primary, + muted: muted, + ), + pw.SizedBox(height: 14), + ..._photoSection( + 'DESPUÉS DE LA MANTENCIÓN', + images.after, + primary: primary, + muted: muted, + ), + pw.SizedBox(height: 28), + ]; + } + + List _partsWidgets( + List parts, + int subtotal, { + required PdfColor primary, + required PdfColor dark, + required PdfColor muted, + required PdfColor pale, + required NumberFormat priceFormat, + }) { + final widgets = [ + pw.Row( + children: [ + pw.Text( + 'REPUESTOS UTILIZADOS', + style: pw.TextStyle( + color: primary, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + letterSpacing: .7, + ), + ), + pw.Spacer(), + pw.Text( + '${parts.length} ${parts.length == 1 ? 'repuesto' : 'repuestos'}', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + ], + ), + pw.SizedBox(height: 6), + pw.Container( + padding: const pw.EdgeInsets.symmetric(horizontal: 9, vertical: 6), + decoration: pw.BoxDecoration( + color: pale, + borderRadius: pw.BorderRadius.circular(3), + ), + child: pw.Row( + children: [ + pw.Expanded( + child: pw.Text( + 'DESCRIPCIÓN', + style: pw.TextStyle( + color: muted, + fontSize: 6.5, + fontWeight: pw.FontWeight.bold, + ), + ), + ), + pw.SizedBox( + width: 90, + child: pw.Text( + 'PRECIO', + textAlign: pw.TextAlign.right, + style: pw.TextStyle( + color: muted, + fontSize: 6.5, + fontWeight: pw.FontWeight.bold, + ), + ), + ), + ], + ), + ), + for (final part in parts) + pw.Container( + padding: const pw.EdgeInsets.symmetric(horizontal: 9, vertical: 6), + decoration: const pw.BoxDecoration( + border: pw.Border( + bottom: pw.BorderSide( + color: PdfColor.fromInt(0xFFD6E0DF), + width: .6, + ), + ), + ), + child: pw.Row( + crossAxisAlignment: pw.CrossAxisAlignment.start, + children: [ + pw.Expanded( + child: pw.Text( + part.name, + style: pw.TextStyle(color: dark, fontSize: 8), + ), + ), + pw.SizedBox( + width: 90, + child: pw.Text( + '\$${priceFormat.format(part.price)}', + textAlign: pw.TextAlign.right, + style: pw.TextStyle( + color: dark, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + ), + ), + ), + ], + ), + ), + pw.Container( + padding: const pw.EdgeInsets.only(top: 7), + child: pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.end, + children: [ + pw.Text( + 'Subtotal: ', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + pw.Text( + '\$${priceFormat.format(subtotal)}', + style: pw.TextStyle( + color: primary, + fontSize: 9, + fontWeight: pw.FontWeight.bold, + ), + ), + ], + ), + ), + ]; + if (parts.length <= 8) { + return [ + pw.Inseparable( + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: widgets, + ), + ), + ]; + } + return widgets; + } + + List _photoSection( + String title, + List images, { + required PdfColor primary, + required PdfColor muted, + }) { + final widgets = [ + pw.Row( + children: [ + pw.Text( + title, + style: pw.TextStyle( + color: primary, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + letterSpacing: .7, + ), + ), + pw.SizedBox(width: 8), + pw.Text( + '${images.length} ${images.length == 1 ? 'foto' : 'fotos'}', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + ], + ), + pw.SizedBox(height: 7), + ]; + + for (var index = 0; index < images.length; index += 3) { + widgets.add( + pw.Row( + crossAxisAlignment: pw.CrossAxisAlignment.start, + children: [ + for (var offset = 0; offset < 3; offset++) ...[ + pw.Expanded( + child: index + offset < images.length + ? _pdfImage(images[index + offset]) + : pw.SizedBox(), + ), + if (offset < 2) pw.SizedBox(width: 8), + ], + ], + ), + ); + widgets.add(pw.SizedBox(height: 8)); + } + return widgets; + } + + pw.Widget _costSummary( + WorkOrder order, { + required PdfColor primary, + required PdfColor dark, + required PdfColor muted, + required PdfColor pale, + required NumberFormat priceFormat, + }) { + pw.Widget costRow(String label, int value, {bool emphasize = false}) { + return pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.Text( + label, + style: pw.TextStyle( + color: emphasize ? dark : muted, + fontSize: emphasize ? 10 : 9, + fontWeight: emphasize ? pw.FontWeight.bold : pw.FontWeight.normal, + ), + ), + pw.Text( + '\$${priceFormat.format(value)}', + style: pw.TextStyle( + color: emphasize ? primary : dark, + fontSize: emphasize ? 11 : 9, + fontWeight: pw.FontWeight.bold, + ), + ), + ], + ); + } + + return pw.Inseparable( + child: pw.Container( + width: double.infinity, + padding: const pw.EdgeInsets.all(12), + decoration: pw.BoxDecoration( + color: pale, + borderRadius: pw.BorderRadius.circular(6), + ), + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ + pw.Text( + 'RESUMEN DE COSTOS', + style: pw.TextStyle( + color: primary, + fontSize: 8, + fontWeight: pw.FontWeight.bold, + letterSpacing: .7, + ), + ), + pw.SizedBox(height: 9), + costRow('Costo de mano de obra', order.laborCost), + pw.SizedBox(height: 6), + costRow('Total de repuestos', order.totalPartsCost), + pw.SizedBox(height: 8), + pw.Divider(color: muted, thickness: .5), + pw.SizedBox(height: 6), + costRow('Valor total de la OT', order.totalCost, emphasize: true), + ], + ), + ), + ); + } + + pw.Widget _signatureBlock( + pw.ImageProvider signature, { + required PdfColor dark, + required PdfColor muted, + }) { + return pw.Inseparable( + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.center, + children: [ + pw.SizedBox(width: double.infinity, height: 8), + pw.Text( + 'Atentamente', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + pw.SizedBox(height: 2), + pw.SizedBox( + width: 105, + height: 78, + child: pw.Image(signature, fit: pw.BoxFit.contain), + ), + pw.Text( + 'Simón Moya Salinas', + style: pw.TextStyle( + color: dark, + fontSize: 10, + fontWeight: pw.FontWeight.bold, + ), + ), + pw.SizedBox(height: 2), + pw.Text( + 'C.I.: 9.990.302-3 - Instalador de gas autorizado SEC', + style: pw.TextStyle(color: dark, fontSize: 8), + ), + pw.SizedBox(height: 2), + pw.Text( + 'WhatsApp: 933922780', + style: pw.TextStyle(color: muted, fontSize: 8), + ), + ], + ), + ); + } + + pw.Widget _pdfImage(pw.ImageProvider image) { + return pw.Container( + height: 115, + decoration: pw.BoxDecoration( + borderRadius: pw.BorderRadius.circular(4), + border: pw.Border.all( + color: const PdfColor.fromInt(0xFFD6E0DF), + width: .7, + ), + ), + child: pw.Center(child: pw.Image(image, fit: pw.BoxFit.contain)), + ); + } + + Future<_TaskImages> _loadTaskImages(WorkTask task) async { + final before = []; + final after = []; + for (final photo in task.photos) { + final file = File(photo.path); + if (!await file.exists()) continue; + final Uint8List bytes = await file.readAsBytes(); + final provider = pw.MemoryImage(bytes); + if (photo.kind == PhotoKind.before) { + before.add(provider); + } else { + after.add(provider); + } + } + return _TaskImages(before: before, after: after); + } +} + +class _TaskImages { + const _TaskImages({required this.before, required this.after}); + + final List before; + final List after; +} diff --git a/lib/services/speech_dictation_service.dart b/lib/services/speech_dictation_service.dart new file mode 100644 index 0000000..18d35eb --- /dev/null +++ b/lib/services/speech_dictation_service.dart @@ -0,0 +1,110 @@ +import 'package:flutter/foundation.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +typedef DictationResultCallback = + void Function(String words, bool isFinalResult); +typedef DictationStatusCallback = void Function(bool isListening); +typedef DictationErrorCallback = void Function(String errorCode); + +class SpeechDictationService { + SpeechDictationService._(); + + static final SpeechDictationService instance = SpeechDictationService._(); + + final stt.SpeechToText _speech = stt.SpeechToText(); + + DictationResultCallback? _onResult; + DictationStatusCallback? _onStatusChanged; + DictationErrorCallback? _onError; + + bool get isListening => _speech.isListening; + + Future initialize({ + required DictationStatusCallback onStatusChanged, + required DictationErrorCallback onError, + }) async { + _onStatusChanged = onStatusChanged; + _onError = onError; + + if (_speech.isAvailable) return true; + + return _speech.initialize( + onStatus: _handleStatus, + onError: _handleError, + debugLogging: kDebugMode, + options: [stt.SpeechToText.androidNoBluetooth], + ); + } + + Future listen({required DictationResultCallback onResult}) async { + _onResult = onResult; + final localeId = await _preferredSpanishLocaleId(); + + await _speech.listen( + onResult: (result) => + _onResult?.call(result.recognizedWords, result.finalResult), + listenOptions: stt.SpeechListenOptions( + cancelOnError: true, + partialResults: true, + listenMode: stt.ListenMode.dictation, + autoPunctuation: true, + pauseFor: const Duration(seconds: 8), + listenFor: const Duration(minutes: 2), + localeId: localeId, + ), + ); + } + + Future stop() async { + await _speech.stop(); + // Android puede entregar el resultado final poco después de informar que + // dejó de escuchar. Esta breve espera permite conservar esas últimas + // palabras antes de cerrar el receptor. + await Future.delayed(const Duration(milliseconds: 300)); + _onResult = null; + _onStatusChanged?.call(false); + } + + Future endSession() async { + _onResult = null; + _onStatusChanged = null; + _onError = null; + if (_speech.isAvailable) { + await _speech.cancel(); + } + } + + void _handleStatus(String status) { + if (status == stt.SpeechToText.listeningStatus) { + _onStatusChanged?.call(true); + } else if (status == stt.SpeechToText.doneStatus || + status == stt.SpeechToText.notListeningStatus) { + _onStatusChanged?.call(false); + } + } + + void _handleError(SpeechRecognitionError error) { + _onResult = null; + _onError?.call(error.errorMsg); + _onStatusChanged?.call(false); + } + + Future _preferredSpanishLocaleId() async { + try { + final locales = await _speech.locales(); + for (final locale in locales) { + final normalized = locale.localeId.toLowerCase().replaceAll('_', '-'); + if (normalized == 'es-cl') return locale.localeId; + } + for (final locale in locales) { + if (locale.localeId.toLowerCase().startsWith('es')) { + return locale.localeId; + } + } + } catch (_) { + // El reconocedor usará el idioma predeterminado del dispositivo. + } + return null; + } +} diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100644 index 0000000..c7ea17f --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt new file mode 100644 index 0000000..86b3654 --- /dev/null +++ b/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# 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 "ot_movil") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "cl.otmovil.ot_movil") + +# 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/linux/flutter/CMakeLists.txt b/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..27860e8 --- /dev/null +++ b/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# 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/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..42b1fe4 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); + g_autoptr(FlPluginRegistrar) printing_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "PrintingPlugin"); + printing_plugin_register_with_registrar(printing_registrar); +} diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// 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/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..e2bb736 --- /dev/null +++ b/linux/flutter/generated_plugins.cmake @@ -0,0 +1,26 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux + printing +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni +) + +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/linux/runner/CMakeLists.txt b/linux/runner/CMakeLists.txt new file mode 100644 index 0000000..7ed6f3e --- /dev/null +++ b/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +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/linux/runner/main.cc b/linux/runner/main.cc new file mode 100644 index 0000000..4340ffc --- /dev/null +++ b/linux/runner/main.cc @@ -0,0 +1,6 @@ +#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/linux/runner/my_application.cc b/linux/runner/my_application.cc new file mode 100644 index 0000000..7a2e3aa --- /dev/null +++ b/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#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, "SMoya Gasfiter"); + 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, "SMoya Gasfiter"); + } + + 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/linux/runner/my_application.h b/linux/runner/my_application.h new file mode 100644 index 0000000..c4c4a71 --- /dev/null +++ b/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#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/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..d4e0569 --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..f022c34 --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..f022c34 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..2b21836 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import file_selector_macos +import flutter_email_sender +import printing +import speech_to_text +import sqflite_darwin + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) + FlutterEmailSenderPlugin.register(with: registry.registrar(forPlugin: "FlutterEmailSenderPlugin")) + PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin")) + SpeechToTextPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) +} diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..71d01af --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*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 /* ot_movil.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ot_movil.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 /* ot_movil.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 /* ot_movil.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 = cl.otmovil.otMovil.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ot_movil.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ot_movil"; + }; + 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 = cl.otmovil.otMovil.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ot_movil.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ot_movil"; + }; + 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 = cl.otmovil.otMovil.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ot_movil.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ot_movil"; + }; + 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/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..d979890 --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..59c6d39 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..c5c474d --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +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/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..96d3fee --- /dev/null +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "info": { + "version": 1, + "author": "xcode" + }, + "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" + } + ] +} \ No newline at end of file diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..1289f14 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..a0ab812 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..6d65769 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..a48a02e Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..a63c91c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..80cedeb Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..6c3b5d7 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..4632c69 --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..6868a31 --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// 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 = ot_movil + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = cl.otmovil.otMovil + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2026 cl.otmovil. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..b398823 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..d93e5dc --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..fb4d7d3 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +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/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..d5cab0e --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,16 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.device.audio-input + + com.apple.security.network.client + + com.apple.security.network.server + + + diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..297bdac --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + SMoya Gasfiter + 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) + NSMicrophoneUsageDescription + SMoya Gasfiter necesita el micrófono para dictar las observaciones de las tareas. + NSMainNibFile + MainMenu + NSSpeechRecognitionUsageDescription + SMoya Gasfiter necesita convertir el dictado en texto para completar las observaciones. + NSPrincipalClass + NSApplication + + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..ab30cba --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +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/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..a5e396c --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.device.audio-input + + com.apple.security.network.client + + + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..21fe1ab --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +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/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..7cbc7db --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,778 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff + url: "https://pub.dev" + source: hosted + version: "4.0.9" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.dev" + source: hosted + version: "2.13.1" + barcode: + dependency: transitive + description: + name: barcode + sha256: "7b6729c37e3b7f34233e2318d866e8c48ddb46c1f7ad01ff7bb2a8de1da2b9f4" + url: "https://pub.dev" + source: hosted + version: "2.2.9" + bidi: + dependency: transitive + description: + name: bidi + sha256: "77f475165e94b261745cf1032c751e2032b8ed92ccb2bf5716036db79320637d" + url: "https://pub.dev" + source: hosted + version: "2.0.13" + 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" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "92c9c43c383bfa1c32079d3bc492d55d6d4318044b7b47edaff8971cbb555c51" + url: "https://pub.dev" + source: hosted + version: "0.3.5+4" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.dev" + source: hosted + version: "1.0.9" + 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_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "2567f398e06ac72dcf2e98a0c95df2a9edd03c2c2e0cacd4780f20cdf56263a0" + url: "https://pub.dev" + source: hosted + version: "0.9.4" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "5e0bbe9c312416f1787a68259ea1505b52f258c587f12920422671807c4d618a" + url: "https://pub.dev" + source: hosted + version: "0.9.5" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "35e0bd61ebcdb91a3505813b055b09b79dfdc7d0aee9c09a7ba59ae4bb13dc85" + url: "https://pub.dev" + source: hosted + version: "2.7.0" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "62197474ae75893a62df75939c777763d39c2bc5f73ce5b88497208bc269abfd" + url: "https://pub.dev" + source: hosted + version: "0.9.3+5" + 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_email_sender: + dependency: "direct main" + description: + name: flutter_email_sender + sha256: f01bccb29bc1aba3d128859ca970883923a43824c7b9bc2fc47bb278a8cc2674 + url: "https://pub.dev" + source: hosted + version: "9.0.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7" + url: "https://pub.dev" + source: hosted + version: "0.14.4" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "3854fe5e3bff0b113c658f260b90c95dea17c92db0f2addeac2e343dd9969785" + url: "https://pub.dev" + source: hosted + version: "2.0.35" + 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" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + http: + dependency: transitive + 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" + image: + dependency: transitive + description: + name: image + sha256: f9881ff4998044947ec38d098bc7c8316ae1186fa786eddffdb867b9bc94dfce + url: "https://pub.dev" + source: hosted + version: "4.8.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: d8402284df184bc05f4a2210c6c23983b0720f4cd87cbd05c5390a78af602667 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d5b3e1774af29c9ab00103afb0d4614070f924d2e0057ac867ec98800114793f + url: "https://pub.dev" + source: hosted + version: "0.8.13+17" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "66257a3191ab360d23a55c8241c91a6e329d31e94efa7be9cf7a212e65850214" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: b9c4a438a9ff4f60808c9cf0039b93a42bb6c2211ef6ebb647394b2b3fa84588 + url: "https://pub.dev" + source: hosted + version: "0.8.13+6" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "1f81c5f2046b9ab724f85523e4af65be1d47b038160a8c8deed909762c308ed4" + url: "https://pub.dev" + source: hosted + version: "0.2.2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "86f0f15a309de7e1a552c12df9ce5b59fe927e71385329355aec4776c6a8ec91" + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "567e056716333a1647c64bb6bd873cff7622233a5c3f694be28a583d4715690c" + url: "https://pub.dev" + source: hosted + version: "2.11.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: d248c86554a72b5495a31c56f060cf73a41c7ff541689327b1a7dbccc33adfae + url: "https://pub.dev" + source: hosted + version: "0.2.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867" + url: "https://pub.dev" + source: hosted + version: "0.20.3" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + url: "https://pub.dev" + source: hosted + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + 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" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.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" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" + url: "https://pub.dev" + source: hosted + version: "9.4.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: "direct main" + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 + url: "https://pub.dev" + source: hosted + version: "2.1.6" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + pdf: + dependency: "direct main" + description: + name: pdf + sha256: e47a275b267873d5944ad5f5ff0dcc7ac2e36c02b3046a0ffac9b72fd362c44b + url: "https://pub.dev" + source: hosted + version: "3.12.0" + pdf_widget_wrapper: + dependency: transitive + description: + name: pdf_widget_wrapper + sha256: c930860d987213a3d58c7ec3b7ecf8085c3897f773e8dc23da9cae60a5d6d0f5 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" + url: "https://pub.dev" + source: hosted + version: "7.0.2" + 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" + posix: + dependency: transitive + description: + name: posix + sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e + url: "https://pub.dev" + source: hosted + version: "6.5.2" + printing: + dependency: "direct main" + description: + name: printing + sha256: "689170c9ddb1bda85826466ba80378aa8993486d3c959a71cd7d2d80cb606692" + url: "https://pub.dev" + source: hosted + version: "5.14.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + qr: + dependency: transitive + description: + name: qr + sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" + url: "https://pub.dev" + source: hosted + version: "0.6.0" + 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" + speech_to_text: + dependency: "direct main" + description: + name: speech_to_text + sha256: "75587f7400f485fdf166beacd471549d98fe5d58e634f708916bb65dec05d6a4" + url: "https://pub.dev" + source: hosted + version: "7.4.0" + speech_to_text_platform_interface: + dependency: transitive + description: + name: speech_to_text_platform_interface + sha256: a7e16e02853853ed7534ac2bde9a1c4f39c8879970a7974ac6ff832d4bdaa4b0 + url: "https://pub.dev" + source: hosted + version: "2.4.0" + speech_to_text_windows: + dependency: transitive + description: + name: speech_to_text_windows + sha256: "2d1d10565b23262386b453b33656299608dc7a66784453735d6c1318f13f44d7" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + sqflite: + dependency: "direct main" + description: + name: sqflite + sha256: "564cfed0746fe53140c23b70b308e045c3b31f17778f2f326ccb7d804ea0250a" + url: "https://pub.dev" + source: hosted + version: "2.4.2+1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "881e28efdcc9950fd8e9bb42713dcf1103e62a2e7168f23c9338d82db13dec40" + url: "https://pub.dev" + source: hosted + version: "2.4.2+3" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "1581ffbf7a0e333b380d6a30737d78516b826cb35beb7fb0bf8a3ea0c678b465" + url: "https://pub.dev" + source: hosted + version: "2.5.8" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + 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" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "63896c27e81b28f8cb4e69ead0d3e8f03f1d1e5fc531a3e579cabed6a2c7c9e5" + url: "https://pub.dev" + source: hosted + version: "3.4.0+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" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd" + url: "https://pub.dev" + source: hosted + version: "4.6.0" + 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" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.11.1 <4.0.0" + flutter: ">=3.41.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..f5b9fa3 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,126 @@ +name: ot_movil +description: "Registro móvil de órdenes de trabajo de mantenimiento." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.11.1 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + sqflite: ^2.4.2+1 + image_picker: ^1.2.3 + path_provider: ^2.1.6 + path: ^1.9.1 + pdf: ^3.12.0 + flutter_email_sender: ^9.0.0 + intl: ^0.20.3 + printing: ^5.14.3 + uuid: ^4.6.0 + speech_to_text: ^7.4.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_launcher_icons: ^0.14.4 + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^6.0.0 + +flutter_launcher_icons: + android: true + ios: true + image_path: assets/icon/app_icon.png + min_sdk_android: 21 + adaptive_icon_background: "#FFFFFF" + adaptive_icon_foreground: assets/icon/app_icon.png + adaptive_icon_foreground_inset: 0 + remove_alpha_ios: true + background_color_ios: "#FFFFFF" + web: + generate: true + image_path: assets/icon/app_icon.png + background_color: "#FFFFFF" + theme_color: "#0B5C5E" + windows: + generate: true + image_path: assets/icon/app_icon.png + icon_size: 256 + macos: + generate: true + image_path: assets/icon/app_icon.png + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + assets: + - assets/pdf/simon_moya_report_logo.png + - assets/pdf/simon_moya_signature.png + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package diff --git a/test/dictation_text_accumulator_test.dart b/test/dictation_text_accumulator_test.dart new file mode 100644 index 0000000..2f60528 --- /dev/null +++ b/test/dictation_text_accumulator_test.dart @@ -0,0 +1,46 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/services/dictation_text_accumulator.dart'; + +void main() { + test('un resultado parcial más corto no borra el texto reconocido', () { + final accumulator = DictationTextAccumulator()..begin('Texto anterior.'); + + expect( + accumulator.addResult('revisión del drenaje de condensado'), + 'Texto anterior. revisión del drenaje de condensado', + ); + expect( + accumulator.addResult('revisión del drenaje'), + 'Texto anterior. revisión del drenaje de condensado', + ); + }); + + test('un resultado parcial acumulativo reemplaza la versión anterior', () { + final accumulator = DictationTextAccumulator()..begin(''); + + expect(accumulator.addResult('carga de'), 'carga de'); + expect(accumulator.addResult('carga de gas'), 'carga de gas'); + }); + + test('una opción nueva se agrega sin repetir las palabras superpuestas', () { + final accumulator = DictationTextAccumulator()..begin(''); + + accumulator.addResult('limpieza de filtros'); + expect( + accumulator.addResult('filtros y revisión del drenaje'), + 'limpieza de filtros y revisión del drenaje', + ); + }); + + test('al reiniciar después de una pausa conserva todo lo visible', () { + final accumulator = DictationTextAccumulator()..begin('Primera opción'); + + accumulator.addResult('segunda opción'); + accumulator.begin(accumulator.text); + + expect( + accumulator.addResult('tercera opción'), + 'Primera opción segunda opción tercera opción', + ); + }); +} diff --git a/test/email_recipient_dialog_test.dart b/test/email_recipient_dialog_test.dart new file mode 100644 index 0000000..81885a5 --- /dev/null +++ b/test/email_recipient_dialog_test.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/screens/work_order_screen.dart'; +import 'package:ot_movil/services/pdf_service.dart'; + +void main() { + testWidgets('el diálogo de correo se desmonta sin errores', (tester) async { + String? selectedEmail; + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Builder( + builder: (context) => FilledButton( + onPressed: () async { + selectedEmail = await showDialog( + context: context, + builder: (_) => const EmailRecipientDialog(), + ); + }, + child: const Text('Abrir'), + ), + ), + ), + ), + ); + + await tester.tap(find.text('Abrir')); + await tester.pumpAndSettle(); + await tester.enterText(find.byType(TextFormField), 'tecnico@empresa.cl'); + await tester.tap(find.text('Continuar')); + await tester.pumpAndSettle(); + + expect(selectedEmail, 'tecnico@empresa.cl'); + expect(find.byType(EmailRecipientDialog), findsNothing); + expect(tester.takeException(), isNull); + }); + + testWidgets('permite elegir el informe para empresa certificadora', ( + tester, + ) async { + PdfReportType? selectedType; + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Builder( + builder: (context) => FilledButton( + onPressed: () async { + selectedType = await showDialog( + context: context, + builder: (_) => const PdfReportTypeDialog(), + ); + }, + child: const Text('Abrir'), + ), + ), + ), + ), + ); + + await tester.tap(find.text('Abrir')); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('report-type-certificadora'))); + await tester.pumpAndSettle(); + + expect(selectedType, PdfReportType.certifier); + expect(find.byType(PdfReportTypeDialog), findsNothing); + }); +} diff --git a/test/pdf_service_test.dart b/test/pdf_service_test.dart new file mode 100644 index 0000000..0f4d0ef --- /dev/null +++ b/test/pdf_service_test.dart @@ -0,0 +1,188 @@ +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/models/work_order.dart'; +import 'package:ot_movil/services/pdf_service.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('distingue los informes con la identidad vigente', () { + final service = PdfService(); + + expect( + service.isCurrentReport('/reports/OT_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v2_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v3_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v4_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v5_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v6_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v7_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport('/reports/OT_v8_20260725_abcd1234.pdf'), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v9_cliente_20260725_abcd1234.pdf', + type: PdfReportType.client, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v9_certificadora_20260725_abcd1234.pdf', + type: PdfReportType.certifier, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v10_cliente_20260725_abcd1234.pdf', + type: PdfReportType.client, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v10_certificadora_20260725_abcd1234.pdf', + type: PdfReportType.certifier, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v11_cliente_20260725_abcd1234.pdf', + type: PdfReportType.client, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v11_certificadora_20260725_abcd1234.pdf', + type: PdfReportType.certifier, + ), + isFalse, + ); + expect( + service.isCurrentReport( + '/reports/OT_v12_cliente_20260725_abcd1234.pdf', + type: PdfReportType.client, + ), + isTrue, + ); + expect( + service.isCurrentReport( + '/reports/OT_v12_certificadora_20260725_abcd1234.pdf', + type: PdfReportType.certifier, + ), + isTrue, + ); + expect( + service.isCurrentReport( + '/reports/OT_v12_cliente_20260725_abcd1234.pdf', + type: PdfReportType.certifier, + ), + isFalse, + ); + }); + + test('genera los informes para cliente y empresa certificadora', () async { + final completedAt = DateTime(2026, 7, 25, 16, 30); + final order = WorkOrder( + id: '12345678-1234-1234-1234-123456789012', + title: 'Mantención Preventiva', + createdAt: completedAt.subtract(const Duration(hours: 2)), + updatedAt: completedAt, + completedAt: completedAt, + status: WorkOrderStatus.completed, + laborCost: 40000, + details: const WorkOrderDetails( + client: 'Cliente de prueba', + phone: '+56 9 9999 0000', + address: 'Av. Principal 123, Santiago', + ), + tasks: List.generate( + 8, + (index) => WorkTask( + id: 'task-$index', + title: index.isEven ? 'Limpieza Full' : 'Chequeo de gas refrigerante', + observation: + 'Se realizó la inspección del equipo, la limpieza de sus ' + 'componentes y la verificación de los parámetros de operación. ' + 'El equipo quedó funcionando correctamente.', + position: index, + parts: index == 0 + ? const [ + TaskPart( + id: 'part-1', + name: 'Flexible de agua 1/2 pulgada', + price: 8500, + ), + TaskPart(id: 'part-2', name: 'Llave de paso', price: 12990), + ] + : const [], + photos: index == 0 + ? List.generate( + 3, + (photoIndex) => TaskPhoto( + id: 'before-$photoIndex', + path: 'assets/pdf/simon_moya_report_logo.png', + kind: PhotoKind.before, + ), + ) + : const [], + ), + ), + ); + + final service = PdfService(); + final clientBytes = await service.build(order, type: PdfReportType.client); + final certifierBytes = await service.build( + order, + type: PdfReportType.certifier, + ); + + expect(clientBytes, isNotEmpty); + expect(certifierBytes, isNotEmpty); + expect(String.fromCharCodes(clientBytes.take(4)), '%PDF'); + expect(String.fromCharCodes(certifierBytes.take(4)), '%PDF'); + expect(clientBytes, isNot(equals(certifierBytes))); + + const samplePath = String.fromEnvironment('PDF_SAMPLE_PATH'); + if (samplePath.isNotEmpty) { + final file = File(samplePath); + await file.parent.create(recursive: true); + await file.writeAsBytes(clientBytes, flush: true); + } + + const certifierSamplePath = String.fromEnvironment( + 'PDF_CERTIFIER_SAMPLE_PATH', + ); + if (certifierSamplePath.isNotEmpty) { + final file = File(certifierSamplePath); + await file.parent.create(recursive: true); + await file.writeAsBytes(certifierBytes, flush: true); + } + }); +} diff --git a/test/work_order_details_screen_test.dart b/test/work_order_details_screen_test.dart new file mode 100644 index 0000000..ec53c40 --- /dev/null +++ b/test/work_order_details_screen_test.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/models/work_order.dart'; +import 'package:ot_movil/screens/work_order_details_screen.dart'; + +void main() { + testWidgets('solicita cliente y dirección antes de mostrar las tareas', ( + tester, + ) async { + await tester.pumpWidget(const MaterialApp(home: _DetailsTestHost())); + await tester.tap(find.text('Abrir datos')); + await tester.pumpAndSettle(); + + await tester.tap(find.byKey(const Key('continue-button'))); + await tester.pump(); + + expect(find.text('Ingresa el nombre del cliente'), findsOneWidget); + expect(find.text('Ingresa el teléfono del cliente'), findsOneWidget); + expect(find.text('Ingresa la dirección del trabajo'), findsOneWidget); + + await tester.enterText( + find.byKey(const Key('client-field')), + 'Comercial San Martín', + ); + await tester.enterText( + find.byKey(const Key('phone-field')), + '+56 9 8765 4321', + ); + await tester.enterText( + find.byKey(const Key('address-field')), + 'Av. Central 450, Santiago', + ); + await tester.tap(find.byKey(const Key('continue-button'))); + await tester.pumpAndSettle(); + + expect(find.text('Comercial San Martín'), findsOneWidget); + expect(find.text('+56 9 8765 4321'), findsOneWidget); + expect(find.text('Av. Central 450, Santiago'), findsOneWidget); + }); +} + +class _DetailsTestHost extends StatefulWidget { + const _DetailsTestHost(); + + @override + State<_DetailsTestHost> createState() => _DetailsTestHostState(); +} + +class _DetailsTestHostState extends State<_DetailsTestHost> { + WorkOrderDetails? _details; + + Future _openDetails() async { + final details = await Navigator.of(context).push( + MaterialPageRoute(builder: (_) => const WorkOrderDetailsScreen()), + ); + if (details != null) setState(() => _details = details); + } + + @override + Widget build(BuildContext context) { + final details = _details; + if (details != null) { + return Scaffold( + body: Column( + children: [ + Text(details.client), + Text(details.phone), + Text(details.address), + ], + ), + ); + } + return Scaffold( + body: Center( + child: FilledButton( + onPressed: _openDetails, + child: const Text('Abrir datos'), + ), + ), + ); + } +} diff --git a/test/work_order_model_test.dart b/test/work_order_model_test.dart new file mode 100644 index 0000000..5594389 --- /dev/null +++ b/test/work_order_model_test.dart @@ -0,0 +1,59 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/models/work_order.dart'; + +void main() { + test('calcula la evidencia total de una orden', () { + final now = DateTime(2026, 7, 24); + final order = WorkOrder( + id: 'ot-1', + title: 'Mantención preventiva', + createdAt: now, + updatedAt: now, + status: WorkOrderStatus.completed, + laborCost: 25000, + details: const WorkOrderDetails( + client: 'María Soto', + phone: '+56 9 1234 5678', + address: 'Los Aromos 120', + ), + tasks: const [ + WorkTask( + id: 'task-1', + title: 'Lubricar equipo', + observation: 'Equipo lubricado.', + position: 0, + parts: [ + TaskPart(id: 'part-1', name: 'Válvula', price: 7500), + TaskPart(id: 'part-2', name: 'Flexible', price: 3500), + ], + photos: [ + TaskPhoto( + id: 'before-1', + path: '/before.jpg', + kind: PhotoKind.before, + ), + TaskPhoto(id: 'after-1', path: '/after.jpg', kind: PhotoKind.after), + ], + ), + ], + ); + + expect(order.isCompleted, isTrue); + expect(order.totalPhotos, 2); + expect(order.tasks.single.partsTotal, 11000); + expect(order.totalPartsCost, 11000); + expect(order.laborCost, 25000); + expect(order.totalCost, 36000); + expect(order.copyWith(laborCost: 30000).totalCost, 41000); + expect(order.details.isComplete, isTrue); + expect(order.tasks.single.beforePhotos, hasLength(1)); + expect(order.tasks.single.afterPhotos, hasLength(1)); + }); + + test( + 'un estado desconocido de base de datos se interpreta como borrador', + () { + expect(WorkOrderStatus.fromDatabase('desconocido'), WorkOrderStatus.open); + }, + ); +} diff --git a/test/work_order_screen_test.dart b/test/work_order_screen_test.dart new file mode 100644 index 0000000..d3f7863 --- /dev/null +++ b/test/work_order_screen_test.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ot_movil/models/work_order.dart'; +import 'package:ot_movil/screens/work_order_screen.dart'; + +void main() { + testWidgets('muestra el costo de mano de obra al final de la OT', ( + tester, + ) async { + final now = DateTime(2026, 7, 25, 18); + const details = WorkOrderDetails( + client: 'Cliente de prueba', + phone: '+56 9 1234 5678', + address: 'Av. Principal 123', + ); + final order = WorkOrder( + id: 'order-1', + title: 'Mantención preventiva', + createdAt: now, + updatedAt: now, + completedAt: now, + status: WorkOrderStatus.completed, + details: details, + laborCost: 40000, + ); + + await tester.pumpWidget( + MaterialApp( + home: WorkOrderScreen(order: order, details: details), + ), + ); + + await tester.dragUntilVisible( + find.byKey(const Key('labor-cost-field')), + find.byType(ListView), + const Offset(0, -300), + ); + final laborField = tester.widget( + find.byKey(const Key('labor-cost-field')), + ); + expect(laborField.controller?.text, '40000'); + expect(find.text('+56 9 1234 5678'), findsNothing); + expect(find.text('Av. Principal 123'), findsNothing); + }); +} diff --git a/tmp/pdfs/client.txt b/tmp/pdfs/client.txt new file mode 100644 index 0000000..af1cf06 --- /dev/null +++ b/tmp/pdfs/client.txt @@ -0,0 +1,55 @@ + INFORME DE TRABAJOS REALIZADOS + + +Fecha : jueves, 16 de julio de 2026 Informe Nº 745 + + +Cliente: Andrea Álvarez González,Dpto B14, Condominio Los Parques + + + +Descripción del trabajo solicitado : +Clienta dice que al cerrar llave de lavaplatos, se sintió un ruido y empezó a caer mucha agua desde el calefont. + + + + +Trabajo efectuado: +Se revisó calefont encontrando flexible de agua caliente roto, se reemplazó flexible quedando solucionado el problema. + + + + +Evidencia visual: + https://drive.google.com/drive/folders/1AxyDW_yzSKTLtkE7la3qKr_2xNDAM1ju?usp=sharing + + +Materiales utilizados: + +Flexible metálico de calefont de 20 cms + + + 0 +Costo Mano de Obra $15.000 + + +Costo de materiales: $6.500 + + + + +Valor Total del Trabajo : $21.500 + + + + + Atte + + + + + Simón Moya Salinas + C.I. : 9.990.302-3 + Instalador de gas Autorizado SEC + Wsp. 933922780 + \ No newline at end of file diff --git a/tmp/pdfs/client/page-1.png b/tmp/pdfs/client/page-1.png new file mode 100644 index 0000000..785d593 Binary files /dev/null and b/tmp/pdfs/client/page-1.png differ diff --git a/tmp/pdfs/extracted/img-000.png b/tmp/pdfs/extracted/img-000.png new file mode 100644 index 0000000..1e048ab Binary files /dev/null and b/tmp/pdfs/extracted/img-000.png differ diff --git a/tmp/pdfs/extracted/img-001.png b/tmp/pdfs/extracted/img-001.png new file mode 100644 index 0000000..3250183 Binary files /dev/null and b/tmp/pdfs/extracted/img-001.png differ diff --git a/tmp/pdfs/extracted/img-002.png b/tmp/pdfs/extracted/img-002.png new file mode 100644 index 0000000..9de1300 Binary files /dev/null and b/tmp/pdfs/extracted/img-002.png differ diff --git a/tmp/pdfs/extracted/img-003.png b/tmp/pdfs/extracted/img-003.png new file mode 100644 index 0000000..f6664df Binary files /dev/null and b/tmp/pdfs/extracted/img-003.png differ diff --git a/tmp/pdfs/generated-labor/certifier.pdf b/tmp/pdfs/generated-labor/certifier.pdf new file mode 100644 index 0000000..719a992 Binary files /dev/null and b/tmp/pdfs/generated-labor/certifier.pdf differ diff --git a/tmp/pdfs/generated-labor/certifier.txt b/tmp/pdfs/generated-labor/certifier.txt new file mode 100644 index 0000000..8dd8fdf --- /dev/null +++ b/tmp/pdfs/generated-labor/certifier.txt @@ -0,0 +1,193 @@ + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated-labor/certifier/page-1.png b/tmp/pdfs/generated-labor/certifier/page-1.png new file mode 100644 index 0000000..27bc4c6 Binary files /dev/null and b/tmp/pdfs/generated-labor/certifier/page-1.png differ diff --git a/tmp/pdfs/generated-labor/certifier/page-2.png b/tmp/pdfs/generated-labor/certifier/page-2.png new file mode 100644 index 0000000..efe0252 Binary files /dev/null and b/tmp/pdfs/generated-labor/certifier/page-2.png differ diff --git a/tmp/pdfs/generated-labor/certifier/page-3.png b/tmp/pdfs/generated-labor/certifier/page-3.png new file mode 100644 index 0000000..855949c Binary files /dev/null and b/tmp/pdfs/generated-labor/certifier/page-3.png differ diff --git a/tmp/pdfs/generated-labor/certifier/page-4.png b/tmp/pdfs/generated-labor/certifier/page-4.png new file mode 100644 index 0000000..2464278 Binary files /dev/null and b/tmp/pdfs/generated-labor/certifier/page-4.png differ diff --git a/tmp/pdfs/generated-labor/client.pdf b/tmp/pdfs/generated-labor/client.pdf new file mode 100644 index 0000000..a4c7ae7 Binary files /dev/null and b/tmp/pdfs/generated-labor/client.pdf differ diff --git a/tmp/pdfs/generated-labor/client.txt b/tmp/pdfs/generated-labor/client.txt new file mode 100644 index 0000000..86c7e82 --- /dev/null +++ b/tmp/pdfs/generated-labor/client.txt @@ -0,0 +1,215 @@ + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO TOTAL OT + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos $61.490 + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +REPUESTOS UTILIZADOS 2 repuestos + + DESCRIPCIÓN PRECIO + + + Flexible de agua 1/2 pulgada $8.500 + + Llave de paso $12.990 + + Subtotal: $21.490 + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + RESUMEN DE COSTOS + + Costo de mano de obra $40.000 + Total de repuestos $21.490 + + + + Valor total de la OT $61.490 + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated-labor/client/page-1.png b/tmp/pdfs/generated-labor/client/page-1.png new file mode 100644 index 0000000..753b027 Binary files /dev/null and b/tmp/pdfs/generated-labor/client/page-1.png differ diff --git a/tmp/pdfs/generated-labor/client/page-2.png b/tmp/pdfs/generated-labor/client/page-2.png new file mode 100644 index 0000000..73f9718 Binary files /dev/null and b/tmp/pdfs/generated-labor/client/page-2.png differ diff --git a/tmp/pdfs/generated-labor/client/page-3.png b/tmp/pdfs/generated-labor/client/page-3.png new file mode 100644 index 0000000..6f18869 Binary files /dev/null and b/tmp/pdfs/generated-labor/client/page-3.png differ diff --git a/tmp/pdfs/generated-labor/client/page-4.png b/tmp/pdfs/generated-labor/client/page-4.png new file mode 100644 index 0000000..7e5a176 Binary files /dev/null and b/tmp/pdfs/generated-labor/client/page-4.png differ diff --git a/tmp/pdfs/generated-phone/certifier.pdf b/tmp/pdfs/generated-phone/certifier.pdf new file mode 100644 index 0000000..dab12ad Binary files /dev/null and b/tmp/pdfs/generated-phone/certifier.pdf differ diff --git a/tmp/pdfs/generated-phone/certifier.txt b/tmp/pdfs/generated-phone/certifier.txt new file mode 100644 index 0000000..8dd8fdf --- /dev/null +++ b/tmp/pdfs/generated-phone/certifier.txt @@ -0,0 +1,193 @@ + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated-phone/client.pdf b/tmp/pdfs/generated-phone/client.pdf new file mode 100644 index 0000000..ff24d67 Binary files /dev/null and b/tmp/pdfs/generated-phone/client.pdf differ diff --git a/tmp/pdfs/generated-phone/client.txt b/tmp/pdfs/generated-phone/client.txt new file mode 100644 index 0000000..86c7e82 --- /dev/null +++ b/tmp/pdfs/generated-phone/client.txt @@ -0,0 +1,215 @@ + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO TOTAL OT + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos $61.490 + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +REPUESTOS UTILIZADOS 2 repuestos + + DESCRIPCIÓN PRECIO + + + Flexible de agua 1/2 pulgada $8.500 + + Llave de paso $12.990 + + Subtotal: $21.490 + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + RESUMEN DE COSTOS + + Costo de mano de obra $40.000 + Total de repuestos $21.490 + + + + Valor total de la OT $61.490 + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated/certifier.pdf b/tmp/pdfs/generated/certifier.pdf new file mode 100644 index 0000000..9e9eb44 Binary files /dev/null and b/tmp/pdfs/generated/certifier.pdf differ diff --git a/tmp/pdfs/generated/certifier.txt b/tmp/pdfs/generated/certifier.txt new file mode 100644 index 0000000..1f5cea4 --- /dev/null +++ b/tmp/pdfs/generated/certifier.txt @@ -0,0 +1,193 @@ + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + Atentamente + + + + + Simón Moya Salinas +C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated/certifier/page-1.png b/tmp/pdfs/generated/certifier/page-1.png new file mode 100644 index 0000000..27bc4c6 Binary files /dev/null and b/tmp/pdfs/generated/certifier/page-1.png differ diff --git a/tmp/pdfs/generated/certifier/page-2.png b/tmp/pdfs/generated/certifier/page-2.png new file mode 100644 index 0000000..efe0252 Binary files /dev/null and b/tmp/pdfs/generated/certifier/page-2.png differ diff --git a/tmp/pdfs/generated/certifier/page-3.png b/tmp/pdfs/generated/certifier/page-3.png new file mode 100644 index 0000000..855949c Binary files /dev/null and b/tmp/pdfs/generated/certifier/page-3.png differ diff --git a/tmp/pdfs/generated/certifier/page-4.png b/tmp/pdfs/generated/certifier/page-4.png new file mode 100644 index 0000000..2464278 Binary files /dev/null and b/tmp/pdfs/generated/certifier/page-4.png differ diff --git a/tmp/pdfs/generated/client.pdf b/tmp/pdfs/generated/client.pdf new file mode 100644 index 0000000..553399e Binary files /dev/null and b/tmp/pdfs/generated/client.pdf differ diff --git a/tmp/pdfs/generated/client.txt b/tmp/pdfs/generated/client.txt new file mode 100644 index 0000000..438af80 --- /dev/null +++ b/tmp/pdfs/generated/client.txt @@ -0,0 +1,205 @@ + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO REPUESTOS + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos $21.490 + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +REPUESTOS UTILIZADOS 2 repuestos + + DESCRIPCIÓN PRECIO + + + Flexible de agua 1/2 pulgada $8.500 + + Llave de paso $12.990 + + Subtotal: $21.490 + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + Atentamente + + + + + Simón Moya Salinas +C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/generated/client/page-1.png b/tmp/pdfs/generated/client/page-1.png new file mode 100644 index 0000000..e4e0900 Binary files /dev/null and b/tmp/pdfs/generated/client/page-1.png differ diff --git a/tmp/pdfs/generated/client/page-2.png b/tmp/pdfs/generated/client/page-2.png new file mode 100644 index 0000000..73f9718 Binary files /dev/null and b/tmp/pdfs/generated/client/page-2.png differ diff --git a/tmp/pdfs/generated/client/page-3.png b/tmp/pdfs/generated/client/page-3.png new file mode 100644 index 0000000..6f18869 Binary files /dev/null and b/tmp/pdfs/generated/client/page-3.png differ diff --git a/tmp/pdfs/generated/client/page-4.png b/tmp/pdfs/generated/client/page-4.png new file mode 100644 index 0000000..c3833ac Binary files /dev/null and b/tmp/pdfs/generated/client/page-4.png differ diff --git a/tmp/pdfs/generated/contact-sheet.png b/tmp/pdfs/generated/contact-sheet.png new file mode 100644 index 0000000..3f162ff Binary files /dev/null and b/tmp/pdfs/generated/contact-sheet.png differ diff --git a/tmp/pdfs/inspection.txt b/tmp/pdfs/inspection.txt new file mode 100644 index 0000000..d6880ba --- /dev/null +++ b/tmp/pdfs/inspection.txt @@ -0,0 +1,48 @@ + INFORME DE TRABAJOS REALIZADOS + + +Fecha : sábado, 25 de julio de 2026 Informe Nº 755 + + +Cliente: Isabel Riquelme Sur 1459 dpto I32, Maipú + + Jorna + + +Descripción del trabajo solicitado : +En inspección a instalación interior de gas efectuada por empresa Teknogas, se detectó calefont suelto y ducto de +evacuación de gases producto de la combustion, sin sellar. + + + + +Trabajo efectuado: +Se fijó calefont a muro con tornillos y se selló ducto de salida de gases con silicona de alta temperatura. + + + + +Evidencia visual: + https://drive.google.com/drive/folders/1DiVfUKqleYsHCpzqWNJpHSOBn-pTYD0w?usp=sharing +Materiales +silicona utilizados: + de alta +Costo +Costo Mano detemperatura. + Obra + de materiales: $40.000 0 + +Valor Total del Trabajo : $40.000 + + + + Atte + + + + + Simón Moya Salinas + C.I. : 9.990.302-3 + Instalador de gas Autorizado SEC + Wsp. 933922780 + \ No newline at end of file diff --git a/tmp/pdfs/inspection/page-1.png b/tmp/pdfs/inspection/page-1.png new file mode 100644 index 0000000..22f0de4 Binary files /dev/null and b/tmp/pdfs/inspection/page-1.png differ diff --git a/tmp/pdfs/removed-work-fields/certifier.pdf b/tmp/pdfs/removed-work-fields/certifier.pdf new file mode 100644 index 0000000..14ed13b Binary files /dev/null and b/tmp/pdfs/removed-work-fields/certifier.pdf differ diff --git a/tmp/pdfs/removed-work-fields/certifier.txt b/tmp/pdfs/removed-work-fields/certifier.txt new file mode 100644 index 0000000..8dd8fdf --- /dev/null +++ b/tmp/pdfs/removed-work-fields/certifier.txt @@ -0,0 +1,193 @@ + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/removed-work-fields/certifier/first.png b/tmp/pdfs/removed-work-fields/certifier/first.png new file mode 100644 index 0000000..27bc4c6 Binary files /dev/null and b/tmp/pdfs/removed-work-fields/certifier/first.png differ diff --git a/tmp/pdfs/removed-work-fields/client.pdf b/tmp/pdfs/removed-work-fields/client.pdf new file mode 100644 index 0000000..3d8d9c5 Binary files /dev/null and b/tmp/pdfs/removed-work-fields/client.pdf differ diff --git a/tmp/pdfs/removed-work-fields/client.txt b/tmp/pdfs/removed-work-fields/client.txt new file mode 100644 index 0000000..86c7e82 --- /dev/null +++ b/tmp/pdfs/removed-work-fields/client.txt @@ -0,0 +1,215 @@ + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO TOTAL OT + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos $61.490 + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +REPUESTOS UTILIZADOS 2 repuestos + + DESCRIPCIÓN PRECIO + + + Flexible de agua 1/2 pulgada $8.500 + + Llave de paso $12.990 + + Subtotal: $21.490 + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + RESUMEN DE COSTOS + + Costo de mano de obra $40.000 + Total de repuestos $21.490 + + + + Valor total de la OT $61.490 + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/removed-work-fields/client/first.png b/tmp/pdfs/removed-work-fields/client/first.png new file mode 100644 index 0000000..753b027 Binary files /dev/null and b/tmp/pdfs/removed-work-fields/client/first.png differ diff --git a/tmp/pdfs/removed-work-fields/client/last.png b/tmp/pdfs/removed-work-fields/client/last.png new file mode 100644 index 0000000..7e5a176 Binary files /dev/null and b/tmp/pdfs/removed-work-fields/client/last.png differ diff --git a/tmp/pdfs/requested-performed/certifier.pdf b/tmp/pdfs/requested-performed/certifier.pdf new file mode 100644 index 0000000..b523061 Binary files /dev/null and b/tmp/pdfs/requested-performed/certifier.pdf differ diff --git a/tmp/pdfs/requested-performed/certifier.txt b/tmp/pdfs/requested-performed/certifier.txt new file mode 100644 index 0000000..1067794 --- /dev/null +++ b/tmp/pdfs/requested-performed/certifier.txt @@ -0,0 +1,206 @@ + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos + + + +TRABAJO SOLICITADO + + + Se solicita revisar el funcionamiento general del equipo. + + +TRABAJO REALIZADO + + + Se efectuó la mantención y el equipo quedó operativo. + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para empresa certificadora + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/requested-performed/certifier/page-1.png b/tmp/pdfs/requested-performed/certifier/page-1.png new file mode 100644 index 0000000..cdb21da Binary files /dev/null and b/tmp/pdfs/requested-performed/certifier/page-1.png differ diff --git a/tmp/pdfs/requested-performed/certifier/page-2.png b/tmp/pdfs/requested-performed/certifier/page-2.png new file mode 100644 index 0000000..718487f Binary files /dev/null and b/tmp/pdfs/requested-performed/certifier/page-2.png differ diff --git a/tmp/pdfs/requested-performed/certifier/page-3.png b/tmp/pdfs/requested-performed/certifier/page-3.png new file mode 100644 index 0000000..db4ae73 Binary files /dev/null and b/tmp/pdfs/requested-performed/certifier/page-3.png differ diff --git a/tmp/pdfs/requested-performed/certifier/page-4.png b/tmp/pdfs/requested-performed/certifier/page-4.png new file mode 100644 index 0000000..4753a23 Binary files /dev/null and b/tmp/pdfs/requested-performed/certifier/page-4.png differ diff --git a/tmp/pdfs/requested-performed/client.pdf b/tmp/pdfs/requested-performed/client.pdf new file mode 100644 index 0000000..8d3aa1b Binary files /dev/null and b/tmp/pdfs/requested-performed/client.pdf differ diff --git a/tmp/pdfs/requested-performed/client.txt b/tmp/pdfs/requested-performed/client.txt new file mode 100644 index 0000000..f7f09cd --- /dev/null +++ b/tmp/pdfs/requested-performed/client.txt @@ -0,0 +1,227 @@ + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + +Mantención Preventiva +Orden de trabajo finalizada + + + CREADA FINALIZADA CONTENIDO TOTAL OT + 25/07/2026 14:30 25/07/2026 16:30 8 tareas - 3 fotos $61.490 + + + +TRABAJO SOLICITADO + + + Se solicita revisar el funcionamiento general del equipo. + + +TRABAJO REALIZADO + + + Se efectuó la mantención y el equipo quedó operativo. + + + + + 1 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +REPUESTOS UTILIZADOS 2 repuestos + + DESCRIPCIÓN PRECIO + + + Flexible de agua 1/2 pulgada $8.500 + + Llave de paso $12.990 + + Subtotal: $21.490 + + +ANTES DE LA MANTENCIÓN 3 fotos + + + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + +Generado por SMoya Gasfiter Página 1 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 2 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 3 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 4 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 2 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 5 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 6 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + 7 Limpieza Full + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + +Generado por SMoya Gasfiter Página 3 de 4 + Informe para cliente + CLIENTE: Cliente de prueba + DIRECCIÓN: Av. Principal 123, Santiago + + + + + 8 Chequeo de gas refrigerante + +OB S E RVACIÓN + + + Se realizó la inspección del equipo, la limpieza de sus componentes y la verificación de los parámetros de + operación. El equipo quedó funcionando correctamente. + + +ANTES DE LA MANTENCIÓN 0 fotos + + +DESPUÉS DE LA MANTENCIÓN 0 fotos + + + + + RESUMEN DE COSTOS + + Costo de mano de obra $40.000 + Total de repuestos $21.490 + + + + Valor total de la OT $61.490 + + + Atentamente + + + + + Simón Moya Salinas + C.I.: 9.990.302-3 - Instalador de gas autorizado SEC + WhatsApp: 933922780 + + + + +Generado por SMoya Gasfiter Página 4 de 4 + \ No newline at end of file diff --git a/tmp/pdfs/requested-performed/client/page-1.png b/tmp/pdfs/requested-performed/client/page-1.png new file mode 100644 index 0000000..0944d28 Binary files /dev/null and b/tmp/pdfs/requested-performed/client/page-1.png differ diff --git a/tmp/pdfs/requested-performed/client/page-2.png b/tmp/pdfs/requested-performed/client/page-2.png new file mode 100644 index 0000000..e76fd1b Binary files /dev/null and b/tmp/pdfs/requested-performed/client/page-2.png differ diff --git a/tmp/pdfs/requested-performed/client/page-3.png b/tmp/pdfs/requested-performed/client/page-3.png new file mode 100644 index 0000000..6f18869 Binary files /dev/null and b/tmp/pdfs/requested-performed/client/page-3.png differ diff --git a/tmp/pdfs/requested-performed/client/page-4.png b/tmp/pdfs/requested-performed/client/page-4.png new file mode 100644 index 0000000..7e5a176 Binary files /dev/null and b/tmp/pdfs/requested-performed/client/page-4.png differ diff --git a/tmp/pdfs/requested-performed/contact-sheet.png b/tmp/pdfs/requested-performed/contact-sheet.png new file mode 100644 index 0000000..ffa2fc2 Binary files /dev/null and b/tmp/pdfs/requested-performed/contact-sheet.png differ diff --git a/tmp/pdfs/signature-preview.png b/tmp/pdfs/signature-preview.png new file mode 100644 index 0000000..a430ec0 Binary files /dev/null and b/tmp/pdfs/signature-preview.png differ diff --git a/web/favicon.png b/web/favicon.png new file mode 100644 index 0000000..6d65769 Binary files /dev/null and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png new file mode 100644 index 0000000..e51583c Binary files /dev/null and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png new file mode 100644 index 0000000..80cedeb Binary files /dev/null and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..e51583c Binary files /dev/null and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..80cedeb Binary files /dev/null and b/web/icons/Icon-maskable-512.png differ diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..9bcb832 --- /dev/null +++ b/web/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + SMoya Gasfiter + + + + + + + diff --git a/web/manifest.json b/web/manifest.json new file mode 100644 index 0000000..1274f7c --- /dev/null +++ b/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "SMoya Gasfiter", + "short_name": "SMoya Gasfiter", + "start_url": ".", + "display": "standalone", + "background_color": "#FFFFFF", + "theme_color": "#0B5C5E", + "description": "Aplicación de órdenes de trabajo de SMoya Gasfiter.", + "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/windows/.gitignore b/windows/.gitignore new file mode 100644 index 0000000..ec4098a --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,17 @@ +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/windows/CMakeLists.txt b/windows/CMakeLists.txt new file mode 100644 index 0000000..c95b005 --- /dev/null +++ b/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(ot_movil 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 "ot_movil") + +# 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/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..efb62eb --- /dev/null +++ b/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# 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/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..22da262 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); + PrintingPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PrintingPlugin")); + SpeechToTextWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SpeechToTextWindows")); +} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// 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/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..3b17fbe --- /dev/null +++ b/windows/flutter/generated_plugins.cmake @@ -0,0 +1,27 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + file_selector_windows + printing + speech_to_text_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni +) + +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/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..2041a04 --- /dev/null +++ b/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +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/windows/runner/Runner.rc b/windows/runner/Runner.rc new file mode 100644 index 0000000..f1be15c --- /dev/null +++ b/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// 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", "cl.otmovil" "\0" + VALUE "FileDescription", "SMoya Gasfiter" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "ot_movil" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 cl.otmovil. All rights reserved." "\0" + VALUE "OriginalFilename", "ot_movil.exe" "\0" + VALUE "ProductName", "SMoya Gasfiter" "\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/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..c819cb0 --- /dev/null +++ b/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#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/windows/runner/flutter_window.h b/windows/runner/flutter_window.h new file mode 100644 index 0000000..28c2383 --- /dev/null +++ b/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#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/windows/runner/main.cpp b/windows/runner/main.cpp new file mode 100644 index 0000000..f9fc49d --- /dev/null +++ b/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#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"SMoya Gasfiter", 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/windows/runner/resource.h b/windows/runner/resource.h new file mode 100644 index 0000000..ddc7f3e --- /dev/null +++ b/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{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/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..1edb87e Binary files /dev/null and b/windows/runner/resources/app_icon.ico differ diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..4b962bb --- /dev/null +++ b/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp new file mode 100644 index 0000000..259d85b --- /dev/null +++ b/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#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/windows/runner/utils.h b/windows/runner/utils.h new file mode 100644 index 0000000..3f0e05c --- /dev/null +++ b/windows/runner/utils.h @@ -0,0 +1,19 @@ +#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/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp new file mode 100644 index 0000000..b5ba2a0 --- /dev/null +++ b/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#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/windows/runner/win32_window.h b/windows/runner/win32_window.h new file mode 100644 index 0000000..49b847f --- /dev/null +++ b/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#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_