diff --git a/.idea/LibraryAppFlutter.iml b/.idea/LibraryAppFlutter.iml index 9d377e0..565d22c 100644 --- a/.idea/LibraryAppFlutter.iml +++ b/.idea/LibraryAppFlutter.iml @@ -36,6 +36,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index b8ce787..5c5a0b5 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,25 +1,27 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml index 27197a0..62c263e 100644 --- a/.idea/libraries/Flutter_Plugins.xml +++ b/.idea/libraries/Flutter_Plugins.xml @@ -1,56 +1,54 @@ - - - - + + - - + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/other.xml b/.idea/other.xml new file mode 100644 index 0000000..0d3a1fb --- /dev/null +++ b/.idea/other.xml @@ -0,0 +1,263 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1dd..41611c9 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,9 @@ + + + + \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 1f94b9d..c2a0e92 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,7 @@ group 'com.assecont.servicos.assecontservices' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() @@ -27,6 +27,7 @@ apply plugin: 'kotlin-android' android { compileSdkVersion 34 + namespace "com.assecont.servicos.assecontservices" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.jar rename to android/gradle/wrapper/gradle-wrapper.jar diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties similarity index 79% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to android/gradle/wrapper/gradle-wrapper.properties index 562c5e4..3c472b9 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/example/android/gradlew b/android/gradlew similarity index 100% rename from example/android/gradlew rename to android/gradlew diff --git a/example/android/gradlew.bat b/android/gradlew.bat similarity index 100% rename from example/android/gradlew.bat rename to android/gradlew.bat diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index a4cab34..dce34f9 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/example/.gitignore b/example/.gitignore deleted file mode 100644 index a1345d0..0000000 --- a/example/.gitignore +++ /dev/null @@ -1,45 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# 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 -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related - -# 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/example/README.md b/example/README.md deleted file mode 100644 index df90942..0000000 --- a/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# assecontservices_example - -Demonstrates how to use the assecontservices plugin. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml deleted file mode 100644 index 61b6c4d..0000000 --- a/example/analysis_options.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# 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-lang.github.io/linter/lints/index.html. - # - # 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/example/android/.gitignore b/example/android/.gitignore deleted file mode 100644 index 6f56801..0000000 --- a/example/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 2516d50..0000000 --- a/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 0cc6851..0000000 --- a/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java deleted file mode 100644 index 8ed39f6..0000000 --- a/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.flutter.plugins; - -import androidx.annotation.Keep; -import androidx.annotation.NonNull; -import io.flutter.Log; - -import io.flutter.embedding.engine.FlutterEngine; - -/** - * Generated file. Do not edit. - * This file is generated by the Flutter tool based on the - * plugins that support the Android platform. - */ -@Keep -public final class GeneratedPluginRegistrant { - private static final String TAG = "GeneratedPluginRegistrant"; - public static void registerWith(@NonNull FlutterEngine flutterEngine) { - try { - flutterEngine.getPlugins().add(new com.assecont.servicos.assecontservices.AssecontservicesPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin assecontservices, com.assecont.servicos.assecontservices.AssecontservicesPlugin", e); - } - try { - flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.connectivity.ConnectivityPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin connectivity_plus, dev.fluttercommunity.plus.connectivity.ConnectivityPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.pinciat.external_path.ExternalPathPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin external_path, com.pinciat.external_path.ExternalPathPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.afur.flutter_html_to_pdf.FlutterHtmlToPdfPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin flutter_html_to_pdf, com.afur.flutter_html_to_pdf.FlutterHtmlToPdfPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.baseflow.geocoding.GeocodingPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin geocoding_android, com.baseflow.geocoding.GeocodingPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.googlemaps.GoogleMapsPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin google_maps_flutter_android, io.flutter.plugins.googlemaps.GoogleMapsPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin image_picker_android, io.flutter.plugins.imagepicker.ImagePickerPlugin", e); - } - try { - flutterEngine.getPlugins().add(new dev.britannio.in_app_review.InAppReviewPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin in_app_review, dev.britannio.in_app_review.InAppReviewPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.iyaffle.launchreview.LaunchReviewPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin launch_review, com.iyaffle.launchreview.LaunchReviewPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.localauth.LocalAuthPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin local_auth_android, io.flutter.plugins.localauth.LocalAuthPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.lyokone.location.LocationPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin location, com.lyokone.location.LocationPlugin", e); - } - try { - flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.xamdesign.safe_device.SafeDevicePlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin safe_device, com.xamdesign.safe_device.SafeDevicePlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.zt.shareextend.ShareExtendPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin share_extend, com.zt.shareextend.ShareExtendPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.tekartik.sqflite.SqflitePlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin sqflite, com.tekartik.sqflite.SqflitePlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin syncfusion_flutter_pdfviewer, com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin", e); - } - try { - flutterEngine.getPlugins().add(new com.wongpiwat.trust_location.TrustLocationPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin trust_location, com.wongpiwat.trust_location.TrustLocationPlugin", e); - } - try { - flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e); - } - } -} diff --git a/example/android/app/src/main/kotlin/com/assecont/servicos/assecontservices_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/assecont/servicos/assecontservices_example/MainActivity.kt deleted file mode 100644 index 0696e96..0000000 --- a/example/android/app/src/main/kotlin/com/assecont/servicos/assecontservices_example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.assecont.servicos.assecontservices_example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/example/android/app/src/main/res/drawable-v21/launch_background.xml b/example/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/example/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 3db14bb..0000000 --- a/example/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index d460d1e..0000000 --- a/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 2516d50..0000000 --- a/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/example/android/assecontservices_example_android.iml b/example/android/assecontservices_example_android.iml deleted file mode 100644 index 1899969..0000000 --- a/example/android/assecontservices_example_android.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/example/android/local.properties b/example/android/local.properties deleted file mode 100644 index b7eb155..0000000 --- a/example/android/local.properties +++ /dev/null @@ -1,5 +0,0 @@ -sdk.dir=C:\\Users\\gabri\\AppData\\Local\\Android\\sdk -flutter.sdk=C:\\SDK\\flutter -flutter.buildMode=debug -flutter.versionName=3.1.2 -flutter.versionCode=1 \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/example/assets/imagens/DOWN1.png b/example/assets/imagens/DOWN1.png deleted file mode 100644 index 7e8c10c..0000000 Binary files a/example/assets/imagens/DOWN1.png and /dev/null differ diff --git a/example/assets/imagens/LOGO_ASSECONT.png b/example/assets/imagens/LOGO_ASSECONT.png deleted file mode 100644 index c457bce..0000000 Binary files a/example/assets/imagens/LOGO_ASSECONT.png and /dev/null differ diff --git a/example/assets/imagens/assecont.png b/example/assets/imagens/assecont.png deleted file mode 100644 index b6971a8..0000000 Binary files a/example/assets/imagens/assecont.png and /dev/null differ diff --git a/example/assets/imagens/bompacredito.jpg b/example/assets/imagens/bompacredito.jpg deleted file mode 100644 index 2b64edc..0000000 Binary files a/example/assets/imagens/bompacredito.jpg and /dev/null differ diff --git a/example/assets/imagens/check.png b/example/assets/imagens/check.png deleted file mode 100644 index 26073fa..0000000 Binary files a/example/assets/imagens/check.png and /dev/null differ diff --git a/example/assets/imagens/dispo.png b/example/assets/imagens/dispo.png deleted file mode 100644 index a2a06a5..0000000 Binary files a/example/assets/imagens/dispo.png and /dev/null differ diff --git a/example/assets/imagens/email.png b/example/assets/imagens/email.png deleted file mode 100644 index c9f379f..0000000 Binary files a/example/assets/imagens/email.png and /dev/null differ diff --git a/example/assets/imagens/ic_launcher.png b/example/assets/imagens/ic_launcher.png deleted file mode 100644 index 2faeb6e..0000000 Binary files a/example/assets/imagens/ic_launcher.png and /dev/null differ diff --git a/example/assets/imagens/ic_sendM4.png b/example/assets/imagens/ic_sendM4.png deleted file mode 100644 index 1aa7daf..0000000 Binary files a/example/assets/imagens/ic_sendM4.png and /dev/null differ diff --git a/example/assets/imagens/logo-assepontoweb.png b/example/assets/imagens/logo-assepontoweb.png deleted file mode 100644 index 8e5516d..0000000 Binary files a/example/assets/imagens/logo-assepontoweb.png and /dev/null differ diff --git a/example/assets/imagens/logo-asseweb.png b/example/assets/imagens/logo-asseweb.png deleted file mode 100644 index 37010a4..0000000 Binary files a/example/assets/imagens/logo-asseweb.png and /dev/null differ diff --git a/example/assets/imagens/logo.png b/example/assets/imagens/logo.png deleted file mode 100644 index 13ee643..0000000 Binary files a/example/assets/imagens/logo.png and /dev/null differ diff --git a/example/assets/imagens/logo_assepontoweb.png b/example/assets/imagens/logo_assepontoweb.png deleted file mode 100644 index 786b940..0000000 Binary files a/example/assets/imagens/logo_assepontoweb.png and /dev/null differ diff --git a/example/assets/imagens/pending.png b/example/assets/imagens/pending.png deleted file mode 100644 index 41b1f5b..0000000 Binary files a/example/assets/imagens/pending.png and /dev/null differ diff --git a/example/assets/imagens/sms.png b/example/assets/imagens/sms.png deleted file mode 100644 index 1bf1cc3..0000000 Binary files a/example/assets/imagens/sms.png and /dev/null differ diff --git a/example/assets/imagens/visualizado.png b/example/assets/imagens/visualizado.png deleted file mode 100644 index c562be1..0000000 Binary files a/example/assets/imagens/visualizado.png and /dev/null differ diff --git a/example/ios/.gitignore b/example/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/example/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/example/ios/Flutter/Generated.xcconfig b/example/ios/Flutter/Generated.xcconfig deleted file mode 100644 index 7960212..0000000 --- a/example/ios/Flutter/Generated.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=C:\sdk\flutter -FLUTTER_APPLICATION_PATH=C:\Users\User\AndroidStudioProjects\LibraryAppFlutter\example -COCOAPODS_PARALLEL_CODE_SIGN=true -FLUTTER_TARGET=lib\main.dart -FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=3.1.2 -FLUTTER_BUILD_NUMBER=1 -EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 -EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 -DART_OBFUSCATION=false -TRACK_WIDGET_CREATION=true -TREE_SHAKE_ICONS=false -PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh deleted file mode 100644 index 876d648..0000000 --- a/example/ios/Flutter/flutter_export_environment.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=C:\sdk\flutter" -export "FLUTTER_APPLICATION_PATH=C:\Users\User\AndroidStudioProjects\LibraryAppFlutter\example" -export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=lib\main.dart" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=3.1.2" -export "FLUTTER_BUILD_NUMBER=1" -export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=true" -export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/example/ios/Runner/GeneratedPluginRegistrant.h b/example/ios/Runner/GeneratedPluginRegistrant.h deleted file mode 100644 index 7a89092..0000000 --- a/example/ios/Runner/GeneratedPluginRegistrant.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GeneratedPluginRegistrant_h -#define GeneratedPluginRegistrant_h - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface GeneratedPluginRegistrant : NSObject -+ (void)registerWithRegistry:(NSObject*)registry; -@end - -NS_ASSUME_NONNULL_END -#endif /* GeneratedPluginRegistrant_h */ diff --git a/example/ios/Runner/GeneratedPluginRegistrant.m b/example/ios/Runner/GeneratedPluginRegistrant.m deleted file mode 100644 index fd3dd96..0000000 --- a/example/ios/Runner/GeneratedPluginRegistrant.m +++ /dev/null @@ -1,140 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#import "GeneratedPluginRegistrant.h" - -#if __has_include() -#import -#else -@import assecontservices; -#endif - -#if __has_include() -#import -#else -@import connectivity_plus; -#endif - -#if __has_include() -#import -#else -@import flutter_html_to_pdf; -#endif - -#if __has_include() -#import -#else -@import geocoding_ios; -#endif - -#if __has_include() -#import -#else -@import google_maps_flutter_ios; -#endif - -#if __has_include() -#import -#else -@import image_picker_ios; -#endif - -#if __has_include() -#import -#else -@import in_app_review; -#endif - -#if __has_include() -#import -#else -@import launch_review; -#endif - -#if __has_include() -#import -#else -@import local_auth_ios; -#endif - -#if __has_include() -#import -#else -@import location; -#endif - -#if __has_include() -#import -#else -@import package_info_plus; -#endif - -#if __has_include() -#import -#else -@import path_provider_foundation; -#endif - -#if __has_include() -#import -#else -@import safe_device; -#endif - -#if __has_include() -#import -#else -@import share_extend; -#endif - -#if __has_include() -#import -#else -@import shared_preferences_foundation; -#endif - -#if __has_include() -#import -#else -@import sqflite; -#endif - -#if __has_include() -#import -#else -@import syncfusion_flutter_pdfviewer; -#endif - -#if __has_include() -#import -#else -@import url_launcher_ios; -#endif - -@implementation GeneratedPluginRegistrant - -+ (void)registerWithRegistry:(NSObject*)registry { - [AssecontservicesPlugin registerWithRegistrar:[registry registrarForPlugin:@"AssecontservicesPlugin"]]; - [ConnectivityPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"ConnectivityPlusPlugin"]]; - [FlutterHtmlToPdfPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterHtmlToPdfPlugin"]]; - [GeocodingPlugin registerWithRegistrar:[registry registrarForPlugin:@"GeocodingPlugin"]]; - [FLTGoogleMapsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTGoogleMapsPlugin"]]; - [FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]]; - [InAppReviewPlugin registerWithRegistrar:[registry registrarForPlugin:@"InAppReviewPlugin"]]; - [LaunchReviewPlugin registerWithRegistrar:[registry registrarForPlugin:@"LaunchReviewPlugin"]]; - [FLTLocalAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTLocalAuthPlugin"]]; - [LocationPlugin registerWithRegistrar:[registry registrarForPlugin:@"LocationPlugin"]]; - [FPPPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPPackageInfoPlusPlugin"]]; - [PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]]; - [SafeDevicePlugin registerWithRegistrar:[registry registrarForPlugin:@"SafeDevicePlugin"]]; - [ShareExtendPlugin registerWithRegistrar:[registry registrarForPlugin:@"ShareExtendPlugin"]]; - [SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]]; - [SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]]; - [SyncfusionFlutterPdfViewerPlugin registerWithRegistrar:[registry registrarForPlugin:@"SyncfusionFlutterPdfViewerPlugin"]]; - [FLTURLLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTURLLauncherPlugin"]]; -} - -@end diff --git a/example/lib/controller/gethora.dart b/example/lib/controller/gethora.dart deleted file mode 100644 index 3013177..0000000 --- a/example/lib/controller/gethora.dart +++ /dev/null @@ -1,22 +0,0 @@ - -import 'dart:async'; - -import 'package:flutter/cupertino.dart'; -import 'package:intl/intl.dart'; - -class GetHora extends ChangeNotifier { - GetHora(){ - atualizarhora(); - } - static Timer? timer; - String get horarioAtual => "${DateFormat('HH:mm').format(DateTime.now())}"; - - atualizarhora() { - timer = Timer.periodic( - Duration(seconds: 1), (Timer timer) { - horarioAtual; - notifyListeners(); - } - ); - } -} \ No newline at end of file diff --git a/example/lib/controller/gps.dart b/example/lib/controller/gps.dart deleted file mode 100644 index d3a76eb..0000000 --- a/example/lib/controller/gps.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:location/location.dart'; -import 'package:assecontservices/assecontservices.dart'; - - - -class Gps extends ChangeNotifier { - Location location = Location(); - LocationData? locationData; - - CameraPosition _cam = const CameraPosition(target: LatLng(-23.5505199, -46.6333094), zoom: 18); - CameraPosition get cam => _cam; - set cam(CameraPosition c){ - _cam = c; - notifyListeners(); - } - - Future get serviceEnabled async { - return await location.serviceEnabled(); - } - - Future get isMockLocation async { - return await SafeDevice.canMockLocation;; - } - - localizacao() async { - PermissionStatus _permissionGranted; - try{ - _permissionGranted = await location.hasPermission(); - if (_permissionGranted == PermissionStatus.denied) { - _permissionGranted = await location.requestPermission(); - } - - bool _serviceEnabled = await location.serviceEnabled(); - if (!_serviceEnabled) { - _serviceEnabled = await location.requestService(); - } - - if ((_permissionGranted == PermissionStatus.granted || - _permissionGranted == PermissionStatus.grantedLimited ) && _serviceEnabled) { - //if(!Config.isIOS) TrustLocation.start(5) ; - //location.changeConfig(accuracy: LocationAccuracy.balanced); - getLocalizacao(); - }else{ - //locationData = null; - } - }catch (e){ - debugPrint(e.toString()); - //locationData = null; - //erro(); - } - } - - getLocalizacao() async { - try{ - locationData = await location.getLocation(); - cam = CameraPosition( - target: LatLng(locationData!.latitude!, locationData!.longitude!), - zoom: 18 - ); - }catch(e){ - debugPrint(e.toString()); - } - } - -} \ No newline at end of file diff --git a/example/lib/controller/home_controller.dart b/example/lib/controller/home_controller.dart deleted file mode 100644 index b2adddd..0000000 --- a/example/lib/controller/home_controller.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:flutter/cupertino.dart'; - -class HomeController extends ChangeNotifier { - static PageController pageController = PageController(); - int page = 0; - int? filtro; - - void setPage(int value) { - page = value; - pageController.jumpToPage(value); - notifyListeners(); - } -} diff --git a/example/lib/controller/tutor_controller.dart b/example/lib/controller/tutor_controller.dart deleted file mode 100644 index 514fa58..0000000 --- a/example/lib/controller/tutor_controller.dart +++ /dev/null @@ -1,324 +0,0 @@ - - -import 'package:assecontservices/assecontservices.dart'; -import 'package:flutter/material.dart'; - -class TutorController { - List itens = []; - - final GlobalKey> keyMenu = GlobalKey(); - final GlobalKey keyMenu1 = GlobalKey(); - final GlobalKey keyMenu2 = GlobalKey(); - final GlobalKey keyMenu3 = GlobalKey(); - final GlobalKey keyMenu4 = GlobalKey(); - final GlobalKey keyMenu5 = GlobalKey(); - final GlobalKey keyResumo = GlobalKey(); - final GlobalKey keyListMenu = GlobalKey(); - final GlobalKey keyRegistro = GlobalKey(); - - init(BuildContext context){ - itens.addAll({ - TutorialItens( - globalKey: keyMenu1, - touchScreen: true, - top: WidgetsBinding.instance.window.padding.top, - left: 10, - right: 180, - children: [ - Container( - color: Colors.black54, - child: CustomText.text( - "Nesse menu é possível alterar o período para consultas.", - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - softWrap: true, - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square), - TutorialItens( - globalKey: keyMenu2, - touchScreen: true, - top: 30 + (WidgetsBinding.instance.window.padding.top), - left: 10, - right: 180, - children: [ - Container( - color: Colors.black54, - child: CustomText.text( - "Nesse menu é possível alterar a senha do usuário.", - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - softWrap: true, - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - softWrap: true, - ), - ), - shapeFocus: ShapeFocus.square), - TutorialItens( - globalKey: keyMenu3, - touchScreen: true, - top: 60 + (WidgetsBinding.instance.window.padding.top), - left: 10, - right: 180, - children: [ - Container( - color: Colors.black54, - child: CustomText.text( - "Nesse menu é possível verificar versão do app, alterar modo escuro e autenticação.", - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - softWrap: true, - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square), - if (!Config.isWin) - TutorialItens( - globalKey: keyMenu4, - touchScreen: true, - top: 120 + (WidgetsBinding.instance.window.padding.top), - left: 10, - right: 180, - children: [ - Container( - color: Colors.black54, - child: CustomText.text( - "Nesse menu é possível avaliar o app na loja.", - softWrap: true, - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square), - TutorialItens( - globalKey: keyMenu5, - touchScreen: true, - top: 160 + (WidgetsBinding.instance.window.padding.top), - left: 10, - right: 180, - children: [ - Container( - color: Colors.black54, - child: CustomText.text( - "Nesse menu é possível deslogar do usuário atual.", - softWrap: true, - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square), - TutorialItens( - globalKey: keyListMenu, - touchScreen: true, - bottom: 100, - right: 0, - left: 0, - children: [ - Container( - color: Colors.black54, - padding: const EdgeInsets.only(top: 20, bottom: 20, left: 20), - child: Center( - child: CustomText.text( - "Lista de menu deslizável na horizontal.", - softWrap: true, - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - ), - ), - ), - const SizedBox( - height: 50, - ) - ], - widgetNext: Container( - padding: const EdgeInsets.all(5), - //margin: EdgeInsets.only(right: 30), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square, - ), - TutorialItens( - globalKey: keyResumo, - touchScreen: true, - top: 300, - right: 0, - left: 0, - children: [ - Container( - color: Colors.black54, - padding: const EdgeInsets.only( - top: 20, - bottom: 20, - ), - child: Center( - child: CustomText.text( - "Resumo dos resultados do período.", - softWrap: true, - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - ), - ), - ), - const SizedBox( - height: 30, - ) - ], - widgetNext: Container( - padding: - const EdgeInsets.all(5), //margin: EdgeInsets.only(right: 30), - color: Colors.black12, - child: CustomText.text( - "Continuar", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.square, - ), - TutorialItens( - globalKey: keyRegistro, - touchScreen: true, - bottom: 220, - right: 20, - left: 20, - children: [ - Container( - color: Colors.black54, - padding: const EdgeInsets.only(top: 20, bottom: 20, right: 50), - child: Center( - child: CustomText.text( - "Clicando em Registrar é possível realizar a marcação de ponto.", - style: const TextStyle(color: Colors.white, fontSize: 18), - textAlign: TextAlign.center, - ), - ), - ), - const SizedBox( - height: 20, - ) - ], - widgetNext: Container( - padding: - const EdgeInsets.all(5), //margin: EdgeInsets.only(right: 30), - color: Colors.black12, - child: CustomText.text( - "Sair", - style: const TextStyle( - color: Config.corPri, - fontWeight: FontWeight.bold, - ), - ), - ), - shapeFocus: ShapeFocus.oval, - ), - }); - - keyStatus(context); - } - - void keyStatus(BuildContext context) async { - Future.delayed(const Duration(microseconds: 200)).then((value) async { - keyMenu.currentState?.showButtonMenu(); - Future.delayed(const Duration(seconds: 1)).then((value) async { - Tutorial.showTutorial(context, itens, (v) { - if (v == (Config.isWin ? 3 : 4) && - (keyMenu.currentState?.mounted ?? false)) { - //keyMenu.currentState!.showButtonMenu(); - Navigator.pop( - keyMenu.currentState!.context, - ); - } else if (v == (Config.isWin ? 5 : 6)) { - Config().priacesso(); - } else if (v == (Config.isWin ? 6 : 7)) { - BiometriaAlert(context); - itens.clear(); - } - }); - }); - }); - } - - -} \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart deleted file mode 100644 index 36aec18..0000000 --- a/example/lib/main.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:assecontservices/assecontservices.dart'; - - -import '../route_generator.dart'; -import 'controller/gps.dart'; -import 'controller/home_controller.dart'; -import 'controller/tutor_controller.dart'; - - -void main() { - WidgetsFlutterBinding.ensureInitialized(); - - Assecontservices.init( - config: ConfiguracoesModel( - apiAsseweb: 'https://www.asseweb.com.br/ApiAsseweb', - apiHolerite: 'https://www.asseweb.com.br/AssecontAPI', - apiHoleriteEmail: 'https://www.asseweb.com.br/HoleriteApi', - apiAsseponto: 'https://www.asseponto.com.br/asseponto.api.v5', - apiEspelho: 'https://www.asseponto.com.br/ApiEspelho', - apiAssepontoNova: 'https://www.asseponto.com.br/ApiAsseponto', - androidAppId: 'com.assecont.AssepontoMobile', - iosAppId: 'com.assecont.assepontoweb', - iosAppIdNum: '1490469231', - nomeApp: VersaoApp.PontoApp - ), - titulo: 'Asseponto App', - rotas: RouteGenerator.generateRoute, - providers: [ - - ChangeNotifierProvider( - create: (_)=> Gps(), - ), - ChangeNotifierProvider( - create: (_)=> HomeController(), - ), - Provider( - create: (_)=> TutorController(), - ), - ] - ); -} \ No newline at end of file diff --git a/example/lib/route_generator.dart b/example/lib/route_generator.dart deleted file mode 100644 index cb971d9..0000000 --- a/example/lib/route_generator.dart +++ /dev/null @@ -1,88 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import '../ui/espelho/espelho_screen.dart'; -import '../ui/home/home.dart'; -import '../ui/login/start_screen.dart'; -import '../ui/registro/screen_registro.dart'; -import '../ui/banco_horas/banco_screen.dart'; -import '../ui/marcacoes/Marcacoes.dart'; -import '../ui/solicitacoes/solicitacoes_screen.dart'; -import 'ui/comprovantes/comprovantes_screen.dart'; - - -class RouteGenerator { - static Route generateRoute(RouteSettings settings){ - - switch (settings.name) { - case '/': - return MaterialPageRoute( - builder: (_) => IntroScreen() - ); - case '/login': - if(UserPontoManager.susuario != null){ - return MaterialPageRoute( - builder: (_) => Home() - ); - } - return MaterialPageRoute( - builder: (_) => StartScreen() - ); - case '/holerites': - return MaterialPageRoute( - builder: (_) => HoleriteScreen() - ); - case '/espelho': - return MaterialPageRoute( - builder: (_) => EspelhoScreen() - ); - case '/registro': - return MaterialPageRoute( - builder: (_) => RegistroScreen() - ); - case '/comprovantes': - return MaterialPageRoute( - builder: (_) => ComprovantesScreen() - ); - case '/home': - return MaterialPageRoute( - builder: (_) => Home() - ); - case '/banco': - return MaterialPageRoute( - builder: (_) => BancoHorasScreen() - ); - case '/marcacoes': - return MaterialPageRoute( - builder: (_) => MarcacoesPage(filtro: settings.arguments as int?,) - ); - case '/solicitacoes': - return MaterialPageRoute( - builder: (_) => Solicitacoes() - ); - case '/configuracoes': - return MaterialPageRoute( - builder: (_) => ConfigScreen() - ); - default: - return _erroRota(); - } - - } - - static Route _erroRota(){ - return MaterialPageRoute( - builder: (_){ - return Scaffold( - appBar: AppBar(title: CustomText.text("Tela não encontrada!"),), - body: Center( - child: CustomText.text("Tela não encontrada!"), - ), - ); - } - ); - } - -} \ No newline at end of file diff --git a/example/lib/ui/banco_horas/banco_screen.dart b/example/lib/ui/banco_horas/banco_screen.dart deleted file mode 100644 index fb12661..0000000 --- a/example/lib/ui/banco_horas/banco_screen.dart +++ /dev/null @@ -1,101 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import 'detalhes_banco.dart'; - -class BancoHorasScreen extends StatefulWidget { - @override - _BancoHorasScreenState createState() => _BancoHorasScreenState(); -} - -class _BancoHorasScreenState extends State { - ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); - - final GlobalKey _scaffoldKey = GlobalKey(); - final CalendarWeekController _controller = CalendarWeekController(); - - @override - void initState() { - context.read().getFuncionarioHistorico(); - super.initState(); - } - - - - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (_, banco, __){ - - - String? saldoAnteror() { - String? _saldo; - try{ - if(banco.listabanco.any((element) => - element.data != null ? banco.data.compareTo( - DateTime(element.data!.year, element.data!.month, element.data!.day)) > 0 : false - )) { - _saldo = banco.listabanco.lastWhere((element) => - element.data != null ? banco.data.compareTo( - DateTime(element.data!.year, element.data!.month, - element.data!.day)) > 0 : false - ).saldo; - } - }catch (e){ - _saldo = null; - } - - return _saldo; - } - - return CustomScaffold.calendario( - key: _scaffoldKey, - context: context, - appTitle:'Banco de Horas', - funcData: (DateTime datetime) { - banco.data = datetime; - }, - listdecoration: banco.listdecoration, - controller: _controller, - dataInit: banco.data, - dataMin: context.read().usuario?.periodo?.dataInicial, - dataMax: context.read().usuario?.periodo?.dataFinal, - body: Center( - child: !connectionStatus.hasConnection ? CustomText.text('Verifique sua Conexão com Internet') : - FutureBuilder( - future: banco.getBancodia(), - builder: (context, snapshot){ - Widget resultado = Container(); - String? _saldo = saldoAnteror(); - switch( snapshot.connectionState ){ - case ConnectionState.none : - case ConnectionState.waiting : - resultado = const Center(child: CircularProgressIndicator()); - break; - case ConnectionState.active : - case ConnectionState.done : - if( snapshot.hasError ){ - resultado = GestureDetector( - child: Icon(Icons.autorenew_outlined, - color: Config.corPri, size: 70,), - onTap: (){ - setState(() {}); - } - ); - }else { - resultado = DetalhesBanco(snapshot.data, banco.data, _saldo); - } - break; - } - return resultado; - }, - ) - ), - ); - } - ); - } -} \ No newline at end of file diff --git a/example/lib/ui/banco_horas/detalhes_banco.dart b/example/lib/ui/banco_horas/detalhes_banco.dart deleted file mode 100644 index 4a81602..0000000 --- a/example/lib/ui/banco_horas/detalhes_banco.dart +++ /dev/null @@ -1,139 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import '../solicitacoes/lancar_solicitacao.dart'; -import '../solicitacoes/solicitacoes_screen.dart'; - -class DetalhesBanco extends StatefulWidget { - BancoDiasList? bancoHoras; - DateTime? dia; - String? saldo; - DetalhesBanco(this.bancoHoras, this.dia, this.saldo); - - @override - _DetalhesMarcacaoState createState() => _DetalhesMarcacaoState(); -} - -class _DetalhesMarcacaoState extends State { - final ScrollController scrollController = ScrollController(); - bool diaMaiorHoje = false; - - @override - void initState() { - if(widget.dia != null) { - diaMaiorHoje = widget.dia!.compareTo(DateTime.now()) > 0; - } - super.initState(); - } - - Widget card(String menu, String valor){ - return Container( - padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 35), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomText.text(menu,style: const TextStyle(fontSize: 20),), - CustomText.text(valor.trim(),style: const TextStyle(fontSize: 20),), - ], - ), - ); - } - - @override - Widget build(BuildContext context) { - List list = context.watch().memorandoDia(widget.dia); - - - - return Scaffold( - body: Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(width: 80, - color: Theme.of(context).scaffoldBackgroundColor)) - ), - //height: MediaQuery.of(context).size.height, - child: SingleChildScrollView( - controller: scrollController, - child: Column(crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 15,), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30), - child: CustomText.text('Resumo'), - ), - const SizedBox(height: 5,), - card("Creditos:", widget.bancoHoras?.credito == null || widget.bancoHoras?.credito == '' || diaMaiorHoje - ? "0:00" : widget.bancoHoras!.credito! ), - if(!diaMaiorHoje && widget.bancoHoras?.descricaoCredito != null && widget.bancoHoras?.descricaoCredito != '') - Container( - padding: const EdgeInsets.symmetric(horizontal: 35), - child: CustomText.text(widget.bancoHoras?.descricaoCredito ?? "", - style: const TextStyle(fontSize: 14),) - ), - const SizedBox(height: 10,), - card("Debitos:", widget.bancoHoras?.debito == null || widget.bancoHoras?.debito == '' || diaMaiorHoje - ? "0:00" : widget.bancoHoras!.debito! ), - if(!diaMaiorHoje && widget.bancoHoras?.descricaoDebito != null && widget.bancoHoras?.descricaoDebito != '') - Container( - padding: const EdgeInsets.symmetric(horizontal: 35), - child: CustomText.text(widget.bancoHoras?.descricaoDebito ?? "", - style: const TextStyle(fontSize: 14),) - ), - - if(!diaMaiorHoje) - const SizedBox(height: 10,), - if(!diaMaiorHoje) - card("Saldo do dia:", widget.bancoHoras?.saldodia == null - ? "0:00" : widget.bancoHoras!.saldodia ), - - if(widget.bancoHoras?.lancamentos != null && widget.bancoHoras?.lancamentos != '') - const SizedBox(height: 10,), - if(widget.bancoHoras?.lancamentos != null && widget.bancoHoras?.lancamentos != '') - card("Lançamentos Manual:", widget.bancoHoras!.lancamentos! ), - if(widget.bancoHoras?.descricaoLancamentos != null && widget.bancoHoras?.descricaoLancamentos != '') - Container( - padding: const EdgeInsets.symmetric(horizontal: 35), - child: CustomText.text(widget.bancoHoras?.descricaoLancamentos ?? "", - style: const TextStyle(fontSize: 14),) - ), - - - if(!diaMaiorHoje) - const SizedBox(height: 15,), - if(!diaMaiorHoje) - card("Saldo:", widget.bancoHoras?.saldo == null ? widget.saldo == null - ? "0:00" : widget.saldo! : widget.bancoHoras!.saldo!), - - const SizedBox(height: 20,), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30), - child: CustomText.text('Obs: Esses dados podem ser alterados ate o fechamento!'), - ), - const Padding( - padding: EdgeInsets.symmetric(horizontal: 30, vertical: 5), - child: Divider(height: 2,), - ), - - ListSolicitacoes( list, 90.0 * list.length, scrollController) - ]), - ), - ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: FloatingActionButton.extended( - backgroundColor: Config.corPri, - onPressed: () async { - CustomAlert.custom( - context: context, - titulo: 'LANÇAR SOLICITAÇÃO', - corpo: LancarSolicitacao( - data: widget.dia - ), - ); - }, - label: CustomText.text('Solicitação'.toUpperCase(), style: const TextStyle(fontSize: 20, color: Colors.white),) - ), - ); - } -} diff --git a/example/lib/ui/camera/foto_screen.dart b/example/lib/ui/camera/foto_screen.dart deleted file mode 100644 index 07a7cad..0000000 --- a/example/lib/ui/camera/foto_screen.dart +++ /dev/null @@ -1,235 +0,0 @@ -import 'dart:convert'; -import 'dart:typed_data'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; -import 'package:photo_view/photo_view.dart'; - -class ImageHero extends StatefulWidget { - List? foto; - - ImageHero(this.foto); - - @override - _ImageHeroState createState() => _ImageHeroState(); -} - -class _ImageHeroState extends State { - @override - Widget build(BuildContext context) { - return Hero( - tag: "foto", - child: Scaffold( - backgroundColor: Colors.black, - appBar: AppBar( - backgroundColor: Colors.black, - iconTheme: const IconThemeData(color: Colors.white), - ), - body: Stack(alignment: AlignmentDirectional.bottomCenter, children: [ - Container( - //height: MediaQuery.of(context).size.height * 0.78, - color: Colors.black, - child: widget.foto != null - ? PhotoView( - imageProvider: - MemoryImage(Uint8List.fromList(widget.foto!))) - : Container(), - ), - - Container( - height: 80, - color: Colors.black, - padding: const EdgeInsets.only(bottom: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - if (!Config.isWin) - GestureDetector( - onTap: () async { - Uint8List? img = await CameraService.getImage(); - if (img != null) { - carregar(context); - bool result = await context - .read() - .setPhoto(context.read().usuario!, - img, null); - if (result) { - context - .read() - .usuario - ?.funcionario - ?.foto = base64Encode(img); - Navigator.pop(context); - Navigator.pop( - context, - context - .read() - .usuario - ?.funcionario - ?.foto); - } else { - Navigator.pop(context); - CustomAlert.erro( - context: context, - mensage: - 'Não foi possivel atualizar sua foto, tente novamente mais tarde!', - ); - } - } - }, - child: const Icon( - Icons.camera, - color: Colors.white, - size: 50, - ), - ), - //SizedBox(width: 27,), - GestureDetector( - onTap: () async { - Uint8List? img = await CameraService.getGallery(); - - if (img != null) { - carregar(context); - bool result = await context - .read() - .setPhoto(context.read().usuario!, - img, null); - if (result) { - context - .read() - .usuario - ?.funcionario - ?.foto = base64Encode(img); - Navigator.pop(context); - Navigator.pop( - context, - context - .read() - .usuario - ?.funcionario - ?.foto); - } else { - Navigator.pop(context); - CustomAlert.erro( - context: context, - mensage: - 'Não foi possivel atualizar sua foto, tente novamente mais tarde!', - ); - } - } - }, - child: const Icon( - Icons.add_photo_alternate, - color: Colors.white, - size: 50, - ), - ), - ], - ), - ), - //SizedBox(height: 20,), - ]), - ), - ); - } -} - -/* -class ImageHero extends StatefulWidget { - var foto; - - ImageHero(this.foto); - - @override - _ImageHeroState createState() => _ImageHeroState(); -} - -class _ImageHeroState extends State { - @override - Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height; - double width = MediaQuery.of(context).size.width; - Orientation orientation = MediaQuery.of(context).orientation; - - return Hero(tag: "foto", - child: Scaffold(backgroundColor: Colors.black, - appBar: AppBar( - backgroundColor: Colors.black, - iconTheme: IconThemeData(color: Colors.white), - ), - body: SingleChildScrollView( - child: Container(height: orientation != Orientation.landscape ? height * 0.865 : null, - child: Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container(height: MediaQuery.of(context).size.height * 0.78, - color: Colors.black, - child: PhotoView( - imageProvider: MemoryImage( base64Decode( widget.foto )) - ), - ), - - Container(height: 50, color: Colors.black, - child: Row(mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () async { - List img = await CustomCamera().getImage(); - if(img != null){ - await context.read().setPhoto( - img, - onSuccess: () { - context.read().updateImg( base64Encode(img) ); - Navigator.pop(context); - }, - onFail: (s, c) { - WarningAlertBox( - context: context, - title: 'Falha', - messageText: s, - buttonText: 'ok' - ); - } - ); - } - }, - child: Icon(Icons.camera, color: Colors.white, size: 50,), - ), - SizedBox(width: 50,), - GestureDetector( - onTap: () async { - List img = await CustomCamera().getGallery(); - if(img != null){ - await context.read().setPhoto( - img, - onSuccess: () { - context.read().updateImg( base64Encode(img) ); - Navigator.pop(context); - }, - onFail: (s, c) { - WarningAlertBox( - context: context, - title: 'Falha', - messageText: s, - buttonText: 'ok' - ); - } - ); - } - }, - child: Icon(Icons.add_photo_alternate, color: Colors.white, size: 50,), - ), - ], - ), - ), - //SizedBox(height: 20,), - ]), - ), - ) - ), - ); - } -} - - - */ \ No newline at end of file diff --git a/example/lib/ui/comprovantes/comprovantes_screen.dart b/example/lib/ui/comprovantes/comprovantes_screen.dart deleted file mode 100644 index c016aad..0000000 --- a/example/lib/ui/comprovantes/comprovantes_screen.dart +++ /dev/null @@ -1,108 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import 'detelhes_comprovantes.dart'; - - -class ComprovantesScreen extends StatefulWidget { - - @override - _ComprovantesScreenState createState() => _ComprovantesScreenState(); -} - -class _ComprovantesScreenState extends State { - final GlobalKey _scaffoldKey = GlobalKey(); - ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); - - Apontamento? _apontamento; - - @override - void initState() { - _apontamento = context.read().apontamento.first ; - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return Consumer( - builder: (_, aponta, __){ - - return CustomScaffold.custom( - context: context, - key: _scaffoldKey, - height: 70, - appTitle: 'Meus Comprovantes\nApp/Asseface', - appbar: Center( - child: Container( - height: 40, - constraints: BoxConstraints(maxWidth: 400), - margin: EdgeInsets.only(left: 30, right: 30, bottom: 20, top: 5), - padding: EdgeInsets.symmetric(horizontal: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - dropdownColor: Colors.white, - value: _apontamento ?? aponta.apontamento.first, - iconSize: 20, - elevation: 0, - icon: Icon(Icons.arrow_drop_down, color: Colors.black,), - style: TextStyle(color: Colors.black), - underline: Container(), - onChanged: ( newValue) { - setState(() { - _apontamento = newValue; - }); - }, - items: aponta.apontamento. - map>(( value) { - return DropdownMenuItem( - value: value, - child: Padding( - padding: EdgeInsets.symmetric(vertical: 8), - child: CustomText.text(value.descricao ?? ''), - ), - ); - }).toList(), - ), - ), - ), - body: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: CustomText.text( - kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 'Esses comprovantes são apenas das marcações realizadasno aplicativo ou equipamento Asseponto facil (Relogio de ponto da Assecont)' - : 'Esses comprovantes são apenas das marcações\nrealizadasno aplicativo ou equipamento\nAsseponto facil (Relogio de ponto da Assecont)', - textAlign: TextAlign.center - ), - ), - Expanded( - child: !connectionStatus.hasConnection ? - Center(child: CustomText.text('Verifique sua Conexão com Internet')) : - aponta.apontamento.isEmpty ? - Center( - child: CustomText.text('Não possui comprovantes de marcações do App/AsseFace neste dia', - style: TextStyle(fontSize: 20),), - ) : _apontamento == null ? - Center( - child: CustomText.text('Seleciona um periodo', - style: TextStyle(fontSize: 20),), - ) : Center( - child: DetalhesComprovantes(_apontamento!) - ) - ), - ], - ), - ); - } - ); - } -} \ No newline at end of file diff --git a/example/lib/ui/comprovantes/detelhes_comprovantes.dart b/example/lib/ui/comprovantes/detelhes_comprovantes.dart deleted file mode 100644 index 5f46286..0000000 --- a/example/lib/ui/comprovantes/detelhes_comprovantes.dart +++ /dev/null @@ -1,115 +0,0 @@ -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -class DetalhesComprovantes extends StatefulWidget { - Apontamento apontamento; - - DetalhesComprovantes(this.apontamento); - - @override - _DetalhesComprovantesState createState() => _DetalhesComprovantesState(); -} - -class _DetalhesComprovantesState extends State { - bool load = false; - - @override - Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height - (WidgetsBinding.instance.window.padding.top); - double width = MediaQuery.of(context).size.width; - - return Consumer( - builder: (_, comprovantes,__) { - return Scaffold( - body: Container( - decoration: BoxDecoration( - border: Border(bottom: BorderSide(width: 70, color: Theme.of(context).scaffoldBackgroundColor)) - ), - width: width, - height: height, - alignment: Alignment.topCenter, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12), - child: FutureBuilder>( - future: comprovantes.listarMarcacoes( - context.read().usuario, - widget.apontamento - ), - builder: (_, snapshot){ - Widget resultado; - switch( snapshot.connectionState ){ - case ConnectionState.none : - case ConnectionState.waiting : - resultado = Center( - child: Container( - width: 50, - child: const LinearProgressIndicator(minHeight: 10, backgroundColor: Colors.transparent,) - ), - ); - break; - case ConnectionState.active : - case ConnectionState.done : - if( snapshot.hasError || !snapshot.hasData || snapshot.data == null){ - resultado = GestureDetector( - child: const Center( - child: Icon(Icons.autorenew_outlined, - color: Config.corPri, size: 70,), - ), - onTap: (){ - setState(() {}); - } - ); - }else { - if(snapshot.data != null && snapshot.data!.isNotEmpty){ - resultado = ListView( - children: snapshot.data!.map((e) { - return Hero( - tag: 'File-${e.marcacaoId}', - child: InkWell( - onTap: () async { - carregar(context); - Uint8List? file = await comprovantes.getPDF(context.read().usuario, e.marcacaoId!); - Navigator.pop(context); - if(file != null){ - Navigator.push(context, MaterialPageRoute( - builder: (context)=> FileHero('Comprovante de Ponto - ${DateFormat('dd-MM-yyy HH-mm', 'pt_BR').format(e.dataHora!)}', - memori: file, - ) - )); - }else{ - CustomSnackbar.context(context, 'Não foi possivel gerar seu comprovante, tente novamente mais tarde!', Colors.red); - } - }, - child: Card( - child: Padding( - padding: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? const EdgeInsets.all(8.0) : EdgeInsets.zero , - child: ListTile( - leading: Text(DateFormat('dd/MM\nE', 'pt_BR').format(e.dataHora!).toUpperCase()), - title: Text('Horario da Marcação: ${DateFormat('HH:mm', 'pt_BR').format(e.dataHora!)}'), - ), - ), - ), - ), - ); - }).toList(), - ); - }else{ - resultado = Center(child: CustomText.text('Nenhum comprovante disponivel')); - } - } - break; - } - return resultado; - } - ), - ), - ); - } - ); - } -} diff --git a/example/lib/ui/espelho/detelhes_espelho.dart b/example/lib/ui/espelho/detelhes_espelho.dart deleted file mode 100644 index 3fcf99c..0000000 --- a/example/lib/ui/espelho/detelhes_espelho.dart +++ /dev/null @@ -1,227 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - - -import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; -import 'package:assecontservices/assecontservices.dart'; - -class DetalhesEspelho extends StatefulWidget { - Apontamento apontamento; - DetalhesEspelho(this.apontamento); - - @override - _DetalhesEspelhoState createState() => _DetalhesEspelhoState(); -} - -class _DetalhesEspelhoState extends State { - @override - Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height - - (WidgetsBinding.instance.window.padding.top); - double width = MediaQuery.of(context).size.width; - - return FutureBuilder( - future: context.read().postEspelhoPontoPDF( - context.read().usuario, widget.apontamento), - builder: (_, snapshot) { - Widget resultado; - switch (snapshot.connectionState) { - case ConnectionState.none: - case ConnectionState.waiting: - resultado = Center( - child: Container( - width: 50, - child: const LinearProgressIndicator( - minHeight: 10, - backgroundColor: Colors.transparent, - )), - ); - break; - case ConnectionState.active: - case ConnectionState.done: - if (snapshot.hasError || - !snapshot.hasData || - snapshot.data == null) { - resultado = GestureDetector( - child: Icon( - Icons.autorenew_outlined, - color: Config.corPri, - size: 60, - ), - onTap: () { - context.read().postEspelhoPontoPDF( - context.read().usuario, - widget.apontamento); - }); - } else { - if (snapshot.data != null) { - - resultado = Scaffold( - body: Center( - child: Container( - decoration: BoxDecoration( - border: snapshot.data?.data != null - ? null - : Border( - bottom: BorderSide( - width: 70, - color: Theme.of(context) - .scaffoldBackgroundColor))), - width: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 600 : width, - height: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? null : height, - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey)), - child: Stack( - alignment: Alignment.center, - children: [ - SfPdfViewer.memory( - snapshot.data!.espelhoHtml!, - enableDocumentLinkAnnotation: false, - canShowPaginationDialog: false, - enableDoubleTapZooming: false, - enableTextSelection: false, - canShowScrollStatus: false, - canShowScrollHead: false, - canShowPasswordDialog: false, - pageSpacing: 4, - interactionMode: - PdfInteractionMode.pan), - /*SingleChildScrollView( - child: HtmlContentViewer( - htmlContent: snapshot.data!.espelhoHtml ?? '', - initialContentHeight: MediaQuery.of(context).size.height, - initialContentWidth: MediaQuery.of(context).size.width, - ), - ),*/ - - Hero( - tag: 'File', - child: GestureDetector( - child: Center( - child: Container( - height: 80, width: double.infinity, - alignment: Alignment.center, - color: Colors.black26, - child: Text('Clique aqui para baixar'), - ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - FileHero('Espelho de Ponto - ${widget.apontamento.descricao}', - file: kIsWeb ? null : snapshot.data!.espelho!, - memori: snapshot.data!.espelhoHtml!, - ))); - }, - ), - ), - ], - )), - ), - const SizedBox( - height: 10, - ), - if (snapshot.data?.data != null) - Padding( - padding: - const EdgeInsets.symmetric(vertical: 20), - child: CustomText.text('Espelho Assinado em: ' + - DateFormat('dd/MM/yyyy HH:mm') - .format(snapshot.data!.data!)), - ) - ], - )), - ), - floatingActionButtonLocation: - FloatingActionButtonLocation.centerFloat, - floatingActionButton: snapshot.data?.data != null - ? null - : widget.apontamento.datatermino - .compareTo(DateTime.now()) >= - 0 - ? null - : FloatingActionButton.extended( - backgroundColor: Config.corPri, - onPressed: () async { - await CustomAlert.custom( - context: context, - titulo: 'Assinar Espelho de Ponto', - corpo: Container( - padding: const EdgeInsets.only( - bottom: 20, top: 5), - child: CustomText.text( - 'Esta deacordo com as informações\ndo espelho de ponto?', - textAlign: TextAlign.center, - style: TextStyle(fontSize: 16), - ), - ), - txtBotaoSucess: 'CONFIRMAR', - txtBotaoCancel: 'REJEITAR', - funcSucess: () async { - bool result = await context - .read() - .postEspelhoStatus( - context - .read() - .usuario, - widget.apontamento, - true); - if (result) { - setState(() {}); - CustomAlert.sucess( - context: context, - mensage: - 'Espelho de ponto assinado.\n', - ); - } else { - CustomAlert.erro( - context: context, - mensage: - 'Não foi possivel assinar seu espelho\ntente novamente!', - ); - } - }, - funcCancel: () async { - await context - .read() - .postEspelhoStatus( - context - .read() - .usuario, - widget.apontamento, - false); - }); - }, - label: Padding( - padding: EdgeInsets.symmetric(horizontal: 5), - child: CustomText.text( - 'ASSINAR', - style: TextStyle( - fontSize: 20, color: Colors.white), - ), - )), - ); - } else { - resultado = Center( - child: CustomText.text('Nenhum Espelho disponivel')); - } - } - break; - } - return resultado; - }); - } -} diff --git a/example/lib/ui/espelho/espelho_screen.dart b/example/lib/ui/espelho/espelho_screen.dart deleted file mode 100644 index 21ec77f..0000000 --- a/example/lib/ui/espelho/espelho_screen.dart +++ /dev/null @@ -1,94 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import 'detelhes_espelho.dart'; - - -class EspelhoScreen extends StatefulWidget { - - @override - _EspelhoScreenState createState() => _EspelhoScreenState(); -} - -class _EspelhoScreenState extends State { - final GlobalKey _scaffoldKey = GlobalKey(); - ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); - - @override - void initState() { - List aponta = context.read().apontamento; - if(aponta.length > 0)context.read().setMesAtual(aponta.first); - super.initState(); - } - - - @override - Widget build(BuildContext context) { - //double width = MediaQuery.of(context).size.width; - - return Consumer2( - builder: (_, espelho, aponta, __){ - return CustomScaffold.custom( - context: context, - height: 70, - key: _scaffoldKey, - appTitle: 'Meu Espelhos', - expanAppbar: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center( - child: Container( - height: 40, - margin: const EdgeInsets.only(left: 30, right: 30, bottom: 20, top: 5), - padding: const EdgeInsets.symmetric(horizontal: 10), - constraints: BoxConstraints(maxWidth: 400), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - dropdownColor: Colors.white, - value: espelho.dropdowndata, - iconSize: 20, - elevation: 0, - icon: const Icon(Icons.arrow_drop_down, color: Colors.black,), - style: const TextStyle(color: Colors.black), - underline: Container(), - onChanged: ( newValue) { - espelho.dropdowndata = newValue!; - espelho.apontamento = aponta.apontamento.firstWhere((e) => e.descricao == newValue); - }, - items: aponta.apontamento.map((e) => e.descricao). - toList().map>(( value) { - return DropdownMenuItem( - value: value, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: CustomText.text(value ?? ''), - ), - ); - }).toList(), - ), - ), - ), - ], - ), - body: Container( - child: !connectionStatus.hasConnection ? - Center(child: CustomText.text('Verifique sua Conexão com Internet')) : - espelho.apontamento == null ? - Center( - child: CustomText.text('Usuario nao possui periodo de apontamento', - style: TextStyle(fontSize: 16), textAlign: TextAlign.center,), - ) : Center(child: DetalhesEspelho(espelho.apontamento!)) - ), - ); - } - ); - } -} \ No newline at end of file diff --git a/example/lib/ui/ferias/ferias.dart b/example/lib/ui/ferias/ferias.dart deleted file mode 100644 index 5455c4f..0000000 --- a/example/lib/ui/ferias/ferias.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:assecontservices/assecontservices.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/rendering.dart'; - -class FeriasPage extends StatefulWidget { - @override - _FeriasPageState createState() => _FeriasPageState(); -} - -class _FeriasPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: CustomText.text("Férias"), - centerTitle: true, - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CustomText.text( - 'Aqui será a página para exibir as FÉRIAS', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - ], - ), - ), - ); - } -} diff --git a/example/lib/ui/home/componentes/custom_listTile.dart b/example/lib/ui/home/componentes/custom_listTile.dart deleted file mode 100644 index 0b6c4ed..0000000 --- a/example/lib/ui/home/componentes/custom_listTile.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:assecontservices/assecontservices.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class CustomListTile extends StatelessWidget { - Widget icon; - String titulo; - String valor; - VoidCallback? function; - - CustomListTile(this.icon, this.titulo, this.valor, this.function); - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - - return Padding( - padding: EdgeInsets.symmetric(horizontal: width * 0.025, vertical: 2), - child: Card( - child: InkWell( - onTap: function, - child: Container( - padding: - EdgeInsets.symmetric(horizontal: width * 0.02, vertical: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 2, - child: Row( - children: [ - icon == null - ? Container() - : Padding( - padding: EdgeInsets.only(right: 12), - child: icon, - ), - Expanded( - child: CustomText.text( - titulo, - maxLines: 1, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: icon == null ? 12 : 16, - ), - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.only(right: 5), - child: CustomText.text( - valor, - textAlign: TextAlign.end, - maxLines: 1, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: icon == null ? 14 : 18, - ), - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/example/lib/ui/home/componentes/custom_listTile_web.dart b/example/lib/ui/home/componentes/custom_listTile_web.dart deleted file mode 100644 index 49f897f..0000000 --- a/example/lib/ui/home/componentes/custom_listTile_web.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:assecontservices/assecontservices.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class CustomListTileWeb extends StatelessWidget { - Widget? icon; - String titulo; - String valor; - VoidCallback? function; - - CustomListTileWeb(this.icon, this.titulo, this.valor, this.function); - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - - return Container( - padding: EdgeInsets.symmetric(horizontal: width * 0.025, vertical: 2), - child: Card( - child: InkWell( - onTap: function, - child: Container( - height: 200, width: 200, - padding: EdgeInsets.symmetric(horizontal: width * 0.02, vertical: 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 2, - child: icon == null - ? Container() - : icon!, - ), - Expanded( - child: CustomText.text( - titulo, - maxLines: 1, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: icon == null ? 12 : 16, - ), - ), - ), - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.only(right: 5), - child: CustomText.text( - valor, - textAlign: TextAlign.end, - maxLines: 1, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: icon == null ? 18 : 22, - ), - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/example/lib/ui/home/componentes/load_widget.dart b/example/lib/ui/home/componentes/load_widget.dart deleted file mode 100644 index 203febb..0000000 --- a/example/lib/ui/home/componentes/load_widget.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:shimmer/shimmer.dart'; -import 'package:assecontservices/assecontservices.dart'; - -Widget shimmerWidget(double width, BuildContext context) { - return Container( - child: Shimmer.fromColors( - baseColor: context.watch().darkTemas ? Colors.grey[800]! : Colors.grey[300]!, - highlightColor: context.watch().darkTemas ? Colors.grey : Colors.white, - child: Container( - padding: EdgeInsets.symmetric(horizontal: width * 0.026), - child: Column( - children:[ - const SizedBox(height: 10,), - Container(margin: const EdgeInsets.only(bottom: 10,), - color: Colors.black, - height: 50, - ), - Container(margin: const EdgeInsets.only(bottom: 10), - color: Colors.black, - height: 50, - ), - Container(margin: const EdgeInsets.only(bottom: 10), - color: Colors.black, - height: 50, - ), - ] - ), - ), - ), - ); -} \ No newline at end of file diff --git a/example/lib/ui/home/componentes/resultados.dart b/example/lib/ui/home/componentes/resultados.dart deleted file mode 100644 index 0419a31..0000000 --- a/example/lib/ui/home/componentes/resultados.dart +++ /dev/null @@ -1,196 +0,0 @@ - - -import 'package:assecontservices/assecontservices.dart'; - - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import '../../../controller/tutor_controller.dart'; -import 'custom_listTile.dart'; -import 'custom_listTile_web.dart'; -import 'load_widget.dart'; - -class ResiltatosView extends StatefulWidget { - UsuarioPonto? usuario; - HomePontoModel? homeModel; - ScrollController? scrollController; - - ResiltatosView(this.usuario, this.homeModel, this.scrollController); - - @override - State createState() => _ResiltatosViewState(); -} - -class _ResiltatosViewState extends State { - Widget icon = Container(); - VoidCallback? function; - - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - dynamic data = DateFormat('EEEE d MMM y', 'pt_BR').format(DateTime.now()); - - return Container( - padding: const EdgeInsets.all(15), - decoration: BoxDecoration( - border: Border(bottom: BorderSide(width: 80, - color: Theme.of(context).scaffoldBackgroundColor))), - child: widget.usuario == null - ? Container( - key: context.read().keyResumo, - child: shimmerWidget(width, context), - ) : Card( - //color: Colors.white.withOpacity(0.95), - child: Column( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) - Column( - children: [ - CustomText.text( - context.watch().horarioAtual, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - letterSpacing: 2), - ), - CustomText.text(data - .toUpperCase() - .toString() - .replaceAll("-FEIRA", ""), - style: TextStyle(fontSize: 12), textAlign: TextAlign.center), - ], - ), - SizedBox(height: 10,), - //const SizedBox(height: 10,), - Row(children: [ - const SizedBox( - width: 50, - ), - CustomText.text( - 'Resumo:', - style: const TextStyle( - //fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ]), - const SizedBox( - width: 5, - ), - CustomText.text( - widget.usuario?.periodo?.descricao?.toUpperCase() ?? '', - style: const TextStyle( - //fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ], - ), - ExpandedOrContainer( - key: context.read().keyResumo, - isContainer: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone, - height: 230, - //height: 80.0 * (home.homeModel?.resultadoItemList?.length ?? 1), - child: ListView.builder( - controller: widget.scrollController, - scrollDirection: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? Axis.horizontal : Axis.vertical, - itemBuilder: (BuildContext context, int index) { - customIcon(widget.homeModel?.resultadosList![index].id); - return kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? - CustomListTileWeb( - icon, - widget.homeModel?.resultadosList![index].titulo ?? '', - widget.homeModel?.resultadosList![index].valor ?? '', - (widget.usuario?.app ?? false) ? function - : () { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - } - ) - : CustomListTile( - icon, - widget.homeModel?.resultadosList![index].titulo ?? '', - widget.homeModel?.resultadosList![index].valor ?? '', - (widget.usuario?.app ?? false) ? function - : () { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - }); - }, - itemCount: - (widget.homeModel?.resultadosList?.length ?? 0), - ), - ), - ], - ), - ) - ); - } - - - customIcon(int? desc) { - switch (desc) { - case 2: - icon = Transform.rotate( - angle: 12.0, - child: Icon( - Icons.arrow_forward_outlined, - size: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 60 : 30, - ), - ); - function = () { - Navigator.pushNamed(context, '/marcacoes', arguments: 2); - }; - break; - case 3: - icon = Transform.rotate( - angle: 15.0, - child: Icon(Icons.arrow_forward_outlined, size: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 60 : 30), - ); - function = () { - Navigator.pushNamed(context, '/marcacoes', arguments: 1); - }; - break; - case 4: - icon = Icon(Icons.medical_services_outlined, size: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 60 : 30); - function = () { - Navigator.pushNamed(context, '/marcacoes', arguments: 3); - }; - break; - case 5: - icon = Icon(Icons.account_balance, size: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 60 : 30); - function = () { - Navigator.pushNamed( - context, - '/banco', - ); - }; - break; - case 1: - icon = Icon(Icons.timer_off_outlined, size: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 60 : 30); - function = () { - Navigator.pushNamed(context, '/marcacoes', arguments: 4); - }; - break; - default: - icon = Container(); - function = null; - break; - } - } -} - - diff --git a/example/lib/ui/home/home.dart b/example/lib/ui/home/home.dart deleted file mode 100644 index f4b82cb..0000000 --- a/example/lib/ui/home/home.dart +++ /dev/null @@ -1,284 +0,0 @@ - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import '../../controller/gps.dart'; -import '../../controller/home_controller.dart'; -import '../../controller/tutor_controller.dart'; - -import '../banco_horas/banco_screen.dart'; -import '../comprovantes/comprovantes_screen.dart'; -import '../espelho/espelho_screen.dart'; -import '../marcacoes/Marcacoes.dart'; -import '../registro/screen_registro.dart'; -import '../solicitacoes/solicitacoes_screen.dart'; -import 'componentes/resultados.dart'; - -class Home extends StatefulWidget { - @override - _HomePageState createState() => _HomePageState(); -} - -class _HomePageState extends State { - final ScrollController scrollController = ScrollController(); - - bool load = false; - - deleteHist() { - RegistroManger().deleteHistorico(); - } - - @override - void initState() { - context.read().getHome(); - context - .read() - .getPeriodo(context.read().usuario); - - RegistroManger().enviarMarcacoes(); - deleteHist(); - if (!kIsWeb) { - context.read().init(context); - } else { - BiometriaAlert(context); - } - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - - @override - Widget build(BuildContext context) { - - - return Container( - color: context.watch().darkTemas - ? Theme.of(context).appBarTheme.backgroundColor - : Config.corPribar, - child: SafeArea( - child: Consumer(builder: (_, user, __) { - return CustomScaffold.home( - context: context, - height: 170 + MediaQuery.of(context).padding.top, - keyListMenu: context.read().keyListMenu, - listMenu: [ - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) - CustomMenuItem( - const Icon(Icons.fingerprint_sharp), - 'Registrar', - () { - context.read().setPage(0); - }, - isSelect: context.watch().page == 0, - ), - CustomMenuItem( - const Icon(Icons.calendar_month_sharp), - 'Marcações', - () { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(1); - else Navigator.pushNamed(context, '/marcacoes'); - }, - isSelect: context.watch().page == 1 - ), - if (!(user.usuario?.app ?? false)) - CustomMenuItem( - const Icon(Icons.receipt_rounded), - 'Comprovantes', - () { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(5); - else Navigator.pushNamed(context, '/comprovantes'); - }, - isSelect: context.watch().page == 5, - ), - CustomMenuItem( - const Icon( - CupertinoIcons.doc_text_fill, - ), - 'Espelho de Ponto', - () { - if (user.usuario?.app ?? false) { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(2); - else Navigator.pushNamed(context, '/espelho'); - } else { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - } - }, - isSelect: context.watch().page == 2, - ), - CustomMenuItem( - const Icon( - Icons.account_balance, - ), - 'Banco Horas', - () { - if (user.usuario?.app ?? false) { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(3); - else Navigator.pushNamed(context, '/banco'); - } else { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - } - }, - isSelect: context.watch().page == 3, - ), - CustomMenuItem( - const Icon(Icons.question_answer), - 'Solicitações', - () { - if (user.usuario?.app ?? false) { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(4); - else Navigator.pushNamed(context, '/solicitacoes'); - } else { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - } - }, - isSelect: context.watch().page == 4, - ), - if (user.usuario?.app ?? false) - CustomMenuItem( - const Icon(Icons.receipt_rounded), - 'Comprovantes', - () { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(5); - else Navigator.pushNamed(context, '/comprovantes'); - }, - isSelect: context.watch().page == 5, - ), - - CustomMenuItem( - const Icon(Icons.monetization_on_outlined), - 'Holerites', - () { - if (user.usuario?.app ?? false) { - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) context.read().setPage(6); - else Navigator.pushNamed(context, '/holerites'); - } else { - CustomAlert.info( - context: context, - mensage: - 'Você está utilizando a Versão free.\nContate seu gestor para contratar a versão máster!\n', - ); - } - }, - isSelect: context.watch().page == 6, - ), - ], - keyMenu: context.read().keyMenu, - key1: context.read().keyMenu1, - key2: context.read().keyMenu2, - key3: context.read().keyMenu3, - key4: context.read().keyMenu4, - key5: context.read().keyMenu5, - foto: user.usuario?.funcionario?.foto, - nome: user.usuario?.funcionario?.nome, - cargo: user.usuario?.funcionario?.cargo, - dados: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomText.text( - 'Olá, ' + (user.usuario?.funcionario?.nome ?? ''), - maxLines: 1, - overflow: TextOverflow.visible, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Config.corPri), - ), - CustomText.text( - user.usuario?.funcionario?.cargo ?? '', - maxLines: 1, - style: const TextStyle( - fontSize: 14, - color: Config.corPri, - letterSpacing: 1, - ), - ), - const SizedBox( - height: 20, - ), - ], - ), - appTitle: 'ASSEPONTO APP', - body: PageView( - controller: HomeController.pageController, - pageSnapping: false, - physics: const NeverScrollableScrollPhysics(), - children: [ - ResiltatosView(user.usuario,user.homeModel, scrollController), - MarcacoesPage(), - EspelhoScreen(), - BancoHorasScreen(), - Solicitacoes(), - ComprovantesScreen(), - HoleriteScreen(), - ] - ), - buttom: context.watch().page != 0 ? null : FloatingActionButton.extended( - key: context.read().keyRegistro, - backgroundColor: Config.corPri, - onPressed: () async { - if(kIsWeb){ - if(user.usuario?.funcionario?.permitirMarcarPontoWeb ?? true){ - await context.read().postPontoMarcar( - context, context.read().usuario!, null, null, - ); - }else{ - CustomAlert.info( - context: context, - mensage: 'Você não tem permissão para marca o ponto!', - ); - } - }else{ - if (user.usuario?.funcionario?.permitirMarcarPonto ?? true) { - if (context - .read() - .usuario - ?.funcionario - ?.capturarGps ?? - false) { - context.read().localizacao(); - } - Navigator.push( - context, - MaterialPageRoute(builder: (context) => RegistroScreen()), - ); - //setState(() {}); - } else { - CustomAlert.info( - context: context, - mensage: 'Você não tem permissão para marca o ponto!', - ); - } - } - }, - label: CustomText.text( - 'REGISTRAR', - style: const TextStyle(fontSize: 20, color: Colors.white), - ) - ), - ); - }), - ), - ); - } - - -} diff --git a/example/lib/ui/login/esqueci_senha_screen.dart b/example/lib/ui/login/esqueci_senha_screen.dart deleted file mode 100644 index ee095d1..0000000 --- a/example/lib/ui/login/esqueci_senha_screen.dart +++ /dev/null @@ -1,153 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - - -import 'package:assecontservices/assecontservices.dart'; - - -class EsqueciSenhaScreen extends StatefulWidget { - final GlobalKey scaffoldKey; - EsqueciSenhaScreen(this.scaffoldKey); - - @override - State createState() => _EsqueciSenhaScreenState(); -} - -class _EsqueciSenhaScreenState extends State { - final GlobalKey _formKey = GlobalKey(); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(20.0), - child:Form( - key: _formKey, - child: ListView( - children: [ - _menssagem(), - const SizedBox(height: 13,), - - textFormFieldEmail(context), - - const SizedBox(height: 13,), - _enviarSenha(context), - ], - )), - ); - } - - Container _menssagem( ) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: CustomText.text("Informe o seu e-mail para o envio de sua senha", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 24, color: Colors.white,), - ), - ); - } - - //Enviar Senha - Widget _enviarSenha(BuildContext context) { - double w = MediaQuery.of(context).size.width; - - return Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - width: w * 0.4 > 200 ? 200 : w * 0.4, - //margin: EdgeInsets.symmetric(horizontal: 15), - alignment: Alignment.center, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), - color: Colors.white, - ), - child: TextButton( - onPressed: () { - context.read().setPage(0); - }, - child: Center( - child: CustomText.text( 'VOLTAR', - style: TextStyle(fontSize: 20, color: Config.corPribar),), - ), - ), - ), - Container( - width: w * 0.4 > 200 ? 200 : w * 0.4, - //margin: EdgeInsets.symmetric(horizontal: 15), - alignment: Alignment.center, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), - color: Colors.white, - ), - child: TextButton( - onPressed: () { - _clickLogin(context); - }, - child: Center( - child: CustomText.text('ENVIAR', - style: TextStyle(fontSize: 20, color: Config.corPribar),), - ), - ), - ) - ]); - } - - textFormFieldEmail(BuildContext context) { - return Container( - padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15), - child: TextFormField( - keyboardType: TextInputType.emailAddress, - controller: context.watch().email, - style: const TextStyle(color: Colors.white), - decoration: InputDecoration( - enabledBorder: const UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)), - border: const UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)), - hintStyle: const TextStyle( - color: Colors.white, - ), - errorStyle: TextStyle( color: Colors.red[100]), - hintText: "E-mail", - prefixIcon: const Padding( - padding: EdgeInsets.only(left: 5,right: 10), - child: Icon( - Icons.person, - color: Colors.white, - size: 25, - ), - ), - ), - validator: (email){ - if(!emailValid(email!)){ - return 'E-mail inválido'; - }else{ - return null; - } - }, - ), - ); - } - - _clickLogin(BuildContext context) async { - if (_formKey.currentState!.validate()) { - carregar(context,); - bool result = await context.read().sendPass( - context.read().email.text, - ); - if(result){ - Navigator.pop(context); - context.read().setPage(0); - await CustomAlert.sucess( - context: context, - mensage: 'Nova senha enviada para seu email!\n', - ); - }else{ - Navigator.pop(context); - await CustomAlert.erro( - context: context, - mensage: 'Não foi possivel enviar sua senha, tente novamente!', - ); - } - } - } -} diff --git a/example/lib/ui/login/login_screen.dart b/example/lib/ui/login/login_screen.dart deleted file mode 100644 index 33e4b23..0000000 --- a/example/lib/ui/login/login_screen.dart +++ /dev/null @@ -1,352 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import 'package:assecontservices/assecontservices.dart'; - - - -class LoginScreen extends StatefulWidget { - const LoginScreen( - this.scaffoldKey, - ); - - final GlobalKey scaffoldKey; - - @override - _LoginScreenState createState() => _LoginScreenState(); -} - -class _LoginScreenState extends State { - final GlobalKey _formKey = GlobalKey(); - final GlobalKey _formKeyEmail = GlobalKey(); - bool load = false; - bool loadAcessar = true; - - @override - void initState() { - super.initState(); - loadAcessar = !kIsWeb; - } - - @override - Widget build(BuildContext context) { - return Container( - child: SingleChildScrollView( - padding: const EdgeInsets.all(25.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - loadAcessar ? acessar() : loginSenha(), - const SizedBox( - height: 20, - ), - !load - ? Container( - margin: const EdgeInsets.symmetric(horizontal: 15), - alignment: Alignment.center, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), - color: Colors.white, - ), - child: TextButton( - onPressed: () { - loadAcessar - ? _clickAcesso(context - .read() - .email - .text - .trim()) - : _clickLogin( - context.read().email.text.trim(), - context.read().senha.text); - }, - child: Center( - child: CustomText.text( - loadAcessar ? 'ACESSAR' : 'LOGIN', - style: TextStyle( - fontSize: 20, color: Config.corPribar), - ), - ), - ), - ) - : const Center( - child: CircularProgressIndicator(), - ), - const SizedBox( - height: 20, - ), - Container( - alignment: Alignment.centerRight, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), - ), - child: TextButton( - onPressed: () { - context.read().setPage(1); - }, - child: Center( - child: CustomText.text( - 'ESQUECEU A SENHA', - style: TextStyle( - color: Colors.white70, - fontWeight: FontWeight.w900, - fontSize: 12 - ), - ), - ), - ), - ), - if(!Config.isIOS) - Container( - alignment: Alignment.centerRight, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), - ), - child: TextButton( - onPressed: () { - PrimeiroAcessoAlert(context); - }, - child: Center( - child: CustomText.text( - 'PRIMEIRO ACESSO', - style: TextStyle( - color: Colors.white70, - fontWeight: FontWeight.w900, - fontSize: 12 - ), - ), - ), - ), - ), - ])), - ); - } - - Widget acessar() { - return Form( - key: _formKeyEmail, - child: Container( - padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15), - child: TextFormField( - keyboardType: TextInputType.emailAddress, - controller: context.watch().email, - style: const TextStyle(color: Colors.white), - decoration: InputDecoration( - suffixIcon: IconButton( - icon: const Icon( - Icons.clear, - color: Colors.white54, - size: 25, - ), - onPressed: () { - context.read().email.clear(); - }), - enabledBorder: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - border: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - hintStyle: const TextStyle( - color: Colors.white, - ), - errorStyle: TextStyle(color: Colors.red[100]), - hintText: "E-mail", - prefixIcon: const Padding( - padding: EdgeInsets.only(left: 5, right: 10), - child: Icon( - Icons.person, - color: Colors.white, - size: 25, - ), - ), - ), - validator: (email) { - if (!emailValid(email!)) { - return 'E-mail inválido'; - } else { - return null; - } - }, - ), - ), - ); - } - - Widget loginSenha() { - final focus = FocusNode(); - - return Form( - key: _formKey, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15), - child: TextFormField( - keyboardType: TextInputType.emailAddress, - controller: context.watch().email, - style: const TextStyle(color: Colors.white), - decoration: InputDecoration( - enabledBorder: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - border: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - hintStyle: const TextStyle( - color: Colors.white, - ), - errorStyle: TextStyle(color: Colors.red[100]), - hintText: "E-mail", - suffix: GestureDetector( - child: const Icon( - Icons.clear, - color: Colors.white54, - size: 25, - ), - onTap: () { - context.read().email.clear(); - }), - - prefixIcon: const Padding( - padding: EdgeInsets.only(left: 5, right: 10), - child: Icon( - Icons.person, - color: Colors.white, - size: 25, - ), - ), - ), - onSaved: (t){ - FocusScope.of(context).requestFocus(focus); - }, - validator: (email) { - if (!emailValid(email!)) { - return 'E-mail inválido'; - } else { - return null; - } - }, - ), - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15), - child: TextFormField( - keyboardType: TextInputType.visiblePassword, - controller: context.watch().senha, - style: const TextStyle(color: Colors.white), - focusNode: focus, - decoration: InputDecoration( - suffixIcon: GestureDetector( - child: const Icon( - Icons.clear, - color: Colors.white54, - size: 25, - ), - onTap: () { - context.read().senha.clear(); - }), - enabledBorder: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - border: const UnderlineInputBorder( - borderSide: BorderSide(color: Colors.white)), - hintStyle: const TextStyle( - color: Colors.white, - ), - errorStyle: TextStyle(color: Colors.red[100]), - hintText: "Senha", - alignLabelWithHint: true, - prefixIcon: const Padding( - padding: EdgeInsets.only(left: 5, right: 10), - child: Icon( - Icons.lock_outline, - color: Colors.white, - size: 25, - ), - ), - ), - obscureText: true, - onSaved: (value){ - _clickLogin( - context.read().email.text.trim(), - context.read().senha.text); - }, - validator: (senha) { - if (senha!.isEmpty || senha.length < 0) { - return "Digite sua senha!"; - } else { - return null; - } - }, - ), - ), - Container( - child: Theme( - data: Theme.of(context).copyWith( - disabledColor: Colors.white, - unselectedWidgetColor: Colors.white), - child: CheckboxListTile( - title: CustomText.text( - "Manter-se Logado", - style: TextStyle(color: Colors.white), - ), - activeColor: Colors.redAccent, - value: context.watch().status, - onChanged: (valor) { - context.read().status = valor!; - }), - )) - ], - ), - ); - } - - _clickLogin(String email, String senha) async { - if (_formKey.currentState!.validate()) { - bool? result = await context.read().auth(context, email, senha, false); - - if(result ?? false){ - Navigator.pushNamedAndRemoveUntil(context, '/home', (route) => false); - } - } - } - - _clickAcesso(String email) async { - if (_formKeyEmail.currentState!.validate()) { - if (context.read().bio) { - if (email == context.read().uemail) { - bool? result = await context.read().auth(context, - email, '', true, - ).onError((error, stackTrace) { - setState(() { - loadAcessar = false; - }); - }); - - if(result ?? false){ - Config.usenha = context.read().senha.text; - Navigator.pushNamedAndRemoveUntil(context, '/home', (route) => false); - }else{ - setState(() { - loadAcessar = false; - }); - } - } else { - setState(() { - loadAcessar = false; - }); - } - } else { - setState(() { - loadAcessar = false; - }); - } - } else { - setState(() { - loadAcessar = false; - }); - } - } -} - -//isabelaf@assecont.com.br diff --git a/example/lib/ui/login/start_screen.dart b/example/lib/ui/login/start_screen.dart deleted file mode 100644 index 4d7b266..0000000 --- a/example/lib/ui/login/start_screen.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import 'esqueci_senha_screen.dart'; -import 'login_screen.dart'; - -class StartScreen extends StatelessWidget { - final GlobalKey _scaffoldKey = GlobalKey(); - final PageController pageController = PageController(); - - - @override - Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height; - double width = MediaQuery.of(context).size.width; - return Scaffold(key: _scaffoldKey, - body: Container( - alignment: Alignment.center, - constraints: BoxConstraints.expand(), - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Config.corPribar2, Config.corPribar] - ) - ), - child: ChangeNotifierProvider( - create: (_) => PageManager(pageController), - child: SingleChildScrollView( - child: Container( - width: width,height: height, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Container( - //width: width, - alignment: Alignment.bottomCenter, - padding: EdgeInsets.only( - left: height * 0.050, right: height * 0.050, //top: height * 0.050 - ), - child: Image.asset("assets/imagens/logo-assepontoweb.png", - fit: BoxFit.fitWidth, - ) - ), - ), - - Expanded( - flex: 2, - child: Container( - //height: height * 0.60, - constraints: BoxConstraints(maxWidth: 500), - alignment: Alignment.topCenter, - child: PageView( - controller: pageController, - physics: const NeverScrollableScrollPhysics(), - children: [ - LoginScreen(_scaffoldKey), - EsqueciSenhaScreen(_scaffoldKey) - ]), - ), - ), - ] - ), - ), - ), - ), - ), - ); - } - -} diff --git a/example/lib/ui/marcacoes/Marcacoes.dart b/example/lib/ui/marcacoes/Marcacoes.dart deleted file mode 100644 index bf75a69..0000000 --- a/example/lib/ui/marcacoes/Marcacoes.dart +++ /dev/null @@ -1,85 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - - -import 'package:assecontservices/assecontservices.dart'; - -import '../../controller/home_controller.dart'; -import 'detelhes_marcacao.dart'; - -class MarcacoesPage extends StatefulWidget { - int? filtro; - MarcacoesPage({this.filtro}); - - @override - _MarcacoesState createState() => _MarcacoesState(); -} - -class _MarcacoesState extends State { - final GlobalKey _scaffoldKey = new GlobalKey(); - ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); - - final CalendarWeekController _controller = CalendarWeekController(); - - - @override - void initState() { - if(kIsWeb) widget.filtro = context.read().filtro; - context.read().getEspelho(filtro: widget.filtro); - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return Consumer( - builder: (_, marcacao, __){ - - return CustomScaffold.calendario( - key: _scaffoldKey, - context: context, - appTitle:'Marcações', - funcData: (DateTime datetime) { - marcacao.data = datetime; - }, - listdecoration: marcacao.listdecoration, - controller: _controller, - dataInit: marcacao.data, - dataMin: context.read().usuario?.periodo?.dataInicial, - dataMax: context.read().usuario?.periodo?.dataFinal, - body: Center( - child: !connectionStatus.hasConnection ? CustomText.text('Verifique sua Conexão com Internet') : - FutureBuilder( - future: marcacao.getMarcacaoDia(), - builder: (context, snapshot){ - Widget resultado; - switch( snapshot.connectionState ){ - case ConnectionState.none : - case ConnectionState.waiting : - resultado = const CircularProgressIndicator(); - break; - case ConnectionState.active : - case ConnectionState.done : - if( snapshot.hasError ){ - resultado = GestureDetector( - child: Icon(Icons.autorenew_outlined, - color: Config.corPri, size: 70,), - onTap: (){ - setState(() {}); - } - ); - }else { - resultado = DetalhesMarcacao(snapshot.data, marcacao.data); - } - break; - } - return resultado; - }, - ) - ) - ); - } - ); - } -} diff --git a/example/lib/ui/marcacoes/detelhes_marcacao.dart b/example/lib/ui/marcacoes/detelhes_marcacao.dart deleted file mode 100644 index 4b04574..0000000 --- a/example/lib/ui/marcacoes/detelhes_marcacao.dart +++ /dev/null @@ -1,117 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -import '../solicitacoes/lancar_solicitacao.dart'; -import '../solicitacoes/solicitacoes_screen.dart'; - - -class DetalhesMarcacao extends StatefulWidget { - Marcacao? listaMarcacao; - DateTime? dia; - DetalhesMarcacao(this.listaMarcacao, this.dia); - - @override - _DetalhesMarcacaoState createState() => _DetalhesMarcacaoState(); -} - -class _DetalhesMarcacaoState extends State { - final ScrollController scrollController = ScrollController(); - Widget card(String menu, String valor){ - return Container( - padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 35), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomText.text(menu, style: const TextStyle(fontSize: 20),), - CustomText.text(valor, style: const TextStyle(fontSize: 20)), - ], - ), - ); - } - - @override - Widget build(BuildContext context) { - List list = context.watch().memorandoDia(widget.dia); - - return Scaffold( - body: Container( - decoration: (UserPontoManager().usuario?.app ?? false) ? - BoxDecoration( - border: Border(bottom: BorderSide(width: 80, - color: Theme.of(context).scaffoldBackgroundColor)) - ) : null, - height: MediaQuery.of(context).size.height, - child: SingleChildScrollView( - controller: scrollController, - child: Column(crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 15,), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30), - child: CustomText.text('Marcações'), - ), - const SizedBox(height: 5,), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 30), - child: Center( - child: CustomText.text(widget.listaMarcacao?.marcacao.toString(). - replaceAll("[", "").replaceAll("]", "").replaceAll(",", " -") ?? "", - maxLines: 2, style: const TextStyle(fontSize: 18), - ), - ), - ), - const Padding( - padding: EdgeInsets.symmetric(horizontal: 30, vertical: 10), - child: Divider(height: 2,), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30), - child: CustomText.text('Resumo'), - ), - const SizedBox(height: 5,), - card("Horas Extras:", widget.listaMarcacao?.resultado?.extras ?? "0:00"), - const SizedBox(height: 10,), - card("Noturno:", widget.listaMarcacao?.resultado?.noturno ?? "0:00"), - const SizedBox(height: 10,), - card("Abonos:", widget.listaMarcacao?.resultado?.abono ?? "0:00"), - const SizedBox(height: 10,), - card("Descontos", widget.listaMarcacao?.resultado?.descontos ?? "0:00"), - const SizedBox(height: 10,), - card("Falta:", widget.listaMarcacao?.resultado?.faltasDias.toString() ?? "0"), - const SizedBox(height: 10,), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30), - child: CustomText.text('Obs: Esses dados podem ser alterados ate o fechamento!'), - ), - - const Padding( - padding: EdgeInsets.symmetric(horizontal: 30, vertical: 5), - child: Divider(height: 2,), - ), - //Expanded(child: null) - ListSolicitacoes( list, 90.0 * list.length, scrollController) - ]), - ), - ), - floatingActionButtonLocation: (UserPontoManager().usuario?.app ?? false) ? - FloatingActionButtonLocation.centerFloat : null, - floatingActionButton: (UserPontoManager().usuario?.app ?? false) ? - FloatingActionButton.extended( - backgroundColor: Config.corPri, - onPressed: () async { - CustomAlert.custom( - context: context, - titulo: 'LANÇAR SOLICITAÇÃO', - corpo: Container( - child: LancarSolicitacao( - data: widget.dia - ) - ), - ); - }, - label: CustomText.text('Solicitação'.toUpperCase(), style: const TextStyle(fontSize: 20, color: Colors.white),) - ) : null, - ); - } -} diff --git a/example/lib/ui/password/alterar_senha.dart b/example/lib/ui/password/alterar_senha.dart deleted file mode 100644 index 9fb882b..0000000 --- a/example/lib/ui/password/alterar_senha.dart +++ /dev/null @@ -1,165 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'dart:ui'; - - -import 'package:assecontservices/assecontservices.dart'; - - - -Future AlterarSenhaModal(BuildContext context){ - return CustomAlert.custom( - context: context, - titulo: 'Alterar Senha'.toUpperCase(), - corpo: AlertSenha() - ); -} - -class AlertSenha extends StatefulWidget { - - @override - _AlertSenhaState createState() => _AlertSenhaState(); -} - -class _AlertSenhaState extends State { - final GlobalKey _formKey = GlobalKey(); - final TextEditingController senhaAtual = TextEditingController(); - final TextEditingController senhaNova = TextEditingController(); - bool _showSenhaAtual = true; - bool _showSenhaNova = true; - - - @override - Widget build(BuildContext context) { - - return Container( - child: Form( - key: _formKey, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CustomText.text( - "Deseja trocar a senha?", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 20), - ), - const SizedBox(height: 12,), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10,), - child: TextFormField( - controller: senhaAtual, - validator: (value) { - if (value == null || value == '') { - return "Digite sua senha"; - }else if(value != Config.usenha){ - return "Senha Inválida"; - } - return null; - }, - decoration: InputDecoration( - labelText: "Senha Atual", - errorStyle: const TextStyle(color: Colors.red), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.0), - ), - - suffixIcon: GestureDetector( - child: Icon( - !_showSenhaAtual - ? Icons.visibility_off - : Icons.visibility, - color: context.watch().darkTemas ? Colors.white : Colors.black, - ), - onTap: () { - setState(() { - _showSenhaAtual = !_showSenhaAtual; - }); - }, - ), - ), - obscureText: _showSenhaAtual, - - ), - ), - - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 15), - child: TextFormField( - controller: senhaNova, - validator: (value) { - if (value == null || value == '') { - return "Digite sua nova senha"; - } - return null; - }, - decoration: InputDecoration( - labelText: "Nova Senha", - errorStyle: const TextStyle(color: Colors.red), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.0), - ), - suffixIcon: GestureDetector( - child: Icon( - !_showSenhaNova - ? Icons.visibility_off - : Icons.visibility, - color: context.watch().darkTemas ? Colors.white : Colors.black, - ), - onTap: () { - setState(() { - _showSenhaNova = !_showSenhaNova; - }); - }, - ), - ), - obscureText: _showSenhaNova, - ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10,), - child: TextButton( - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: Config.corPri, - ), - child: Center( - child: CustomText.text("ENVIAR", - style: TextStyle(color: Colors.white, fontSize: 20.0), - ), - ), - // onPressed: () {}, - onPressed: () async { - if (_formKey.currentState!.validate()) { - carregar(context); - bool result = await context.read().alteracaoPass( - context, context.read().usuario!, - senhaAtual.text, senhaNova.text, - ); - - if(result){ - Navigator.pop(context); - Navigator.pop(context); - CustomAlert.sucess( - context: context, - mensage: 'Senha Alterada!', - ); - }else{ - Navigator.pop(context); - CustomAlert.erro( - context: context, - mensage: 'Senha Alterada!\n', - ); - } - } - }, - ), - ), - const SizedBox(height: 15,) - ], - ), - ) - ); - } -} - diff --git a/example/lib/ui/registro/screen_registro.dart b/example/lib/ui/registro/screen_registro.dart deleted file mode 100644 index a2c4169..0000000 --- a/example/lib/ui/registro/screen_registro.dart +++ /dev/null @@ -1,369 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:shimmer/shimmer.dart'; -import 'package:assecontservices/assecontservices.dart'; - - -import '../../controller/gps.dart'; - - -class RegistroScreen extends StatefulWidget { - @override - _RegistroState createState() => _RegistroState(); -} - -class _RegistroState extends State { - String txt = "Ponto Registrado com Sucesso"; - -/* @override - void initState() { - super.initState(); - img = context.read().img; - mapa = GoogleMap( - buildingsEnabled: false, - zoomControlsEnabled: false, - mapToolbarEnabled: false, - rotateGesturesEnabled: false, - scrollGesturesEnabled: false, - zoomGesturesEnabled: false, - myLocationButtonEnabled: false, - tiltGesturesEnabled: false, - mapType: MapType.normal, - myLocationEnabled: true, - initialCameraPosition: context.read().cam, - onMapCreated: onMapCreated - ); - }*/ - - @override - Widget build(BuildContext context) { - dynamic data = DateFormat('EEEE d MMM y', 'pt_BR').format(DateTime.now()); - double height = MediaQuery.of(context).size.height - - AppBar().preferredSize.height - MediaQuery.of(context).padding.top; - double width = MediaQuery.of(context).size.width; - - return Scaffold( - appBar: AppBar( - title: CustomText.text('Marcação de Ponto'), - centerTitle: true, - actions: [ - actions(context, registro: true), - ], - ), - body: Container( - height: height, - child: SingleChildScrollView( - child: Stack( - alignment: AlignmentDirectional.topCenter, - children: [ - Container( - height: height, - width: width, - child: Mapa(), - ), - Container( - height: 276, - decoration: BoxDecoration( - color: context.watch().darkTemas - ? Theme.of(context).primaryColor - : Config.corPribar, - borderRadius: const BorderRadius.only( - bottomRight: Radius.circular(45), - bottomLeft: Radius.circular(45), - )), - alignment: Alignment.topCenter, - child: Column( - //mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - width: width * 0.6, - padding: const EdgeInsets.only(left: 15, right: 5), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomText.text( - 'Olá, ${context - .read() - .usuario - ?.funcionario - ?.nome ?? - ''}', - maxLines: 1, - overflow: TextOverflow.visible, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Config.corPri), - ), - CustomText.text( - context - .read() - .usuario - ?.funcionario - ?.cargo ?? - '', - maxLines: 1, - style: const TextStyle( - fontSize: 14, - color: Config.corPri, - letterSpacing: 1, - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsets.all(5.0), - child: Hero( - tag: "foto", - child: GestureDetector( - onTap: () async { - List? _img = await Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ImageHero(context - .read() - .usuario - ?.funcionario - ?.foto == - null - ? null - : base64Decode(context - .read() - .usuario! - .funcionario! - .foto!)))); - - if (_img != null) { - context - .read() - .usuario - ?.funcionario - ?.foto = base64Encode(_img); - } - }, - child: Container( - alignment: Alignment.center, - height: 115, - width: 115, - decoration: BoxDecoration( - border: context - .read() - .usuario - ?.funcionario - ?.foto != - null - ? Border.all( - color: Config.corPri, width: 2) - : Border.all( - color: Colors.white, width: 5), - borderRadius: BorderRadius.circular(100), - color: Config.corPri, - image: context - .read() - .usuario - ?.funcionario - ?.foto != - null - ? DecorationImage( - image: MemoryImage(base64Decode( - context - .read() - .usuario! - .funcionario! - .foto!)), - fit: BoxFit.cover) - : null), - child: context - .read() - .usuario - ?.funcionario - ?.foto == - null - ? const Icon( - CupertinoIcons.person, - color: Colors.white, - size: 105, - ) - : null, - ), - ), - ), - ), - ], - ), - Consumer( - builder: (_, hora, __) { - return Container( - alignment: Alignment.center, - padding: const EdgeInsets.only( - top: 20, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.only(bottom: 5), - child: CustomText.text( - data - .toUpperCase() - .toString() - .replaceAll("-FEIRA", ""), - textAlign: TextAlign.center, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Colors.white, - letterSpacing: 1), - ), - ), - CustomText.text( - hora.horarioAtual, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 70, - color: Colors.white, - fontWeight: FontWeight.bold, - letterSpacing: 2), - ), - ], - ), - ); - }, - ), - ], - ), - ), - ], - ))), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: FloatingActionButton.extended( - backgroundColor: context.watch().regButtom - ? Config.corPri.withOpacity(0.7) - : Config.corPri, - onPressed: context.watch().regButtom - ? null - : () async { - context.read().regButtom = true; - - if (context - .read() - .usuario - ?.funcionario - ?.capturarGps ?? - false) { - await context.read().localizacao(); - } - double? lat = context.read().locationData?.latitude; - double? long = context.read().locationData?.longitude; - - if (!(context.read().usuario?.funcionario?.capturarGps ?? true) || ((await context.read().serviceEnabled))) { - if(await context.read().isMockLocation){ - CustomAlert.info( - context: context, - mensage: 'Identificamos que o recurso de localização fictícia está ativo.\nPor favor, desative essa função para poder realizar a marcação de ponto.', - ); - }else{ - if (!(context - .read() - .usuario - ?.funcionario - ?.capturarGps ?? - true) || - context.read().locationData != null) { - await context.read().postPontoMarcar( - context, - context.read().usuario!, - lat, - long, - ); - } else { - CustomAlert.info( - context: context, - mensage: 'Aguarde carregar o mapa!', - ); - } - } - } else { - Navigator.pop(context); - CustomAlert.info( - context: context, - mensage: 'Ative seu GPS!', - ); - } - context.read().regButtom = false; - }, - label: Center( - child: context.watch().regButtom - ? Shimmer.fromColors( - baseColor: context.watch().darkTemas - ? Colors.grey[800]! - : Colors.grey[300]!, - highlightColor: context.watch().darkTemas - ? Colors.grey - : Colors.white, - child: CustomText.text( - 'AGUARDE..', - style: - const TextStyle(fontSize: 20, color: Colors.white), - ), - ) - : CustomText.text( - 'CONFIRMAR', - style: const TextStyle(fontSize: 20, color: Colors.white), - ) - ) - ), - ); - } -} - -class Mapa extends StatefulWidget { - @override - State createState() => _MapaState(); -} - -class _MapaState extends State { - final Completer _controller = Completer(); - - onMapCreated(GoogleMapController googleMapController) { - _controller.complete(googleMapController); - } - - moveCam(BuildContext context, CameraPosition cam) async { - final GoogleMapController controller = await _controller.future; - controller.animateCamera(CameraUpdate.newCameraPosition(cam)); - } - - @override - Widget build(BuildContext context) { - return Consumer(builder: (_, gps, __) { - moveCam(context, gps.cam); - - return Container( - padding: const EdgeInsets.only(top:200), - child: GoogleMap( - buildingsEnabled: false, - zoomControlsEnabled: false, - mapToolbarEnabled: false, - rotateGesturesEnabled: false, - scrollGesturesEnabled: false, - zoomGesturesEnabled: false, - myLocationButtonEnabled: false, - tiltGesturesEnabled: false, - mapType: MapType.normal, - myLocationEnabled: true, - initialCameraPosition: gps.cam, - onMapCreated: onMapCreated)); - }); - } -} diff --git a/example/lib/ui/solicitacoes/lancar_justificativa.dart b/example/lib/ui/solicitacoes/lancar_justificativa.dart deleted file mode 100644 index 011e8cb..0000000 --- a/example/lib/ui/solicitacoes/lancar_justificativa.dart +++ /dev/null @@ -1,177 +0,0 @@ -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:intl/intl.dart'; - -import 'package:assecontservices/assecontservices.dart'; -import 'package:datetime_picker_formfield/datetime_picker_formfield.dart'; - - -class LancarJustificativa extends StatefulWidget { - - @override - _LancarJustificativaState createState() => _LancarJustificativaState(); -} - -class _LancarJustificativaState extends State { - Widget icone = Container(); - Widget icone2 = Container() ; - - @override - void initState() { - context.read().updateObs(false); - super.initState(); - } - - - - @override - Widget build(BuildContext context) { - - return Consumer( - builder: (_, memo, __) { - - return Container(//height: 310, width: 300, - child: Column(mainAxisSize: MainAxisSize.min, - children: [ - Padding(padding: const EdgeInsets.only(left: 15, right: 15, bottom: 3), - child: DateTimeField( - format: DateFormat('dd/MM/yyyy'), - keyboardType: TextInputType.datetime, - controller: memo.controlerData, - decoration: const InputDecoration( - labelText: "Data:", - prefixIcon: Icon(Icons.today,), - ), - onShowPicker: (context, currentValue) { - return showDatePicker( - context: context, - firstDate: DateTime(1900), - initialDate: currentValue ?? DateTime.now(), - lastDate: DateTime(2100) - ); - }, - ), - ), - const SizedBox(height: 10,), - Padding(padding: const EdgeInsets.only(left: 10, right: 10), - child: Container(padding: const EdgeInsets.all(5), - child: TextField(maxLength: 255, maxLines: 2, readOnly: false, - decoration: const InputDecoration(labelText: "OBS:", - border: OutlineInputBorder(borderSide: BorderSide(width: 5 ,color: Colors.blue)), - prefixIcon: Icon(Icons.edit,), - ), - controller: memo.controlerObs, - ), - ), - ), - const SizedBox(height: 5,), - Row(mainAxisAlignment: MainAxisAlignment.center , - children: [ - Container(decoration: BoxDecoration(//color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular (50) ), - border: Border.all(color: Colors.grey) - ), - child: Padding( - padding: const EdgeInsets.only(left: 8.0, top: 8, bottom: 8, right: 16), - child: PopupMenuButton( - itemBuilder: (context) => [ - if(!Config.isWin) - PopupMenuItem( - value: 1, - child: CustomText.text("Camera"), - ), - PopupMenuItem( - value: 2, - child: CustomText.text("Galeria"), - ), - ], - initialValue: 1, - offset: const Offset(10,5), - onSelected: (value) async { - Uint8List? _f; - if(value == 1){ - _f = (await CameraService.getImage()) ; - }else{ - _f = (await CameraService.getGallery()) ; - } - - memo.foto = _f ; - - if(memo.foto != null){ - setState(() { - icone = const Icon(Icons.attach_file, color: Colors.blueAccent,); - icone2 = IconButton( - onPressed: (){ - setState(() { - icone = Container(); - icone2 = Container(); - }); - }, - icon: const Icon(Icons.delete), color: Colors.red, - ); - }); - }else{ - setState(() { - icone = Container(); - icone2 = Container(); - }); - } - }, - child: Container( - child: Row(children: [ - Padding(padding: EdgeInsets.only(left:10 ,right: 10), - child: Icon(Icons.camera_alt,), - ), - CustomText.text("Comprovante", ), - ],), - ), - ), - ), - ), - icone, - icone2 - ],), - const SizedBox(height: 20,), - Row(mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - child: TextButton( - child: Padding( - padding: EdgeInsets.only(top: 12,), - child: CustomText.text("Cancelar", style: TextStyle(fontSize: 14),), - ), - onPressed: (){ - Navigator.pop(context); - }, - ), - ), - Container( - child: TextButton( - child: Padding( - padding: EdgeInsets.only(top: 12,), - child: CustomText.text("Ok",style: TextStyle(fontSize: 14),), - ), - onPressed: () async { - List _i = memo.controlerData.text.split("/"); - DateTime datahora = DateTime(int.parse(_i[2]), int.parse(_i[1]), int.parse(_i[0])); - - await context.read().postMemorando( - context, context.read().usuario!, - datahora, memo.controlerObs.text, 1, img: memo.foto, - ); - Navigator.pop(context); - }, - ), - ) - ], - ), - ], - ),); - }, - ); - } -} - diff --git a/example/lib/ui/solicitacoes/lancar_marcacao.dart b/example/lib/ui/solicitacoes/lancar_marcacao.dart deleted file mode 100644 index b2a8f7c..0000000 --- a/example/lib/ui/solicitacoes/lancar_marcacao.dart +++ /dev/null @@ -1,153 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:intl/intl.dart'; - -import 'package:assecontservices/assecontservices.dart'; -import 'package:datetime_picker_formfield/datetime_picker_formfield.dart'; - -class LancarMarcacao extends StatefulWidget { - - @override - _LancarMarcacaoState createState() => _LancarMarcacaoState(); -} - -class _LancarMarcacaoState extends State { - List marcacoes = ['','','','']; - - setmarcacao(String titulo, int indice, String string){ - TextEditingController controler_hora = TextEditingController(text: string); - return Container(height: 40, - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded(flex: 1, child: CustomText.text(titulo)), - Expanded(flex: 2, - child: DateTimeField( - format: DateFormat('HH:mm'), - keyboardType: TextInputType.datetime, - controller: controler_hora, - decoration: const InputDecoration(prefixIcon: Icon(Icons.timer,),), - onShowPicker: (context, currentValue) async { - final time = await showTimePicker( - context: context, - initialTime: TimeOfDay.fromDateTime(currentValue ?? DateTime.now()), - ); - return DateTimeField.convert(time); - }, - onChanged: (v){ - if(v != null){ - setState(() { - marcacoes[indice] = DateFormat("HH:mm").format(v); - }); - }else{ - setState(() { - marcacoes[indice] = ''; - }); - } - //debugPrint(marcacoes.toString()); - }, - ), - ), - ], - ), - ); - } - - @override - void initState() { - context.read().updateObs(true); - super.initState(); - } - - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (_, memo, __) { - return Container(//height: 310, width: 300, - child: Column(mainAxisSize: MainAxisSize.min, - children: [ - Padding(padding: const EdgeInsets.only(left: 15, right: 15, bottom: 3), - child: DateTimeField( - format: DateFormat('dd/MM/yyyy'), - keyboardType: TextInputType.datetime, - controller: memo.controlerData, - decoration: const InputDecoration( - labelText: "Data:", - prefixIcon: Icon(Icons.today,), - ), - onShowPicker: (context, currentValue) { - return showDatePicker( - context: context, - firstDate: DateTime(1900), - initialDate: currentValue ?? DateTime.now(), - lastDate: DateTime(2100) - ); - }, - ), - ), - const SizedBox(height: 10,), - Column( - children: [ - setmarcacao('Entrada:', 0, marcacoes[0]), - setmarcacao('Intervalo:', 1, marcacoes[1]), - setmarcacao('Intervalo:', 2, marcacoes[2]), - setmarcacao('Saida:', 3, marcacoes[3]), - ], - ), - const SizedBox(height: 10,), - Padding(padding: const EdgeInsets.only(left: 10, right: 10), - child: Container(padding: const EdgeInsets.all(5), - child: TextField(maxLength: 255, maxLines: 2, readOnly: false, - decoration: const InputDecoration(labelText: "OBS:", - border: OutlineInputBorder(borderSide: BorderSide(width: 5 ,color: Colors.blue)), - prefixIcon: Icon(Icons.edit,), - ), - controller: memo.controlerObs, - ), - ), - ), - - Row(mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - child: TextButton( - child: Padding( - padding: EdgeInsets.only(top: 12,), - child: CustomText.text("Cancelar", style: TextStyle(fontSize: 14),), - ), - onPressed: (){ - Navigator.pop(context); - }, - ), - ), - Container( - child: TextButton( - child: Padding( - padding: EdgeInsets.only(top: 12,), - child: CustomText.text("Ok",style: TextStyle(fontSize: 14),), - ), - onPressed: () async { - if(memo.controlerData.text != null && (marcacoes[0] != '' - || marcacoes[1] != '' || marcacoes[2] != '' || marcacoes[3] != '')){ - List _i = memo.controlerData.text.split("/"); - DateTime datahora = DateTime(int.parse(_i[2]), int.parse(_i[1]), int.parse(_i[0])); - await context.read().postMemorando( - context, context.read().usuario!, - datahora, memo.controlerObs.text, 5, marcacao: marcacoes, - ); - - Navigator.pop(context); - } - }, - ), - ) - ], - ), - const SizedBox(height: 5,), - ], - ),); - }, - ); - } -} diff --git a/example/lib/ui/solicitacoes/lancar_solicitacao.dart b/example/lib/ui/solicitacoes/lancar_solicitacao.dart deleted file mode 100644 index cb8d9c0..0000000 --- a/example/lib/ui/solicitacoes/lancar_solicitacao.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:intl/intl.dart'; - -import 'lancar_marcacao.dart'; -import 'lancar_justificativa.dart'; -import 'package:assecontservices/assecontservices.dart'; - - -class LancarSolicitacao extends StatefulWidget { - DateTime? data; - LancarSolicitacao({this.data}); - - @override - _LancarSolicitacaoState createState() => _LancarSolicitacaoState(); -} - -class _LancarSolicitacaoState extends State { - bool start = true; - - @override - Widget build(BuildContext context) { - if(start && widget.data != null){ - context.read().controlerData.text = - DateFormat("dd/MM/yyyy").format(widget.data!); - start = false; - } - - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), - child: DropdownButton( - value: context.watch().dropdownValue, - isExpanded: true, - iconSize: 24, - elevation: 16, - icon: Icon(Icons.arrow_drop_down,), - style: TextStyle(fontSize: 16, - color: context.read().darkTemas ? - Colors.white: Colors.black), - underline: Container(height: 1, color: Colors.grey), - onChanged: ( newValue) { - context.read().dropdownValue = newValue!; - }, - items: ["Atestado", "Marcação", ] - .map>((String value) { - return DropdownMenuItem( - value: value, - child: CustomText.text(value), - ); - }).toList(), - ), - ), - SingleChildScrollView( - child: context.watch().dropdownValue == "Atestado" ? - LancarJustificativa() : LancarMarcacao(), - ), - ], - ); - } -} diff --git a/example/lib/ui/solicitacoes/solicitacoes_detalhes.dart b/example/lib/ui/solicitacoes/solicitacoes_detalhes.dart deleted file mode 100644 index 4b2ae17..0000000 --- a/example/lib/ui/solicitacoes/solicitacoes_detalhes.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; - -import 'package:assecontservices/assecontservices.dart'; - -class DetalhesJustificativas extends StatelessWidget { - Memorandos memorando; - String get status { - if(memorando.status == 1){ - return "Pendente"; - }else if(memorando.status == 2){ - return "Aprovado"; - }else if(memorando.status == 3){ - return "Reprovado"; - }else{ - return ""; - } - } - - DetalhesJustificativas(this.memorando); - - Widget card(String menu, String valor){ - return Padding( - padding: const EdgeInsets.symmetric(vertical: 5), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomText.text(menu, style: TextStyle(fontSize: 14),), - SizedBox(width: 5,), - CustomText.text(valor, style: TextStyle(fontSize: 14)), - ], - ), - ); - } - - @override - Widget build(BuildContext context) { - - return Container( - width: 500, - height: 160, - child: ListView( - children: [ - card("Status:", status ), - card("Solicitado em:", memorando.dataSolicitacao == null ? '' : - "${DateFormat("dd/MM/yyyy").format(memorando.dataSolicitacao!)}" ), - card("Data Solicitação:", memorando.data == null ? '' : - DateFormat("dd/MM/yyyy").format(memorando.data!) ), - SizedBox(height: 15,), - Column(crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomText.text("Descrição:",), - CustomText.text(memorando.descricao ?? '',) - ],), - - ]), - ); - } -} diff --git a/example/lib/ui/solicitacoes/solicitacoes_screen.dart b/example/lib/ui/solicitacoes/solicitacoes_screen.dart deleted file mode 100644 index faaa2d7..0000000 --- a/example/lib/ui/solicitacoes/solicitacoes_screen.dart +++ /dev/null @@ -1,260 +0,0 @@ -import 'package:auto_animated/auto_animated.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:intl/intl.dart' -; -import 'lancar_solicitacao.dart'; -import 'solicitacoes_detalhes.dart'; -import 'package:assecontservices/assecontservices.dart'; - - -class Solicitacoes extends StatefulWidget { - @override - _SolicitacoesState createState() => _SolicitacoesState(); -} - -class _SolicitacoesState extends State { - final GlobalKey _scaffoldKey = GlobalKey(); - List listamemorando = []; - bool load = true; - late DateTime inicio; - late DateTime fim; - - @override - void dispose() { - super.dispose(); - } - - @override - void initState() { - inicio = context.read().usuario?.periodo?.dataInicial ?? DateTime.now().subtract(const Duration(days: 15)); - fim = context.read().usuario?.periodo?.dataFinal ?? DateTime.now().add(const Duration(days: 15)); - context.read().getMemorandos(context.read().usuario!, inicio, fim); - super.initState(); - } - - @override - Widget build(BuildContext context) { - double heightfull = MediaQuery.of(context).size.height; - double height = heightfull - AppBar().preferredSize.height - MediaQuery.of(context).padding.top ; - - return Consumer( - builder: (_,memorandos,__){ - listamemorando = memorandos.memorandos; - - return CustomScaffold.custom( - context: context, - key: _scaffoldKey, - appTitle: "Solicitações", - height: 70, - appbar: Container( - height: 40, - alignment: Alignment.center, - decoration: BoxDecoration( - color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone - ? context.watch().darkTemas ? Colors.black : Colors.white : null, - border: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone - ? Border(top: BorderSide(color: Config.corPribar)) : null - ), - child: TextButton( - onPressed: () async { - final DateTimeRange? picked = await showDateRangePicker( - context: context, - firstDate: DateTime(2000), - lastDate: DateTime(DateTime.now().year + 1), - ); - if (picked != null ) { - memorandos.getMemorandos(context.read().usuario! ,picked.start, picked.end); - setState(() { - inicio = picked.start; - fim = picked.end; - }); - } - }, - child: CustomText.text( - DateFormat('dd/MM/yyyy').format(inicio) + " - " + - DateFormat('dd/MM/yyyy').format(fim), - style: TextStyle(color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? - context.watch().darkTemas ? Config.corPri : Config.corPribar : Colors.white, fontSize: 20), - ) - ), - ), - body: Container( - decoration: BoxDecoration( - border: Border(bottom: BorderSide( - width: 60, color: Theme.of(context).scaffoldBackgroundColor)) - ), - child: Padding( - padding: const EdgeInsets.all(10), - child: LiveList( - showItemInterval: const Duration(milliseconds: 0), - showItemDuration: const Duration(milliseconds: 180), - itemCount: listamemorando.length, - itemBuilder: (BuildContext context, int indice, Animation animation){ - String _diasolicitacao = ''; - String _horasolicitacao = ''; - String _data = ''; - String _descricao = ''; - int _status = 0; - if(listamemorando.isNotEmpty && listamemorando[indice].data != null ){ - _diasolicitacao = DateFormat('dd/MM', 'pt_BR'). - format( listamemorando[indice].dataSolicitacao! ).toUpperCase(); - _data = DateFormat('dd/MM/yyyy').format( listamemorando[indice].data! ); - _horasolicitacao = listamemorando[indice].horaSolicitacao!; - _descricao = listamemorando[indice].descricao!; - _status = listamemorando[indice].status!; - } - - return FadeTransition( - opacity: Tween( - begin: 0, end: 1, - ).animate(animation), - child: SlideTransition( - position: Tween( - begin: const Offset(0, -0.1), - end: Offset.zero, - ).animate(animation), - child: GestureDetector( - onTap: (){ - CustomAlert.custom( - context: context, - titulo: 'Detalhes Solicitado'.toUpperCase(), - corpo: Container( - child: DetalhesJustificativas(listamemorando[indice]), - ), - ); - }, - child: Card( - margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 5), - child: Padding( padding: const EdgeInsets.all(8.0), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding(padding: const EdgeInsets.only( - left: 5, right: 5,bottom: 5, top: 5 ), - child: CustomText.text("${_horasolicitacao}\n${_diasolicitacao}", - textAlign: TextAlign.center, - ), - ), - Expanded( - child: CustomText.text( "Data: ${_data}\n${_descricao}" , - overflow: TextOverflow.ellipsis, - softWrap: true, - maxLines: 2, - ), - ), - Container( - width: 50, - child: _status == 2 ? - Image.asset('assets/imagens/check.png') : - _status == 3 ? - Image.asset('assets/imagens/erro.png', color: Colors.red,) : - _status == 1 ? - Image.asset('assets/imagens/pending.png', color: Config.corPri,) - : Container(), - ) - ],), - ) - ) - ) - ), - ); - }, - ), - ), - ), - buttom: FloatingActionButton( - backgroundColor: Config.corPri, - child: const Center( - child: Icon(Icons.add, size: 30, color: Colors.white,) - ), - onPressed: () async { - await CustomAlert.custom( - context: context, - titulo: 'LANÇAR SOLICITAÇÃO', - corpo: Container( - child: LancarSolicitacao() - ), - ); - memorandos.getMemorandos(context.read().usuario! , inicio, fim); - } - ), - ); - } - ); - } -} - -ListSolicitacoes(List listamemorando, double value, ScrollController controller){ - return SingleChildScrollView( - child: Container( - height: value, - padding: const EdgeInsets.all(10), - child: ListView.builder( - controller: controller, - //showItemInterval: Duration(milliseconds: 0), - //showItemDuration: Duration(milliseconds: 180), - itemCount: listamemorando.length , - itemBuilder: (BuildContext context, int indice, ){ - String _diasolicitacao = ''; - String _horasolicitacao = ''; - String _data = ''; - String _descricao = ''; - int _status = 0; - if(listamemorando.isNotEmpty && listamemorando[indice].data != null){ - _diasolicitacao = DateFormat('dd/MM', 'pt_BR'). - format( listamemorando[indice].dataSolicitacao! ).toUpperCase(); - _data = DateFormat('dd/MM/yyyy').format( listamemorando[indice].data! ); - _horasolicitacao = listamemorando[indice].horaSolicitacao!; - _descricao = listamemorando[indice].descricao!; - _status = listamemorando[indice].status!; - } - - return GestureDetector( - onTap: (){ - CustomAlert.custom( - context: context, - titulo: 'Detalhes Solicitado'.toUpperCase(), - corpo: Container( - child: DetalhesJustificativas(listamemorando[indice]), - ), - ); - }, - child: Card( - margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 5), - child: Padding( padding: const EdgeInsets.all(8.0), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding(padding: const EdgeInsets.only( - left: 5, right: 5,bottom: 5, top: 5 ), - child: CustomText.text("${_horasolicitacao}\n${_diasolicitacao}", - textAlign: TextAlign.center, - ), - ), - Expanded( - child: CustomText.text( "Data: ${_data}\n${_descricao}" , - overflow: TextOverflow.ellipsis, - softWrap: true, - maxLines: 2, - ), - ), - Container( - width: 50, - child: _status == 2 ? - Image.asset('assets/imagens/check.png') : - _status == 3 ? - Image.asset('assets/imagens/erro.png', color: Colors.red,) : - _status == 1 ? - Image.asset('assets/imagens/pending.png', color: Config.corPri,) - : Container(), - ) - ],), - ) - ) - ); - }, - ), - ), - ); -} \ No newline at end of file diff --git a/example/pubspec.yaml b/example/pubspec.yaml deleted file mode 100644 index 1290f2a..0000000 --- a/example/pubspec.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: assecontservices_example -description: Demonstrates how to use the assecontservices plugin. - - -version: 3.1.2+1 - -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -environment: - sdk: ">=2.17.0 <3.0.0" - - -dependencies: - flutter: - sdk: flutter - flutter_localizations: - sdk: flutter - cupertino_icons: ^1.0.6 - - google_maps_flutter: ^2.5.0 - - - datetime_picker_formfield: ^2.0.1 - shimmer: ^3.0.0 - auto_animated: ^3.2.0 - - assecontservices: - path: ../ - - -dev_dependencies: - flutter_test: - sdk: flutter - - flutter_lints: ^3.0.1 - -flutter: - - uses-material-design: true - - assets: - - assets/imagens/ \ No newline at end of file diff --git a/example/web/favicon.ico b/example/web/favicon.ico deleted file mode 100644 index 676b317..0000000 Binary files a/example/web/favicon.ico and /dev/null differ diff --git a/example/web/icons/Icon-192.png b/example/web/icons/Icon-192.png deleted file mode 100644 index 043e274..0000000 Binary files a/example/web/icons/Icon-192.png and /dev/null differ diff --git a/example/web/icons/Icon-512.png b/example/web/icons/Icon-512.png deleted file mode 100644 index 484a70f..0000000 Binary files a/example/web/icons/Icon-512.png and /dev/null differ diff --git a/example/web/icons/Icon-maskable-192.png b/example/web/icons/Icon-maskable-192.png deleted file mode 100644 index 043e274..0000000 Binary files a/example/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/example/web/icons/Icon-maskable-512.png b/example/web/icons/Icon-maskable-512.png deleted file mode 100644 index 484a70f..0000000 Binary files a/example/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/example/web/index.html b/example/web/index.html deleted file mode 100644 index ee1ffb3..0000000 --- a/example/web/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - AssepontoApp - - - - - - - diff --git a/example/web/manifest.json b/example/web/manifest.json deleted file mode 100644 index 22c050b..0000000 --- a/example/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "assepontomobile", - "short_name": "assepontomobile", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "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/example/web/sqflite_sw.js b/example/web/sqflite_sw.js deleted file mode 100644 index 44587cf..0000000 --- a/example/web/sqflite_sw.js +++ /dev/null @@ -1,11559 +0,0 @@ -(function dartProgram(){function copyProperties(a,b){var s=Object.keys(a) -for(var r=0;r=0)return true -if(typeof version=="function"&&version.length==0){var q=version() -if(/^\d+\.\d+\.\d+\.\d+$/.test(q))return true}}catch(p){}return false}() -function inherit(a,b){a.prototype.constructor=a -a.prototype["$i"+a.name]=a -if(b!=null){if(z){Object.setPrototypeOf(a.prototype,b.prototype) -return}var s=Object.create(b.prototype) -copyProperties(a.prototype,s) -a.prototype=s}}function inheritMany(a,b){for(var s=0;s").b(a))return new A.ej(a,b.h("@<0>").t(c).h("ej<1,2>")) -return new A.c6(a,b.h("@<0>").t(c).h("c6<1,2>"))}, -rZ(a){return new A.cf("Field '"+a+"' has not been initialized.")}, -nq(a){var s,r=a^48 -if(r<=9)return r -s=a|32 -if(97<=s&&s<=102)return s-87 -return-1}, -bV(a,b){a=a+b&536870911 -a=a+((a&524287)<<10)&536870911 -return a^a>>>6}, -o6(a){a=a+((a&67108863)<<3)&536870911 -a^=a>>>11 -return a+((a&16383)<<15)&536870911}, -cx(a,b,c){return a}, -oE(a){var s,r -for(s=$.aU.length,r=0;rc)A.Q(A.au(b,0,c,"start",null))}return new A.ci(a,b,c,d.h("ci<0>"))}, -pg(a,b,c,d){if(t.Q.b(a))return new A.c8(a,b,c.h("@<0>").t(d).h("c8<1,2>")) -return new A.bs(a,b,c.h("@<0>").t(d).h("bs<1,2>"))}, -pp(a,b,c){var s="count" -if(t.Q.b(a)){A.jg(b,s,t.S) -A.aP(b,s) -return new A.cE(a,b,c.h("cE<0>"))}A.jg(b,s,t.S) -A.aP(b,s) -return new A.bv(a,b,c.h("bv<0>"))}, -bq(){return new A.bx("No element")}, -p8(){return new A.bx("Too few elements")}, -t1(a,b){return new A.dJ(a,b.h("dJ<0>"))}, -tn(a,b,c){A.h8(a,0,J.Z(a)-1,b,c)}, -h8(a,b,c,d,e){if(c-b<=32)A.tm(a,b,c,d,e) -else A.tl(a,b,c,d,e)}, -tm(a,b,c,d,e){var s,r,q,p,o,n -for(s=b+1,r=J.V(a);s<=c;++s){q=r.i(a,s) -p=s -while(!0){if(p>b){o=d.$2(r.i(a,p-1),q) -if(typeof o!=="number")return o.a2() -o=o>0}else o=!1 -if(!o)break -n=p-1 -r.j(a,p,r.i(a,n)) -p=n}r.j(a,p,q)}}, -tl(a3,a4,a5,a6,a7){var s,r,q,p,o,n,m,l,k,j=B.c.G(a5-a4+1,6),i=a4+j,h=a5-j,g=B.c.G(a4+a5,2),f=g-j,e=g+j,d=J.V(a3),c=d.i(a3,i),b=d.i(a3,f),a=d.i(a3,g),a0=d.i(a3,e),a1=d.i(a3,h),a2=a6.$2(c,b) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=b -b=c -c=s}a2=a6.$2(a0,a1) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a1 -a1=a0 -a0=s}a2=a6.$2(c,a) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a -a=c -c=s}a2=a6.$2(b,a) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a -a=b -b=s}a2=a6.$2(c,a0) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a0 -a0=c -c=s}a2=a6.$2(a,a0) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a0 -a0=a -a=s}a2=a6.$2(b,a1) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a1 -a1=b -b=s}a2=a6.$2(b,a) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a -a=b -b=s}a2=a6.$2(a0,a1) -if(typeof a2!=="number")return a2.a2() -if(a2>0){s=a1 -a1=a0 -a0=s}d.j(a3,i,c) -d.j(a3,g,a) -d.j(a3,h,a1) -d.j(a3,f,d.i(a3,a4)) -d.j(a3,e,d.i(a3,a5)) -r=a4+1 -q=a5-1 -if(J.a4(a6.$2(b,a0),0)){for(p=r;p<=q;++p){o=d.i(a3,p) -n=a6.$2(o,b) -if(n===0)continue -if(n<0){if(p!==r){d.j(a3,p,d.i(a3,r)) -d.j(a3,r,o)}++r}else for(;!0;){n=a6.$2(d.i(a3,q),b) -if(n>0){--q -continue}else{m=q-1 -if(n<0){d.j(a3,p,d.i(a3,r)) -l=r+1 -d.j(a3,r,d.i(a3,q)) -d.j(a3,q,o) -q=m -r=l -break}else{d.j(a3,p,d.i(a3,q)) -d.j(a3,q,o) -q=m -break}}}}k=!0}else{for(p=r;p<=q;++p){o=d.i(a3,p) -if(a6.$2(o,b)<0){if(p!==r){d.j(a3,p,d.i(a3,r)) -d.j(a3,r,o)}++r}else if(a6.$2(o,a0)>0)for(;!0;)if(a6.$2(d.i(a3,q),a0)>0){--q -if(qh){for(;J.a4(a6.$2(d.i(a3,r),b),0);)++r -for(;J.a4(a6.$2(d.i(a3,q),a0),0);)--q -for(p=r;p<=q;++p){o=d.i(a3,p) -if(a6.$2(o,b)===0){if(p!==r){d.j(a3,p,d.i(a3,r)) -d.j(a3,r,o)}++r}else if(a6.$2(o,a0)===0)for(;!0;)if(a6.$2(d.i(a3,q),a0)===0){--q -if(q=m.length)return A.c(m,3) -s=m[3] -if(b==null){if(s!=null)return parseInt(a,10) -if(m[2]!=null)return parseInt(a,16) -return n}if(b<2||b>36)throw A.b(A.au(b,2,36,"radix",n)) -if(b===10&&s!=null)return parseInt(a,10) -if(b<10||s==null){r=b<=10?47+b:86+b -q=m[1] -for(p=q.length,o=0;or)return n}return parseInt(a,b)}, -k4(a){return A.t6(a)}, -t6(a){var s,r,q,p -if(a instanceof A.r)return A.aJ(A.a3(a),null) -s=J.bj(a) -if(s===B.Y||s===B.a_||t.cx.b(a)){r=B.u(a) -if(r!=="Object"&&r!=="")return r -q=a.constructor -if(typeof q=="function"){p=q.name -if(typeof p=="string"&&p!=="Object"&&p!=="")return p}}return A.aJ(A.a3(a),null)}, -pl(a){if(a==null||typeof a=="number"||A.c2(a))return J.bb(a) -if(typeof a=="string")return JSON.stringify(a) -if(a instanceof A.bN)return a.l(0) -if(a instanceof A.cu)return a.dz(!0) -return"Instance of '"+A.k4(a)+"'"}, -t8(){if(!!self.location)return self.location.href -return null}, -tg(a,b,c){var s,r,q,p -if(c<=500&&b===0&&c===a.length)return String.fromCharCode.apply(null,a) -for(s=b,r="";s>>0,s&1023|56320)}}throw A.b(A.au(a,0,1114111,null,null))}, -aO(a){if(a.date===void 0)a.date=new Date(a.a) -return a.date}, -tf(a){return a.b?A.aO(a).getUTCFullYear()+0:A.aO(a).getFullYear()+0}, -td(a){return a.b?A.aO(a).getUTCMonth()+1:A.aO(a).getMonth()+1}, -t9(a){return a.b?A.aO(a).getUTCDate()+0:A.aO(a).getDate()+0}, -ta(a){return a.b?A.aO(a).getUTCHours()+0:A.aO(a).getHours()+0}, -tc(a){return a.b?A.aO(a).getUTCMinutes()+0:A.aO(a).getMinutes()+0}, -te(a){return a.b?A.aO(a).getUTCSeconds()+0:A.aO(a).getSeconds()+0}, -tb(a){return a.b?A.aO(a).getUTCMilliseconds()+0:A.aO(a).getMilliseconds()+0}, -bT(a,b,c){var s,r,q={} -q.a=0 -s=[] -r=[] -q.a=b.length -B.a.aY(s,b) -q.b="" -if(c!=null&&c.a!==0)c.B(0,new A.k3(q,r,s)) -return J.rt(a,new A.fC(B.a3,0,s,r,0))}, -t7(a,b,c){var s,r,q -if(Array.isArray(b))s=c==null||c.a===0 -else s=!1 -if(s){r=b.length -if(r===0){if(!!a.$0)return a.$0()}else if(r===1){if(!!a.$1)return a.$1(b[0])}else if(r===2){if(!!a.$2)return a.$2(b[0],b[1])}else if(r===3){if(!!a.$3)return a.$3(b[0],b[1],b[2])}else if(r===4){if(!!a.$4)return a.$4(b[0],b[1],b[2],b[3])}else if(r===5)if(!!a.$5)return a.$5(b[0],b[1],b[2],b[3],b[4]) -q=a[""+"$"+r] -if(q!=null)return q.apply(a,b)}return A.t5(a,b,c)}, -t5(a,b,c){var s,r,q,p,o,n,m,l,k,j,i,h,g=Array.isArray(b)?b:A.fG(b,!0,t.z),f=g.length,e=a.$R -if(fn)return A.bT(a,g,null) -if(fe)return A.bT(a,g,c) -if(g===b)g=A.fG(g,!0,t.z) -l=Object.keys(q) -if(c==null)for(r=l.length,k=0;k=s)return A.W(b,s,a,null,r) -return A.pm(b,r)}, -vq(a,b,c){if(a>c)return A.au(a,0,c,"start",null) -if(b!=null)if(bc)return A.au(b,a,c,"end",null) -return new A.bc(!0,b,"end",null)}, -nj(a){return new A.bc(!0,a,null,null)}, -b(a){return A.qH(new Error(),a)}, -qH(a,b){var s -if(b==null)b=new A.by() -a.dartException=b -s=A.vO -if("defineProperty" in Object){Object.defineProperty(a,"message",{get:s}) -a.name=""}else a.toString=s -return a}, -vO(){return J.bb(this.dartException)}, -Q(a){throw A.b(a)}, -qR(a,b){throw A.qH(b,a)}, -aT(a){throw A.b(A.ar(a))}, -bz(a){var s,r,q,p,o,n -a=A.qO(a.replace(String({}),"$receiver$")) -s=a.match(/\\\$[a-zA-Z]+\\\$/g) -if(s==null)s=A.u([],t.s) -r=s.indexOf("\\$arguments\\$") -q=s.indexOf("\\$argumentsExpr\\$") -p=s.indexOf("\\$expr\\$") -o=s.indexOf("\\$method\\$") -n=s.indexOf("\\$receiver\\$") -return new A.la(a.replace(new RegExp("\\\\\\$arguments\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$","g"),"((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$","g"),"((?:x|[^x])*)"),r,q,p,o,n)}, -lb(a){return function($expr$){var $argumentsExpr$="$arguments$" -try{$expr$.$method$($argumentsExpr$)}catch(s){return s.message}}(a)}, -pv(a){return function($expr$){try{$expr$.$method$}catch(s){return s.message}}(a)}, -nQ(a,b){var s=b==null,r=s?null:b.method -return new A.fE(a,r,s?null:b.receiver)}, -T(a){var s -if(a==null)return new A.k_(a) -if(a instanceof A.dB){s=a.a -return A.c5(a,s==null?t.K.a(s):s)}if(typeof a!=="object")return a -if("dartException" in a)return A.c5(a,a.dartException) -return A.ve(a)}, -c5(a,b){if(t.V.b(b))if(b.$thrownJsError==null)b.$thrownJsError=a -return b}, -ve(a){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e=null -if(!("message" in a))return a -s=a.message -if("number" in a&&typeof a.number=="number"){r=a.number -q=r&65535 -if((B.c.R(r,16)&8191)===10)switch(q){case 438:return A.c5(a,A.nQ(A.t(s)+" (Error "+q+")",e)) -case 445:case 5007:p=A.t(s) -return A.c5(a,new A.dR(p+" (Error "+q+")",e))}}if(a instanceof TypeError){o=$.qW() -n=$.qX() -m=$.qY() -l=$.qZ() -k=$.r1() -j=$.r2() -i=$.r0() -$.r_() -h=$.r4() -g=$.r3() -f=o.a1(s) -if(f!=null)return A.c5(a,A.nQ(A.U(s),f)) -else{f=n.a1(s) -if(f!=null){f.method="call" -return A.c5(a,A.nQ(A.U(s),f))}else{f=m.a1(s) -if(f==null){f=l.a1(s) -if(f==null){f=k.a1(s) -if(f==null){f=j.a1(s) -if(f==null){f=i.a1(s) -if(f==null){f=l.a1(s) -if(f==null){f=h.a1(s) -if(f==null){f=g.a1(s) -p=f!=null}else p=!0}else p=!0}else p=!0}else p=!0}else p=!0}else p=!0}else p=!0 -if(p){A.U(s) -return A.c5(a,new A.dR(s,f==null?e:f.method))}}}return A.c5(a,new A.hr(typeof s=="string"?s:""))}if(a instanceof RangeError){if(typeof s=="string"&&s.indexOf("call stack")!==-1)return new A.e3() -s=function(b){try{return String(b)}catch(d){}return null}(a) -return A.c5(a,new A.bc(!1,e,e,typeof s=="string"?s.replace(/^RangeError:\s*/,""):s))}if(typeof InternalError=="function"&&a instanceof InternalError)if(typeof s=="string"&&s==="too much recursion")return new A.e3() -return a}, -a1(a){var s -if(a instanceof A.dB)return a.b -if(a==null)return new A.ez(a) -s=a.$cachedTrace -if(s!=null)return s -return a.$cachedTrace=new A.ez(a)}, -oG(a){if(a==null)return J.bm(a) -if(typeof a=="object")return A.dU(a) -return J.bm(a)}, -vt(a,b){var s,r,q,p=a.length -for(s=0;s=0 -else if(b instanceof A.cO){s=B.b.a_(a,c) -return b.b.test(s)}else{s=J.rk(b,B.b.a_(a,c)) -return!s.gY(s)}}, -vr(a){if(a.indexOf("$",0)>=0)return a.replace(/\$/g,"$$$$") -return a}, -qO(a){if(/[[\]{}()*+?.\\^$|]/.test(a))return a.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&") -return a}, -vL(a,b,c){var s=A.vM(a,b,c) -return s}, -vM(a,b,c){var s,r,q -if(b===""){if(a==="")return c -s=a.length -r=""+c -for(q=0;q=0)return a.split(b).join(c) -return a.replace(new RegExp(A.qO(b),"g"),A.vr(c))}, -dd:function dd(a,b){this.a=a -this.b=b}, -dx:function dx(a,b){this.a=a -this.$ti=b}, -dw:function dw(){}, -c7:function c7(a,b,c){this.a=a -this.b=b -this.$ti=c}, -cs:function cs(a,b){this.a=a -this.$ti=b}, -el:function el(a,b,c){var _=this -_.a=a -_.b=b -_.c=0 -_.d=null -_.$ti=c}, -fC:function fC(a,b,c,d,e){var _=this -_.a=a -_.c=b -_.d=c -_.e=d -_.f=e}, -k3:function k3(a,b,c){this.a=a -this.b=b -this.c=c}, -la:function la(a,b,c,d,e,f){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f}, -dR:function dR(a,b){this.a=a -this.b=b}, -fE:function fE(a,b,c){this.a=a -this.b=b -this.c=c}, -hr:function hr(a){this.a=a}, -k_:function k_(a){this.a=a}, -dB:function dB(a,b){this.a=a -this.b=b}, -ez:function ez(a){this.a=a -this.b=null}, -bN:function bN(){}, -f9:function f9(){}, -fa:function fa(){}, -hi:function hi(){}, -hf:function hf(){}, -cB:function cB(a,b){this.a=a -this.b=b}, -hR:function hR(a){this.a=a}, -h6:function h6(a){this.a=a}, -hL:function hL(a){this.a=a}, -mM:function mM(){}, -b3:function b3(a){var _=this -_.a=0 -_.f=_.e=_.d=_.c=_.b=null -_.r=0 -_.$ti=a}, -jN:function jN(a){this.a=a}, -jM:function jM(a){this.a=a}, -jO:function jO(a,b){var _=this -_.a=a -_.b=b -_.d=_.c=null}, -b4:function b4(a,b){this.a=a -this.$ti=b}, -dI:function dI(a,b,c){var _=this -_.a=a -_.b=b -_.d=_.c=null -_.$ti=c}, -nr:function nr(a){this.a=a}, -ns:function ns(a){this.a=a}, -nt:function nt(a){this.a=a}, -cu:function cu(){}, -dc:function dc(){}, -cO:function cO(a,b){var _=this -_.a=a -_.b=b -_.d=_.c=null}, -eq:function eq(a){this.b=a}, -hJ:function hJ(a,b,c){this.a=a -this.b=b -this.c=c}, -hK:function hK(a,b,c){var _=this -_.a=a -_.b=b -_.c=c -_.d=null}, -e4:function e4(a,b){this.a=a -this.c=b}, -iF:function iF(a,b,c){this.a=a -this.b=b -this.c=c}, -iG:function iG(a,b,c){var _=this -_.a=a -_.b=b -_.c=c -_.d=null}, -bk(a){A.qR(new A.cf("Field '"+a+"' has not been initialized."),new Error())}, -ja(a){A.qR(new A.cf("Field '"+a+"' has been assigned during initialization."),new Error())}, -eg(a){var s=new A.lF(a) -return s.b=s}, -lF:function lF(a){this.a=a -this.b=null}, -uI(a){return a}, -or(a,b,c){}, -uM(a){return a}, -ph(a,b,c){A.or(a,b,c) -c=B.c.G(a.byteLength-b,4) -return new Int32Array(a,b,c)}, -b6(a,b,c){A.or(a,b,c) -return c==null?new Uint8Array(a,b):new Uint8Array(a,b,c)}, -bG(a,b,c){if(a>>>0!==a||a>=c)throw A.b(A.eT(b,a))}, -uJ(a,b,c){var s -if(!(a>>>0!==a))s=b>>>0!==b||a>b||b>c -else s=!0 -if(s)throw A.b(A.vq(a,b,c)) -return b}, -cT:function cT(){}, -a7:function a7(){}, -dN:function dN(){}, -ah:function ah(){}, -bS:function bS(){}, -aM:function aM(){}, -fN:function fN(){}, -fO:function fO(){}, -fP:function fP(){}, -fQ:function fQ(){}, -fR:function fR(){}, -fS:function fS(){}, -fT:function fT(){}, -dO:function dO(){}, -dP:function dP(){}, -es:function es(){}, -et:function et(){}, -eu:function eu(){}, -ev:function ev(){}, -pn(a,b){var s=b.c -return s==null?b.c=A.on(a,b.y,!0):s}, -nW(a,b){var s=b.c -return s==null?b.c=A.eH(a,"I",[b.y]):s}, -po(a){var s=a.x -if(s===6||s===7||s===8)return A.po(a.y) -return s===12||s===13}, -tk(a){return a.at}, -aw(a){return A.iS(v.typeUniverse,a,!1)}, -c3(a,b,a0,a1){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c=b.x -switch(c){case 5:case 1:case 2:case 3:case 4:return b -case 6:s=b.y -r=A.c3(a,s,a0,a1) -if(r===s)return b -return A.pV(a,r,!0) -case 7:s=b.y -r=A.c3(a,s,a0,a1) -if(r===s)return b -return A.on(a,r,!0) -case 8:s=b.y -r=A.c3(a,s,a0,a1) -if(r===s)return b -return A.pU(a,r,!0) -case 9:q=b.z -p=A.eS(a,q,a0,a1) -if(p===q)return b -return A.eH(a,b.y,p) -case 10:o=b.y -n=A.c3(a,o,a0,a1) -m=b.z -l=A.eS(a,m,a0,a1) -if(n===o&&l===m)return b -return A.ol(a,n,l) -case 12:k=b.y -j=A.c3(a,k,a0,a1) -i=b.z -h=A.vb(a,i,a0,a1) -if(j===k&&h===i)return b -return A.pT(a,j,h) -case 13:g=b.z -a1+=g.length -f=A.eS(a,g,a0,a1) -o=b.y -n=A.c3(a,o,a0,a1) -if(f===g&&n===o)return b -return A.om(a,n,f,!0) -case 14:e=b.y -if(e=p)return A.c(q,0) -s=A.eJ(v.typeUniverse,A.ox(q[0]),"@<0>") -for(r=1;r=0)p+=" "+r[q];++q}return p+"})"}, -qk(a4,a5,a6){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3=", " -if(a6!=null){s=a6.length -if(a5==null){a5=A.u([],t.s) -r=null}else r=a5.length -q=a5.length -for(p=s;p>0;--p)B.a.m(a5,"T"+(q+p)) -for(o=t.X,n=t._,m="<",l="",p=0;p=0))return A.c(a5,j) -m=B.b.b7(m+l,a5[j]) -i=a6[p] -h=i.x -if(!(h===2||h===3||h===4||h===5||i===o))if(!(i===n))k=!1 -else k=!0 -else k=!0 -if(!k)m+=" extends "+A.aJ(i,a5)}m+=">"}else{m="" -r=null}o=a4.y -g=a4.z -f=g.a -e=f.length -d=g.b -c=d.length -b=g.c -a=b.length -a0=A.aJ(o,a5) -for(a1="",a2="",p=0;p0){a1+=a2+"[" -for(a2="",p=0;p0){a1+=a2+"{" -for(a2="",p=0;p "+a0}, -aJ(a,b){var s,r,q,p,o,n,m,l=a.x -if(l===5)return"erased" -if(l===2)return"dynamic" -if(l===3)return"void" -if(l===1)return"Never" -if(l===4)return"any" -if(l===6){s=A.aJ(a.y,b) -return s}if(l===7){r=a.y -s=A.aJ(r,b) -q=r.x -return(q===12||q===13?"("+s+")":s)+"?"}if(l===8)return"FutureOr<"+A.aJ(a.y,b)+">" -if(l===9){p=A.vd(a.y) -o=a.z -return o.length>0?p+("<"+A.qu(o,b)+">"):p}if(l===11)return A.v7(a,b) -if(l===12)return A.qk(a,b,null) -if(l===13)return A.qk(a.y,b,a.z) -if(l===14){n=a.y -m=b.length -n=m-1-n -if(!(n>=0&&n0)p+="<"+A.eG(c)+">" -s=a.eC.get(p) -if(s!=null)return s -r=new A.aW(null,null) -r.x=9 -r.y=b -r.z=c -if(c.length>0)r.c=c[0] -r.at=p -q=A.bF(a,r) -a.eC.set(p,q) -return q}, -ol(a,b,c){var s,r,q,p,o,n -if(b.x===10){s=b.y -r=b.z.concat(c)}else{r=c -s=b}q=s.at+(";<"+A.eG(r)+">") -p=a.eC.get(q) -if(p!=null)return p -o=new A.aW(null,null) -o.x=10 -o.y=s -o.z=r -o.at=q -n=A.bF(a,o) -a.eC.set(q,n) -return n}, -uj(a,b,c){var s,r,q="+"+(b+"("+A.eG(c)+")"),p=a.eC.get(q) -if(p!=null)return p -s=new A.aW(null,null) -s.x=11 -s.y=b -s.z=c -s.at=q -r=A.bF(a,s) -a.eC.set(q,r) -return r}, -pT(a,b,c){var s,r,q,p,o,n=b.at,m=c.a,l=m.length,k=c.b,j=k.length,i=c.c,h=i.length,g="("+A.eG(m) -if(j>0){s=l>0?",":"" -g+=s+"["+A.eG(k)+"]"}if(h>0){s=l>0?",":"" -g+=s+"{"+A.ud(i)+"}"}r=n+(g+")") -q=a.eC.get(r) -if(q!=null)return q -p=new A.aW(null,null) -p.x=12 -p.y=b -p.z=c -p.at=r -o=A.bF(a,p) -a.eC.set(r,o) -return o}, -om(a,b,c,d){var s,r=b.at+("<"+A.eG(c)+">"),q=a.eC.get(r) -if(q!=null)return q -s=A.uf(a,b,c,r,d) -a.eC.set(r,s) -return s}, -uf(a,b,c,d,e){var s,r,q,p,o,n,m,l -if(e){s=c.length -r=A.n_(s) -for(q=0,p=0;p0){n=A.c3(a,b,r,0) -m=A.eS(a,c,r,0) -return A.om(a,n,m,c!==m)}}l=new A.aW(null,null) -l.x=13 -l.y=b -l.z=c -l.at=d -return A.bF(a,l)}, -pN(a,b,c,d){return{u:a,e:b,r:c,s:[],p:0,n:d}}, -pP(a){var s,r,q,p,o,n,m,l=a.r,k=a.s -for(s=l.length,r=0;r=48&&q<=57)r=A.u6(r+1,q,l,k) -else if((((q|32)>>>0)-97&65535)<26||q===95||q===36||q===124)r=A.pO(a,r,l,k,!1) -else if(q===46)r=A.pO(a,r,l,k,!0) -else{++r -switch(q){case 44:break -case 58:k.push(!1) -break -case 33:k.push(!0) -break -case 59:k.push(A.c0(a.u,a.e,k.pop())) -break -case 94:k.push(A.ui(a.u,k.pop())) -break -case 35:k.push(A.eI(a.u,5,"#")) -break -case 64:k.push(A.eI(a.u,2,"@")) -break -case 126:k.push(A.eI(a.u,3,"~")) -break -case 60:k.push(a.p) -a.p=k.length -break -case 62:A.u8(a,k) -break -case 38:A.u7(a,k) -break -case 42:p=a.u -k.push(A.pV(p,A.c0(p,a.e,k.pop()),a.n)) -break -case 63:p=a.u -k.push(A.on(p,A.c0(p,a.e,k.pop()),a.n)) -break -case 47:p=a.u -k.push(A.pU(p,A.c0(p,a.e,k.pop()),a.n)) -break -case 40:k.push(-3) -k.push(a.p) -a.p=k.length -break -case 41:A.u5(a,k) -break -case 91:k.push(a.p) -a.p=k.length -break -case 93:o=k.splice(a.p) -A.pQ(a.u,a.e,o) -a.p=k.pop() -k.push(o) -k.push(-1) -break -case 123:k.push(a.p) -a.p=k.length -break -case 125:o=k.splice(a.p) -A.ua(a.u,a.e,o) -a.p=k.pop() -k.push(o) -k.push(-2) -break -case 43:n=l.indexOf("(",r) -k.push(l.substring(r,n)) -k.push(-4) -k.push(a.p) -a.p=k.length -r=n+1 -break -default:throw"Bad character "+q}}}m=k.pop() -return A.c0(a.u,a.e,m)}, -u6(a,b,c,d){var s,r,q=b-48 -for(s=c.length;a=48&&r<=57))break -q=q*10+(r-48)}d.push(q) -return a}, -pO(a,b,c,d,e){var s,r,q,p,o,n,m=b+1 -for(s=c.length;m>>0)-97&65535)<26||r===95||r===36||r===124))q=r>=48&&r<=57 -else q=!0 -if(!q)break}}p=c.substring(b,m) -if(e){s=a.u -o=a.e -if(o.x===10)o=o.y -n=A.un(s,o.y)[p] -if(n==null)A.Q('No "'+p+'" in "'+A.tk(o)+'"') -d.push(A.eJ(s,o,n))}else d.push(p) -return m}, -u8(a,b){var s,r=a.u,q=A.pM(a,b),p=b.pop() -if(typeof p=="string")b.push(A.eH(r,p,q)) -else{s=A.c0(r,a.e,p) -switch(s.x){case 12:b.push(A.om(r,s,q,a.n)) -break -default:b.push(A.ol(r,s,q)) -break}}}, -u5(a,b){var s,r,q,p,o,n=null,m=a.u,l=b.pop() -if(typeof l=="number")switch(l){case-1:s=b.pop() -r=n -break -case-2:r=b.pop() -s=n -break -default:b.push(l) -r=n -s=r -break}else{b.push(l) -r=n -s=r}q=A.pM(a,b) -l=b.pop() -switch(l){case-3:l=b.pop() -if(s==null)s=m.sEA -if(r==null)r=m.sEA -p=A.c0(m,a.e,l) -o=new A.i1() -o.a=q -o.b=s -o.c=r -b.push(A.pT(m,p,o)) -return -case-4:b.push(A.uj(m,b.pop(),q)) -return -default:throw A.b(A.f_("Unexpected state under `()`: "+A.t(l)))}}, -u7(a,b){var s=b.pop() -if(0===s){b.push(A.eI(a.u,1,"0&")) -return}if(1===s){b.push(A.eI(a.u,4,"1&")) -return}throw A.b(A.f_("Unexpected extended operation "+A.t(s)))}, -pM(a,b){var s=b.splice(a.p) -A.pQ(a.u,a.e,s) -a.p=b.pop() -return s}, -c0(a,b,c){if(typeof c=="string")return A.eH(a,c,a.sEA) -else if(typeof c=="number"){b.toString -return A.u9(a,b,c)}else return c}, -pQ(a,b,c){var s,r=c.length -for(s=0;sn)return!1 -m=n-o -l=s.b -k=r.b -j=l.length -i=k.length -if(o+j=d)return!1 -a1=f[b] -b+=3 -if(a00?new Array(q):v.typeUniverse.sEA -for(o=0;o0?new Array(a):v.typeUniverse.sEA}, -aW:function aW(a,b){var _=this -_.a=a -_.b=b -_.w=_.r=_.c=null -_.x=0 -_.at=_.as=_.Q=_.z=_.y=null}, -i1:function i1(){this.c=this.b=this.a=null}, -mX:function mX(a){this.a=a}, -hY:function hY(){}, -eF:function eF(a){this.a=a}, -tS(){var s,r,q={} -if(self.scheduleImmediate!=null)return A.vi() -if(self.MutationObserver!=null&&self.document!=null){s=self.document.createElement("div") -r=self.document.createElement("span") -q.a=null -new self.MutationObserver(A.c4(new A.lw(q),1)).observe(s,{childList:true}) -return new A.lv(q,s,r)}else if(self.setImmediate!=null)return A.vj() -return A.vk()}, -tT(a){self.scheduleImmediate(A.c4(new A.lx(t.M.a(a)),0))}, -tU(a){self.setImmediate(A.c4(new A.ly(t.M.a(a)),0))}, -tV(a){A.pu(B.y,t.M.a(a))}, -pu(a,b){var s=B.c.G(a.a,1000) -return A.ub(s<0?0:s,b)}, -ub(a,b){var s=new A.mV(!0) -s.ex(a,b) -return s}, -y(a){return new A.ec(new A.C($.E,a.h("C<0>")),a.h("ec<0>"))}, -x(a,b){a.$2(0,null) -b.b=!0 -return b.a}, -o(a,b){A.uF(a,b)}, -w(a,b){b.W(0,a)}, -v(a,b){b.bs(A.T(a),A.a1(a))}, -uF(a,b){var s,r,q=new A.n2(b),p=new A.n3(b) -if(a instanceof A.C)a.dw(q,p,t.z) -else{s=t.z -if(a instanceof A.C)a.bH(q,p,s) -else{r=new A.C($.E,t.c) -r.a=8 -r.c=a -r.dw(q,p,s)}}}, -z(a){var s=function(b,c){return function(d,e){while(true)try{b(d,e) -break}catch(r){e=r -d=c}}}(a,1) -return $.E.cJ(new A.ni(s),t.H,t.S,t.z)}, -pS(a,b,c){return 0}, -jh(a,b){var s=A.cx(a,"error",t.K) -return new A.ds(s,b==null?A.f0(a):b)}, -f0(a){var s -if(t.V.b(a)){s=a.gaO() -if(s!=null)return s}return B.W}, -rO(a,b){var s=new A.C($.E,b.h("C<0>")) -A.tL(B.y,new A.jF(s,a)) -return s}, -p4(a,b){var s,r,q,p,o,n,m,l -try{s=a.$0() -if(b.h("I<0>").b(s))return s -else{n=new A.C($.E,b.h("C<0>")) -m=b.a(s) -n.a=8 -n.c=m -return n}}catch(l){r=A.T(l) -q=A.a1(l) -n=$.E -p=new A.C(n,b.h("C<0>")) -o=n.b_(r,q) -if(o!=null)p.ap(o.a,o.b) -else p.ap(r,q) -return p}}, -p5(a,b){var s -b.a(a) -s=new A.C($.E,b.h("C<0>")) -s.bb(a) -return s}, -dD(a,b,c){var s,r -A.cx(a,"error",t.K) -s=$.E -if(s!==B.d){r=s.b_(a,b) -if(r!=null){a=r.a -b=r.b}}if(b==null)b=A.f0(a) -s=new A.C($.E,c.h("C<0>")) -s.ap(a,b) -return s}, -nM(a,b){var s,r,q,p,o,n,m,l,k,j,i={},h=null,g=!1,f=new A.C($.E,b.h("C>")) -i.a=null -i.b=0 -s=A.eg("error") -r=A.eg("stackTrace") -q=new A.jH(i,h,g,f,s,r) -try{for(l=J.aq(a),k=t.P;l.n();){p=l.gq(l) -o=i.b -p.bH(new A.jG(i,o,f,h,g,s,r,b),q,k);++i.b}l=i.b -if(l===0){l=f -l.aU(A.u([],b.h("M<0>"))) -return l}i.a=A.dK(l,null,!1,b.h("0?"))}catch(j){n=A.T(j) -m=A.a1(j) -if(i.b===0||A.dp(g))return A.dD(n,m,b.h("n<0>")) -else{s.b=n -r.b=m}}return f}, -qf(a,b,c){var s=$.E.b_(b,c) -if(s!=null){b=s.a -c=s.b}else if(c==null)c=A.f0(b) -a.P(b,c)}, -oj(a,b){var s,r,q -for(s=t.c;r=a.a,(r&4)!==0;)a=s.a(a.c) -if((r&24)!==0){q=b.bk() -b.bd(a) -A.db(b,q)}else{q=t.d.a(b.c) -b.dq(a) -a.cf(q)}}, -u3(a,b){var s,r,q,p={},o=p.a=a -for(s=t.c;r=o.a,(r&4)!==0;o=a){a=s.a(o.c) -p.a=a}if((r&24)===0){q=t.d.a(b.c) -b.dq(o) -p.a.cf(q) -return}if((r&16)===0&&b.c==null){b.bd(o) -return}b.a^=2 -b.b.ao(new A.lS(p,b))}, -db(a,a0){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c={},b=c.a=a -for(s=t.n,r=t.d,q=t.g7;!0;){p={} -o=b.a -n=(o&16)===0 -m=!n -if(a0==null){if(m&&(o&1)===0){l=s.a(b.c) -b.b.dP(l.a,l.b)}return}p.a=a0 -k=a0.a -for(b=a0;k!=null;b=k,k=j){b.a=null -A.db(c.a,b) -p.a=k -j=k.a}o=c.a -i=o.c -p.b=m -p.c=i -if(n){h=b.c -h=(h&1)!==0||(h&15)===8}else h=!0 -if(h){g=b.b.b -if(m){b=o.b -b=!(b===g||b.gaA()===g.gaA())}else b=!1 -if(b){b=c.a -l=s.a(b.c) -b.b.dP(l.a,l.b) -return}f=$.E -if(f!==g)$.E=g -else f=null -b=p.a.c -if((b&15)===8)new A.lZ(p,c,m).$0() -else if(n){if((b&1)!==0)new A.lY(p,i).$0()}else if((b&2)!==0)new A.lX(c,p).$0() -if(f!=null)$.E=f -b=p.c -if(b instanceof A.C){o=p.a.$ti -o=o.h("I<2>").b(b)||!o.z[1].b(b)}else o=!1 -if(o){q.a(b) -e=p.a.b -if((b.a&24)!==0){d=r.a(e.c) -e.c=null -a0=e.bl(d) -e.a=b.a&30|e.a&1 -e.c=b.c -c.a=b -continue}else A.oj(b,e) -return}}e=p.a.b -d=r.a(e.c) -e.c=null -a0=e.bl(d) -b=p.b -o=p.c -if(!b){e.$ti.c.a(o) -e.a=8 -e.c=o}else{s.a(o) -e.a=e.a&1|16 -e.c=o}c.a=e -b=e}}, -v8(a,b){if(t.R.b(a))return b.cJ(a,t.z,t.K,t.l) -if(t.v.b(a))return b.bF(a,t.z,t.K) -throw A.b(A.bn(a,"onError",u.c))}, -v5(){var s,r -for(s=$.dm;s!=null;s=$.dm){$.eQ=null -r=s.b -$.dm=r -if(r==null)$.eP=null -s.a.$0()}}, -va(){$.ov=!0 -try{A.v5()}finally{$.eQ=null -$.ov=!1 -if($.dm!=null)$.oK().$1(A.qC())}}, -qw(a){var s=new A.hM(a),r=$.eP -if(r==null){$.dm=$.eP=s -if(!$.ov)$.oK().$1(A.qC())}else $.eP=r.b=s}, -v9(a){var s,r,q,p=$.dm -if(p==null){A.qw(a) -$.eQ=$.eP -return}s=new A.hM(a) -r=$.eQ -if(r==null){s.b=p -$.dm=$.eQ=s}else{q=r.b -s.b=q -$.eQ=r.b=s -if(q==null)$.eP=s}}, -qP(a){var s,r=null,q=$.E -if(B.d===q){A.ng(r,r,B.d,a) -return}if(B.d===q.gfk().a)s=B.d.gaA()===q.gaA() -else s=!1 -if(s){A.ng(r,r,q,q.cK(a,t.H)) -return}s=$.E -s.ao(s.co(a))}, -wl(a,b){return new A.iE(A.cx(a,"stream",t.K),b.h("iE<0>"))}, -ow(a){return}, -pJ(a,b,c){var s=b==null?A.vl():b -return a.bF(s,t.H,c)}, -u2(a,b){if(t.k.b(b))return a.cJ(b,t.z,t.K,t.l) -if(t.i6.b(b))return a.bF(b,t.z,t.K) -throw A.b(A.ak("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.",null))}, -v6(a){}, -uH(a,b,c){var s=a.S(0),r=$.eV() -if(s!==r)s.aJ(new A.n4(b,c)) -else b.aT(c)}, -tL(a,b){var s=$.E -if(s===B.d)return s.dK(a,b) -return s.dK(a,s.co(b))}, -ne(a,b){A.v9(new A.nf(a,b))}, -qr(a,b,c,d,e){var s,r -t.U.a(a) -t.r.a(b) -t.x.a(c) -e.h("0()").a(d) -r=$.E -if(r===c)return d.$0() -$.E=c -s=r -try{r=d.$0() -return r}finally{$.E=s}}, -qt(a,b,c,d,e,f,g){var s,r -t.U.a(a) -t.r.a(b) -t.x.a(c) -f.h("@<0>").t(g).h("1(2)").a(d) -g.a(e) -r=$.E -if(r===c)return d.$1(e) -$.E=c -s=r -try{r=d.$1(e) -return r}finally{$.E=s}}, -qs(a,b,c,d,e,f,g,h,i){var s,r -t.U.a(a) -t.r.a(b) -t.x.a(c) -g.h("@<0>").t(h).t(i).h("1(2,3)").a(d) -h.a(e) -i.a(f) -r=$.E -if(r===c)return d.$2(e,f) -$.E=c -s=r -try{r=d.$2(e,f) -return r}finally{$.E=s}}, -ng(a,b,c,d){var s,r -t.M.a(d) -if(B.d!==c){s=B.d.gaA() -r=c.gaA() -d=s!==r?c.co(d):c.fD(d,t.H)}A.qw(d)}, -lw:function lw(a){this.a=a}, -lv:function lv(a,b,c){this.a=a -this.b=b -this.c=c}, -lx:function lx(a){this.a=a}, -ly:function ly(a){this.a=a}, -mV:function mV(a){this.a=a -this.b=null -this.c=0}, -mW:function mW(a,b){this.a=a -this.b=b}, -ec:function ec(a,b){this.a=a -this.b=!1 -this.$ti=b}, -n2:function n2(a){this.a=a}, -n3:function n3(a){this.a=a}, -ni:function ni(a){this.a=a}, -eC:function eC(a,b){var _=this -_.a=a -_.e=_.d=_.c=_.b=null -_.$ti=b}, -dg:function dg(a,b){this.a=a -this.$ti=b}, -ds:function ds(a,b){this.a=a -this.b=b}, -jF:function jF(a,b){this.a=a -this.b=b}, -jH:function jH(a,b,c,d,e,f){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f}, -jG:function jG(a,b,c,d,e,f,g,h){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f -_.r=g -_.w=h}, -co:function co(){}, -cn:function cn(a,b){this.a=a -this.$ti=b}, -aa:function aa(a,b){this.a=a -this.$ti=b}, -bE:function bE(a,b,c,d,e){var _=this -_.a=null -_.b=a -_.c=b -_.d=c -_.e=d -_.$ti=e}, -C:function C(a,b){var _=this -_.a=0 -_.b=a -_.c=null -_.$ti=b}, -lP:function lP(a,b){this.a=a -this.b=b}, -lW:function lW(a,b){this.a=a -this.b=b}, -lT:function lT(a){this.a=a}, -lU:function lU(a){this.a=a}, -lV:function lV(a,b,c){this.a=a -this.b=b -this.c=c}, -lS:function lS(a,b){this.a=a -this.b=b}, -lR:function lR(a,b){this.a=a -this.b=b}, -lQ:function lQ(a,b,c){this.a=a -this.b=b -this.c=c}, -lZ:function lZ(a,b,c){this.a=a -this.b=b -this.c=c}, -m_:function m_(a){this.a=a}, -lY:function lY(a,b){this.a=a -this.b=b}, -lX:function lX(a,b){this.a=a -this.b=b}, -hM:function hM(a){this.a=a -this.b=null}, -d_:function d_(){}, -l6:function l6(a,b){this.a=a -this.b=b}, -l7:function l7(a,b){this.a=a -this.b=b}, -l4:function l4(a){this.a=a}, -l5:function l5(a,b,c){this.a=a -this.b=b -this.c=c}, -df:function df(){}, -mR:function mR(a){this.a=a}, -mQ:function mQ(a){this.a=a}, -iL:function iL(){}, -dh:function dh(a,b,c,d,e){var _=this -_.a=null -_.b=0 -_.c=null -_.d=a -_.e=b -_.f=c -_.r=d -_.$ti=e}, -d6:function d6(a,b){this.a=a -this.$ti=b}, -d7:function d7(a,b,c,d,e,f,g){var _=this -_.w=a -_.a=b -_.b=c -_.c=d -_.d=e -_.e=f -_.r=_.f=null -_.$ti=g}, -ee:function ee(){}, -lE:function lE(a,b,c){this.a=a -this.b=b -this.c=c}, -lD:function lD(a){this.a=a}, -eB:function eB(){}, -bD:function bD(){}, -cq:function cq(a,b){this.b=a -this.a=null -this.$ti=b}, -eh:function eh(a,b){this.b=a -this.c=b -this.a=null}, -hT:function hT(){}, -aY:function aY(a){var _=this -_.a=0 -_.c=_.b=null -_.$ti=a}, -mJ:function mJ(a,b){this.a=a -this.b=b}, -iE:function iE(a,b){var _=this -_.a=null -_.b=a -_.c=!1 -_.$ti=b}, -n4:function n4(a,b){this.a=a -this.b=b}, -iT:function iT(a,b,c){this.a=a -this.b=b -this.$ti=c}, -eM:function eM(){}, -nf:function nf(a,b){this.a=a -this.b=b}, -it:function it(){}, -mO:function mO(a,b,c){this.a=a -this.b=b -this.c=c}, -mN:function mN(a,b){this.a=a -this.b=b}, -mP:function mP(a,b,c){this.a=a -this.b=b -this.c=c}, -t_(a,b){return new A.b3(a.h("@<0>").t(b).h("b3<1,2>"))}, -aA(a,b,c){return b.h("@<0>").t(c).h("pe<1,2>").a(A.vt(a,new A.b3(b.h("@<0>").t(c).h("b3<1,2>"))))}, -X(a,b){return new A.b3(a.h("@<0>").t(b).h("b3<1,2>"))}, -t0(a){return new A.em(a.h("em<0>"))}, -ok(){var s=Object.create(null) -s[""]=s -delete s[""] -return s}, -pL(a,b,c){var s=new A.ct(a,b,c.h("ct<0>")) -s.c=a.e -return s}, -nR(a,b,c){var s=A.t_(b,c) -J.bl(a,new A.jP(s,b,c)) -return s}, -fI(a){var s,r={} -if(A.oE(a))return"{...}" -s=new A.aj("") -try{B.a.m($.aU,a) -s.a+="{" -r.a=!0 -J.bl(a,new A.jS(r,s)) -s.a+="}"}finally{if(0>=$.aU.length)return A.c($.aU,-1) -$.aU.pop()}r=s.a -return r.charCodeAt(0)==0?r:r}, -em:function em(a){var _=this -_.a=0 -_.f=_.e=_.d=_.c=_.b=null -_.r=0 -_.$ti=a}, -ia:function ia(a){this.a=a -this.c=this.b=null}, -ct:function ct(a,b,c){var _=this -_.a=a -_.b=b -_.d=_.c=null -_.$ti=c}, -jP:function jP(a,b,c){this.a=a -this.b=b -this.c=c}, -cP:function cP(a){var _=this -_.b=_.a=0 -_.c=null -_.$ti=a}, -en:function en(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=null -_.d=c -_.e=!1 -_.$ti=d}, -af:function af(){}, -i:function i(){}, -D:function D(){}, -jR:function jR(a){this.a=a}, -jS:function jS(a,b){this.a=a -this.b=b}, -d4:function d4(){}, -eo:function eo(a,b){this.a=a -this.$ti=b}, -ep:function ep(a,b,c){var _=this -_.a=a -_.b=b -_.c=null -_.$ti=c}, -c1:function c1(){}, -cQ:function cQ(){}, -e7:function e7(){}, -cV:function cV(){}, -ew:function ew(){}, -dj:function dj(){}, -tQ(a,b,c,d){var s,r -if(b instanceof Uint8Array){s=b -if(d==null)d=s.length -if(d-c<15)return null -r=A.tR(a,s,c,d) -if(r!=null&&a)if(r.indexOf("\ufffd")>=0)return null -return r}return null}, -tR(a,b,c,d){var s=a?$.r6():$.r5() -if(s==null)return null -if(0===c&&d===b.length)return A.pB(s,b) -return A.pB(s,b.subarray(c,A.bt(c,d,b.length)))}, -pB(a,b){var s,r -try{s=a.decode(b) -return s}catch(r){}return null}, -oV(a,b,c,d,e,f){if(B.c.a7(f,4)!==0)throw A.b(A.ae("Invalid base64 padding, padded length must be multiple of four, is "+f,a,c)) -if(d+e!==f)throw A.b(A.ae("Invalid base64 padding, '=' not at the end",a,b)) -if(e>2)throw A.b(A.ae("Invalid base64 padding, more than two '=' characters",a,b))}, -uz(a){switch(a){case 65:return"Missing extension byte" -case 67:return"Unexpected extension byte" -case 69:return"Invalid UTF-8 byte" -case 71:return"Overlong encoding" -case 73:return"Out of unicode range" -case 75:return"Encoded surrogate" -case 77:return"Unfinished UTF-8 octet sequence" -default:return""}}, -uy(a,b,c){var s,r,q,p=c-b,o=new Uint8Array(p) -for(s=J.V(a),r=0;r>>0!==0)q=255 -if(!(r=16)return null -r=r*16+o}n=h-1 -if(!(h>=0&&h=0&&s=16)return null -r=r*16+o}m=n-1 -if(!(n>=0&&n=j)return A.c(i,0) -l=i[0]===0}else l=!1 -if(l)return $.bJ() -l=A.aX(j,i) -return new A.a8(l===0?!1:c,i,l)}, -oi(a,b){var s,r,q,p,o,n -if(a==="")return null -s=$.r8().fR(a) -if(s==null)return null -r=s.b -q=r.length -if(1>=q)return A.c(r,1) -p=r[1]==="-" -if(4>=q)return A.c(r,4) -o=r[4] -n=r[3] -if(5>=q)return A.c(r,5) -if(o!=null)return A.tZ(o,p) -if(n!=null)return A.u_(n,2,p) -return null}, -aX(a,b){var s,r=b.length -while(!0){if(a>0){s=a-1 -if(!(s=0&&q=0;--s){p=s+c -if(!(s=0&&p=0;--s){if(!(s=0;--s){if(!(s=0&&n>>0 -p=B.c.aM((o&i)>>>0,k)}if(!(l>=0&&l=0;){if(!(q=0&&p=0&&m>>0,k) -if(!(p>>0 -s=B.c.aN(n,l)}if(!(r>=0&&r=0;--s){if(!(s=0&&o=0&&b=0&&o=0;e=m,c=p){p=c+1 -if(!(c=0&&e=0&&e=0&&c=0&&r>>0,a) -if(q>65535)return 65535 -return q}, -nu(a,b){var s=A.nU(a,b) -if(s!=null)return s -throw A.b(A.ae(a,null,null))}, -rJ(a,b){a=A.b(a) -if(a==null)a=t.K.a(a) -a.stack=b.l(0) -throw a -throw A.b("unreachable")}, -dK(a,b,c,d){var s,r=c?J.rU(a,d):J.pa(a,d) -if(a!==0&&b!=null)for(s=0;s")) -for(s=J.aq(a);s.n();)B.a.m(r,c.a(s.gq(s))) -if(b)return r -return J.jK(r,c)}, -fG(a,b,c){var s -if(b)return A.pf(a,c) -s=J.jK(A.pf(a,c),c) -return s}, -pf(a,b){var s,r -if(Array.isArray(a))return A.u(a.slice(0),b.h("M<0>")) -s=A.u([],b.h("M<0>")) -for(r=J.aq(a);r.n();)B.a.m(s,r.gq(r)) -return s}, -dL(a,b){return J.pb(A.jQ(a,!1,b))}, -pt(a,b,c){var s=A.tg(a,b,A.bt(b,c,a.length)) -return s}, -tJ(a){return A.bf(a)}, -aV(a,b){return new A.cO(a,A.pd(a,!1,b,!1,!1,!1))}, -l8(a,b,c){var s=J.aq(b) -if(!s.n())return a -if(c.length===0){do a+=A.t(s.gq(s)) -while(s.n())}else{a+=A.t(s.gq(s)) -for(;s.n();)a=a+c+A.t(s.gq(s))}return a}, -pi(a,b){return new A.fU(a,b.ghg(),b.ghq(),b.ghh())}, -o8(){var s,r,q=A.t8() -if(q==null)throw A.b(A.F("'Uri.base' is not supported")) -s=$.py -if(s!=null&&q===$.px)return s -r=A.pz(q) -$.py=r -$.px=q -return r}, -rH(a){var s=Math.abs(a),r=a<0?"-":"" -if(s>=1000)return""+a -if(s>=100)return r+"0"+s -if(s>=10)return r+"00"+s -return r+"000"+s}, -rI(a){if(a>=100)return""+a -if(a>=10)return"0"+a -return"00"+a}, -fm(a){if(a>=10)return""+a -return"0"+a}, -ca(a){if(typeof a=="number"||A.c2(a)||a==null)return J.bb(a) -if(typeof a=="string")return JSON.stringify(a) -return A.pl(a)}, -rK(a,b){A.cx(a,"error",t.K) -A.cx(b,"stackTrace",t.l) -A.rJ(a,b)}, -f_(a){return new A.dr(a)}, -ak(a,b){return new A.bc(!1,null,b,a)}, -bn(a,b,c){return new A.bc(!0,a,b,c)}, -jg(a,b,c){return a}, -pm(a,b){return new A.cU(null,null,!0,a,b,"Value not in range")}, -au(a,b,c,d,e){return new A.cU(b,c,!0,a,d,"Invalid value")}, -ti(a,b,c,d){if(ac)throw A.b(A.au(a,b,c,d,null)) -return a}, -bt(a,b,c){if(0>a||a>c)throw A.b(A.au(a,0,c,"start",null)) -if(b!=null){if(a>b||b>c)throw A.b(A.au(b,a,c,"end",null)) -return b}return c}, -aP(a,b){if(a<0)throw A.b(A.au(a,0,null,b,null)) -return a}, -W(a,b,c,d,e){return new A.fy(b,!0,a,e,"Index out of range")}, -F(a){return new A.ht(a)}, -hq(a){return new A.hp(a)}, -K(a){return new A.bx(a)}, -ar(a){return new A.fd(a)}, -p3(a){return new A.lM(a)}, -ae(a,b,c){return new A.jE(a,b,c)}, -rT(a,b,c){var s,r -if(A.oE(a)){if(b==="("&&c===")")return"(...)" -return b+"..."+c}s=A.u([],t.s) -B.a.m($.aU,a) -try{A.v4(a,s)}finally{if(0>=$.aU.length)return A.c($.aU,-1) -$.aU.pop()}r=A.l8(b,t.e7.a(s),", ")+c -return r.charCodeAt(0)==0?r:r}, -nN(a,b,c){var s,r -if(A.oE(a))return b+"..."+c -s=new A.aj(b) -B.a.m($.aU,a) -try{r=s -r.a=A.l8(r.a,a,", ")}finally{if(0>=$.aU.length)return A.c($.aU,-1) -$.aU.pop()}s.a+=c -r=s.a -return r.charCodeAt(0)==0?r:r}, -v4(a,b){var s,r,q,p,o,n,m,l=a.gC(a),k=0,j=0 -while(!0){if(!(k<80||j<3))break -if(!l.n())return -s=A.t(l.gq(l)) -B.a.m(b,s) -k+=s.length+2;++j}if(!l.n()){if(j<=5)return -if(0>=b.length)return A.c(b,-1) -r=b.pop() -if(0>=b.length)return A.c(b,-1) -q=b.pop()}else{p=l.gq(l);++j -if(!l.n()){if(j<=4){B.a.m(b,A.t(p)) -return}r=A.t(p) -if(0>=b.length)return A.c(b,-1) -q=b.pop() -k+=r.length+2}else{o=l.gq(l);++j -for(;l.n();p=o,o=n){n=l.gq(l);++j -if(j>100){while(!0){if(!(k>75&&j>3))break -if(0>=b.length)return A.c(b,-1) -k-=b.pop().length+2;--j}B.a.m(b,"...") -return}}q=A.t(p) -r=A.t(o) -k+=r.length+q.length+4}}if(j>b.length+2){k+=5 -m="..."}else m=null -while(!0){if(!(k>80&&b.length>3))break -if(0>=b.length)return A.c(b,-1) -k-=b.pop().length+2 -if(m==null){k+=5 -m="..."}}if(m!=null)B.a.m(b,m) -B.a.m(b,q) -B.a.m(b,r)}, -nT(a,b,c,d){var s -if(B.p===c){s=B.j.gA(a) -b=J.bm(b) -return A.o6(A.bV(A.bV($.nF(),s),b))}if(B.p===d){s=B.j.gA(a) -b=J.bm(b) -c=J.bm(c) -return A.o6(A.bV(A.bV(A.bV($.nF(),s),b),c))}s=B.j.gA(a) -b=J.bm(b) -c=J.bm(c) -d=J.bm(d) -d=A.o6(A.bV(A.bV(A.bV(A.bV($.nF(),s),b),c),d)) -return d}, -b_(a){var s=$.qM -if(s==null)A.qL(a) -else s.$1(a)}, -pz(a5){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3=null,a4=a5.length -if(a4>=5){if(4>=a4)return A.c(a5,4) -s=((a5.charCodeAt(4)^58)*3|a5.charCodeAt(0)^100|a5.charCodeAt(1)^97|a5.charCodeAt(2)^116|a5.charCodeAt(3)^97)>>>0 -if(s===0)return A.pw(a4=14)B.a.j(r,7,a4) -q=r[1] -if(q>=0)if(A.qv(a5,0,q,20,r)===20)r[7]=q -p=r[2]+1 -o=r[3] -n=r[4] -m=r[5] -l=r[6] -if(lq+3){j=a3 -k=!1}else{i=o>0 -if(i&&o+1===n){j=a3 -k=!1}else{if(!B.b.I(a5,"\\",n))if(p>0)h=B.b.I(a5,"\\",p-1)||B.b.I(a5,"\\",p-2) -else h=!1 -else h=!0 -if(h){j=a3 -k=!1}else{if(!(mn+2&&B.b.I(a5,"/..",m-3) -else h=!0 -if(h){j=a3 -k=!1}else{if(q===4)if(B.b.I(a5,"file",0)){if(p<=0){if(!B.b.I(a5,"/",n)){g="file:///" -s=3}else{g="file://" -s=2}a5=g+B.b.p(a5,n,a4) -q-=0 -i=s-0 -m+=i -l+=i -a4=a5.length -p=7 -o=7 -n=7}else if(n===m){++l -f=m+1 -a5=B.b.aG(a5,n,m,"/");++a4 -m=f}j="file"}else if(B.b.I(a5,"http",0)){if(i&&o+3===n&&B.b.I(a5,"80",o+1)){l-=3 -e=n-3 -m-=3 -a5=B.b.aG(a5,o,n,"") -a4-=3 -n=e}j="http"}else j=a3 -else if(q===5&&B.b.I(a5,"https",0)){if(i&&o+4===n&&B.b.I(a5,"443",o+1)){l-=4 -e=n-4 -m-=4 -a5=B.b.aG(a5,o,n,"") -a4-=3 -n=e}j="https"}else j=a3 -k=!0}}}}else j=a3 -if(k){if(a40)j=A.ut(a5,0,q) -else{if(q===0)A.dk(a5,0,"Invalid empty scheme") -j=""}if(p>0){d=q+3 -c=d=0&&r9)j.$2("invalid character",r)}else{if(p===3)j.$2(l,r) -n=A.nu(B.b.p(a,q,r),null) -if(n>255)j.$2(k,q) -m=p+1 -if(!(p<4))return A.c(i,p) -i[p]=n -q=r+1 -p=m}}if(p!==3)j.$2(l,c) -n=A.nu(B.b.p(a,q,c),null) -if(n>255)j.$2(k,q) -if(!(p<4))return A.c(i,p) -i[p]=n -return i}, -pA(a,a0,a1){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e=null,d=new A.le(a),c=new A.lf(d,a),b=a.length -if(b<2)d.$2("address is too short",e) -s=A.u([],t.t) -for(r=a0,q=r,p=!1,o=!1;r=0&&r>>0) -B.a.m(s,(l[2]<<8|l[3])>>>0)}if(p){if(s.length>7)d.$2("an address with a wildcard must have less than 7 parts",e)}else if(s.length!==8)d.$2("an address without a wildcard must contain exactly 8 parts",e) -k=new Uint8Array(16) -for(b=s.length,j=9-b,r=0,i=0;r=0&&i<16))return A.c(k,i) -k[i]=0 -f=i+1 -if(!(f<16))return A.c(k,f) -k[f]=0 -i+=2}else{f=B.c.R(h,8) -if(!(i>=0&&i<16))return A.c(k,i) -k[i]=f -f=i+1 -if(!(f<16))return A.c(k,f) -k[f]=h&255 -i+=2}}return k}, -pX(a,b,c,d,e,f,g){return new A.eK(a,b,c,d,e,f,g)}, -pZ(a){if(a==="http")return 80 -if(a==="https")return 443 -return 0}, -dk(a,b,c){throw A.b(A.ae(c,a,b))}, -up(a,b){var s,r,q -for(s=a.length,r=0;r")),r=r.h("a5.E");s.n();){q=s.d -if(q==null)q=r.a(q) -if(B.b.N(q,A.aV('["*/:<>?\\\\|]',!0))){s=A.F("Illegal character in path: "+q) -throw A.b(s)}}}, -uq(a,b){var s -if(!(65<=a&&a<=90))s=97<=a&&a<=122 -else s=!0 -if(s)return -s=A.F("Illegal drive letter "+A.tJ(a)) -throw A.b(s)}, -q4(a,b){if(a!=null&&a===A.pZ(b))return null -return a}, -q2(a,b,c,d){var s,r,q,p,o,n -if(a==null)return null -if(b===c)return"" -s=a.length -if(!(b>=0&&b=0&&r=b&&q=b&&s=0&&r>>4 -if(!(m<8))return A.c(B.k,m) -m=(B.k[m]&1<<(o&15))!==0}else m=!1 -if(m){if(p&&65<=o&&90>=o){if(h==null)h=new A.aj("") -if(q=0&&r>>4 -if(!(l<8))return A.c(B.A,l) -l=(B.A[l]&1<<(n&15))!==0}else l=!1 -if(l){if(o&&65<=n&&90>=n){if(p==null)p=new A.aj("") -if(q>>4 -if(!(l<8))return A.c(B.m,l) -l=(B.m[l]&1<<(n&15))!==0}else l=!1 -if(l)A.dk(a,r,"Invalid character") -else{if((n&64512)===55296&&r+1>>4 -if(!(o<8))return A.c(B.l,o) -o=(B.l[o]&1<<(p&15))!==0}else o=!1 -if(!o)A.dk(a,r,"Illegal scheme character") -if(65<=p&&p<=90)q=!0}a=B.b.p(a,b,c) -return A.uo(q?a.toLowerCase():a)}, -uo(a){if(a==="http")return"http" -if(a==="file")return"file" -if(a==="https")return"https" -if(a==="package")return"package" -return a}, -q6(a,b,c){if(a==null)return"" -return A.eL(a,b,c,B.a0,!1,!1)}, -q3(a,b,c,d,e,f){var s=e==="file",r=s||f,q=A.eL(a,b,c,B.z,!0,!0) -if(q.length===0){if(s)return"/"}else if(r&&!B.b.M(q,"/"))q="/"+q -return A.uu(q,e,f)}, -uu(a,b,c){var s=b.length===0 -if(s&&!c&&!B.b.M(a,"/")&&!B.b.M(a,"\\"))return A.q9(a,!s||c) -return A.qb(a)}, -q5(a,b,c,d){if(a!=null)return A.eL(a,b,c,B.o,!0,!1) -return null}, -q1(a,b,c){if(a==null)return null -return A.eL(a,b,c,B.o,!0,!1)}, -op(a,b,c){var s,r,q,p,o,n,m=b+2,l=a.length -if(m>=l)return"%" -s=b+1 -if(!(s>=0&&s=0))return A.c(a,m) -q=a.charCodeAt(m) -p=A.nq(r) -o=A.nq(q) -if(p<0||o<0)return"%" -n=p*16+o -if(n<127){m=B.c.R(n,4) -if(!(m<8))return A.c(B.k,m) -m=(B.k[m]&1<<(n&15))!==0}else m=!1 -if(m)return A.bf(c&&65<=n&&90>=n?(n|32)>>>0:n) -if(r>=97||q>=97)return B.b.p(a,b,b+3).toUpperCase() -return null}, -oo(a){var s,r,q,p,o,n,m,l,k="0123456789ABCDEF" -if(a<128){s=new Uint8Array(3) -s[0]=37 -r=a>>>4 -if(!(r<16))return A.c(k,r) -s[1]=k.charCodeAt(r) -s[2]=k.charCodeAt(a&15)}else{if(a>2047)if(a>65535){q=240 -p=4}else{q=224 -p=3}else{q=192 -p=2}r=3*p -s=new Uint8Array(r) -for(o=0;--p,p>=0;q=128){n=B.c.fp(a,6*p)&63|q -if(!(o>>4 -if(!(l<16))return A.c(k,l) -if(!(m=0&&q>>4 -if(!(m<8))return A.c(d,m) -m=(d[m]&1<<(n&15))!==0}else m=!1 -if(m)++q -else{if(n===37){l=A.op(a,q,!1) -if(l==null){q+=3 -continue}if("%"===l){l="%25" -k=1}else k=3}else if(n===92&&f){l="/" -k=1}else{if(s)if(n<=93){m=n>>>4 -if(!(m<8))return A.c(B.m,m) -m=(B.m[m]&1<<(n&15))!==0}else m=!1 -else m=!1 -if(m){A.dk(a,q,"Invalid character") -k=h -l=k}else{if((n&64512)===55296){m=q+1 -if(m=m)return A.c(s,-1) -s.pop() -if(s.length===0)B.a.m(s,"")}p=!0}else if("."===n)p=!0 -else{B.a.m(s,n) -p=!1}}if(p)B.a.m(s,"") -return B.a.al(s,"/")}, -q9(a,b){var s,r,q,p,o,n -if(!A.q7(a))return!b?A.q_(a):a -s=A.u([],t.s) -for(r=a.split("/"),q=r.length,p=!1,o=0;o=s.length)return A.c(s,-1) -s.pop() -p=!0}else{B.a.m(s,"..") -p=!1}else if("."===n)p=!0 -else{B.a.m(s,n) -p=!1}}r=s.length -if(r!==0)if(r===1){if(0>=r)return A.c(s,0) -r=s[0].length===0}else r=!1 -else r=!0 -if(r)return"./" -if(p||B.a.ga6(s)==="..")B.a.m(s,"") -if(!b){if(0>=s.length)return A.c(s,0) -B.a.j(s,0,A.q_(s[0]))}return B.a.al(s,"/")}, -q_(a){var s,r,q,p=a.length -if(p>=2&&A.q0(a.charCodeAt(0)))for(s=1;s>>4 -if(!(q<8))return A.c(B.l,q) -q=(B.l[q]&1<<(r&15))===0}else q=!0 -if(q)break}return a}, -uw(a){var s,r,q,p=a.gcF(),o=p.length -if(o>0&&J.Z(p[0])===2&&J.oQ(p[0],1)===58){if(0>=o)return A.c(p,0) -A.uq(J.oQ(p[0],0),!1) -A.pY(p,!1,1) -s=!0}else{A.pY(p,!1,0) -s=!1}r=a.gdQ()&&!s?""+"\\":"" -if(a.gcu()){q=a.gb1(a) -if(q.length!==0)r=r+"\\"+q+"\\"}r=A.l8(r,p,"\\") -o=s&&o===1?r+"\\":r -return o.charCodeAt(0)==0?o:o}, -us(a,b){var s,r,q,p,o -for(s=a.length,r=0,q=0;q<2;++q){p=b+q -if(!(p127)throw A.b(A.ak("Illegal percent encoding in URI",null)) -if(r===37){if(n+3>o)throw A.b(A.ak("Truncated URI",null)) -B.a.m(p,A.us(a,n+1)) -n+=2}else B.a.m(p,r)}}return d.aZ(0,p)}, -q0(a){var s=a|32 -return 97<=s&&s<=122}, -pw(a,b,c){var s,r,q,p,o,n,m,l,k="Invalid MIME type",j=A.u([b-1],t.t) -for(s=a.length,r=b,q=-1,p=null;rb)throw A.b(A.ae(k,a,r)) -for(;p!==44;){B.a.m(j,r);++r -for(o=-1;r=0))return A.c(a,r) -p=a.charCodeAt(r) -if(p===61){if(o<0)o=r}else if(p===59||p===44)break}if(o>=0)B.a.m(j,o) -else{n=B.a.ga6(j) -if(p!==44||r!==n+7||!B.b.I(a,"base64",n+1))throw A.b(A.ae("Expecting '='",a,r)) -break}}B.a.m(j,r) -m=r+1 -if((j.length&1)===1)a=B.L.hl(0,a,m,s) -else{l=A.q8(a,m,s,B.o,!0,!1) -if(l!=null)a=B.b.aG(a,m,s,l)}return new A.lc(a,j,c)}, -uL(){var s,r,q,p,o,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=",m=".",l=":",k="/",j="\\",i="?",h="#",g="/\\",f=t.p,e=J.p9(22,f) -for(s=0;s<22;++s)e[s]=new Uint8Array(96) -r=new A.n7(e) -q=new A.n8() -p=new A.n9() -o=f.a(r.$2(0,225)) -q.$3(o,n,1) -q.$3(o,m,14) -q.$3(o,l,34) -q.$3(o,k,3) -q.$3(o,j,227) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(14,225)) -q.$3(o,n,1) -q.$3(o,m,15) -q.$3(o,l,34) -q.$3(o,g,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(15,225)) -q.$3(o,n,1) -q.$3(o,"%",225) -q.$3(o,l,34) -q.$3(o,k,9) -q.$3(o,j,233) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(1,225)) -q.$3(o,n,1) -q.$3(o,l,34) -q.$3(o,k,10) -q.$3(o,j,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(2,235)) -q.$3(o,n,139) -q.$3(o,k,131) -q.$3(o,j,131) -q.$3(o,m,146) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(3,235)) -q.$3(o,n,11) -q.$3(o,k,68) -q.$3(o,j,68) -q.$3(o,m,18) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(4,229)) -q.$3(o,n,5) -p.$3(o,"AZ",229) -q.$3(o,l,102) -q.$3(o,"@",68) -q.$3(o,"[",232) -q.$3(o,k,138) -q.$3(o,j,138) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(5,229)) -q.$3(o,n,5) -p.$3(o,"AZ",229) -q.$3(o,l,102) -q.$3(o,"@",68) -q.$3(o,k,138) -q.$3(o,j,138) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(6,231)) -p.$3(o,"19",7) -q.$3(o,"@",68) -q.$3(o,k,138) -q.$3(o,j,138) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(7,231)) -p.$3(o,"09",7) -q.$3(o,"@",68) -q.$3(o,k,138) -q.$3(o,j,138) -q.$3(o,i,172) -q.$3(o,h,205) -q.$3(f.a(r.$2(8,8)),"]",5) -o=f.a(r.$2(9,235)) -q.$3(o,n,11) -q.$3(o,m,16) -q.$3(o,g,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(16,235)) -q.$3(o,n,11) -q.$3(o,m,17) -q.$3(o,g,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(17,235)) -q.$3(o,n,11) -q.$3(o,k,9) -q.$3(o,j,233) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(10,235)) -q.$3(o,n,11) -q.$3(o,m,18) -q.$3(o,k,10) -q.$3(o,j,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(18,235)) -q.$3(o,n,11) -q.$3(o,m,19) -q.$3(o,g,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(19,235)) -q.$3(o,n,11) -q.$3(o,g,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(11,235)) -q.$3(o,n,11) -q.$3(o,k,10) -q.$3(o,j,234) -q.$3(o,i,172) -q.$3(o,h,205) -o=f.a(r.$2(12,236)) -q.$3(o,n,12) -q.$3(o,i,12) -q.$3(o,h,205) -o=f.a(r.$2(13,237)) -q.$3(o,n,13) -q.$3(o,i,13) -p.$3(f.a(r.$2(20,245)),"az",21) -r=f.a(r.$2(21,245)) -p.$3(r,"az",21) -p.$3(r,"09",21) -q.$3(r,"+-.",21) -return e}, -qv(a,b,c,d,e){var s,r,q,p,o,n=$.rd() -for(s=a.length,r=b;r=0&&d95?31:p] -d=o&31 -B.a.j(e,o>>>5,r)}return d}, -a8:function a8(a,b,c){this.a=a -this.b=b -this.c=c}, -lB:function lB(){}, -lC:function lC(){}, -i0:function i0(a,b){this.a=a -this.$ti=b}, -jY:function jY(a,b){this.a=a -this.b=b}, -bP:function bP(a,b){this.a=a -this.b=b}, -bQ:function bQ(a){this.a=a}, -lI:function lI(){}, -R:function R(){}, -dr:function dr(a){this.a=a}, -by:function by(){}, -bc:function bc(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -cU:function cU(a,b,c,d,e,f){var _=this -_.e=a -_.f=b -_.a=c -_.b=d -_.c=e -_.d=f}, -fy:function fy(a,b,c,d,e){var _=this -_.f=a -_.a=b -_.b=c -_.c=d -_.d=e}, -fU:function fU(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -ht:function ht(a){this.a=a}, -hp:function hp(a){this.a=a}, -bx:function bx(a){this.a=a}, -fd:function fd(a){this.a=a}, -fY:function fY(){}, -e3:function e3(){}, -lM:function lM(a){this.a=a}, -jE:function jE(a,b,c){this.a=a -this.b=b -this.c=c}, -fA:function fA(){}, -e:function e(){}, -a6:function a6(a,b,c){this.a=a -this.b=b -this.$ti=c}, -P:function P(){}, -r:function r(){}, -iJ:function iJ(){}, -aj:function aj(a){this.a=a}, -ld:function ld(a){this.a=a}, -le:function le(a){this.a=a}, -lf:function lf(a,b){this.a=a -this.b=b}, -eK:function eK(a,b,c,d,e,f,g){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f -_.r=g -_.y=_.x=_.w=$}, -lc:function lc(a,b,c){this.a=a -this.b=b -this.c=c}, -n7:function n7(a){this.a=a}, -n8:function n8(){}, -n9:function n9(){}, -ix:function ix(a,b,c,d,e,f,g,h){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f -_.r=g -_.w=h -_.x=null}, -hS:function hS(a,b,c,d,e,f,g){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f -_.r=g -_.y=_.x=_.w=$}, -fr:function fr(a,b){this.a=a -this.$ti=b}, -rz(a){var s=new self.Blob(a) -return s}, -b8(a,b,c,d,e){var s=c==null?null:A.qz(new A.lK(c),t.A) -s=new A.ek(a,b,s,!1,e.h("ek<0>")) -s.dA() -return s}, -qz(a,b){var s=$.E -if(s===B.d)return a -return s.dG(a,b)}, -q:function q(){}, -eX:function eX(){}, -eY:function eY(){}, -eZ:function eZ(){}, -bM:function bM(){}, -bd:function bd(){}, -fg:function fg(){}, -O:function O(){}, -cC:function cC(){}, -jx:function jx(){}, -as:function as(){}, -b2:function b2(){}, -fh:function fh(){}, -fi:function fi(){}, -fj:function fj(){}, -fn:function fn(){}, -dy:function dy(){}, -dz:function dz(){}, -fo:function fo(){}, -fp:function fp(){}, -p:function p(){}, -m:function m(){}, -f:function f(){}, -ay:function ay(){}, -cG:function cG(){}, -ft:function ft(){}, -fv:function fv(){}, -az:function az(){}, -fw:function fw(){}, -cc:function cc(){}, -cK:function cK(){}, -fH:function fH(){}, -fJ:function fJ(){}, -cS:function cS(){}, -cg:function cg(){}, -fK:function fK(){}, -jU:function jU(a){this.a=a}, -jV:function jV(a){this.a=a}, -fL:function fL(){}, -jW:function jW(a){this.a=a}, -jX:function jX(a){this.a=a}, -aB:function aB(){}, -fM:function fM(){}, -H:function H(){}, -dQ:function dQ(){}, -aC:function aC(){}, -h_:function h_(){}, -h5:function h5(){}, -ke:function ke(a){this.a=a}, -kf:function kf(a){this.a=a}, -h7:function h7(){}, -cW:function cW(){}, -cX:function cX(){}, -aD:function aD(){}, -h9:function h9(){}, -aE:function aE(){}, -ha:function ha(){}, -aF:function aF(){}, -hg:function hg(){}, -l2:function l2(a){this.a=a}, -l3:function l3(a){this.a=a}, -an:function an(){}, -aH:function aH(){}, -ao:function ao(){}, -hj:function hj(){}, -hk:function hk(){}, -hl:function hl(){}, -aI:function aI(){}, -hm:function hm(){}, -hn:function hn(){}, -hv:function hv(){}, -hy:function hy(){}, -bY:function bY(){}, -hP:function hP(){}, -ei:function ei(){}, -i2:function i2(){}, -er:function er(){}, -iA:function iA(){}, -iK:function iK(){}, -nL:function nL(a,b){this.a=a -this.$ti=b}, -lJ:function lJ(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.$ti=d}, -ek:function ek(a,b,c,d,e){var _=this -_.a=0 -_.b=a -_.c=b -_.d=c -_.e=d -_.$ti=e}, -lK:function lK(a){this.a=a}, -lL:function lL(a){this.a=a}, -A:function A(){}, -dC:function dC(a,b,c){var _=this -_.a=a -_.b=b -_.c=-1 -_.d=null -_.$ti=c}, -hQ:function hQ(){}, -hU:function hU(){}, -hV:function hV(){}, -hW:function hW(){}, -hX:function hX(){}, -hZ:function hZ(){}, -i_:function i_(){}, -i3:function i3(){}, -i4:function i4(){}, -ic:function ic(){}, -id:function id(){}, -ie:function ie(){}, -ig:function ig(){}, -ih:function ih(){}, -ii:function ii(){}, -im:function im(){}, -io:function io(){}, -iw:function iw(){}, -ex:function ex(){}, -ey:function ey(){}, -iy:function iy(){}, -iz:function iz(){}, -iD:function iD(){}, -iM:function iM(){}, -iN:function iN(){}, -eD:function eD(){}, -eE:function eE(){}, -iO:function iO(){}, -iP:function iP(){}, -iU:function iU(){}, -iV:function iV(){}, -iW:function iW(){}, -iX:function iX(){}, -iY:function iY(){}, -iZ:function iZ(){}, -j_:function j_(){}, -j0:function j0(){}, -j1:function j1(){}, -j2:function j2(){}, -qh(a){var s,r,q -if(a==null)return a -if(typeof a=="string"||typeof a=="number"||A.c2(a))return a -if(A.qJ(a))return A.aZ(a) -s=Array.isArray(a) -s.toString -if(s){r=[] -q=0 -while(!0){s=a.length -s.toString -if(!(q")),r=new A.aa(s,b.h("aa<0>")),q=t.Y,p=t.A -A.b8(a,"success",q.a(new A.n5(a,r,b)),!1,p) -A.b8(a,"error",q.a(r.gfH()),!1,p) -return s}, -t4(a,b,c){var s=null,r=c.h("dh<0>"),q=new A.dh(s,s,s,s,r),p=t.Y,o=t.A -A.b8(a,"error",p.a(q.gfz()),!1,o) -A.b8(a,"success",p.a(new A.k0(a,q,b,c)),!1,o) -return new A.d6(q,r.h("d6<1>"))}, -bO:function bO(){}, -bo:function bo(){}, -be:function be(){}, -cJ:function cJ(){}, -n5:function n5(a,b,c){this.a=a -this.b=b -this.c=c}, -dE:function dE(){}, -dS:function dS(){}, -k0:function k0(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -bu:function bu(){}, -e6:function e6(){}, -bA:function bA(){}, -uK(a){var s,r=a.$dart_jsFunction -if(r!=null)return r -s=function(b,c){return function(){return b(c,Array.prototype.slice.apply(arguments))}}(A.uG,a) -s[$.oI()]=a -a.$dart_jsFunction=s -return s}, -uG(a,b){t.j.a(b) -t.Z.a(a) -return A.t7(a,b,null)}, -Y(a,b){if(typeof a=="function")return a -else return b.a(A.uK(a))}, -qD(a,b,c,d){return d.a(a[b].apply(a,c))}, -nA(a,b){var s=new A.C($.E,b.h("C<0>")),r=new A.cn(s,b.h("cn<0>")) -a.then(A.c4(new A.nB(r,b),1),A.c4(new A.nC(r),1)) -return s}, -nB:function nB(a,b){this.a=a -this.b=b}, -nC:function nC(a){this.a=a}, -jZ:function jZ(a){this.a=a}, -i7:function i7(a){this.a=a}, -aL:function aL(){}, -fF:function fF(){}, -aN:function aN(){}, -fW:function fW(){}, -h0:function h0(){}, -hh:function hh(){}, -aR:function aR(){}, -ho:function ho(){}, -i8:function i8(){}, -i9:function i9(){}, -ij:function ij(){}, -ik:function ik(){}, -iH:function iH(){}, -iI:function iI(){}, -iQ:function iQ(){}, -iR:function iR(){}, -f1:function f1(){}, -f2:function f2(){}, -jq:function jq(a){this.a=a}, -jr:function jr(a){this.a=a}, -f3:function f3(){}, -bL:function bL(){}, -fX:function fX(){}, -hN:function hN(){}, -fV:function fV(){}, -hs:function hs(){}, -vf(a,b){var s,r,q,p,o,n,m,l -for(s=b.length,r=1;r=1;s=q){q=s-1 -if(b[q]!=null)break}p=new A.aj("") -o=""+(a+"(") -p.a=o -n=A.ab(b) -m=n.h("ci<1>") -l=new A.ci(b,0,s,m) -l.es(b,0,s,n.c) -m=o+new A.ag(l,m.h("j(a5.E)").a(new A.nh()),m.h("ag")).al(0,", ") -p.a=m -p.a=m+("): part "+(r-1)+" was null, but part "+r+" was not.") -throw A.b(A.ak(p.l(0),null))}}, -fe:function fe(a){this.a=a}, -jw:function jw(){}, -nh:function nh(){}, -cM:function cM(){}, -pj(a,b){var s,r,q,p,o,n,m=b.eg(a) -b.aD(a) -if(m!=null)a=B.b.a_(a,m.length) -s=t.s -r=A.u([],s) -q=A.u([],s) -s=a.length -if(s!==0){if(0>=s)return A.c(a,0) -p=b.a5(a.charCodeAt(0))}else p=!1 -if(p){if(0>=s)return A.c(a,0) -B.a.m(q,a[0]) -o=1}else{B.a.m(q,"") -o=0}for(n=o;n50)return B.b.p(s,0,50)+"..." -return s}, -vg(a){if(t.p.b(a))return"Blob("+a.length+")" -return A.uA(a)}, -qB(a){var s=a.$ti -return"["+new A.ag(a,s.h("j?(i.E)").a(new A.nk()),s.h("ag")).al(0,", ")+"]"}, -nk:function nk(){}, -fk:function fk(){}, -hb:function hb(){}, -kh:function kh(a){this.a=a}, -ki:function ki(a){this.a=a}, -jB:function jB(){}, -rL(a){var s=J.V(a),r=s.i(a,"method"),q=s.i(a,"arguments") -if(r!=null)return new A.fs(A.U(r),q) -return null}, -fs:function fs(a,b){this.a=a -this.b=b}, -cF:function cF(a,b){this.a=a -this.b=b}, -hc(a,b,c,d){var s=new A.bw(a,b,b,c) -s.b=d -return s}, -bw:function bw(a,b,c,d){var _=this -_.r=_.f=_.e=null -_.w=a -_.x=b -_.b=null -_.c=c -_.a=d}, -kw:function kw(){}, -kx:function kx(){}, -nc(a,b,c,d){var s,r,q,p -if(a instanceof A.bw){s=a.e -if(s==null)s=a.e=b -r=a.f -if(r==null)r=a.f=c -q=a.r -if(q==null)q=a.r=d -p=s==null -if(!p||r!=null||q!=null)if(a.x==null){r=A.X(t.N,t.X) -if(!p)r.j(0,"database",s.e3()) -s=a.f -if(s!=null)r.j(0,"sql",s) -s=a.r -if(s!=null)r.j(0,"arguments",s) -a.sfO(0,r)}return a}else if(a instanceof A.e2){s=a.l(0) -return A.nc(A.hc("sqlite_error",null,s,a.c),b,c,d)}else return A.nc(A.hc("error",null,J.bb(a),null),b,c,d)}, -kV(a){return A.tE(a)}, -tE(a){var s=0,r=A.y(t.z),q,p=2,o,n,m,l,k,j,i,h -var $async$kV=A.z(function(b,c){if(b===1){o=c -s=p}while(true)switch(s){case 0:p=4 -s=7 -return A.o(A.ai(a),$async$kV) -case 7:n=c -q=n -s=1 -break -p=2 -s=6 -break -case 4:p=3 -h=o -m=A.T(h) -A.a1(h) -j=A.pq(a) -i=A.bU(a,"sql",t.N) -l=A.nc(m,j,i,A.hd(a)) -throw A.b(l) -s=6 -break -case 3:s=2 -break -case 6:case 1:return A.w(q,r) -case 2:return A.v(o,r)}}) -return A.x($async$kV,r)}, -dZ(a,b){var s=A.kC(a) -return s.b0(A.dl(J.ad(t.f.a(a.b),"transactionId")),new A.kB(b,s))}, -ch(a,b){return $.rc().a3(new A.kA(b),t.z)}, -ai(a){var s=0,r=A.y(t.z),q,p -var $async$ai=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=a.a -case 3:switch(p){case"openDatabase":s=5 -break -case"closeDatabase":s=6 -break -case"query":s=7 -break -case"queryCursorNext":s=8 -break -case"execute":s=9 -break -case"insert":s=10 -break -case"update":s=11 -break -case"batch":s=12 -break -case"getDatabasesPath":s=13 -break -case"deleteDatabase":s=14 -break -case"databaseExists":s=15 -break -case"options":s=16 -break -case"writeDatabaseBytes":s=17 -break -case"readDatabaseBytes":s=18 -break -case"debugMode":s=19 -break -default:s=20 -break}break -case 5:s=21 -return A.o(A.ch(a,A.tw(a)),$async$ai) -case 21:q=c -s=1 -break -case 6:s=22 -return A.o(A.ch(a,A.tq(a)),$async$ai) -case 22:q=c -s=1 -break -case 7:s=23 -return A.o(A.dZ(a,A.ty(a)),$async$ai) -case 23:q=c -s=1 -break -case 8:s=24 -return A.o(A.dZ(a,A.tz(a)),$async$ai) -case 24:q=c -s=1 -break -case 9:s=25 -return A.o(A.dZ(a,A.tt(a)),$async$ai) -case 25:q=c -s=1 -break -case 10:s=26 -return A.o(A.dZ(a,A.tv(a)),$async$ai) -case 26:q=c -s=1 -break -case 11:s=27 -return A.o(A.dZ(a,A.tB(a)),$async$ai) -case 27:q=c -s=1 -break -case 12:s=28 -return A.o(A.dZ(a,A.tp(a)),$async$ai) -case 28:q=c -s=1 -break -case 13:s=29 -return A.o(A.ch(a,A.tu(a)),$async$ai) -case 29:q=c -s=1 -break -case 14:s=30 -return A.o(A.ch(a,A.ts(a)),$async$ai) -case 30:q=c -s=1 -break -case 15:s=31 -return A.o(A.ch(a,A.tr(a)),$async$ai) -case 31:q=c -s=1 -break -case 16:s=32 -return A.o(A.ch(a,A.tx(a)),$async$ai) -case 32:q=c -s=1 -break -case 17:s=33 -return A.o(A.ch(a,A.tC(a)),$async$ai) -case 33:q=c -s=1 -break -case 18:s=34 -return A.o(A.ch(a,A.tA(a)),$async$ai) -case 34:q=c -s=1 -break -case 19:s=35 -return A.o(A.o_(a),$async$ai) -case 35:q=c -s=1 -break -case 20:throw A.b(A.ak("Invalid method "+p+" "+a.l(0),null)) -case 4:case 1:return A.w(q,r)}}) -return A.x($async$ai,r)}, -tw(a){return new A.kM(a)}, -kW(a){return A.tF(a)}, -tF(a){var s=0,r=A.y(t.f),q,p=2,o,n,m,l,k,j,i,h,g,f,e,d,c -var $async$kW=A.z(function(b,a0){if(b===1){o=a0 -s=p}while(true)switch(s){case 0:i=t.f.a(a.b) -h=J.V(i) -g=A.U(h.i(i,"path")) -f=new A.kX() -e=A.eO(h.i(i,"singleInstance")) -d=e===!0 -h=A.eO(h.i(i,"readOnly")) -if(d){l=$.j7.i(0,g) -if(l!=null){if($.nw>=2)l.am("Reopening existing single database "+l.l(0)) -q=f.$1(l.e) -s=1 -break}}n=null -p=4 -e=$.ap -s=7 -return A.o((e==null?$.ap=A.cy():e).bC(i),$async$kW) -case 7:n=a0 -p=2 -s=6 -break -case 4:p=3 -c=o -i=A.T(c) -if(i instanceof A.e2){m=i -i=m -h=i.l(0) -throw A.b(A.hc("sqlite_error",null,"open_failed: "+h,i.c))}else throw c -s=6 -break -case 3:s=2 -break -case 6:j=$.qp=$.qp+1 -i=n -e=$.nw -l=new A.aQ(A.u([],t.it),A.nS(),j,d,g,h===!0,i,e,A.X(t.S,t.lz),A.nS()) -$.qE.j(0,j,l) -l.am("Opening database "+l.l(0)) -if(d)$.j7.j(0,g,l) -q=f.$1(j) -s=1 -break -case 1:return A.w(q,r) -case 2:return A.v(o,r)}}) -return A.x($async$kW,r)}, -tq(a){return new A.kG(a)}, -nY(a){var s=0,r=A.y(t.z),q -var $async$nY=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:q=A.kC(a) -if(q.f){$.j7.J(0,q.r) -if($.qy==null)$.qy=new A.jB()}q.ad(0) -return A.w(null,r)}}) -return A.x($async$nY,r)}, -kC(a){var s=A.pq(a) -if(s==null)throw A.b(A.K("Database "+A.t(A.pr(a))+" not found")) -return s}, -pq(a){var s=A.pr(a) -if(s!=null)return $.qE.i(0,s) -return null}, -pr(a){var s=a.b -if(t.f.b(s))return A.dl(J.ad(s,"id")) -return null}, -bU(a,b,c){var s=a.b -if(t.f.b(s))return c.h("0?").a(J.ad(s,b)) -return null}, -tG(a){var s,r="transactionId",q=a.b -if(t.f.b(q)){s=J.ac(q) -return s.D(q,r)&&s.i(q,r)==null}return!1}, -kE(a){var s,r,q=A.bU(a,"path",t.N) -if(q!=null&&q!==":memory:"&&$.oO().a.ag(q)<=0){if($.ap==null)$.ap=A.cy() -s=$.oO() -r=A.u(["/",q,null,null,null,null,null,null,null,null,null,null,null,null,null,null],t.mf) -A.vf("join",r) -q=s.hc(new A.ea(r,t.lS))}return q}, -hd(a){var s,r,q,p=A.bU(a,"arguments",t.j) -if(p!=null)for(s=J.aq(p),r=t.p;s.n();){q=s.gq(s) -if(q!=null)if(typeof q!="number")if(typeof q!="string")if(!r.b(q))if(!(q instanceof A.a8))throw A.b(A.ak("Invalid sql argument type '"+J.eW(q).l(0)+"': "+A.t(q),null))}return p==null?null:J.je(p,t.X)}, -to(a){var s=A.u([],t.bw),r=t.f -r=J.je(t.j.a(J.ad(r.a(a.b),"operations")),r) -r.B(r,new A.kD(s)) -return s}, -ty(a){return new A.kP(a)}, -o2(a,b){var s=0,r=A.y(t.z),q,p,o -var $async$o2=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:o=A.bU(a,"sql",t.N) -o.toString -p=A.hd(a) -q=b.fZ(A.dl(J.ad(t.f.a(a.b),"cursorPageSize")),o,p) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o2,r)}, -tz(a){return new A.kO(a)}, -o3(a,b){var s=0,r=A.y(t.z),q,p,o,n -var $async$o3=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:b=A.kC(a) -p=t.f.a(a.b) -o=J.V(p) -n=A.h(o.i(p,"cursorId")) -q=b.h_(A.eO(o.i(p,"cancel")),n) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o3,r)}, -kz(a,b){var s=0,r=A.y(t.X),q,p -var $async$kz=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:b=A.kC(a) -p=A.bU(a,"sql",t.N) -p.toString -s=3 -return A.o(b.fX(p,A.hd(a)),$async$kz) -case 3:q=null -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$kz,r)}, -tt(a){return new A.kJ(a)}, -kU(a,b){return A.tD(a,b)}, -tD(a,b){var s=0,r=A.y(t.X),q,p=2,o,n,m,l,k -var $async$kU=A.z(function(c,d){if(c===1){o=d -s=p}while(true)switch(s){case 0:m=A.bU(a,"inTransaction",t.y) -l=m===!0&&A.tG(a) -if(A.dp(l))b.b=++b.a -p=4 -s=7 -return A.o(A.kz(a,b),$async$kU) -case 7:p=2 -s=6 -break -case 4:p=3 -k=o -if(A.dp(l))b.b=null -throw k -s=6 -break -case 3:s=2 -break -case 6:if(A.dp(l)){q=A.aA(["transactionId",b.b],t.N,t.X) -s=1 -break}else if(m===!1)b.b=null -q=null -s=1 -break -case 1:return A.w(q,r) -case 2:return A.v(o,r)}}) -return A.x($async$kU,r)}, -tx(a){return new A.kN(a)}, -kY(a){var s=0,r=A.y(t.z),q,p,o -var $async$kY=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:o=a.b -s=t.f.b(o)?3:4 -break -case 3:p=J.ac(o) -if(p.D(o,"logLevel")){p=A.dl(p.i(o,"logLevel")) -$.nw=p==null?0:p}p=$.ap -s=5 -return A.o((p==null?$.ap=A.cy():p).ct(o),$async$kY) -case 5:case 4:q=null -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$kY,r)}, -o_(a){var s=0,r=A.y(t.z),q -var $async$o_=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:if(J.a4(a.b,!0))$.nw=2 -q=null -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o_,r)}, -tv(a){return new A.kL(a)}, -o1(a,b){var s=0,r=A.y(t.I),q,p -var $async$o1=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:p=A.bU(a,"sql",t.N) -p.toString -q=b.fY(p,A.hd(a)) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o1,r)}, -tB(a){return new A.kR(a)}, -o4(a,b){var s=0,r=A.y(t.S),q,p -var $async$o4=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:p=A.bU(a,"sql",t.N) -p.toString -q=b.h1(p,A.hd(a)) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o4,r)}, -tp(a){return new A.kF(a)}, -tu(a){return new A.kK(a)}, -o0(a){var s=0,r=A.y(t.z),q -var $async$o0=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:if($.ap==null)$.ap=A.cy() -q="/" -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o0,r)}, -ts(a){return new A.kI(a)}, -kT(a){var s=0,r=A.y(t.H),q=1,p,o,n,m,l,k,j -var $async$kT=A.z(function(b,c){if(b===1){p=c -s=q}while(true)switch(s){case 0:l=A.kE(a) -k=$.j7.i(0,l) -if(k!=null){k.ad(0) -$.j7.J(0,l)}q=3 -o=$.ap -if(o==null)o=$.ap=A.cy() -n=l -n.toString -s=6 -return A.o(o.bu(n),$async$kT) -case 6:q=1 -s=5 -break -case 3:q=2 -j=p -s=5 -break -case 2:s=1 -break -case 5:return A.w(null,r) -case 1:return A.v(p,r)}}) -return A.x($async$kT,r)}, -tr(a){return new A.kH(a)}, -nZ(a){var s=0,r=A.y(t.y),q,p,o -var $async$nZ=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=A.kE(a) -o=$.ap -if(o==null)o=$.ap=A.cy() -p.toString -q=o.bx(p) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$nZ,r)}, -tA(a){return new A.kQ(a)}, -kZ(a){var s=0,r=A.y(t.f),q,p,o,n -var $async$kZ=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=A.kE(a) -o=$.ap -if(o==null)o=$.ap=A.cy() -p.toString -n=A -s=3 -return A.o(o.bE(p),$async$kZ) -case 3:q=n.aA(["bytes",c],t.N,t.X) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$kZ,r)}, -tC(a){return new A.kS(a)}, -o5(a){var s=0,r=A.y(t.H),q,p,o,n -var $async$o5=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=A.kE(a) -o=A.bU(a,"bytes",t.p) -n=$.ap -if(n==null)n=$.ap=A.cy() -p.toString -o.toString -q=n.bJ(p,o) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$o5,r)}, -e_:function e_(){this.c=this.b=this.a=null}, -iB:function iB(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=!1}, -ip:function ip(a,b){this.a=a -this.b=b}, -aQ:function aQ(a,b,c,d,e,f,g,h,i,j){var _=this -_.a=0 -_.b=null -_.c=a -_.d=b -_.e=c -_.f=d -_.r=e -_.w=f -_.x=g -_.y=h -_.z=i -_.Q=0 -_.as=j}, -kr:function kr(a,b,c){this.a=a -this.b=b -this.c=c}, -kp:function kp(a){this.a=a}, -kk:function kk(a){this.a=a}, -ks:function ks(a,b,c){this.a=a -this.b=b -this.c=c}, -kv:function kv(a,b,c){this.a=a -this.b=b -this.c=c}, -ku:function ku(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -kt:function kt(a,b,c){this.a=a -this.b=b -this.c=c}, -kq:function kq(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -ko:function ko(){}, -kn:function kn(a,b){this.a=a -this.b=b}, -kl:function kl(a,b,c,d,e,f){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e -_.f=f}, -km:function km(a,b){this.a=a -this.b=b}, -kB:function kB(a,b){this.a=a -this.b=b}, -kA:function kA(a){this.a=a}, -kM:function kM(a){this.a=a}, -kX:function kX(){}, -kG:function kG(a){this.a=a}, -kD:function kD(a){this.a=a}, -kP:function kP(a){this.a=a}, -kO:function kO(a){this.a=a}, -kJ:function kJ(a){this.a=a}, -kN:function kN(a){this.a=a}, -kL:function kL(a){this.a=a}, -kR:function kR(a){this.a=a}, -kF:function kF(a){this.a=a}, -kK:function kK(a){this.a=a}, -kI:function kI(a){this.a=a}, -kH:function kH(a){this.a=a}, -kQ:function kQ(a){this.a=a}, -kS:function kS(a){this.a=a}, -kj:function kj(a){this.a=a}, -ky:function ky(a){var _=this -_.a=a -_.b=$ -_.d=_.c=null}, -iC:function iC(){}, -j4(a){return A.uR(t.A.a(a))}, -uR(a8){var s=0,r=A.y(t.H),q=1,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7 -var $async$j4=A.z(function(a9,b0){if(a9===1){p=b0 -s=q}while(true)switch(s){case 0:t.hy.a(a8) -o=new A.bZ([],[]).av(a8.data,!0) -a1=a8.ports -a1.toString -n=J.bK(a1) -q=3 -s=typeof o=="string"?6:8 -break -case 6:J.cz(n,o) -s=7 -break -case 8:s=t.j.b(o)?9:11 -break -case 9:m=J.ad(o,0) -if(J.a4(m,"varSet")){l=t.f.a(J.ad(o,1)) -k=A.U(J.ad(l,"key")) -j=J.ad(l,"value") -A.b_($.eR+" "+A.t(m)+" "+A.t(k)+": "+A.t(j)) -$.qQ.j(0,k,j) -J.cz(n,null)}else if(J.a4(m,"varGet")){i=t.f.a(J.ad(o,1)) -h=A.U(J.ad(i,"key")) -g=$.qQ.i(0,h) -A.b_($.eR+" "+A.t(m)+" "+A.t(h)+": "+A.t(g)) -a1=t.N -J.cz(n,A.aA(["result",A.aA(["key",h,"value",g],a1,t.X)],a1,t.lb))}else{A.b_($.eR+" "+A.t(m)+" unknown") -J.cz(n,null)}s=10 -break -case 11:s=t.f.b(o)?12:14 -break -case 12:f=A.rL(o) -s=f!=null?15:17 -break -case 15:f=new A.fs(f.a,A.os(f.b)) -s=$.qx==null?18:19 -break -case 18:s=20 -return A.o(A.j8(new A.l_(),!0),$async$j4) -case 20:a1=b0 -$.qx=a1 -a1.toString -$.ap=new A.ky(a1) -case 19:e=new A.nd(n) -q=22 -s=25 -return A.o(A.kV(f),$async$j4) -case 25:d=b0 -d=A.ot(d) -e.$1(new A.cF(d,null)) -q=3 -s=24 -break -case 22:q=21 -a6=p -c=A.T(a6) -b=A.a1(a6) -a1=c -a3=b -a4=new A.cF($,$) -a5=A.X(t.N,t.X) -if(a1 instanceof A.bw){a5.j(0,"code",a1.w) -a5.j(0,"details",a1.x) -a5.j(0,"message",a1.a) -a5.j(0,"resultCode",a1.bP())}else a5.j(0,"message",J.bb(a1)) -a1=$.qo -if(!(a1==null?$.qo=!0:a1)&&a3!=null)a5.j(0,"stackTrace",a3.l(0)) -a4.b=a5 -a4.a=null -e.$1(a4) -s=24 -break -case 21:s=3 -break -case 24:s=16 -break -case 17:A.b_($.eR+" "+A.t(o)+" unknown") -J.cz(n,null) -case 16:s=13 -break -case 14:A.b_($.eR+" "+A.t(o)+" map unknown") -J.cz(n,null) -case 13:case 10:case 7:q=1 -s=5 -break -case 3:q=2 -a7=p -a=A.T(a7) -a0=A.a1(a7) -A.b_($.eR+" error caught "+A.t(a)+" "+A.t(a0)) -J.cz(n,null) -s=5 -break -case 2:s=1 -break -case 5:return A.w(null,r) -case 1:return A.v(p,r)}}) -return A.x($async$j4,r)}, -vI(a){var s,r -try{s=self -s.toString -A.b8(t.aD.a(s),"connect",t.Y.a(new A.nx()),!1,t.A)}catch(r){try{s=self -s.toString -J.ri(s,"message",A.oH())}catch(r){}}}, -nd:function nd(a){this.a=a}, -nx:function nx(){}, -ql(a){if(a==null)return!0 -else if(typeof a=="number"||typeof a=="string"||A.c2(a))return!0 -return!1}, -qq(a){var s,r=J.V(a) -if(r.gk(a)===1){s=J.bK(r.gH(a)) -if(typeof s=="string")return B.b.M(s,"@") -throw A.b(A.bn(s,null,null))}return!1}, -ot(a){var s,r,q,p,o,n,m,l,k={} -if(A.ql(a))return a -a.toString -for(s=$.oN(),r=0;r<1;++r){q=s[r] -p=A.B(q).h("di.T") -if(p.b(a))return A.aA(["@"+q.a,t.dz.a(p.a(a)).l(0)],t.N,t.X)}if(t.f.b(a)){if(A.qq(a))return A.aA(["@",a],t.N,t.X) -k.a=null -J.bl(a,new A.nb(k,a)) -s=k.a -if(s==null)s=a -return s}else if(t.j.b(a)){for(s=J.V(a),p=t.z,o=null,n=0;n")),n=new A.aa(o,c.h("aa<0>")) -p.a=p.b=null -s=new A.ka(p) -r=t.Y -q=t.A -p.b=A.b8(a,"success",r.a(new A.kb(s,n,b,a,c)),!1,q) -p.a=A.b8(a,"error",r.a(new A.kc(p,s,n)),!1,q) -return o}, -ka:function ka(a){this.a=a}, -kb:function kb(a,b,c,d,e){var _=this -_.a=a -_.b=b -_.c=c -_.d=d -_.e=e}, -k9:function k9(a,b,c){this.a=a -this.b=b -this.c=c}, -kc:function kc(a,b,c){this.a=a -this.b=b -this.c=c}, -d8:function d8(a,b){var _=this -_.c=_.b=_.a=null -_.d=a -_.$ti=b}, -lG:function lG(a,b){this.a=a -this.b=b}, -lH:function lH(a,b){this.a=a -this.b=b}, -jA:function jA(){}, -ll(a,b){var s=0,r=A.y(t.ax),q,p,o,n,m -var $async$ll=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:o={} -b.B(0,new A.ln(o)) -p=t.N -p=new A.hC(A.X(p,t.Z),A.X(p,t.ng)) -n=p -m=J -s=3 -return A.o(A.nA(self.WebAssembly.instantiateStreaming(a,o),t.ot),$async$ll) -case 3:n.eu(m.rp(d)) -q=p -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$ll,r)}, -n0:function n0(){}, -de:function de(){}, -hC:function hC(a,b){this.a=a -this.b=b}, -ln:function ln(a){this.a=a}, -lm:function lm(a){this.a=a}, -jT:function jT(){}, -cI:function cI(){}, -lp(a){var s=0,r=A.y(t.es),q,p,o -var $async$lp=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=t.d9 -o=A -s=3 -return A.o(A.nA(self.fetch(a.gdT()?p.a(new globalThis.URL(a.l(0))):p.a(new globalThis.URL(a.l(0),A.o8().l(0))),null),p),$async$lp) -case 3:q=o.lo(c) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$lp,r)}, -lo(a){var s=0,r=A.y(t.es),q,p,o -var $async$lo=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=A -o=A -s=3 -return A.o(A.lk(a),$async$lo) -case 3:q=new p.hD(new o.hE(c)) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$lo,r)}, -hD:function hD(a){this.a=a}, -ls:function ls(){}, -fz(a){var s=0,r=A.y(t.cF),q,p,o,n,m,l -var $async$fz=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=t.N -o=new A.ji(a) -n=A.rP() -m=$.oJ() -l=new A.cd(o,n,new A.cP(t.h),A.t0(p),A.X(p,t.S),m,"indexeddb") -s=3 -return A.o(o.bB(0),$async$fz) -case 3:s=4 -return A.o(l.aW(),$async$fz) -case 4:q=l -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$fz,r)}, -ji:function ji(a){this.a=null -this.b=a}, -jn:function jn(){}, -jm:function jm(a){this.a=a}, -jj:function jj(a){this.a=a}, -jo:function jo(a,b,c,d){var _=this -_.a=a -_.b=b -_.c=c -_.d=d}, -jl:function jl(a,b){this.a=a -this.b=b}, -jk:function jk(a,b){this.a=a -this.b=b}, -b9:function b9(){}, -lN:function lN(a,b,c){this.a=a -this.b=b -this.c=c}, -lO:function lO(a,b){this.a=a -this.b=b}, -il:function il(a,b){this.a=a -this.b=b}, -cd:function cd(a,b,c,d,e,f,g){var _=this -_.d=a -_.f=null -_.r=b -_.w=c -_.x=d -_.y=e -_.b=f -_.a=g}, -jI:function jI(a){this.a=a}, -jJ:function jJ(){}, -i6:function i6(a,b,c){this.a=a -this.b=b -this.c=c}, -m1:function m1(a,b){this.a=a -this.b=b}, -a9:function a9(){}, -da:function da(a,b){var _=this -_.w=a -_.d=b -_.c=_.b=_.a=null}, -d9:function d9(a,b,c){var _=this -_.w=a -_.x=b -_.d=c -_.c=_.b=_.a=null}, -cp:function cp(a,b,c){var _=this -_.w=a -_.x=b -_.d=c -_.c=_.b=_.a=null}, -cw:function cw(a,b,c,d,e){var _=this -_.w=a -_.x=b -_.y=c -_.z=d -_.d=e -_.c=_.b=_.a=null}, -rP(){var s=$.oJ() -return new A.fx(A.X(t.N,t.nh),s,"dart-memory")}, -fx:function fx(a,b,c){this.d=a -this.b=b -this.a=c}, -i5:function i5(a,b,c){var _=this -_.a=a -_.b=b -_.c=c -_.d=0}, -lk(c1){var s=0,r=A.y(t.n0),q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,c0 -var $async$lk=A.z(function(c2,c3){if(c2===1)return A.v(c3,r) -while(true)switch(s){case 0:b9=A.u4() -c0=b9.b -c0===$&&A.bk("injectedValues") -s=3 -return A.o(A.ll(c1,c0),$async$lk) -case 3:p=c3 -c0=b9.c -c0===$&&A.bk("memory") -o=p.a -n=o.i(0,"dart_sqlite3_malloc") -n.toString -m=o.i(0,"dart_sqlite3_free") -m.toString -o.i(0,"dart_sqlite3_create_scalar_function").toString -o.i(0,"dart_sqlite3_create_aggregate_function").toString -o.i(0,"dart_sqlite3_create_window_function").toString -o.i(0,"dart_sqlite3_create_collation").toString -l=o.i(0,"dart_sqlite3_register_vfs") -l.toString -o.i(0,"sqlite3_vfs_unregister").toString -k=o.i(0,"dart_sqlite3_updates") -k.toString -o.i(0,"sqlite3_libversion").toString -o.i(0,"sqlite3_sourceid").toString -o.i(0,"sqlite3_libversion_number").toString -j=o.i(0,"sqlite3_open_v2") -j.toString -i=o.i(0,"sqlite3_close_v2") -i.toString -h=o.i(0,"sqlite3_extended_errcode") -h.toString -g=o.i(0,"sqlite3_errmsg") -g.toString -f=o.i(0,"sqlite3_errstr") -f.toString -e=o.i(0,"sqlite3_extended_result_codes") -e.toString -d=o.i(0,"sqlite3_exec") -d.toString -o.i(0,"sqlite3_free").toString -c=o.i(0,"sqlite3_prepare_v3") -c.toString -b=o.i(0,"sqlite3_bind_parameter_count") -b.toString -a=o.i(0,"sqlite3_column_count") -a.toString -a0=o.i(0,"sqlite3_column_name") -a0.toString -a1=o.i(0,"sqlite3_reset") -a1.toString -a2=o.i(0,"sqlite3_step") -a2.toString -a3=o.i(0,"sqlite3_finalize") -a3.toString -a4=o.i(0,"sqlite3_column_type") -a4.toString -a5=o.i(0,"sqlite3_column_int64") -a5.toString -a6=o.i(0,"sqlite3_column_double") -a6.toString -a7=o.i(0,"sqlite3_column_bytes") -a7.toString -a8=o.i(0,"sqlite3_column_blob") -a8.toString -a9=o.i(0,"sqlite3_column_text") -a9.toString -b0=o.i(0,"sqlite3_bind_null") -b0.toString -b1=o.i(0,"sqlite3_bind_int64") -b1.toString -b2=o.i(0,"sqlite3_bind_double") -b2.toString -b3=o.i(0,"sqlite3_bind_text") -b3.toString -b4=o.i(0,"sqlite3_bind_blob64") -b4.toString -b5=o.i(0,"sqlite3_bind_parameter_index") -b5.toString -b6=o.i(0,"sqlite3_changes") -b6.toString -b7=o.i(0,"sqlite3_last_insert_rowid") -b7.toString -b8=o.i(0,"sqlite3_user_data") -b8.toString -o.i(0,"sqlite3_result_null").toString -o.i(0,"sqlite3_result_int64").toString -o.i(0,"sqlite3_result_double").toString -o.i(0,"sqlite3_result_text").toString -o.i(0,"sqlite3_result_blob64").toString -o.i(0,"sqlite3_result_error").toString -o.i(0,"sqlite3_value_type").toString -o.i(0,"sqlite3_value_int64").toString -o.i(0,"sqlite3_value_double").toString -o.i(0,"sqlite3_value_bytes").toString -o.i(0,"sqlite3_value_text").toString -o.i(0,"sqlite3_value_blob").toString -o.i(0,"sqlite3_aggregate_context").toString -o.i(0,"dart_sqlite3_db_config_int") -p.b.i(0,"sqlite3_temp_directory").toString -q=b9.a=new A.hA(c0,b9.d,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a4,a5,a6,a7,a9,a8,b0,b1,b2,b3,b4,b5,a3,b6,b7,b8) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$lk,r)}, -aK(a){var s,r,q -try{a.$0() -return 0}catch(r){q=A.T(r) -if(q instanceof A.e9){s=q -return s.a}else return 1}}, -ob(a,b){var s=A.b6(t.J.a(a.buffer),b,null),r=s.length,q=0 -while(!0){if(!(q=65&&a<=90))s=a>=97&&a<=122 -else s=!0 -return s}, -vD(a,b){var s,r=a.length,q=b+2 -if(r=0&&b=0&&q4294967295)throw A.b(A.au(a,0,4294967295,"length",null)) -return J.rV(new Array(a),b)}, -rU(a,b){if(a<0)throw A.b(A.ak("Length must be a non-negative integer: "+a,null)) -return A.u(new Array(a),b.h("M<0>"))}, -p9(a,b){if(a<0)throw A.b(A.ak("Length must be a non-negative integer: "+a,null)) -return A.u(new Array(a),b.h("M<0>"))}, -rV(a,b){return J.jK(A.u(a,b.h("M<0>")),b)}, -jK(a,b){a.fixed$length=Array -return a}, -pb(a){a.fixed$length=Array -a.immutable$list=Array -return a}, -rW(a,b){var s=t.bP -return J.rl(s.a(a),s.a(b))}, -pc(a){if(a<256)switch(a){case 9:case 10:case 11:case 12:case 13:case 32:case 133:case 160:return!0 -default:return!1}switch(a){case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8232:case 8233:case 8239:case 8287:case 12288:case 65279:return!0 -default:return!1}}, -rX(a,b){var s,r -for(s=a.length;b0;b=r){r=b-1 -if(!(r>>0===b&&b").t(b).h("b1<1,2>"))}, -m(a,b){A.ab(a).c.a(b) -if(!!a.fixed$length)A.Q(A.F("add")) -a.push(b)}, -hu(a,b){var s -if(!!a.fixed$length)A.Q(A.F("removeAt")) -s=a.length -if(b>=s)throw A.b(A.pm(b,null)) -return a.splice(b,1)[0]}, -h3(a,b,c){var s,r -A.ab(a).h("e<1>").a(c) -if(!!a.fixed$length)A.Q(A.F("insertAll")) -A.ti(b,0,a.length,"index") -if(!t.Q.b(c))c=J.rx(c) -s=J.Z(c) -a.length=a.length+s -r=b+s -this.L(a,r,a.length,a,b) -this.U(a,b,r,c)}, -J(a,b){var s -if(!!a.fixed$length)A.Q(A.F("remove")) -for(s=0;s").a(b) -if(!!a.fixed$length)A.Q(A.F("addAll")) -if(Array.isArray(b)){this.eB(a,b) -return}for(s=J.aq(b);s.n();)a.push(s.gq(s))}, -eB(a,b){var s,r -t.b.a(b) -s=b.length -if(s===0)return -if(a===b)throw A.b(A.ar(a)) -for(r=0;r").t(c).h("ag<1,2>"))}, -al(a,b){var s,r=A.dK(a.length,"",!1,t.N) -for(s=0;s=0&&b0)return a[0] -throw A.b(A.bq())}, -ga6(a){var s=a.length -if(s>0)return a[s-1] -throw A.b(A.bq())}, -L(a,b,c,d,e){var s,r,q,p,o -A.ab(a).h("e<1>").a(d) -if(!!a.immutable$list)A.Q(A.F("setRange")) -A.bt(b,c,a.length) -s=c-b -if(s===0)return -A.aP(e,"skipCount") -if(t.j.b(d)){r=d -q=e}else{r=J.nJ(d,e).aI(0,!1) -q=0}p=J.V(r) -if(q+s>p.gk(r))throw A.b(A.p8()) -if(q=0;--o)a[b+o]=p.i(r,q+o) -else for(o=0;o=r -for(s=q;s>=0;--s){if(!(s"))}, -gA(a){return A.dU(a)}, -gk(a){return a.length}, -i(a,b){if(!(b>=0&&b=0&&b=p){r.scW(null) -return!1}r.scW(q[s]);++r.c -return!0}, -scW(a){this.d=this.$ti.h("1?").a(a)}, -$iL:1} -J.cN.prototype={ -a0(a,b){var s -A.uB(b) -if(ab)return 1 -else if(a===b){if(a===0){s=this.gcB(b) -if(this.gcB(a)===s)return 0 -if(this.gcB(a))return-1 -return 1}return 0}else if(isNaN(a)){if(isNaN(b))return 0 -return 1}else return-1}, -gcB(a){return a===0?1/a<0:a<0}, -fE(a){var s,r -if(a>=0){if(a<=2147483647){s=a|0 -return a===s?s:s+1}}else if(a>=-2147483648)return a|0 -r=Math.ceil(a) -if(isFinite(r))return r -throw A.b(A.F(""+a+".ceil()"))}, -l(a){if(a===0&&1/a<0)return"-0.0" -else return""+a}, -gA(a){var s,r,q,p,o=a|0 -if(a===o)return o&536870911 -s=Math.abs(a) -r=Math.log(s)/0.6931471805599453|0 -q=Math.pow(2,r) -p=s<1?s/q:q/s -return((p*9007199254740992|0)+(p*3542243181176521|0))*599197+r*1259&536870911}, -a7(a,b){var s=a%b -if(s===0)return 0 -if(s>0)return s -return s+b}, -er(a,b){if((a|0)===a)if(b>=1||b<-1)return a/b|0 -return this.du(a,b)}, -G(a,b){return(a|0)===a?a/b|0:this.du(a,b)}, -du(a,b){var s=a/b -if(s>=-2147483648&&s<=2147483647)return s|0 -if(s>0){if(s!==1/0)return Math.floor(s)}else if(s>-1/0)return Math.ceil(s) -throw A.b(A.F("Result of truncating division is "+A.t(s)+": "+A.t(a)+" ~/ "+b))}, -aM(a,b){if(b<0)throw A.b(A.nj(b)) -return b>31?0:a<>>0}, -aN(a,b){var s -if(b<0)throw A.b(A.nj(b)) -if(a>0)s=this.ci(a,b) -else{s=b>31?31:b -s=a>>s>>>0}return s}, -R(a,b){var s -if(a>0)s=this.ci(a,b) -else{s=b>31?31:b -s=a>>s>>>0}return s}, -fp(a,b){if(0>b)throw A.b(A.nj(b)) -return this.ci(a,b)}, -ci(a,b){return b>31?0:a>>>b}, -gF(a){return A.bi(t.cZ)}, -$ial:1, -$iN:1, -$ia_:1} -J.dG.prototype={ -gdH(a){var s,r=a<0?-a-1:a,q=r -for(s=32;q>=4294967296;){q=this.G(q,4294967296) -s+=32}return s-Math.clz32(q)}, -gF(a){return A.bi(t.S)}, -$iS:1, -$id:1} -J.fD.prototype={ -gF(a){return A.bi(t.i)}, -$iS:1} -J.bR.prototype={ -fF(a,b){if(b<0)throw A.b(A.eT(a,b)) -if(b>=a.length)A.Q(A.eT(a,b)) -return a.charCodeAt(b)}, -dF(a,b){return new A.iF(b,a,0)}, -b7(a,b){return a+b}, -dL(a,b){var s=b.length,r=a.length -if(s>r)return!1 -return b===this.a_(a,r-s)}, -aG(a,b,c,d){var s=A.bt(b,c,a.length) -return a.substring(0,b)+d+a.substring(s)}, -I(a,b,c){var s -if(c<0||c>a.length)throw A.b(A.au(c,0,a.length,null,null)) -s=c+b.length -if(s>a.length)return!1 -return b===a.substring(c,s)}, -M(a,b){return this.I(a,b,0)}, -p(a,b,c){return a.substring(b,A.bt(b,c,a.length))}, -a_(a,b){return this.p(a,b,null)}, -hA(a){var s,r,q,p=a.trim(),o=p.length -if(o===0)return p -if(0>=o)return A.c(p,0) -if(p.charCodeAt(0)===133){s=J.rX(p,1) -if(s===o)return""}else s=0 -r=o-1 -if(!(r>=0))return A.c(p,r) -q=p.charCodeAt(r)===133?J.rY(p,r):o -if(s===0&&q===o)return p -return p.substring(s,q)}, -b8(a,b){var s,r -if(0>=b)return"" -if(b===1||a.length===0)return a -if(b!==b>>>0)throw A.b(B.U) -for(s=a,r="";!0;){if((b&1)===1)r=s+r -b=b>>>1 -if(b===0)break -s+=s}return r}, -ho(a,b,c){var s=b-a.length -if(s<=0)return a -return this.b8(c,s)+a}, -ak(a,b,c){var s -if(c<0||c>a.length)throw A.b(A.au(c,0,a.length,null,null)) -s=a.indexOf(b,c) -return s}, -cv(a,b){return this.ak(a,b,0)}, -N(a,b){return A.vK(a,b,0)}, -a0(a,b){var s -A.U(b) -if(a===b)s=0 -else s=a>6}r=r+((r&67108863)<<3)&536870911 -r^=r>>11 -return r+((r&16383)<<15)&536870911}, -gF(a){return A.bi(t.N)}, -gk(a){return a.length}, -$iS:1, -$ial:1, -$ik2:1, -$ij:1} -A.c_.prototype={ -gC(a){var s=A.B(this) -return new A.dt(J.aq(this.gac()),s.h("@<1>").t(s.z[1]).h("dt<1,2>"))}, -gk(a){return J.Z(this.gac())}, -Z(a,b){var s=A.B(this) -return A.f8(J.nJ(this.gac(),b),s.c,s.z[1])}, -u(a,b){return A.B(this).z[1].a(J.jf(this.gac(),b))}, -gv(a){return A.B(this).z[1].a(J.bK(this.gac()))}, -N(a,b){return J.nI(this.gac(),b)}, -l(a){return J.bb(this.gac())}} -A.dt.prototype={ -n(){return this.a.n()}, -gq(a){var s=this.a -return this.$ti.z[1].a(s.gq(s))}, -$iL:1} -A.c6.prototype={ -gac(){return this.a}} -A.ej.prototype={$il:1} -A.ef.prototype={ -i(a,b){return this.$ti.z[1].a(J.ad(this.a,b))}, -j(a,b,c){var s=this.$ti -J.nH(this.a,b,s.c.a(s.z[1].a(c)))}, -L(a,b,c,d,e){var s=this.$ti -J.rv(this.a,b,c,A.f8(s.h("e<2>").a(d),s.z[1],s.c),e)}, -U(a,b,c,d){return this.L(a,b,c,d,0)}, -$il:1, -$in:1} -A.b1.prototype={ -br(a,b){return new A.b1(this.a,this.$ti.h("@<1>").t(b).h("b1<1,2>"))}, -gac(){return this.a}} -A.du.prototype={ -D(a,b){return J.rm(this.a,b)}, -i(a,b){return this.$ti.h("4?").a(J.ad(this.a,b))}, -B(a,b){J.bl(this.a,new A.jv(this,this.$ti.h("~(3,4)").a(b)))}, -gH(a){var s=this.$ti -return A.f8(J.oT(this.a),s.c,s.z[2])}, -gO(a){var s=this.$ti -return A.f8(J.rq(this.a),s.z[1],s.z[3])}, -gk(a){return J.Z(this.a)}, -gaz(a){return J.oS(this.a).af(0,new A.ju(this),this.$ti.h("a6<3,4>"))}} -A.jv.prototype={ -$2(a,b){var s=this.a.$ti -s.c.a(a) -s.z[1].a(b) -this.b.$2(s.z[2].a(a),s.z[3].a(b))}, -$S(){return this.a.$ti.h("~(1,2)")}} -A.ju.prototype={ -$1(a){var s,r=this.a.$ti -r.h("a6<1,2>").a(a) -s=r.z[3] -return new A.a6(r.z[2].a(a.a),s.a(a.b),r.h("@<3>").t(s).h("a6<1,2>"))}, -$S(){return this.a.$ti.h("a6<3,4>(a6<1,2>)")}} -A.cf.prototype={ -l(a){return"LateInitializationError: "+this.a}} -A.dv.prototype={ -gk(a){return this.a.length}, -i(a,b){var s=this.a -if(!(b>=0&&b"))}, -gv(a){if(this.gk(this)===0)throw A.b(A.bq()) -return this.u(0,0)}, -N(a,b){var s,r=this,q=r.gk(r) -for(s=0;s").t(c).h("ag<1,2>"))}, -Z(a,b){return A.e5(this,b,null,A.B(this).h("a5.E"))}} -A.ci.prototype={ -es(a,b,c,d){var s,r=this.b -A.aP(r,"start") -s=this.c -if(s!=null){A.aP(s,"end") -if(r>s)throw A.b(A.au(r,0,s,"start",null))}}, -geV(){var s=J.Z(this.a),r=this.c -if(r==null||r>s)return s -return r}, -gfs(){var s=J.Z(this.a),r=this.b -if(r>s)return s -return r}, -gk(a){var s,r=J.Z(this.a),q=this.b -if(q>=r)return 0 -s=this.c -if(s==null||s>=r)return r-q -if(typeof s!=="number")return s.aP() -return s-q}, -u(a,b){var s=this,r=s.gfs()+b -if(b<0||r>=s.geV())throw A.b(A.W(b,s.gk(s),s,null,"index")) -return J.jf(s.a,r)}, -Z(a,b){var s,r,q=this -A.aP(b,"count") -s=q.b+b -r=q.c -if(r!=null&&s>=r)return new A.c9(q.$ti.h("c9<1>")) -return A.e5(q.a,s,r,q.$ti.c)}, -aI(a,b){var s,r,q,p=this,o=p.b,n=p.a,m=J.V(n),l=m.gk(n),k=p.c -if(k!=null&&k=o){r.saR(null) -return!1}r.saR(p.u(q,s));++r.c -return!0}, -saR(a){this.d=this.$ti.h("1?").a(a)}, -$iL:1} -A.bs.prototype={ -gC(a){var s=A.B(this) -return new A.dM(J.aq(this.a),this.b,s.h("@<1>").t(s.z[1]).h("dM<1,2>"))}, -gk(a){return J.Z(this.a)}, -gv(a){return this.b.$1(J.bK(this.a))}, -u(a,b){return this.b.$1(J.jf(this.a,b))}} -A.c8.prototype={$il:1} -A.dM.prototype={ -n(){var s=this,r=s.b -if(r.n()){s.saR(s.c.$1(r.gq(r))) -return!0}s.saR(null) -return!1}, -gq(a){var s=this.a -return s==null?this.$ti.z[1].a(s):s}, -saR(a){this.a=this.$ti.h("2?").a(a)}, -$iL:1} -A.ag.prototype={ -gk(a){return J.Z(this.a)}, -u(a,b){return this.b.$1(J.jf(this.a,b))}} -A.lr.prototype={ -gC(a){return new A.cl(J.aq(this.a),this.b,this.$ti.h("cl<1>"))}, -af(a,b,c){var s=this.$ti -return new A.bs(this,s.t(c).h("1(2)").a(b),s.h("@<1>").t(c).h("bs<1,2>"))}} -A.cl.prototype={ -n(){var s,r -for(s=this.a,r=this.b;s.n();)if(A.dp(r.$1(s.gq(s))))return!0 -return!1}, -gq(a){var s=this.a -return s.gq(s)}, -$iL:1} -A.bv.prototype={ -Z(a,b){A.jg(b,"count",t.S) -A.aP(b,"count") -return new A.bv(this.a,this.b+b,A.B(this).h("bv<1>"))}, -gC(a){return new A.dY(J.aq(this.a),this.b,A.B(this).h("dY<1>"))}} -A.cE.prototype={ -gk(a){var s=J.Z(this.a)-this.b -if(s>=0)return s -return 0}, -Z(a,b){A.jg(b,"count",t.S) -A.aP(b,"count") -return new A.cE(this.a,this.b+b,this.$ti)}, -$il:1} -A.dY.prototype={ -n(){var s,r -for(s=this.a,r=0;r"))}, -Z(a,b){A.aP(b,"count") -return this}} -A.dA.prototype={ -n(){return!1}, -gq(a){throw A.b(A.bq())}, -$iL:1} -A.ea.prototype={ -gC(a){return new A.eb(J.aq(this.a),this.$ti.h("eb<1>"))}} -A.eb.prototype={ -n(){var s,r -for(s=this.a,r=this.$ti.c;s.n();)if(r.b(s.gq(s)))return!0 -return!1}, -gq(a){var s=this.a -return this.$ti.c.a(s.gq(s))}, -$iL:1} -A.at.prototype={} -A.bX.prototype={ -j(a,b,c){A.B(this).h("bX.E").a(c) -throw A.b(A.F("Cannot modify an unmodifiable list"))}, -L(a,b,c,d,e){A.B(this).h("e").a(d) -throw A.b(A.F("Cannot modify an unmodifiable list"))}, -U(a,b,c,d){return this.L(a,b,c,d,0)}} -A.d3.prototype={} -A.ib.prototype={ -gk(a){return J.Z(this.a)}, -u(a,b){var s=J.Z(this.a) -if(0>b||b>=s)A.Q(A.W(b,s,this,null,"index")) -return b}} -A.dJ.prototype={ -i(a,b){return this.D(0,b)?J.ad(this.a,A.h(b)):null}, -gk(a){return J.Z(this.a)}, -gO(a){return A.e5(this.a,0,null,this.$ti.c)}, -gH(a){return new A.ib(this.a)}, -D(a,b){return A.j5(b)&&b>=0&&b>"))}, -fP(a){var s=this -return function(){var r=a -var q=0,p=1,o,n,m,l,k,j -return function $async$gaz(b,c,d){if(c===1){o=d -q=p}while(true)switch(q){case 0:n=s.gH(s),n=n.gC(n),m=A.B(s),l=m.z[1],m=m.h("@<1>").t(l).h("a6<1,2>") -case 2:if(!n.n()){q=3 -break}k=n.gq(n) -j=s.i(0,k) -q=4 -return b.b=new A.a6(k,j==null?l.a(j):j,m),1 -case 4:q=2 -break -case 3:return 0 -case 1:return b.c=o,3}}}}, -$iJ:1} -A.c7.prototype={ -gk(a){return this.b.length}, -gde(){var s=this.$keys -if(s==null){s=Object.keys(this.a) -this.$keys=s}return s}, -D(a,b){if(typeof b!="string")return!1 -if("__proto__"===b)return!1 -return this.a.hasOwnProperty(b)}, -i(a,b){if(!this.D(0,b))return null -return this.b[this.a[b]]}, -B(a,b){var s,r,q,p -this.$ti.h("~(1,2)").a(b) -s=this.gde() -r=this.b -for(q=s.length,p=0;p"))}, -gO(a){return new A.cs(this.b,this.$ti.h("cs<2>"))}} -A.cs.prototype={ -gk(a){return this.a.length}, -gC(a){var s=this.a -return new A.el(s,s.length,this.$ti.h("el<1>"))}} -A.el.prototype={ -gq(a){var s=this.d -return s==null?this.$ti.c.a(s):s}, -n(){var s=this,r=s.c -if(r>=s.b){s.saS(null) -return!1}s.saS(s.a[r]);++s.c -return!0}, -saS(a){this.d=this.$ti.h("1?").a(a)}, -$iL:1} -A.fC.prototype={ -ghg(){var s=this.a -return s}, -ghq(){var s,r,q,p,o=this -if(o.c===1)return B.D -s=o.d -r=s.length-o.e.length-o.f -if(r===0)return B.D -q=[] -for(p=0;p=0&&l>>0}, -l(a){return"Closure '"+this.$_name+"' of "+("Instance of '"+A.k4(this.a)+"'")}} -A.hR.prototype={ -l(a){return"Reading static variable '"+this.a+"' during its initialization"}} -A.h6.prototype={ -l(a){return"RuntimeError: "+this.a}} -A.hL.prototype={ -l(a){return"Assertion failed: "+A.ca(this.a)}} -A.mM.prototype={} -A.b3.prototype={ -gk(a){return this.a}, -gha(a){return this.a!==0}, -gH(a){return new A.b4(this,A.B(this).h("b4<1>"))}, -gO(a){var s=A.B(this) -return A.pg(new A.b4(this,s.h("b4<1>")),new A.jN(this),s.c,s.z[1])}, -D(a,b){var s,r -if(typeof b=="string"){s=this.b -if(s==null)return!1 -return s[b]!=null}else if(typeof b=="number"&&(b&0x3fffffff)===b){r=this.c -if(r==null)return!1 -return r[b]!=null}else return this.h6(b)}, -h6(a){var s=this.d -if(s==null)return!1 -return this.bz(s[this.by(a)],a)>=0}, -aY(a,b){J.bl(A.B(this).h("J<1,2>").a(b),new A.jM(this))}, -i(a,b){var s,r,q,p,o=null -if(typeof b=="string"){s=this.b -if(s==null)return o -r=s[b] -q=r==null?o:r.b -return q}else if(typeof b=="number"&&(b&0x3fffffff)===b){p=this.c -if(p==null)return o -r=p[b] -q=r==null?o:r.b -return q}else return this.h7(b)}, -h7(a){var s,r,q=this.d -if(q==null)return null -s=q[this.by(a)] -r=this.bz(s,a) -if(r<0)return null -return s[r].b}, -j(a,b,c){var s,r,q=this,p=A.B(q) -p.c.a(b) -p.z[1].a(c) -if(typeof b=="string"){s=q.b -q.cX(s==null?q.b=q.cd():s,b,c)}else if(typeof b=="number"&&(b&0x3fffffff)===b){r=q.c -q.cX(r==null?q.c=q.cd():r,b,c)}else q.h9(b,c)}, -h9(a,b){var s,r,q,p,o=this,n=A.B(o) -n.c.a(a) -n.z[1].a(b) -s=o.d -if(s==null)s=o.d=o.cd() -r=o.by(a) -q=s[r] -if(q==null)s[r]=[o.ce(a,b)] -else{p=o.bz(q,a) -if(p>=0)q[p].b=b -else q.push(o.ce(a,b))}}, -hs(a,b,c){var s,r,q=this,p=A.B(q) -p.c.a(b) -p.h("2()").a(c) -if(q.D(0,b)){s=q.i(0,b) -return s==null?p.z[1].a(s):s}r=c.$0() -q.j(0,b,r) -return r}, -J(a,b){var s=this -if(typeof b=="string")return s.dm(s.b,b) -else if(typeof b=="number"&&(b&0x3fffffff)===b)return s.dm(s.c,b) -else return s.h8(b)}, -h8(a){var s,r,q,p,o=this,n=o.d -if(n==null)return null -s=o.by(a) -r=n[s] -q=o.bz(r,a) -if(q<0)return null -p=r.splice(q,1)[0] -o.dB(p) -if(r.length===0)delete n[s] -return p.b}, -B(a,b){var s,r,q=this -A.B(q).h("~(1,2)").a(b) -s=q.e -r=q.r -for(;s!=null;){b.$2(s.a,s.b) -if(r!==q.r)throw A.b(A.ar(q)) -s=s.c}}, -cX(a,b,c){var s,r=A.B(this) -r.c.a(b) -r.z[1].a(c) -s=a[b] -if(s==null)a[b]=this.ce(b,c) -else s.b=c}, -dm(a,b){var s -if(a==null)return null -s=a[b] -if(s==null)return null -this.dB(s) -delete a[b] -return s.b}, -dg(){this.r=this.r+1&1073741823}, -ce(a,b){var s=this,r=A.B(s),q=new A.jO(r.c.a(a),r.z[1].a(b)) -if(s.e==null)s.e=s.f=q -else{r=s.f -r.toString -q.d=r -s.f=r.c=q}++s.a -s.dg() -return q}, -dB(a){var s=this,r=a.d,q=a.c -if(r==null)s.e=q -else r.c=q -if(q==null)s.f=r -else q.d=r;--s.a -s.dg()}, -by(a){return J.bm(a)&1073741823}, -bz(a,b){var s,r -if(a==null)return-1 -s=a.length -for(r=0;r"]=s -delete s[""] -return s}, -$ipe:1} -A.jN.prototype={ -$1(a){var s=this.a,r=A.B(s) -s=s.i(0,r.c.a(a)) -return s==null?r.z[1].a(s):s}, -$S(){return A.B(this.a).h("2(1)")}} -A.jM.prototype={ -$2(a,b){var s=this.a,r=A.B(s) -s.j(0,r.c.a(a),r.z[1].a(b))}, -$S(){return A.B(this.a).h("~(1,2)")}} -A.jO.prototype={} -A.b4.prototype={ -gk(a){return this.a.a}, -gC(a){var s=this.a,r=new A.dI(s,s.r,this.$ti.h("dI<1>")) -r.c=s.e -return r}, -N(a,b){return this.a.D(0,b)}} -A.dI.prototype={ -gq(a){return this.d}, -n(){var s,r=this,q=r.a -if(r.b!==q.r)throw A.b(A.ar(q)) -s=r.c -if(s==null){r.saS(null) -return!1}else{r.saS(s.a) -r.c=s.c -return!0}}, -saS(a){this.d=this.$ti.h("1?").a(a)}, -$iL:1} -A.nr.prototype={ -$1(a){return this.a(a)}, -$S:64} -A.ns.prototype={ -$2(a,b){return this.a(a,b)}, -$S:37} -A.nt.prototype={ -$1(a){return this.a(A.U(a))}, -$S:74} -A.cu.prototype={ -gF(a){return A.bi(this.da())}, -da(){return A.vs(this.$r,this.d8())}, -l(a){return this.dz(!1)}, -dz(a){var s,r,q,p,o,n=this.eZ(),m=this.d8(),l=(a?""+"Record ":"")+"(" -for(s=n.length,r="",q=0;q0;){--q;--s -B.a.j(j,q,r[s])}}return A.dL(j,k)}} -A.dc.prototype={ -d8(){return[this.a,this.b]}, -K(a,b){if(b==null)return!1 -return b instanceof A.dc&&this.$s===b.$s&&J.a4(this.a,b.a)&&J.a4(this.b,b.b)}, -gA(a){return A.nT(this.$s,this.a,this.b,B.p)}} -A.cO.prototype={ -l(a){return"RegExp/"+this.a+"/"+this.b.flags}, -gf6(){var s=this,r=s.c -if(r!=null)return r -r=s.b -return s.c=A.pd(s.a,r.multiline,!r.ignoreCase,r.unicode,r.dotAll,!0)}, -fR(a){var s=this.b.exec(a) -if(s==null)return null -return new A.eq(s)}, -dF(a,b){return new A.hJ(this,b,0)}, -eX(a,b){var s,r=this.gf6() -if(r==null)r=t.K.a(r) -r.lastIndex=b -s=r.exec(a) -if(s==null)return null -return new A.eq(s)}, -$ik2:1, -$itj:1} -A.eq.prototype={$icR:1,$idW:1} -A.hJ.prototype={ -gC(a){return new A.hK(this.a,this.b,this.c)}} -A.hK.prototype={ -gq(a){var s=this.d -return s==null?t.lu.a(s):s}, -n(){var s,r,q,p,o,n,m=this,l=m.b -if(l==null)return!1 -s=m.c -r=l.length -if(s<=r){q=m.a -p=q.eX(l,s) -if(p!=null){m.d=p -s=p.b -o=s.index -n=o+s[0].length -if(o===n){if(q.b.unicode){s=m.c -q=s+1 -if(q=0&&s=55296&&s<=56319){if(!(q>=0))return A.c(l,q) -s=l.charCodeAt(q) -s=s>=56320&&s<=57343}else s=!1}else s=!1}else s=!1 -n=(s?n+1:n)+1}m.c=n -return!0}}m.b=m.d=null -return!1}, -$iL:1} -A.e4.prototype={$icR:1} -A.iF.prototype={ -gC(a){return new A.iG(this.a,this.b,this.c)}, -gv(a){var s=this.b,r=this.a.indexOf(s,this.c) -if(r>=0)return new A.e4(r,s) -throw A.b(A.bq())}} -A.iG.prototype={ -n(){var s,r,q=this,p=q.c,o=q.b,n=o.length,m=q.a,l=m.length -if(p+n>l){q.d=null -return!1}s=m.indexOf(o,p) -if(s<0){q.c=l+1 -q.d=null -return!1}r=s+n -q.d=new A.e4(s,o) -q.c=r===q.c?r+1:r -return!0}, -gq(a){var s=this.d -s.toString -return s}, -$iL:1} -A.lF.prototype={ -bj(){var s=this.b -if(s===this)throw A.b(new A.cf("Local '"+this.a+"' has not been initialized.")) -return s}, -V(){var s=this.b -if(s===this)throw A.b(A.rZ(this.a)) -return s}} -A.cT.prototype={ -gF(a){return B.a4}, -$iS:1, -$icT:1, -$inK:1} -A.a7.prototype={ -f5(a,b,c,d){var s=A.au(b,0,c,d,null) -throw A.b(s)}, -d_(a,b,c,d){if(b>>>0!==b||b>c)this.f5(a,b,c,d)}, -$ia7:1} -A.dN.prototype={ -gF(a){return B.a5}, -f0(a,b,c){return a.getUint32(b,c)}, -fo(a,b,c,d){return a.setUint32(b,c,d)}, -$iS:1, -$ip0:1} -A.ah.prototype={ -gk(a){return a.length}, -dr(a,b,c,d,e){var s,r,q=a.length -this.d_(a,b,q,"start") -this.d_(a,c,q,"end") -if(b>c)throw A.b(A.au(b,0,c,null,null)) -s=c-b -if(e<0)throw A.b(A.ak(e,null)) -r=d.length -if(r-e").b(b))s.cZ(b) -else s.aU(b)}}, -bs(a,b){var s=this.a -if(this.b)s.P(a,b) -else s.ap(a,b)}, -$ifc:1} -A.n2.prototype={ -$1(a){return this.a.$2(0,a)}, -$S:5} -A.n3.prototype={ -$2(a,b){this.a.$2(1,new A.dB(a,t.l.a(b)))}, -$S:66} -A.ni.prototype={ -$2(a,b){this.a(A.h(a),b)}, -$S:35} -A.eC.prototype={ -gq(a){var s=this.b -return s==null?this.$ti.c.a(s):s}, -fj(a,b){var s,r,q -a=A.h(a) -b=b -s=this.a -for(;!0;)try{r=s(this,a,b) -return r}catch(q){b=q -a=1}}, -n(){var s,r,q,p,o=this,n=null,m=null,l=0 -for(;!0;){s=o.d -if(s!=null)try{if(s.n()){o.sbU(J.ro(s)) -return!0}else o.scc(n)}catch(r){m=r -l=1 -o.scc(n)}q=o.fj(l,m) -if(1===q)return!0 -if(0===q){o.sbU(n) -p=o.e -if(p==null||p.length===0){o.a=A.pS -return!1}if(0>=p.length)return A.c(p,-1) -o.a=p.pop() -l=0 -m=null -continue}if(2===q){l=0 -m=null -continue}if(3===q){m=o.c -o.c=null -p=o.e -if(p==null||p.length===0){o.sbU(n) -o.a=A.pS -throw m -return!1}if(0>=p.length)return A.c(p,-1) -o.a=p.pop() -l=1 -continue}throw A.b(A.K("sync*"))}return!1}, -hG(a){var s,r,q=this -if(a instanceof A.dg){s=a.a() -r=q.e -if(r==null)r=q.e=[] -B.a.m(r,q.a) -q.a=s -return 2}else{q.scc(J.aq(a)) -return 2}}, -sbU(a){this.b=this.$ti.h("1?").a(a)}, -scc(a){this.d=this.$ti.h("L<1>?").a(a)}, -$iL:1} -A.dg.prototype={ -gC(a){return new A.eC(this.a(),this.$ti.h("eC<1>"))}} -A.ds.prototype={ -l(a){return A.t(this.a)}, -$iR:1, -gaO(){return this.b}} -A.jF.prototype={ -$0(){var s,r,q -try{this.a.aT(this.b.$0())}catch(q){s=A.T(q) -r=A.a1(q) -A.qf(this.a,s,r)}}, -$S:0} -A.jH.prototype={ -$2(a,b){var s,r,q=this -t.K.a(a) -t.l.a(b) -s=q.a -r=--s.b -if(s.a!=null){s.a=null -if(s.b===0||q.c)q.d.P(a,b) -else{q.e.b=a -q.f.b=b}}else if(r===0&&!q.c)q.d.P(q.e.bj(),q.f.bj())}, -$S:20} -A.jG.prototype={ -$1(a){var s,r,q=this,p=q.w -p.a(a) -r=q.a;--r.b -s=r.a -if(s!=null){J.nH(s,q.b,a) -if(r.b===0)q.c.aU(A.jQ(s,!0,p))}else if(r.b===0&&!q.e)q.c.P(q.f.bj(),q.r.bj())}, -$S(){return this.w.h("P(0)")}} -A.co.prototype={ -bs(a,b){var s -A.cx(a,"error",t.K) -if((this.a.a&30)!==0)throw A.b(A.K("Future already completed")) -s=$.E.b_(a,b) -if(s!=null){a=s.a -b=s.b}else if(b==null)b=A.f0(a) -this.P(a,b)}, -ae(a){return this.bs(a,null)}, -$ifc:1} -A.cn.prototype={ -W(a,b){var s,r=this.$ti -r.h("1/?").a(b) -s=this.a -if((s.a&30)!==0)throw A.b(A.K("Future already completed")) -s.bb(r.h("1/").a(b))}, -P(a,b){this.a.ap(a,b)}} -A.aa.prototype={ -W(a,b){var s,r=this.$ti -r.h("1/?").a(b) -s=this.a -if((s.a&30)!==0)throw A.b(A.K("Future already completed")) -s.aT(r.h("1/").a(b))}, -fG(a){return this.W(a,null)}, -P(a,b){this.a.P(a,b)}} -A.bE.prototype={ -hf(a){if((this.c&15)!==6)return!0 -return this.b.b.cM(t.iW.a(this.d),a.a,t.y,t.K)}, -fW(a){var s,r=this,q=r.e,p=null,o=t.z,n=t.K,m=a.a,l=r.b.b -if(t.R.b(q))p=l.hx(q,m,a.b,o,n,t.l) -else p=l.cM(t.v.a(q),m,o,n) -try{o=r.$ti.h("2/").a(p) -return o}catch(s){if(t.do.b(A.T(s))){if((r.c&1)!==0)throw A.b(A.ak("The error handler of Future.then must return a value of the returned future's type","onError")) -throw A.b(A.ak("The error handler of Future.catchError must return a value of the future's type","onError"))}else throw s}}} -A.C.prototype={ -dq(a){this.a=this.a&1|4 -this.c=a}, -bH(a,b,c){var s,r,q,p=this.$ti -p.t(c).h("1/(2)").a(a) -s=$.E -if(s===B.d){if(b!=null&&!t.R.b(b)&&!t.v.b(b))throw A.b(A.bn(b,"onError",u.c))}else{a=s.bF(a,c.h("0/"),p.c) -if(b!=null)b=A.v8(b,s)}r=new A.C($.E,c.h("C<0>")) -q=b==null?1:3 -this.ba(new A.bE(r,q,a,b,p.h("@<1>").t(c).h("bE<1,2>"))) -return r}, -e2(a,b){return this.bH(a,null,b)}, -dw(a,b,c){var s,r=this.$ti -r.t(c).h("1/(2)").a(a) -s=new A.C($.E,c.h("C<0>")) -this.ba(new A.bE(s,3,a,b,r.h("@<1>").t(c).h("bE<1,2>"))) -return s}, -aJ(a){var s,r,q -t.mY.a(a) -s=this.$ti -r=$.E -q=new A.C(r,s) -if(r!==B.d)a=r.cK(a,t.z) -this.ba(new A.bE(q,8,a,null,s.h("@<1>").t(s.c).h("bE<1,2>"))) -return q}, -fm(a){this.a=this.a&1|16 -this.c=a}, -bd(a){this.a=a.a&30|this.a&1 -this.c=a.c}, -ba(a){var s,r=this,q=r.a -if(q<=3){a.a=t.d.a(r.c) -r.c=a}else{if((q&4)!==0){s=t.c.a(r.c) -if((s.a&24)===0){s.ba(a) -return}r.bd(s)}r.b.ao(new A.lP(r,a))}}, -cf(a){var s,r,q,p,o,n,m=this,l={} -l.a=a -if(a==null)return -s=m.a -if(s<=3){r=t.d.a(m.c) -m.c=a -if(r!=null){q=a.a -for(p=a;q!=null;p=q,q=o)o=q.a -p.a=r}}else{if((s&4)!==0){n=t.c.a(m.c) -if((n.a&24)===0){n.cf(a) -return}m.bd(n)}l.a=m.bl(a) -m.b.ao(new A.lW(l,m))}}, -bk(){var s=t.d.a(this.c) -this.c=null -return this.bl(s)}, -bl(a){var s,r,q -for(s=a,r=null;s!=null;r=s,s=q){q=s.a -s.a=r}return r}, -cY(a){var s,r,q,p=this -p.a^=2 -try{a.bH(new A.lT(p),new A.lU(p),t.P)}catch(q){s=A.T(q) -r=A.a1(q) -A.qP(new A.lV(p,s,r))}}, -aT(a){var s,r=this,q=r.$ti -q.h("1/").a(a) -if(q.h("I<1>").b(a))if(q.b(a))A.oj(a,r) -else r.cY(a) -else{s=r.bk() -q.c.a(a) -r.a=8 -r.c=a -A.db(r,s)}}, -aU(a){var s,r=this -r.$ti.c.a(a) -s=r.bk() -r.a=8 -r.c=a -A.db(r,s)}, -P(a,b){var s -t.K.a(a) -t.l.a(b) -s=this.bk() -this.fm(A.jh(a,b)) -A.db(this,s)}, -bb(a){var s=this.$ti -s.h("1/").a(a) -if(s.h("I<1>").b(a)){this.cZ(a) -return}this.eF(a)}, -eF(a){var s=this -s.$ti.c.a(a) -s.a^=2 -s.b.ao(new A.lR(s,a))}, -cZ(a){var s=this.$ti -s.h("I<1>").a(a) -if(s.b(a)){A.u3(a,this) -return}this.cY(a)}, -ap(a,b){t.l.a(b) -this.a^=2 -this.b.ao(new A.lQ(this,a,b))}, -$iI:1} -A.lP.prototype={ -$0(){A.db(this.a,this.b)}, -$S:0} -A.lW.prototype={ -$0(){A.db(this.b,this.a.a)}, -$S:0} -A.lT.prototype={ -$1(a){var s,r,q,p=this.a -p.a^=2 -try{p.aU(p.$ti.c.a(a))}catch(q){s=A.T(q) -r=A.a1(q) -p.P(s,r)}}, -$S:22} -A.lU.prototype={ -$2(a,b){this.a.P(t.K.a(a),t.l.a(b))}, -$S:70} -A.lV.prototype={ -$0(){this.a.P(this.b,this.c)}, -$S:0} -A.lS.prototype={ -$0(){A.oj(this.a.a,this.b)}, -$S:0} -A.lR.prototype={ -$0(){this.a.aU(this.b)}, -$S:0} -A.lQ.prototype={ -$0(){this.a.P(this.b,this.c)}, -$S:0} -A.lZ.prototype={ -$0(){var s,r,q,p,o,n,m=this,l=null -try{q=m.a.a -l=q.b.b.cL(t.mY.a(q.d),t.z)}catch(p){s=A.T(p) -r=A.a1(p) -q=m.c&&t.n.a(m.b.a.c).a===s -o=m.a -if(q)o.c=t.n.a(m.b.a.c) -else o.c=A.jh(s,r) -o.b=!0 -return}if(l instanceof A.C&&(l.a&24)!==0){if((l.a&16)!==0){q=m.a -q.c=t.n.a(l.c) -q.b=!0}return}if(l instanceof A.C){n=m.b.a -q=m.a -q.c=l.e2(new A.m_(n),t.z) -q.b=!1}}, -$S:0} -A.m_.prototype={ -$1(a){return this.a}, -$S:73} -A.lY.prototype={ -$0(){var s,r,q,p,o,n,m,l -try{q=this.a -p=q.a -o=p.$ti -n=o.c -m=n.a(this.b) -q.c=p.b.b.cM(o.h("2/(1)").a(p.d),m,o.h("2/"),n)}catch(l){s=A.T(l) -r=A.a1(l) -q=this.a -q.c=A.jh(s,r) -q.b=!0}}, -$S:0} -A.lX.prototype={ -$0(){var s,r,q,p,o,n,m=this -try{s=t.n.a(m.a.a.c) -p=m.b -if(p.a.hf(s)&&p.a.e!=null){p.c=p.a.fW(s) -p.b=!1}}catch(o){r=A.T(o) -q=A.a1(o) -p=t.n.a(m.a.a.c) -n=m.b -if(p.a===r)n.c=p -else n.c=A.jh(r,q) -n.b=!0}}, -$S:0} -A.hM.prototype={} -A.d_.prototype={ -gk(a){var s={},r=new A.C($.E,t.g_) -s.a=0 -this.cC(new A.l6(s,this),!0,new A.l7(s,r),r.gd3()) -return r}, -gv(a){var s=new A.C($.E,A.B(this).h("C<1>")),r=this.cC(null,!0,new A.l4(s),s.gd3()) -r.dX(new A.l5(this,r,s)) -return s}} -A.l6.prototype={ -$1(a){A.B(this.b).c.a(a);++this.a.a}, -$S(){return A.B(this.b).h("~(1)")}} -A.l7.prototype={ -$0(){this.b.aT(this.a.a)}, -$S:0} -A.l4.prototype={ -$0(){var s,r,q,p -try{q=A.bq() -throw A.b(q)}catch(p){s=A.T(p) -r=A.a1(p) -A.qf(this.a,s,r)}}, -$S:0} -A.l5.prototype={ -$1(a){A.uH(this.b,this.c,A.B(this.a).c.a(a))}, -$S(){return A.B(this.a).h("~(1)")}} -A.df.prototype={ -gfa(){var s,r=this -if((r.b&8)===0)return A.B(r).h("aY<1>?").a(r.a) -s=A.B(r) -return s.h("aY<1>?").a(s.h("eA<1>").a(r.a).gcQ())}, -c3(){var s,r,q=this -if((q.b&8)===0){s=q.a -if(s==null)s=q.a=new A.aY(A.B(q).h("aY<1>")) -return A.B(q).h("aY<1>").a(s)}r=A.B(q) -s=r.h("eA<1>").a(q.a).gcQ() -return r.h("aY<1>").a(s)}, -gcj(){var s=this.a -if((this.b&8)!==0)s=t.gL.a(s).gcQ() -return A.B(this).h("d7<1>").a(s)}, -bV(){if((this.b&4)!==0)return new A.bx("Cannot add event after closing") -return new A.bx("Cannot add event while adding a stream")}, -d7(){var s=this.c -if(s==null)s=this.c=(this.b&2)!==0?$.eV():new A.C($.E,t.D) -return s}, -dE(a,b){var s,r,q=this -A.cx(a,"error",t.K) -if(q.b>=4)throw A.b(q.bV()) -s=$.E.b_(a,b) -if(s!=null){a=s.a -b=s.b}else b=A.f0(a) -r=q.b -if((r&1)!==0)q.bp(a,b) -else if((r&3)===0)q.c3().m(0,new A.eh(a,b))}, -fA(a){return this.dE(a,null)}, -ad(a){var s=this,r=s.b -if((r&4)!==0)return s.d7() -if(r>=4)throw A.b(s.bV()) -r=s.b=r|4 -if((r&1)!==0)s.bo() -else if((r&3)===0)s.c3().m(0,B.w) -return s.d7()}, -ft(a,b,c,d){var s,r,q,p,o,n,m,l=this,k=A.B(l) -k.h("~(1)?").a(a) -t.e.a(c) -if((l.b&3)!==0)throw A.b(A.K("Stream has already been listened to.")) -s=$.E -r=d?1:0 -q=A.pJ(s,a,k.c) -p=A.u2(s,b) -o=new A.d7(l,q,p,s.cK(c,t.H),s,r,k.h("d7<1>")) -n=l.gfa() -s=l.b|=1 -if((s&8)!==0){m=k.h("eA<1>").a(l.a) -m.scQ(o) -m.hw(0)}else l.a=o -o.fn(n) -o.f1(new A.mR(l)) -return o}, -fd(a){var s,r,q,p,o,n,m,l=this,k=A.B(l) -k.h("d0<1>").a(a) -s=null -if((l.b&8)!==0)s=k.h("eA<1>").a(l.a).S(0) -l.a=null -l.b=l.b&4294967286|2 -r=l.r -if(r!=null)if(s==null)try{q=r.$0() -if(q instanceof A.C)s=q}catch(n){p=A.T(n) -o=A.a1(n) -m=new A.C($.E,t.D) -m.ap(p,o) -s=m}else s=s.aJ(r) -k=new A.mQ(l) -if(s!=null)s=s.aJ(k) -else k.$0() -return s}, -$ipR:1, -$icr:1} -A.mR.prototype={ -$0(){A.ow(this.a.d)}, -$S:0} -A.mQ.prototype={ -$0(){var s=this.a.c -if(s!=null&&(s.a&30)===0)s.bb(null)}, -$S:0} -A.iL.prototype={ -bn(a){this.$ti.c.a(a) -this.gcj().eA(0,a)}, -bp(a,b){this.gcj().eC(a,b)}, -bo(){this.gcj().eJ()}} -A.dh.prototype={} -A.d6.prototype={ -gA(a){return(A.dU(this.a)^892482866)>>>0}, -K(a,b){if(b==null)return!1 -if(this===b)return!0 -return b instanceof A.d6&&b.a===this.a}} -A.d7.prototype={ -dh(){return this.w.fd(this)}, -dj(){var s=this.w,r=A.B(s) -r.h("d0<1>").a(this) -if((s.b&8)!==0)r.h("eA<1>").a(s.a).hI(0) -A.ow(s.e)}, -dk(){var s=this.w,r=A.B(s) -r.h("d0<1>").a(this) -if((s.b&8)!==0)r.h("eA<1>").a(s.a).hw(0) -A.ow(s.f)}} -A.ee.prototype={ -fn(a){var s=this -A.B(s).h("aY<1>?").a(a) -if(a==null)return -s.sbi(a) -if(a.c!=null){s.e=(s.e|64)>>>0 -a.bQ(s)}}, -dX(a){var s=A.B(this) -this.seE(A.pJ(this.d,s.h("~(1)?").a(a),s.c))}, -S(a){var s=this,r=(s.e&4294967279)>>>0 -s.e=r -if((r&8)===0)s.bY() -r=s.f -return r==null?$.eV():r}, -bY(){var s,r=this,q=r.e=(r.e|8)>>>0 -if((q&64)!==0){s=r.r -if(s.a===1)s.a=3}if((q&32)===0)r.sbi(null) -r.f=r.dh()}, -eA(a,b){var s,r=this,q=A.B(r) -q.c.a(b) -s=r.e -if((s&8)!==0)return -if(s<32)r.bn(b) -else r.bT(new A.cq(b,q.h("cq<1>")))}, -eC(a,b){var s=this.e -if((s&8)!==0)return -if(s<32)this.bp(a,b) -else this.bT(new A.eh(a,b))}, -eJ(){var s=this,r=s.e -if((r&8)!==0)return -r=(r|2)>>>0 -s.e=r -if(r<32)s.bo() -else s.bT(B.w)}, -dj(){}, -dk(){}, -dh(){return null}, -bT(a){var s,r=this,q=r.r -if(q==null){q=new A.aY(A.B(r).h("aY<1>")) -r.sbi(q)}q.m(0,a) -s=r.e -if((s&64)===0){s=(s|64)>>>0 -r.e=s -if(s<128)q.bQ(r)}}, -bn(a){var s,r=this,q=A.B(r).c -q.a(a) -s=r.e -r.e=(s|32)>>>0 -r.d.cN(r.a,a,q) -r.e=(r.e&4294967263)>>>0 -r.bZ((s&4)!==0)}, -bp(a,b){var s,r=this,q=r.e,p=new A.lE(r,a,b) -if((q&1)!==0){r.e=(q|16)>>>0 -r.bY() -s=r.f -if(s!=null&&s!==$.eV())s.aJ(p) -else p.$0()}else{p.$0() -r.bZ((q&4)!==0)}}, -bo(){var s,r=this,q=new A.lD(r) -r.bY() -r.e=(r.e|16)>>>0 -s=r.f -if(s!=null&&s!==$.eV())s.aJ(q) -else q.$0()}, -f1(a){var s,r=this -t.M.a(a) -s=r.e -r.e=(s|32)>>>0 -a.$0() -r.e=(r.e&4294967263)>>>0 -r.bZ((s&4)!==0)}, -bZ(a){var s,r,q=this,p=q.e -if((p&64)!==0&&q.r.c==null){p=q.e=(p&4294967231)>>>0 -if((p&4)!==0)if(p<128){s=q.r -s=s==null?null:s.c==null -s=s!==!1}else s=!1 -else s=!1 -if(s){p=(p&4294967291)>>>0 -q.e=p}}for(;!0;a=r){if((p&8)!==0){q.sbi(null) -return}r=(p&4)!==0 -if(a===r)break -q.e=(p^32)>>>0 -if(r)q.dj() -else q.dk() -p=(q.e&4294967263)>>>0 -q.e=p}if((p&64)!==0&&p<128)q.r.bQ(q)}, -seE(a){this.a=A.B(this).h("~(1)").a(a)}, -sbi(a){this.r=A.B(this).h("aY<1>?").a(a)}, -$id0:1, -$icr:1} -A.lE.prototype={ -$0(){var s,r,q,p=this.a,o=p.e -if((o&8)!==0&&(o&16)===0)return -p.e=(o|32)>>>0 -s=p.b -o=this.b -r=t.K -q=p.d -if(t.k.b(s))q.hy(s,o,this.c,r,t.l) -else q.cN(t.i6.a(s),o,r) -p.e=(p.e&4294967263)>>>0}, -$S:0} -A.lD.prototype={ -$0(){var s=this.a,r=s.e -if((r&16)===0)return -s.e=(r|42)>>>0 -s.d.e1(s.c) -s.e=(s.e&4294967263)>>>0}, -$S:0} -A.eB.prototype={ -cC(a,b,c,d){var s=this.$ti -s.h("~(1)?").a(a) -t.e.a(c) -return this.a.ft(s.h("~(1)?").a(a),d,c,!0)}} -A.bD.prototype={ -sb3(a,b){this.a=t.lT.a(b)}, -gb3(a){return this.a}} -A.cq.prototype={ -cG(a){this.$ti.h("cr<1>").a(a).bn(this.b)}} -A.eh.prototype={ -cG(a){a.bp(this.b,this.c)}} -A.hT.prototype={ -cG(a){a.bo()}, -gb3(a){return null}, -sb3(a,b){throw A.b(A.K("No events after a done."))}, -$ibD:1} -A.aY.prototype={ -bQ(a){var s,r=this -r.$ti.h("cr<1>").a(a) -s=r.a -if(s===1)return -if(s>=1){r.a=1 -return}A.qP(new A.mJ(r,a)) -r.a=1}, -m(a,b){var s=this,r=s.c -if(r==null)s.b=s.c=b -else{r.sb3(0,b) -s.c=b}}} -A.mJ.prototype={ -$0(){var s,r,q,p=this.a,o=p.a -p.a=0 -if(o===3)return -s=p.$ti.h("cr<1>").a(this.b) -r=p.b -q=r.gb3(r) -p.b=q -if(q==null)p.c=null -r.cG(s)}, -$S:0} -A.iE.prototype={} -A.n4.prototype={ -$0(){return this.a.aT(this.b)}, -$S:0} -A.iT.prototype={} -A.eM.prototype={$ibC:1} -A.nf.prototype={ -$0(){A.rK(this.a,this.b)}, -$S:0} -A.it.prototype={ -gfk(){return B.ai}, -gaA(){return this}, -e1(a){var s,r,q -t.M.a(a) -try{if(B.d===$.E){a.$0() -return}A.qr(null,null,this,a,t.H)}catch(q){s=A.T(q) -r=A.a1(q) -A.ne(t.K.a(s),t.l.a(r))}}, -cN(a,b,c){var s,r,q -c.h("~(0)").a(a) -c.a(b) -try{if(B.d===$.E){a.$1(b) -return}A.qt(null,null,this,a,b,t.H,c)}catch(q){s=A.T(q) -r=A.a1(q) -A.ne(t.K.a(s),t.l.a(r))}}, -hy(a,b,c,d,e){var s,r,q -d.h("@<0>").t(e).h("~(1,2)").a(a) -d.a(b) -e.a(c) -try{if(B.d===$.E){a.$2(b,c) -return}A.qs(null,null,this,a,b,c,t.H,d,e)}catch(q){s=A.T(q) -r=A.a1(q) -A.ne(t.K.a(s),t.l.a(r))}}, -fD(a,b){return new A.mO(this,b.h("0()").a(a),b)}, -co(a){return new A.mN(this,t.M.a(a))}, -dG(a,b){return new A.mP(this,b.h("~(0)").a(a),b)}, -dP(a,b){A.ne(a,t.l.a(b))}, -cL(a,b){b.h("0()").a(a) -if($.E===B.d)return a.$0() -return A.qr(null,null,this,a,b)}, -cM(a,b,c,d){c.h("@<0>").t(d).h("1(2)").a(a) -d.a(b) -if($.E===B.d)return a.$1(b) -return A.qt(null,null,this,a,b,c,d)}, -hx(a,b,c,d,e,f){d.h("@<0>").t(e).t(f).h("1(2,3)").a(a) -e.a(b) -f.a(c) -if($.E===B.d)return a.$2(b,c) -return A.qs(null,null,this,a,b,c,d,e,f)}, -cK(a,b){return b.h("0()").a(a)}, -bF(a,b,c){return b.h("@<0>").t(c).h("1(2)").a(a)}, -cJ(a,b,c,d){return b.h("@<0>").t(c).t(d).h("1(2,3)").a(a)}, -b_(a,b){t.fw.a(b) -return null}, -ao(a){A.ng(null,null,this,t.M.a(a))}, -dK(a,b){return A.pu(a,t.M.a(b))}} -A.mO.prototype={ -$0(){return this.a.cL(this.b,this.c)}, -$S(){return this.c.h("0()")}} -A.mN.prototype={ -$0(){return this.a.e1(this.b)}, -$S:0} -A.mP.prototype={ -$1(a){var s=this.c -return this.a.cN(this.b,s.a(a),s)}, -$S(){return this.c.h("~(0)")}} -A.em.prototype={ -gC(a){var s=this,r=new A.ct(s,s.r,s.$ti.h("ct<1>")) -r.c=s.e -return r}, -gk(a){return this.a}, -N(a,b){var s,r -if(b!=="__proto__"){s=this.b -if(s==null)return!1 -return t.g.a(s[b])!=null}else{r=this.eO(b) -return r}}, -eO(a){var s=this.d -if(s==null)return!1 -return this.c7(s[B.b.gA(a)&1073741823],a)>=0}, -gv(a){var s=this.e -if(s==null)throw A.b(A.K("No elements")) -return this.$ti.c.a(s.a)}, -m(a,b){var s,r,q=this -q.$ti.c.a(b) -if(typeof b=="string"&&b!=="__proto__"){s=q.b -return q.d0(s==null?q.b=A.ok():s,b)}else if(typeof b=="number"&&(b&1073741823)===b){r=q.c -return q.d0(r==null?q.c=A.ok():r,b)}else return q.eK(0,b)}, -eK(a,b){var s,r,q,p=this -p.$ti.c.a(b) -s=p.d -if(s==null)s=p.d=A.ok() -r=J.bm(b)&1073741823 -q=s[r] -if(q==null)s[r]=[p.c0(b)] -else{if(p.c7(q,b)>=0)return!1 -q.push(p.c0(b))}return!0}, -J(a,b){var s -if(b!=="__proto__")return this.eL(this.b,b) -else{s=this.ff(0,b) -return s}}, -ff(a,b){var s,r,q,p,o=this.d -if(o==null)return!1 -s=B.b.gA(b)&1073741823 -r=o[s] -q=this.c7(r,b) -if(q<0)return!1 -p=r.splice(q,1)[0] -if(0===r.length)delete o[s] -this.d2(p) -return!0}, -d0(a,b){this.$ti.c.a(b) -if(t.g.a(a[b])!=null)return!1 -a[b]=this.c0(b) -return!0}, -eL(a,b){var s -if(a==null)return!1 -s=t.g.a(a[b]) -if(s==null)return!1 -this.d2(s) -delete a[b] -return!0}, -d1(){this.r=this.r+1&1073741823}, -c0(a){var s,r=this,q=new A.ia(r.$ti.c.a(a)) -if(r.e==null)r.e=r.f=q -else{s=r.f -s.toString -q.c=s -r.f=s.b=q}++r.a -r.d1() -return q}, -d2(a){var s=this,r=a.c,q=a.b -if(r==null)s.e=q -else r.b=q -if(q==null)s.f=r -else q.c=r;--s.a -s.d1()}, -c7(a,b){var s,r -if(a==null)return-1 -s=a.length -for(r=0;r"))}, -gk(a){return this.b}, -gv(a){var s -if(this.b===0)throw A.b(A.K("No such element")) -s=this.c -s.toString -return s}, -ga6(a){var s -if(this.b===0)throw A.b(A.K("No such element")) -s=this.c.c -s.toString -return s}, -gY(a){return this.b===0}, -cb(a,b,c){var s=this,r=s.$ti -r.h("1?").a(a) -r.c.a(b) -if(b.a!=null)throw A.b(A.K("LinkedListEntry is already in a LinkedList"));++s.a -b.sdf(s) -if(s.b===0){b.sai(b) -b.saV(b) -s.sc8(b);++s.b -return}r=a.c -r.toString -b.saV(r) -b.sai(a) -r.sai(b) -a.saV(b);++s.b}, -ck(a){var s,r,q=this,p=null -q.$ti.c.a(a);++q.a -a.b.saV(a.c) -s=a.c -r=a.b -s.sai(r);--q.b -a.saV(p) -a.sai(p) -a.sdf(p) -if(q.b===0)q.sc8(p) -else if(a===q.c)q.sc8(r)}, -sc8(a){this.c=this.$ti.h("1?").a(a)}} -A.en.prototype={ -gq(a){var s=this.c -return s==null?this.$ti.c.a(s):s}, -n(){var s=this,r=s.a -if(s.b!==r.a)throw A.b(A.ar(s)) -if(r.b!==0)r=s.e&&s.d===r.gv(r) -else r=!0 -if(r){s.saa(null) -return!1}s.e=!0 -s.saa(s.d) -s.sai(s.d.b) -return!0}, -saa(a){this.c=this.$ti.h("1?").a(a)}, -sai(a){this.d=this.$ti.h("1?").a(a)}, -$iL:1} -A.af.prototype={ -gb4(){var s=this.a -if(s==null||this===s.gv(s))return null -return this.c}, -sdf(a){this.a=A.B(this).h("cP?").a(a)}, -sai(a){this.b=A.B(this).h("af.E?").a(a)}, -saV(a){this.c=A.B(this).h("af.E?").a(a)}} -A.i.prototype={ -gC(a){return new A.b5(a,this.gk(a),A.a3(a).h("b5"))}, -u(a,b){return this.i(a,b)}, -B(a,b){var s,r -A.a3(a).h("~(i.E)").a(b) -s=this.gk(a) -for(r=0;r").t(c).h("ag<1,2>"))}, -Z(a,b){return A.e5(a,b,null,A.a3(a).h("i.E"))}, -br(a,b){return new A.b1(a,A.a3(a).h("@").t(b).h("b1<1,2>"))}, -cs(a,b,c,d){var s -A.a3(a).h("i.E?").a(d) -A.bt(b,c,this.gk(a)) -for(s=b;s").a(d) -A.bt(b,c,this.gk(a)) -s=c-b -if(s===0)return -A.aP(e,"skipCount") -if(o.h("n").b(d)){r=e -q=d}else{q=J.nJ(d,e).aI(0,!1) -r=0}o=J.V(q) -if(r+s>o.gk(q))throw A.b(A.p8()) -if(r=0;--p)this.j(a,b+p,o.i(q,r+p)) -else for(p=0;p").a(c) -if(t.j.b(c))this.U(a,b,b+c.length,c) -else for(s=J.aq(c);s.n();b=r){r=b+1 -this.j(a,b,s.gq(s))}}, -l(a){return A.nN(a,"[","]")}, -$il:1, -$ie:1, -$in:1} -A.D.prototype={ -B(a,b){var s,r,q,p=A.a3(a) -p.h("~(D.K,D.V)").a(b) -for(s=J.aq(this.gH(a)),p=p.h("D.V");s.n();){r=s.gq(s) -q=this.i(a,r) -b.$2(r,q==null?p.a(q):q)}}, -gaz(a){return J.oU(this.gH(a),new A.jR(a),A.a3(a).h("a6"))}, -he(a,b,c,d){var s,r,q,p,o,n=A.a3(a) -n.t(c).t(d).h("a6<1,2>(D.K,D.V)").a(b) -s=A.X(c,d) -for(r=J.aq(this.gH(a)),n=n.h("D.V");r.n();){q=r.gq(r) -p=this.i(a,q) -o=b.$2(q,p==null?n.a(p):p) -s.j(0,o.a,o.b)}return s}, -D(a,b){return J.nI(this.gH(a),b)}, -gk(a){return J.Z(this.gH(a))}, -gO(a){var s=A.a3(a) -return new A.eo(a,s.h("@").t(s.h("D.V")).h("eo<1,2>"))}, -l(a){return A.fI(a)}, -$iJ:1} -A.jR.prototype={ -$1(a){var s=this.a,r=A.a3(s) -r.h("D.K").a(a) -s=J.ad(s,a) -if(s==null)s=r.h("D.V").a(s) -return new A.a6(a,s,r.h("@").t(r.h("D.V")).h("a6<1,2>"))}, -$S(){return A.a3(this.a).h("a6(D.K)")}} -A.jS.prototype={ -$2(a,b){var s,r=this.a -if(!r.a)this.b.a+=", " -r.a=!1 -r=this.b -s=r.a+=A.t(a) -r.a=s+": " -r.a+=A.t(b)}, -$S:52} -A.d4.prototype={} -A.eo.prototype={ -gk(a){return J.Z(this.a)}, -gv(a){var s=this.a,r=J.ac(s) -s=r.i(s,J.bK(r.gH(s))) -return s==null?this.$ti.z[1].a(s):s}, -gC(a){var s=this.a,r=this.$ti -return new A.ep(J.aq(J.oT(s)),s,r.h("@<1>").t(r.z[1]).h("ep<1,2>"))}} -A.ep.prototype={ -n(){var s=this,r=s.a -if(r.n()){s.saa(J.ad(s.b,r.gq(r))) -return!0}s.saa(null) -return!1}, -gq(a){var s=this.c -return s==null?this.$ti.z[1].a(s):s}, -saa(a){this.c=this.$ti.h("2?").a(a)}, -$iL:1} -A.c1.prototype={} -A.cQ.prototype={ -i(a,b){return this.a.i(0,b)}, -D(a,b){return this.a.D(0,b)}, -B(a,b){this.a.B(0,this.$ti.h("~(1,2)").a(b))}, -gk(a){return this.a.a}, -gH(a){var s=this.a -return new A.b4(s,s.$ti.h("b4<1>"))}, -l(a){return A.fI(this.a)}, -gO(a){var s=this.a -return s.gO(s)}, -gaz(a){var s=this.a -return s.gaz(s)}, -$iJ:1} -A.e7.prototype={} -A.cV.prototype={ -af(a,b,c){var s=this.$ti -return new A.c8(this,s.t(c).h("1(2)").a(b),s.h("@<1>").t(c).h("c8<1,2>"))}, -l(a){return A.nN(this,"{","}")}, -Z(a,b){return A.pp(this,b,this.$ti.c)}, -gv(a){var s,r=A.pL(this,this.r,this.$ti.c) -if(!r.n())throw A.b(A.bq()) -s=r.d -return s==null?r.$ti.c.a(s):s}, -u(a,b){var s,r,q,p=this -A.aP(b,"index") -s=A.pL(p,p.r,p.$ti.c) -for(r=b;s.n();){if(r===0){q=s.d -return q==null?s.$ti.c.a(q):q}--r}throw A.b(A.W(b,b-r,p,null,"index"))}, -$il:1, -$ie:1, -$inX:1} -A.ew.prototype={} -A.dj.prototype={} -A.li.prototype={ -$0(){var s,r -try{s=new TextDecoder("utf-8",{fatal:true}) -return s}catch(r){}return null}, -$S:17} -A.lh.prototype={ -$0(){var s,r -try{s=new TextDecoder("utf-8",{fatal:false}) -return s}catch(r){}return null}, -$S:17} -A.f4.prototype={ -hl(a2,a3,a4,a5){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a0="Invalid base64 encoding length ",a1=a3.length -a5=A.bt(a4,a5,a1) -s=$.r7() -for(r=s.length,q=a4,p=q,o=null,n=-1,m=-1,l=0;q=0&&e=0){if(!(d<64))return A.c(a,d) -e=a.charCodeAt(d) -if(e===j)continue -j=e}else{if(d===-1){if(n<0){g=o==null?null:o.a.length -if(g==null)g=0 -n=g+(q-p) -m=q}++l -if(j===61)continue}j=e}if(d!==-2){if(o==null){o=new A.aj("") -g=o}else g=o -g.a+=B.b.p(a3,p,q) -g.a+=A.bf(j) -p=k -continue}}throw A.b(A.ae("Invalid base64 data",a3,q))}if(o!=null){a1=o.a+=B.b.p(a3,p,a5) -r=a1.length -if(n>=0)A.oV(a3,m,a5,n,l,r) -else{c=B.c.a7(r-1,4)+1 -if(c===1)throw A.b(A.ae(a0,a3,a5)) -for(;c<4;){a1+="=" -o.a=a1;++c}}a1=o.a -return B.b.aG(a3,a4,a5,a1.charCodeAt(0)==0?a1:a1)}b=a5-a4 -if(n>=0)A.oV(a3,m,a5,n,l,b) -else{c=B.c.a7(b,4) -if(c===1)throw A.b(A.ae(a0,a3,a5)) -if(c>1)a3=B.b.aG(a3,a5,a5,c===2?"==":"=")}return a3}} -A.js.prototype={} -A.ax.prototype={} -A.ff.prototype={} -A.fq.prototype={} -A.e8.prototype={ -aZ(a,b){t.L.a(b) -return B.t.a4(b)}, -gaw(){return B.V}} -A.lj.prototype={ -a4(a){var s,r,q,p,o=a.length,n=A.bt(0,null,o),m=n-0 -if(m===0)return new Uint8Array(0) -s=m*3 -r=new Uint8Array(s) -q=new A.mZ(r) -if(q.f_(a,0,n)!==n){p=n-1 -if(!(p>=0&&p>>18|240 -q=n.b=p+1 -if(!(p>>12&63|128 -p=n.b=q+1 -if(!(q>>6&63|128 -n.b=p+1 -if(!(p=0&&s=r)break -l.b=n+1 -s[n]=o}else{n=o&64512 -if(n===55296){if(l.b+4>r)break -n=p+1 -if(!(nr)break -l.cl()}else if(o<=2047){n=l.b -m=n+1 -if(m>=r)break -l.b=m -if(!(n>>6|192 -l.b=m+1 -s[m]=o&63|128}else{n=l.b -if(n+2>=r)break -m=l.b=n+1 -if(!(n>>12|224 -n=l.b=m+1 -if(!(m>>6&63|128 -l.b=n+1 -if(!(n1000){s=B.c.G(b+c,2) -r=q.c2(a,b,s,!1) -if((q.b&1)!==0)return r -return r+q.c2(a,s,c,d)}return q.fM(a,b,c,d)}, -fM(a,b,a0,a1){var s,r,q,p,o,n,m,l,k=this,j="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE",i=" \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA",h=65533,g=k.b,f=k.c,e=new A.aj(""),d=b+1,c=a.length -if(!(b>=0&&b=0&&s<256))return A.c(j,s) -q=j.charCodeAt(s)&31 -f=g<=32?s&61694>>>q:(s&63|f<<6)>>>0 -p=g+q -if(!(p>=0&&p<144))return A.c(i,p) -g=i.charCodeAt(p) -if(g===0){e.a+=A.bf(f) -if(d===a0)break $label0$0 -break}else if((g&1)!==0){if(r)switch(g){case 69:case 67:e.a+=A.bf(h) -break -case 65:e.a+=A.bf(h);--d -break -default:p=e.a+=A.bf(h) -e.a=p+A.bf(h) -break}else{k.b=g -k.c=d-1 -return""}g=0}if(d===a0)break $label0$0 -o=d+1 -if(!(d>=0&&d=0&&d=0&&o=128){n=m-1 -o=m -break}o=m}if(n-d<20)for(l=d;l32)if(r)e.a+=A.bf(h) -else{k.b=77 -k.c=a0 -return""}k.b=g -k.c=f -c=e.a -return c.charCodeAt(0)==0?c:c}} -A.a8.prototype={ -a8(a){var s,r,q=this,p=q.c -if(p===0)return q -s=!q.a -r=q.b -p=A.aX(p,r) -return new A.a8(p===0?!1:s,r,p)}, -eU(a){var s,r,q,p,o,n,m,l,k=this,j=k.c -if(j===0)return $.bJ() -s=j-a -if(s<=0)return k.a?$.oM():$.bJ() -r=k.b -q=new Uint16Array(s) -for(p=r.length,o=a;o=0&&o=0&&r>>0!==0)return l.aP(0,$.jc()) -for(k=0;k=0)return q.b9(b,r) -return b.b9(q,!r)}, -aP(a,b){var s,r,q=this,p=q.c -if(p===0)return b.a8(0) -s=b.c -if(s===0)return q -r=q.a -if(r!==b.a)return q.bS(b,r) -if(A.lA(q.b,p,b.b,s)>=0)return q.b9(b,r) -return b.b9(q,!r)}, -b8(a,b){var s,r,q,p,o,n,m,l=this.c,k=b.c -if(l===0||k===0)return $.bJ() -s=l+k -r=this.b -q=b.b -p=new Uint16Array(s) -for(o=q.length,n=0;n0?p.a8(0):p}, -fe(a){var s,r,q,p=this -if(p.c0)q=q.aN(0,$.of.V()) -return p.a&&q.c>0?q.a8(0):q}, -d6(a0){var s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b=this,a=b.c -if(a===$.pF&&a0.c===$.pH&&b.b===$.pE&&a0.b===$.pG)return -s=a0.b -r=a0.c -q=r-1 -if(!(q>=0&&q0){o=new Uint16Array(r+5) -n=A.pD(s,r,p,o) -m=new Uint16Array(a+5) -l=A.pD(b.b,a,p,m)}else{m=A.og(b.b,0,a,a+2) -n=r -o=s -l=a}q=n-1 -if(!(q>=0&&q=0){if(!(l>=0&&l=0&&l=0&&n0;){c=A.tX(k,m,d);--j -A.pI(c,e,0,m,j,n) -if(!(d>=0&&d=m.length)return A.c(m,0) -return B.c.l(-m[0])}m=n.b -if(0>=m.length)return A.c(m,0) -return B.c.l(m[0])}s=A.u([],t.s) -m=n.a -r=m?n.a8(0):n -for(;r.c>1;){q=$.oL() -if(q.c===0)A.Q(B.N) -p=r.fe(q).l(0) -B.a.m(s,p) -o=p.length -if(o===1)B.a.m(s,"000") -if(o===2)B.a.m(s,"00") -if(o===3)B.a.m(s,"0") -r=r.eT(q)}q=r.b -if(0>=q.length)return A.c(q,0) -B.a.m(s,B.c.l(q[0])) -if(m)B.a.m(s,"-") -return new A.dX(s,t.hF).hb(0)}, -$icA:1, -$ial:1} -A.lB.prototype={ -$2(a,b){a=a+b&536870911 -a=a+((a&524287)<<10)&536870911 -return a^a>>>6}, -$S:3} -A.lC.prototype={ -$1(a){a=a+((a&67108863)<<3)&536870911 -a^=a>>>11 -return a+((a&16383)<<15)&536870911}, -$S:11} -A.i0.prototype={} -A.jY.prototype={ -$2(a,b){var s,r,q -t.bR.a(a) -s=this.b -r=this.a -q=s.a+=r.a -q+=a.a -s.a=q -s.a=q+": " -s.a+=A.ca(b) -r.a=", "}, -$S:38} -A.bP.prototype={ -K(a,b){if(b==null)return!1 -return b instanceof A.bP&&this.a===b.a&&this.b===b.b}, -a0(a,b){return B.c.a0(this.a,t.cs.a(b).a)}, -gA(a){var s=this.a -return(s^B.c.R(s,30))&1073741823}, -l(a){var s=this,r=A.rH(A.tf(s)),q=A.fm(A.td(s)),p=A.fm(A.t9(s)),o=A.fm(A.ta(s)),n=A.fm(A.tc(s)),m=A.fm(A.te(s)),l=A.rI(A.tb(s)),k=r+"-"+q -if(s.b)return k+"-"+p+" "+o+":"+n+":"+m+"."+l+"Z" -else return k+"-"+p+" "+o+":"+n+":"+m+"."+l}, -$ial:1} -A.bQ.prototype={ -K(a,b){if(b==null)return!1 -return b instanceof A.bQ&&this.a===b.a}, -gA(a){return B.c.gA(this.a)}, -a0(a,b){return B.c.a0(this.a,t.jS.a(b).a)}, -l(a){var s,r,q,p,o,n=this.a,m=B.c.G(n,36e8),l=n%36e8 -if(n<0){m=0-m -n=0-l -s="-"}else{n=l -s=""}r=B.c.G(n,6e7) -n%=6e7 -q=r<10?"0":"" -p=B.c.G(n,1e6) -o=p<10?"0":"" -return s+m+":"+q+r+":"+o+p+"."+B.b.ho(B.c.l(n%1e6),6,"0")}, -$ial:1} -A.lI.prototype={ -l(a){return this.eW()}} -A.R.prototype={ -gaO(){return A.a1(this.$thrownJsError)}} -A.dr.prototype={ -l(a){var s=this.a -if(s!=null)return"Assertion failed: "+A.ca(s) -return"Assertion failed"}} -A.by.prototype={} -A.bc.prototype={ -gc5(){return"Invalid argument"+(!this.a?"(s)":"")}, -gc4(){return""}, -l(a){var s=this,r=s.c,q=r==null?"":" ("+r+")",p=s.d,o=p==null?"":": "+A.t(p),n=s.gc5()+q+o -if(!s.a)return n -return n+s.gc4()+": "+A.ca(s.gcA())}, -gcA(){return this.b}} -A.cU.prototype={ -gcA(){return A.uC(this.b)}, -gc5(){return"RangeError"}, -gc4(){var s,r=this.e,q=this.f -if(r==null)s=q!=null?": Not less than or equal to "+A.t(q):"" -else if(q==null)s=": Not greater than or equal to "+A.t(r) -else if(q>r)s=": Not in inclusive range "+A.t(r)+".."+A.t(q) -else s=qe.length -else s=!1 -if(s)f=null -if(f==null){if(e.length>78)e=B.b.p(e,0,75)+"..." -return g+"\n"+e}for(r=e.length,q=1,p=0,o=!1,n=0;n1?g+(" (at line "+q+", character "+(f-p+1)+")\n"):g+(" (at character "+(f+1)+")\n") -for(n=f;n=0))return A.c(e,n) -m=e.charCodeAt(n) -if(m===10||m===13){r=n -break}}if(r-p>78)if(f-p<75){l=p+75 -k=p -j="" -i="..."}else{if(r-f<75){k=r-75 -l=r -i=""}else{k=f-36 -l=f+36 -i="..."}j="..."}else{l=r -k=p -j="" -i=""}return g+j+B.b.p(e,k,l)+i+"\n"+B.b.b8(" ",f-k+j.length)+"^\n"}else return f!=null?g+(" (at offset "+A.t(f)+")"):g}} -A.fA.prototype={ -gaO(){return null}, -l(a){return"IntegerDivisionByZeroException"}, -$iR:1} -A.e.prototype={ -br(a,b){return A.f8(this,A.B(this).h("e.E"),b)}, -af(a,b,c){var s=A.B(this) -return A.pg(this,s.t(c).h("1(e.E)").a(b),s.h("e.E"),c)}, -N(a,b){var s -for(s=this.gC(this);s.n();)if(J.a4(s.gq(s),b))return!0 -return!1}, -B(a,b){var s -A.B(this).h("~(e.E)").a(b) -for(s=this.gC(this);s.n();)b.$1(s.gq(s))}, -aI(a,b){return A.fG(this,b,A.B(this).h("e.E"))}, -e4(a){return this.aI(a,!0)}, -gk(a){var s,r=this.gC(this) -for(s=0;r.n();)++s -return s}, -gY(a){return!this.gC(this).n()}, -Z(a,b){return A.pp(this,b,A.B(this).h("e.E"))}, -gv(a){var s=this.gC(this) -if(!s.n())throw A.b(A.bq()) -return s.gq(s)}, -u(a,b){var s,r -A.aP(b,"index") -s=this.gC(this) -for(r=b;s.n();){if(r===0)return s.gq(s);--r}throw A.b(A.W(b,b-r,this,null,"index"))}, -l(a){return A.rT(this,"(",")")}} -A.a6.prototype={ -l(a){return"MapEntry("+A.t(this.a)+": "+A.t(this.b)+")"}} -A.P.prototype={ -gA(a){return A.r.prototype.gA.call(this,this)}, -l(a){return"null"}} -A.r.prototype={$ir:1, -K(a,b){return this===b}, -gA(a){return A.dU(this)}, -l(a){return"Instance of '"+A.k4(this)+"'"}, -dV(a,b){throw A.b(A.pi(this,t.bg.a(b)))}, -gF(a){return A.qF(this)}, -toString(){return this.l(this)}} -A.iJ.prototype={ -l(a){return""}, -$iaG:1} -A.aj.prototype={ -gk(a){return this.a.length}, -l(a){var s=this.a -return s.charCodeAt(0)==0?s:s}, -$itI:1} -A.ld.prototype={ -$2(a,b){throw A.b(A.ae("Illegal IPv4 address, "+a,this.a,b))}, -$S:39} -A.le.prototype={ -$2(a,b){throw A.b(A.ae("Illegal IPv6 address, "+a,this.a,b))}, -$S:43} -A.lf.prototype={ -$2(a,b){var s -if(b-a>4)this.a.$2("an IPv6 part can only contain a maximum of 4 hex digits",a) -s=A.nu(B.b.p(this.b,a,b),16) -if(s<0||s>65535)this.a.$2("each part must be in the range of `0x0..0xFFFF`",a) -return s}, -$S:3} -A.eK.prototype={ -gdv(){var s,r,q,p,o=this,n=o.w -if(n===$){s=o.a -r=s.length!==0?""+s+":":"" -q=o.c -p=q==null -if(!p||s==="file"){s=r+"//" -r=o.b -if(r.length!==0)s=s+r+"@" -if(!p)s+=q -r=o.d -if(r!=null)s=s+":"+A.t(r)}else s=r -s+=o.e -r=o.f -if(r!=null)s=s+"?"+r -r=o.r -if(r!=null)s=s+"#"+r -n!==$&&A.ja("_text") -n=o.w=s.charCodeAt(0)==0?s:s}return n}, -gcF(){var s,r,q,p=this,o=p.x -if(o===$){s=p.e -r=s.length -if(r!==0){if(0>=r)return A.c(s,0) -r=s.charCodeAt(0)===47}else r=!1 -if(r)s=B.b.a_(s,1) -q=s.length===0?B.B:A.dL(new A.ag(A.u(s.split("/"),t.s),t.ha.a(A.vo()),t.iZ),t.N) -p.x!==$&&A.ja("pathSegments") -p.sez(q) -o=q}return o}, -gA(a){var s,r=this,q=r.y -if(q===$){s=B.b.gA(r.gdv()) -r.y!==$&&A.ja("hashCode") -r.y=s -q=s}return q}, -ge6(){return this.b}, -gb1(a){var s=this.c -if(s==null)return"" -if(B.b.M(s,"["))return B.b.p(s,1,s.length-1) -return s}, -gcH(a){var s=this.d -return s==null?A.pZ(this.a):s}, -ge0(a){var s=this.f -return s==null?"":s}, -gdO(){var s=this.r -return s==null?"":s}, -gdT(){if(this.a!==""){var s=this.r -s=(s==null?"":s)===""}else s=!1 -return s}, -gcu(){return this.c!=null}, -gdS(){return this.f!=null}, -gdR(){return this.r!=null}, -gdQ(){return B.b.M(this.e,"/")}, -hz(){var s,r=this,q=r.a -if(q!==""&&q!=="file")throw A.b(A.F("Cannot extract a file path from a "+q+" URI")) -q=r.f -if((q==null?"":q)!=="")throw A.b(A.F("Cannot extract a file path from a URI with a query component")) -q=r.r -if((q==null?"":q)!=="")throw A.b(A.F("Cannot extract a file path from a URI with a fragment component")) -q=$.r9() -if(q)q=A.uw(r) -else{if(r.c!=null&&r.gb1(r)!=="")A.Q(A.F("Cannot extract a non-Windows file path from a file URI with an authority")) -s=r.gcF() -A.up(s,!1) -q=A.l8(B.b.M(r.e,"/")?""+"/":"",s,"/") -q=q.charCodeAt(0)==0?q:q}return q}, -l(a){return this.gdv()}, -K(a,b){var s,r,q=this -if(b==null)return!1 -if(q===b)return!0 -if(t.jJ.b(b))if(q.a===b.gbR())if(q.c!=null===b.gcu())if(q.b===b.ge6())if(q.gb1(q)===b.gb1(b))if(q.gcH(q)===b.gcH(b))if(q.e===b.gcE(b)){s=q.f -r=s==null -if(!r===b.gdS()){if(r)s="" -if(s===b.ge0(b)){s=q.r -r=s==null -if(!r===b.gdR()){if(r)s="" -s=s===b.gdO()}else s=!1}else s=!1}else s=!1}else s=!1 -else s=!1 -else s=!1 -else s=!1 -else s=!1 -else s=!1 -else s=!1 -return s}, -sez(a){this.x=t.a.a(a)}, -$ihu:1, -gbR(){return this.a}, -gcE(a){return this.e}} -A.lc.prototype={ -ge5(){var s,r,q,p,o=this,n=null,m=o.c -if(m==null){m=o.b -if(0>=m.length)return A.c(m,0) -s=o.a -m=m[0]+1 -r=B.b.ak(s,"?",m) -q=s.length -if(r>=0){p=A.eL(s,r+1,q,B.o,!1,!1) -q=r}else p=n -m=o.c=new A.hS("data","",n,n,A.eL(s,m,q,B.z,!1,!1),p,n)}return m}, -l(a){var s,r=this.b -if(0>=r.length)return A.c(r,0) -s=this.a -return r[0]===-1?"data:"+s:s}} -A.n7.prototype={ -$2(a,b){var s=this.a -if(!(a=q)return A.c(b,0) -s=b.charCodeAt(0) -if(1>=q)return A.c(b,1) -r=b.charCodeAt(1) -for(;s<=r;++s){q=(s^96)>>>0 -if(!(q<96))return A.c(a,q) -a[q]=c}}, -$S:15} -A.ix.prototype={ -gcu(){return this.c>0}, -gh2(){return this.c>0&&this.d+10&&this.r>=this.a.length}, -gbR(){var s=this.w -return s==null?this.w=this.eN():s}, -eN(){var s,r=this,q=r.b -if(q<=0)return"" -s=q===4 -if(s&&B.b.M(r.a,"http"))return"http" -if(q===5&&B.b.M(r.a,"https"))return"https" -if(s&&B.b.M(r.a,"file"))return"file" -if(q===7&&B.b.M(r.a,"package"))return"package" -return B.b.p(r.a,0,q)}, -ge6(){var s=this.c,r=this.b+3 -return s>r?B.b.p(this.a,r,s-1):""}, -gb1(a){var s=this.c -return s>0?B.b.p(this.a,s,this.d):""}, -gcH(a){var s,r=this -if(r.gh2())return A.nu(B.b.p(r.a,r.d+1,r.e),null) -s=r.b -if(s===4&&B.b.M(r.a,"http"))return 80 -if(s===5&&B.b.M(r.a,"https"))return 443 -return 0}, -gcE(a){return B.b.p(this.a,this.e,this.f)}, -ge0(a){var s=this.f,r=this.r -return s=0&&q>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.q.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){A.U(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.W.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.G.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.ib.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.G.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.d8.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.ls.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.cA.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.gJ.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.dR.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.ki.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.d5.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -return a[b]}, -j(a,b,c){t.ef.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){if(a.length>0)return a[0] -throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.G.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.hI.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b>>0!==b||b>=s -r.toString -if(r)throw A.b(A.W(b,s,a,null,null)) -s=a[b] -s.toString -return s}, -j(a,b,c){t.lv.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s -if(a.length>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){if(!(b>=0&&b"))}, -L(a,b,c,d,e){A.a3(a).h("e").a(d) -throw A.b(A.F("Cannot setRange on immutable List."))}, -U(a,b,c,d){return this.L(a,b,c,d,0)}} -A.dC.prototype={ -n(){var s=this,r=s.c+1,q=s.b -if(r=4)A.Q(p.bV()) -if((r&1)!==0)p.bn(q) -else if((r&3)===0)p.c3().m(0,new A.cq(q,s.h("cq<1>")))}}, -$S:2} -A.bu.prototype={$ibu:1} -A.e6.prototype={$ie6:1} -A.bA.prototype={$ibA:1} -A.nB.prototype={ -$1(a){return this.a.W(0,this.b.h("0/?").a(a))}, -$S:5} -A.nC.prototype={ -$1(a){if(a==null)return this.a.ae(new A.jZ(a===undefined)) -return this.a.ae(a)}, -$S:5} -A.jZ.prototype={ -l(a){return"Promise was rejected with a value of `"+(this.a?"undefined":"null")+"`."}} -A.i7.prototype={ -ew(){var s=self.crypto -if(s!=null)if(s.getRandomValues!=null)return -throw A.b(A.F("No source of cryptographically secure random numbers available."))}, -dU(a){var s,r,q,p,o,n,m,l,k,j=null -if(a<=0||a>4294967296)throw A.b(new A.cU(j,j,!1,j,j,"max must be in range 0 < max \u2264 2^32, was "+a)) -if(a>255)if(a>65535)s=a>16777215?4:3 -else s=2 -else s=1 -r=this.a -B.G.fo(r,0,0,!1) -q=4-s -p=A.h(Math.pow(256,s)) -for(o=a-1,n=(a&o)===0;!0;){m=r.buffer -m=new Uint8Array(m,q,s) -crypto.getRandomValues(m) -l=B.G.f0(r,0,!1) -if(n)return(l&o)>>>0 -k=l%a -if(l-k+a>>0!==b||b>=s -s.toString -if(s)throw A.b(A.W(b,this.gk(a),a,null,null)) -s=a.getItem(b) -s.toString -return s}, -j(a,b,c){t.kT.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s=a.length -s.toString -if(s>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){return this.i(a,b)}, -$il:1, -$ie:1, -$in:1} -A.aN.prototype={$iaN:1} -A.fW.prototype={ -gk(a){var s=a.length -s.toString -return s}, -i(a,b){var s=a.length -s.toString -s=b>>>0!==b||b>=s -s.toString -if(s)throw A.b(A.W(b,this.gk(a),a,null,null)) -s=a.getItem(b) -s.toString -return s}, -j(a,b,c){t.ai.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s=a.length -s.toString -if(s>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){return this.i(a,b)}, -$il:1, -$ie:1, -$in:1} -A.h0.prototype={ -gk(a){return a.length}} -A.hh.prototype={ -gk(a){var s=a.length -s.toString -return s}, -i(a,b){var s=a.length -s.toString -s=b>>>0!==b||b>=s -s.toString -if(s)throw A.b(A.W(b,this.gk(a),a,null,null)) -s=a.getItem(b) -s.toString -return s}, -j(a,b,c){A.U(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s=a.length -s.toString -if(s>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){return this.i(a,b)}, -$il:1, -$ie:1, -$in:1} -A.aR.prototype={$iaR:1} -A.ho.prototype={ -gk(a){var s=a.length -s.toString -return s}, -i(a,b){var s=a.length -s.toString -s=b>>>0!==b||b>=s -s.toString -if(s)throw A.b(A.W(b,this.gk(a),a,null,null)) -s=a.getItem(b) -s.toString -return s}, -j(a,b,c){t.hk.a(c) -throw A.b(A.F("Cannot assign element of immutable List."))}, -gv(a){var s=a.length -s.toString -if(s>0){s=a[0] -s.toString -return s}throw A.b(A.K("No elements"))}, -u(a,b){return this.i(a,b)}, -$il:1, -$ie:1, -$in:1} -A.i8.prototype={} -A.i9.prototype={} -A.ij.prototype={} -A.ik.prototype={} -A.iH.prototype={} -A.iI.prototype={} -A.iQ.prototype={} -A.iR.prototype={} -A.f1.prototype={ -gk(a){return a.length}} -A.f2.prototype={ -D(a,b){return A.aZ(a.get(b))!=null}, -i(a,b){return A.aZ(a.get(A.U(b)))}, -B(a,b){var s,r,q -t.u.a(b) -s=a.entries() -for(;!0;){r=s.next() -q=r.done -q.toString -if(q)return -q=r.value[0] -q.toString -b.$2(q,A.aZ(r.value[1]))}}, -gH(a){var s=A.u([],t.s) -this.B(a,new A.jq(s)) -return s}, -gO(a){var s=A.u([],t.C) -this.B(a,new A.jr(s)) -return s}, -gk(a){var s=a.size -s.toString -return s}, -$iJ:1} -A.jq.prototype={ -$2(a,b){return B.a.m(this.a,a)}, -$S:1} -A.jr.prototype={ -$2(a,b){return B.a.m(this.a,t.f.a(b))}, -$S:1} -A.f3.prototype={ -gk(a){return a.length}} -A.bL.prototype={} -A.fX.prototype={ -gk(a){return a.length}} -A.hN.prototype={} -A.fV.prototype={} -A.hs.prototype={} -A.fe.prototype={ -hc(a){var s,r,q,p,o,n,m,l,k,j -t.bq.a(a) -for(s=a.$ti,r=s.h("bh(e.E)").a(new A.jw()),q=a.gC(a),s=new A.cl(q,r,s.h("cl")),r=this.a,p=!1,o=!1,n="";s.n();){m=q.gq(q) -if(r.aD(m)&&o){l=A.pj(m,r) -k=n.charCodeAt(0)==0?n:n -n=B.b.p(k,0,r.aH(k,!0)) -l.b=n -if(r.b2(n))B.a.j(l.e,0,r.gaL()) -n=""+l.l(0)}else if(r.ag(m)>0){o=!r.aD(m) -n=""+m}else{j=m.length -if(j!==0){if(0>=j)return A.c(m,0) -j=r.cp(m[0])}else j=!1 -if(!j)if(p)n+=r.gaL() -n+=m}p=r.b2(m)}return n.charCodeAt(0)==0?n:n}, -dW(a,b){var s -if(!this.f7(b))return b -s=A.pj(b,this.a) -s.hk(0) -return s.l(0)}, -f7(a){var s,r,q,p,o,n,m,l,k=this.a,j=k.ag(a) -if(j!==0){if(k===$.jb())for(s=a.length,r=0;r=0))return A.c(s,r) -m=s.charCodeAt(r) -if(k.a5(m)){if(k===$.jb()&&m===47)return!0 -if(p!=null&&k.a5(p))return!0 -if(p===46)l=n==null||n===46||k.a5(n) -else l=!1 -if(l)return!0}}if(p==null)return!0 -if(k.a5(p))return!0 -if(p===46)k=n==null||k.a5(n)||n===46 -else k=!1 -if(k)return!0 -return!1}} -A.jw.prototype={ -$1(a){return A.U(a)!==""}, -$S:30} -A.nh.prototype={ -$1(a){A.oq(a) -return a==null?"null":'"'+a+'"'}, -$S:31} -A.cM.prototype={ -eg(a){var s,r=this.ag(a) -if(r>0)return B.b.p(a,0,r) -if(this.aD(a)){if(0>=a.length)return A.c(a,0) -s=a[0]}else s=null -return s}} -A.k1.prototype={ -hv(){var s,r,q=this -while(!0){s=q.d -if(!(s.length!==0&&J.a4(B.a.ga6(s),"")))break -s=q.d -if(0>=s.length)return A.c(s,-1) -s.pop() -s=q.e -if(0>=s.length)return A.c(s,-1) -s.pop()}s=q.e -r=s.length -if(r!==0)B.a.j(s,r-1,"")}, -hk(a){var s,r,q,p,o,n,m=this,l=A.u([],t.s) -for(s=m.d,r=s.length,q=0,p=0;p=n)return A.c(l,-1) -l.pop()}else ++q}else B.a.m(l,o)}if(m.b==null)B.a.h3(l,0,A.dK(q,"..",!1,t.N)) -if(l.length===0&&m.b==null)B.a.m(l,".") -m.shp(l) -s=m.a -m.seh(A.dK(l.length+1,s.gaL(),!0,t.N)) -r=m.b -if(r==null||l.length===0||!s.b2(r))B.a.j(m.e,0,"") -r=m.b -if(r!=null&&s===$.jb()){r.toString -m.b=A.vL(r,"/","\\")}m.hv()}, -l(a){var s,r,q,p=this,o=p.b -o=o!=null?""+o:"" -for(s=0;r=p.d,s=0))return A.c(a,s) -s=a.charCodeAt(s)!==47 -r=s}else r=!1 -return r}, -aH(a,b){var s=a.length -if(s!==0){if(0>=s)return A.c(a,0) -s=a.charCodeAt(0)===47}else s=!1 -if(s)return 1 -return 0}, -ag(a){return this.aH(a,!1)}, -aD(a){return!1}, -gaE(){return"posix"}, -gaL(){return"/"}} -A.hw.prototype={ -cp(a){return B.b.N(a,"/")}, -a5(a){return a===47}, -b2(a){var s,r=a.length -if(r===0)return!1 -s=r-1 -if(!(s>=0))return A.c(a,s) -if(a.charCodeAt(s)!==47)return!0 -return B.b.dL(a,"://")&&this.ag(a)===r}, -aH(a,b){var s,r,q,p,o=a.length -if(o===0)return 0 -if(0>=o)return A.c(a,0) -if(a.charCodeAt(0)===47)return 1 -for(s=0;s=s)return A.c(a,0) -s=a.charCodeAt(0)===47}else s=!1 -return s}, -gaE(){return"url"}, -gaL(){return"/"}} -A.hG.prototype={ -cp(a){return B.b.N(a,"/")}, -a5(a){return a===47||a===92}, -b2(a){var s,r=a.length -if(r===0)return!1 -s=r-1 -if(!(s>=0))return A.c(a,s) -s=a.charCodeAt(s) -return!(s===47||s===92)}, -aH(a,b){var s,r,q=a.length -if(q===0)return 0 -if(0>=q)return A.c(a,0) -if(a.charCodeAt(0)===47)return 1 -if(a.charCodeAt(0)===92){if(q>=2){if(1>=q)return A.c(a,1) -s=a.charCodeAt(1)!==92}else s=!0 -if(s)return 1 -r=B.b.ak(a,"\\",2) -if(r>0){r=B.b.ak(a,"\\",r+1) -if(r>0)return r}return q}if(q<3)return 0 -if(!A.qI(a.charCodeAt(0)))return 0 -if(a.charCodeAt(1)!==58)return 0 -q=a.charCodeAt(2) -if(!(q===47||q===92))return 0 -return 3}, -ag(a){return this.aH(a,!1)}, -aD(a){return this.ag(a)===1}, -gaE(){return"windows"}, -gaL(){return"\\"}} -A.nk.prototype={ -$1(a){return A.vg(a)}, -$S:32} -A.fk.prototype={ -l(a){return"DatabaseException("+this.a+")"}} -A.hb.prototype={ -l(a){return this.el(0)}, -bP(){var s=this.b -if(s==null){s=new A.kh(this).$0() -this.sfh(s)}return s}, -sfh(a){this.b=A.dl(a)}} -A.kh.prototype={ -$0(){var s=new A.ki(this.a.a.toLowerCase()),r=s.$1("(sqlite code ") -if(r!=null)return r -r=s.$1("(code ") -if(r!=null)return r -r=s.$1("code=") -if(r!=null)return r -return null}, -$S:33} -A.ki.prototype={ -$1(a){var s,r,q,p,o,n=this.a,m=B.b.cv(n,a) -if(!J.a4(m,-1))try{p=m -if(typeof p!=="number")return p.b7() -p=B.b.hA(B.b.a_(n,p+a.length)).split(" ") -if(0>=p.length)return A.c(p,0) -s=p[0] -r=J.rr(s,")") -if(!J.a4(r,-1))s=J.rw(s,0,r) -q=A.nU(s,null) -if(q!=null)return q}catch(o){}return null}, -$S:34} -A.jB.prototype={} -A.fs.prototype={ -l(a){return A.qF(this).l(0)+"("+this.a+", "+A.t(this.b)+")"}} -A.cF.prototype={} -A.bw.prototype={ -l(a){var s=this,r=t.N,q=t.X,p=A.X(r,q),o=s.x -if(o!=null){r=A.nR(o,r,q) -q=A.B(r) -q=q.h("@").t(q.h("D.V")) -o=q.h("r?") -o.a(r.J(0,"arguments")) -o.a(r.J(0,"sql")) -if(r.gha(r))p.j(0,"details",new A.du(r,q.h("du<1,2,j,r?>")))}r=s.bP()==null?"":": "+A.t(s.bP())+", " -r=""+("SqfliteFfiException("+s.w+r+", "+s.a+"})") -q=s.f -if(q!=null){r+=" sql "+q -q=s.r -q=q==null?null:!q.gY(q) -if(q===!0){q=s.r -q.toString -q=r+(" args "+A.qB(q)) -r=q}}else r+=" "+s.ep(0) -if(p.a!==0)r+=" "+p.l(0) -return r.charCodeAt(0)==0?r:r}, -sfO(a,b){this.x=t.h9.a(b)}} -A.kw.prototype={} -A.kx.prototype={} -A.e_.prototype={ -l(a){var s=this.a,r=this.b,q=this.c,p=q==null?null:!q.gY(q) -if(p===!0){q.toString -q=" "+A.qB(q)}else q="" -return A.t(s)+" "+(A.t(r)+q)}, -sek(a){this.c=t.kR.a(a)}} -A.iB.prototype={} -A.ip.prototype={ -E(){var s=0,r=A.y(t.H),q=1,p,o=this,n,m,l,k -var $async$E=A.z(function(a,b){if(a===1){p=b -s=q}while(true)switch(s){case 0:q=3 -s=6 -return A.o(o.a.$0(),$async$E) -case 6:n=b -o.b.W(0,n) -q=1 -s=5 -break -case 3:q=2 -k=p -m=A.T(k) -o.b.ae(m) -s=5 -break -case 2:s=1 -break -case 5:return A.w(null,r) -case 1:return A.v(p,r)}}) -return A.x($async$E,r)}} -A.aQ.prototype={ -e3(){var s=this -return A.aA(["path",s.r,"id",s.e,"readOnly",s.w,"singleInstance",s.f],t.N,t.X)}, -d9(){var s,r=this -if(r.dc()===0)return null -s=r.x.b -s=s.a.x2.$1(s.b) -s=self.Number(s==null?t.K.a(s):s) -if(r.y>=1)A.b_("[sqflite-"+r.e+"] Inserted "+A.t(s)) -return s}, -l(a){return A.fI(this.e3())}, -ad(a){var s=this -s.bc() -s.am("Closing database "+s.l(0)) -s.x.X()}, -c6(a){var s=a==null?null:new A.b1(a.a,a.$ti.h("b1<1,r?>")) -return s==null?B.C:s}, -fX(a,b){return this.d.a3(new A.kr(this,a,b),t.H)}, -ab(a,b){return this.f3(a,b)}, -f3(a,b){var s=0,r=A.y(t.H),q,p=[],o=this,n,m,l -var $async$ab=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:o.cD(a,b) -m=b==null?null:!b.gY(b) -l=o.x -if(m===!0){n=l.cI(a) -try{n.dM(new A.ce(o.c6(b))) -s=1 -break}finally{n.X()}}else l.fQ(a) -case 1:return A.w(q,r)}}) -return A.x($async$ab,r)}, -am(a){if(a!=null&&this.y>=1)A.b_("[sqflite-"+this.e+"] "+A.t(a))}, -cD(a,b){var s -if(this.y>=1){s=b==null?null:!b.gY(b) -s=s===!0?" "+A.t(b):"" -A.b_("[sqflite-"+this.e+"] "+a+s) -this.am(null)}}, -bm(){var s=0,r=A.y(t.H),q=this -var $async$bm=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:s=q.c.length!==0?2:3 -break -case 2:s=4 -return A.o(q.as.a3(new A.kp(q),t.P),$async$bm) -case 4:case 3:return A.w(null,r)}}) -return A.x($async$bm,r)}, -bc(){var s=0,r=A.y(t.H),q=this -var $async$bc=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:s=q.c.length!==0?2:3 -break -case 2:s=4 -return A.o(q.as.a3(new A.kk(q),t.P),$async$bc) -case 4:case 3:return A.w(null,r)}}) -return A.x($async$bc,r)}, -b0(a,b){return this.h0(a,t.gq.a(b))}, -h0(a,b){var s=0,r=A.y(t.z),q,p=2,o,n=[],m=this,l -var $async$b0=A.z(function(c,d){if(c===1){o=d -s=p}while(true)switch(s){case 0:l=m.b -s=l==null?3:5 -break -case 3:s=6 -return A.o(b.$0(),$async$b0) -case 6:q=d -s=1 -break -s=4 -break -case 5:s=a===l||a===-1?7:9 -break -case 7:p=10 -s=13 -return A.o(b.$0(),$async$b0) -case 13:l=d -q=l -n=[1] -s=11 -break -n.push(12) -s=11 -break -case 10:n=[2] -case 11:p=2 -if(m.b==null)m.bm() -s=n.pop() -break -case 12:s=8 -break -case 9:l=new A.C($.E,t.D) -B.a.m(m.c,new A.ip(b,new A.cn(l,t.ou))) -q=l -s=1 -break -case 8:case 4:case 1:return A.w(q,r) -case 2:return A.v(o,r)}}) -return A.x($async$b0,r)}, -fY(a,b){return this.d.a3(new A.ks(this,a,b),t.I)}, -bf(a,b){var s=0,r=A.y(t.I),q,p=this,o -var $async$bf=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:if(p.w)A.Q(A.hc("sqlite_error",null,"Database readonly",null)) -s=3 -return A.o(p.ab(a,b),$async$bf) -case 3:o=p.d9() -if(p.y>=1)A.b_("[sqflite-"+p.e+"] Inserted id "+A.t(o)) -q=o -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$bf,r)}, -h1(a,b){return this.d.a3(new A.kv(this,a,b),t.S)}, -bh(a,b){var s=0,r=A.y(t.S),q,p=this -var $async$bh=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:if(p.w)A.Q(A.hc("sqlite_error",null,"Database readonly",null)) -s=3 -return A.o(p.ab(a,b),$async$bh) -case 3:q=p.dc() -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$bh,r)}, -fZ(a,b,c){return this.d.a3(new A.ku(this,a,c,b),t.z)}, -bg(a,b){return this.f4(a,b)}, -f4(a,b){var s=0,r=A.y(t.z),q,p=[],o=this,n,m,l,k -var $async$bg=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:k=o.x.cI(a) -try{o.cD(a,b) -m=k -l=o.c6(b) -if(m.c.e)A.Q(A.K(u.f)) -m.au() -m.bW(new A.ce(l)) -n=m.fl() -o.am("Found "+n.d.length+" rows") -m=n -m=A.aA(["columns",m.a,"rows",m.d],t.N,t.X) -q=m -s=1 -break}finally{k.X()}case 1:return A.w(q,r)}}) -return A.x($async$bg,r)}, -dn(a){var s,r,q,p,o,n,m,l,k=a.a,j=k -try{s=a.d -r=s.a -q=A.u([],t.dO) -for(n=a.c;!0;){if(s.n()){m=s.x -m===$&&A.bk("current") -p=m -J.rh(q,p.b)}else{a.e=!0 -break}if(J.Z(q)>=n)break}o=A.aA(["columns",r,"rows",q],t.N,t.X) -if(!a.e)J.nH(o,"cursorId",k) -return o}catch(l){this.c_(j) -throw l}finally{if(a.e)this.c_(j)}}, -c9(a,b,c){var s=0,r=A.y(t.X),q,p=this,o,n,m,l,k -var $async$c9=A.z(function(d,e){if(d===1)return A.v(e,r) -while(true)switch(s){case 0:k=p.x.cI(b) -p.cD(b,c) -o=p.c6(c) -n=k.c -if(n.e)A.Q(A.K(u.f)) -k.au() -k.bW(new A.ce(o)) -o=k.gc1() -k.gdt() -m=new A.hI(k,o,B.E) -m.bX() -n.c=!1 -k.f=m -n=++p.Q -l=new A.iB(n,k,a,m) -p.z.j(0,n,l) -q=p.dn(l) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$c9,r)}, -h_(a,b){return this.d.a3(new A.kt(this,b,a),t.z)}, -ca(a,b){var s=0,r=A.y(t.X),q,p=this,o,n -var $async$ca=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:if(p.y>=2){o=a===!0?" (cancel)":"" -p.am("queryCursorNext "+b+o)}n=p.z.i(0,b) -if(a===!0){p.c_(b) -q=null -s=1 -break}if(n==null)throw A.b(A.K("Cursor "+b+" not found")) -q=p.dn(n) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$ca,r)}, -c_(a){var s=this.z.J(0,a) -if(s!=null){if(this.y>=2)this.am("Closing cursor "+a) -s.b.X()}}, -dc(){var s=this.x.b,r=A.h(s.a.x1.$1(s.b)) -if(this.y>=1)A.b_("[sqflite-"+this.e+"] Modified "+r+" rows") -return r}, -fV(a,b,c){return this.d.a3(new A.kq(this,t.fr.a(c),b,a),t.z)}, -ah(a,b,c){return this.f2(a,b,t.fr.a(c))}, -f2(b3,b4,b5){var s=0,r=A.y(t.z),q,p=2,o,n=this,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2 -var $async$ah=A.z(function(b6,b7){if(b6===1){o=b7 -s=p}while(true)switch(s){case 0:a8={} -a8.a=null -d=!b4 -if(d)a8.a=A.u([],t.ke) -c=b5.length,b=n.y>=1,a=n.x.b,a0=a.b,a=a.a.x1,a1="[sqflite-"+n.e+"] Modified ",a2=0 -case 3:if(!(a20)A.Q(A.p3("BigInt value exceeds the range of 64 bits")) -A.h(s.c.p4.$3(s.b,b,self.BigInt(a.l(0)))) -break $label0$0}if(A.c2(a)){s=o.a -r=a?1:0 -s.c.cT(s.b,b,r) -break $label0$0}if(typeof a=="number"){s=o.a -A.h(s.c.R8.$3(s.b,b,a)) -break $label0$0}if(typeof a=="string"){s=o.a -t.O.h("ax.S").a(a) -q=B.f.gaw().a4(a) -r=s.c -p=r.cn(q) -B.a.m(s.d,p) -A.h(r.RG.$5(s.b,b,p,q.length,0)) -break $label0$0}s=t.L -if(s.b(a)){r=o.a -s.a(a) -s=r.c -p=s.cn(a) -B.a.m(r.d,p) -A.h(s.rx.$5(r.b,b,p,self.BigInt(J.Z(a)),0)) -break $label0$0}throw A.b(A.bn(a,"params["+b+"]","Allowed parameters must either be null or bool, int, num, String or List."))}}, -bW(a){$label0$0:{this.eG(a.a) -break $label0$0}}, -X(){var s,r=this.c -if(!r.e){$.jd().a.unregister(this) -r.X() -s=this.b -if(!s.e)B.a.J(s.c.d,r)}}, -dM(a){var s=this -if(s.c.e)A.Q(A.K(u.f)) -s.au() -s.bW(a) -s.eY()}} -A.hI.prototype={ -gq(a){var s=this.x -s===$&&A.bk("current") -return s}, -n(){var s,r,q,p,o=this,n=o.r -if(n.c.e||n.f!==o)return!1 -s=n.a -r=s.c -s=s.b -q=A.h(r.k1.$1(s)) -if(q===100){if(!o.y){o.w=A.h(r.fy.$1(s)) -o.sfi(t.a.a(n.gc1())) -o.bX() -o.y=!0}s=[] -for(p=0;p=0&&b>>0!==b||b>=s.length)return A.c(s,b) -return s[b]}return null}r=this.a.c.i(0,b) -if(r==null)return null -s=this.b -if(r>>>0!==r||r>=s.length)return A.c(s,r) -return s[r]}, -gH(a){return this.a.a}, -gO(a){return this.b}, -$iJ:1} -A.iq.prototype={ -gq(a){var s=this.a,r=s.d,q=this.b -if(!(q>=0&&q")),p=t.ng,o=t.Z,n=t.K,q=q.h("i.E"),m=this.b,l=this.a;r.n();){k=r.d -if(k==null)k=q.a(k) -j=n.a(s.gdN(a)[k]) -if(o.b(j))l.j(0,k,j) -else if(p.b(j))m.j(0,k,j)}}} -A.ln.prototype={ -$2(a,b){var s -A.U(a) -t.lK.a(b) -s={} -this.a[a]=s -J.bl(b,new A.lm(s))}, -$S:56} -A.lm.prototype={ -$2(a,b){this.a[A.U(a)]=t.K.a(b)}, -$S:57} -A.jT.prototype={} -A.cI.prototype={} -A.hD.prototype={} -A.ls.prototype={} -A.ji.prototype={ -bB(a){var s=0,r=A.y(t.H),q=this,p,o,n -var $async$bB=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:p=new A.C($.E,t.go) -o=new A.aa(p,t.my) -n=t.kq.a(self.self.indexedDB) -n.toString -o.W(0,J.ru(n,q.b,new A.jm(o),new A.jn(),1)) -s=2 -return A.o(p,$async$bB) -case 2:q.seS(c) -return A.w(null,r)}}) -return A.x($async$bB,r)}, -bA(){var s=0,r=A.y(t.dV),q,p=this,o,n,m,l,k -var $async$bA=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:l=p.a -l.toString -o=A.X(t.N,t.S) -n=new A.d8(t.B.a(B.h.cO(l,"files","readonly").objectStore("files").index("fileName").openKeyCursor()),t.oz) -case 3:k=A -s=5 -return A.o(n.n(),$async$bA) -case 5:if(!k.dp(b)){s=4 -break}m=n.a -if(m==null)m=A.Q(A.K("Await moveNext() first")) -o.j(0,A.U(m.key),A.h(m.primaryKey)) -s=3 -break -case 4:q=o -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$bA,r)}, -bw(a){var s=0,r=A.y(t.I),q,p=this,o,n -var $async$bw=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:o=p.a -o.toString -o=B.h.cO(o,"files","readonly").objectStore("files").index("fileName") -o.toString -n=A -s=3 -return A.o(B.X.ef(o,a),$async$bw) -case 3:q=n.dl(c) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$bw,r)}, -cg(a,b){return A.nV(t.B.a(a.objectStore("files").get(b)),!1,t.jV).e2(new A.jj(b),t.bc)}, -aF(a){var s=0,r=A.y(t.p),q,p=this,o,n,m,l,k,j,i,h,g,f,e,d -var $async$aF=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:e=p.a -e.toString -o=B.h.bI(e,B.n,"readonly") -e=o.objectStore("blocks") -e.toString -s=3 -return A.o(p.cg(o,a),$async$aF) -case 3:n=c -m=J.V(n) -l=m.gk(n) -k=new Uint8Array(l) -j=A.u([],t.iw) -l=t.t -i=new A.d8(t.B.a(e.openCursor(self.IDBKeyRange.bound(A.u([a,0],l),A.u([a,9007199254740992],l)))),t.c6) -e=t.j,l=t.H -case 4:d=A -s=6 -return A.o(i.n(),$async$aF) -case 6:if(!d.dp(c)){s=5 -break}h=i.a -if(h==null)h=A.Q(A.K("Await moveNext() first")) -g=A.h(J.ad(e.a(h.key),1)) -f=m.gk(n) -if(typeof f!=="number"){q=f.aP() -s=1 -break}B.a.m(j,A.p4(new A.jo(h,k,g,Math.min(4096,f-g)),l)) -s=4 -break -case 5:s=7 -return A.o(A.nM(j,l),$async$aF) -case 7:q=k -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$aF,r)}, -aj(a,b){return this.fv(A.h(a),b)}, -fv(a,b){var s=0,r=A.y(t.H),q=this,p,o,n,m,l,k,j -var $async$aj=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:k=q.a -k.toString -p=B.h.bI(k,B.n,"readwrite") -k=p.objectStore("blocks") -k.toString -s=2 -return A.o(q.cg(p,a),$async$aj) -case 2:o=d -n=b.b -m=A.B(n).h("b4<1>") -l=A.fG(new A.b4(n,m),!0,m.h("e.E")) -B.a.ei(l) -m=A.ab(l) -s=3 -return A.o(A.nM(new A.ag(l,m.h("I<~>(1)").a(new A.jk(new A.jl(k,a),b)),m.h("ag<1,I<~>>")),t.H),$async$aj) -case 3:k=J.V(o) -s=b.c!==k.gk(o)?4:5 -break -case 4:n=p.objectStore("files") -n.toString -n=B.i.dY(n,a) -j=B.q -s=7 -return A.o(n.gv(n),$async$aj) -case 7:s=6 -return A.o(j.cP(d,{name:k.gaE(o),length:b.c}),$async$aj) -case 6:case 5:return A.w(null,r)}}) -return A.x($async$aj,r)}, -an(a,b,c){return this.hB(0,A.h(b),c)}, -hB(a,b,c){var s=0,r=A.y(t.H),q=this,p,o,n,m,l,k,j -var $async$an=A.z(function(d,e){if(d===1)return A.v(e,r) -while(true)switch(s){case 0:k=q.a -k.toString -p=B.h.bI(k,B.n,"readwrite") -k=p.objectStore("files") -k.toString -o=p.objectStore("blocks") -o.toString -s=2 -return A.o(q.cg(p,b),$async$an) -case 2:n=e -m=J.V(n) -s=m.gk(n)>c?3:4 -break -case 3:l=t.t -s=5 -return A.o(B.i.cr(o,self.IDBKeyRange.bound(A.u([b,B.c.G(c,4096)*4096+1],l),A.u([b,9007199254740992],l))),$async$an) -case 5:case 4:k=B.i.dY(k,b) -j=B.q -s=7 -return A.o(k.gv(k),$async$an) -case 7:s=6 -return A.o(j.cP(e,{name:m.gaE(n),length:c}),$async$an) -case 6:return A.w(null,r)}}) -return A.x($async$an,r)}, -bv(a){var s=0,r=A.y(t.H),q=this,p,o,n,m -var $async$bv=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:m=q.a -m.toString -p=B.h.bI(m,B.n,"readwrite") -m=t.t -o=self.IDBKeyRange.bound(A.u([a,0],m),A.u([a,9007199254740992],m)) -m=p.objectStore("blocks") -m.toString -m=B.i.cr(m,o) -n=p.objectStore("files") -n.toString -s=2 -return A.o(A.nM(A.u([m,B.i.cr(n,a)],t.iw),t.H),$async$bv) -case 2:return A.w(null,r)}}) -return A.x($async$bv,r)}, -seS(a){this.a=t.k5.a(a)}} -A.jn.prototype={ -$1(a){var s,r,q,p -t.bo.a(a) -s=t.E.a(new A.bZ([],[]).av(a.target.result,!1)) -r=a.oldVersion -if(r==null||r===0){q=B.h.dJ(s,"files",!0) -r=t.z -p=A.X(r,r) -p.j(0,"unique",!0) -B.i.eP(q,"fileName","name",p) -B.h.fK(s,"blocks")}}, -$S:58} -A.jm.prototype={ -$1(a){return this.a.ae("Opening database blocked: "+A.t(a))}, -$S:2} -A.jj.prototype={ -$1(a){t.jV.a(a) -if(a==null)throw A.b(A.bn(this.a,"fileId","File not found in database")) -else return a}, -$S:59} -A.jo.prototype={ -$0(){var s=0,r=A.y(t.H),q=this,p,o,n,m -var $async$$0=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:p=B.e -o=q.b -n=q.c -m=A -s=2 -return A.o(A.k8(t.w.a(new A.bZ([],[]).av(q.a.value,!1))),$async$$0) -case 2:p.a9(o,n,m.b6(b.buffer,0,q.d)) -return A.w(null,r)}}) -return A.x($async$$0,r)}, -$S:4} -A.jl.prototype={ -$2(a,b){var s=0,r=A.y(t.H),q=this,p,o,n,m,l -var $async$$2=A.z(function(c,d){if(c===1)return A.v(d,r) -while(true)switch(s){case 0:p=q.a -o=q.b -n=t.t -s=2 -return A.o(A.nV(t.B.a(p.openCursor(self.IDBKeyRange.only(A.u([o,a],n)))),!0,t.g9),$async$$2) -case 2:m=d -l=A.rz(A.u([b],t.bs)) -s=m==null?3:5 -break -case 3:s=6 -return A.o(B.i.hr(p,l,A.u([o,a],n)),$async$$2) -case 6:s=4 -break -case 5:s=7 -return A.o(B.q.cP(m,l),$async$$2) -case 7:case 4:return A.w(null,r)}}) -return A.x($async$$2,r)}, -$S:60} -A.jk.prototype={ -$1(a){var s -A.h(a) -s=this.b.b.i(0,a) -s.toString -return this.a.$2(a,s)}, -$S:61} -A.b9.prototype={} -A.lN.prototype={ -fu(a,b,c){B.e.a9(this.b.hs(0,a,new A.lO(this,a)),b,c)}, -fC(a,b){var s,r,q,p,o,n,m,l,k -for(s=b.length,r=0;rp)B.e.a9(s,0,A.b6(r.buffer,r.byteOffset+p,A.dl(Math.min(4096,q-p)))) -return s}, -$S:62} -A.il.prototype={} -A.cd.prototype={ -aX(a){var s=this.d.a -if(s==null)A.Q(A.hx(10)) -if(a.cz(this.w)){this.ds() -return a.d.a}else return A.p5(null,t.H)}, -ds(){var s,r,q=this -if(q.f==null){s=q.w -s=!s.gY(s)}else s=!1 -if(s){s=q.w -r=q.f=s.gv(s) -s.J(0,r) -r.d.W(0,A.rO(r.gbG(),t.H).aJ(new A.jI(q)))}}, -aq(a){var s=0,r=A.y(t.S),q,p=this,o,n -var $async$aq=A.z(function(b,c){if(b===1)return A.v(c,r) -while(true)switch(s){case 0:n=p.y -s=n.D(0,a)?3:5 -break -case 3:n=n.i(0,a) -n.toString -q=n -s=1 -break -s=4 -break -case 5:s=6 -return A.o(p.d.bw(a),$async$aq) -case 6:o=c -o.toString -n.j(0,a,o) -q=o -s=1 -break -case 4:case 1:return A.w(q,r)}}) -return A.x($async$aq,r)}, -aW(){var s=0,r=A.y(t.H),q=this,p,o,n,m,l,k,j -var $async$aW=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:m=q.d -s=2 -return A.o(m.bA(),$async$aW) -case 2:l=b -q.y.aY(0,l) -p=J.oS(l),p=p.gC(p),o=q.r.d -case 3:if(!p.n()){s=4 -break}n=p.gq(p) -k=o -j=n.a -s=5 -return A.o(m.aF(n.b),$async$aW) -case 5:k.j(0,j,b) -s=3 -break -case 4:return A.w(null,r)}}) -return A.x($async$aW,r)}, -fS(a){return this.aX(new A.da(t.M.a(new A.jJ()),new A.aa(new A.C($.E,t.D),t.F)))}, -cR(a,b){return this.r.d.D(0,a)?1:0}, -cS(a,b){var s=this -s.r.d.J(0,a) -if(!s.x.J(0,a))s.aX(new A.d9(s,a,new A.aa(new A.C($.E,t.D),t.F)))}, -e9(a){return $.oP().dW(0,"/"+a)}, -b6(a,b){var s,r,q,p=this,o=a.a -if(o==null)o=A.p6(p.b,"/") -s=p.r -r=s.d.D(0,o)?1:0 -q=s.b6(new A.cY(o),b) -if(r===0)if((b&8)!==0)p.x.m(0,o) -else p.aX(new A.cp(p,o,new A.aa(new A.C($.E,t.D),t.F))) -return new A.dd(new A.i6(p,q.a,o),0)}, -eb(a){}} -A.jI.prototype={ -$0(){var s=this.a -s.f=null -s.ds()}, -$S:8} -A.jJ.prototype={ -$0(){}, -$S:8} -A.i6.prototype={ -bM(a,b){this.b.bM(a,b)}, -ge8(){return 0}, -e7(){return this.b.d>=2?1:0}, -bK(){}, -bL(){return this.b.bL()}, -ea(a){this.b.d=a -return null}, -ec(a){}, -bN(a){var s=this,r=s.a,q=r.d.a -if(q==null)A.Q(A.hx(10)) -s.b.bN(a) -if(!r.x.N(0,s.c))r.aX(new A.da(t.M.a(new A.m1(s,a)),new A.aa(new A.C($.E,t.D),t.F)))}, -ed(a){this.b.d=a -return null}, -bO(a,b){var s,r,q,p,o=this.a,n=o.d.a -if(n==null)A.Q(A.hx(10)) -n=this.c -s=o.r.d.i(0,n) -if(s==null)s=new Uint8Array(0) -this.b.bO(a,b) -if(!o.x.N(0,n)){r=new Uint8Array(a.length) -B.e.a9(r,0,a) -q=A.u([],t.p8) -p=$.E -B.a.m(q,new A.il(b,r)) -o.aX(new A.cw(o,n,s,q,new A.aa(new A.C(p,t.D),t.F)))}}, -$ihz:1} -A.m1.prototype={ -$0(){var s=0,r=A.y(t.H),q,p=this,o,n,m -var $async$$0=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:o=p.a -n=o.a -m=n.d -s=3 -return A.o(n.aq(o.c),$async$$0) -case 3:q=m.an(0,b,p.b) -s=1 -break -case 1:return A.w(q,r)}}) -return A.x($async$$0,r)}, -$S:4} -A.a9.prototype={ -cz(a){t.h.a(a) -a.$ti.c.a(this) -a.cb(a.c,this,!1) -return!0}} -A.da.prototype={ -E(){return this.w.$0()}} -A.d9.prototype={ -cz(a){var s,r,q,p -t.h.a(a) -if(!a.gY(a)){s=a.ga6(a) -for(r=this.x;s!=null;)if(s instanceof A.d9)if(s.x===r)return!1 -else s=s.gb4() -else if(s instanceof A.cw){q=s.gb4() -if(s.x===r){p=s.a -p.toString -p.ck(A.B(s).h("af.E").a(s))}s=q}else if(s instanceof A.cp){if(s.x===r){r=s.a -r.toString -r.ck(A.B(s).h("af.E").a(s)) -return!1}s=s.gb4()}else break}a.$ti.c.a(this) -a.cb(a.c,this,!1) -return!0}, -E(){var s=0,r=A.y(t.H),q=this,p,o,n -var $async$E=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:p=q.w -o=q.x -s=2 -return A.o(p.aq(o),$async$E) -case 2:n=b -p.y.J(0,o) -s=3 -return A.o(p.d.bv(n),$async$E) -case 3:return A.w(null,r)}}) -return A.x($async$E,r)}} -A.cp.prototype={ -E(){var s=0,r=A.y(t.H),q=this,p,o,n,m,l -var $async$E=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:p=q.w -o=q.x -n=p.d.a -n.toString -n=B.h.cO(n,"files","readwrite").objectStore("files") -n.toString -m=p.y -l=o -s=2 -return A.o(A.nV(A.t3(n,{name:o,length:0}),!0,t.S),$async$E) -case 2:m.j(0,l,b) -return A.w(null,r)}}) -return A.x($async$E,r)}} -A.cw.prototype={ -cz(a){var s,r -t.h.a(a) -s=a.b===0?null:a.ga6(a) -for(r=this.x;s!=null;)if(s instanceof A.cw)if(s.x===r){B.a.aY(s.z,this.z) -return!1}else s=s.gb4() -else if(s instanceof A.cp){if(s.x===r)break -s=s.gb4()}else break -a.$ti.c.a(this) -a.cb(a.c,this,!1) -return!0}, -E(){var s=0,r=A.y(t.H),q=this,p,o,n,m,l,k -var $async$E=A.z(function(a,b){if(a===1)return A.v(b,r) -while(true)switch(s){case 0:m=q.y -l=new A.lN(m,A.X(t.S,t.p),m.length) -for(m=q.z,p=m.length,o=0;o=2?1:0}, -bK(){if(this.c)this.a.d.J(0,this.b)}, -bL(){var s=this.a.d.i(0,this.b) -s.toString -return J.Z(s)}, -ea(a){this.d=a}, -ec(a){}, -bN(a){var s=this.a.d,r=this.b,q=s.i(0,r),p=new Uint8Array(a) -if(q!=null)B.e.U(p,0,Math.min(a,q.length),q) -s.j(0,r,p)}, -ed(a){this.d=a}, -bO(a,b){var s,r,q,p,o=this.a.d,n=this.b,m=o.i(0,n) -if(m==null)m=new Uint8Array(0) -s=b+a.length -r=m.length -q=s-r -if(q<=0)B.e.U(m,b,s,a) -else{p=new Uint8Array(r+q) -B.e.a9(p,0,m) -B.e.a9(p,b,a) -o.j(0,n,p)}}} -A.hA.prototype={ -bq(a,b){var s,r,q -t.L.a(a) -s=J.V(a) -r=A.h(this.d.$1(s.gk(a)+b)) -q=A.b6(t.J.a(this.b.buffer),0,null) -B.e.U(q,r,r+s.gk(a),a) -B.e.cs(q,r+s.gk(a),r+s.gk(a)+b,0) -return r}, -cn(a){return this.bq(a,0)}, -cT(a,b,c){return A.h(this.p4.$3(a,b,self.BigInt(c)))}} -A.m2.prototype={ -ev(){var s,r,q,p=this,o=t.d9.a(new globalThis.WebAssembly.Memory({initial:16})) -p.c=o -s=t.N -r=t.K -q=t.Z -p.sey(t.n2.a(A.aA(["env",A.aA(["memory",o],s,r),"dart",A.aA(["error_log",A.Y(new A.mi(o),q),"xOpen",A.Y(new A.mj(p,o),q),"xDelete",A.Y(new A.mk(p,o),q),"xAccess",A.Y(new A.mv(p,o),q),"xFullPathname",A.Y(new A.mB(p,o),q),"xRandomness",A.Y(new A.mC(p,o),q),"xSleep",A.Y(new A.mD(p),q),"xCurrentTimeInt64",A.Y(new A.mE(p,o),q),"xDeviceCharacteristics",A.Y(new A.mF(p),q),"xClose",A.Y(new A.mG(p),q),"xRead",A.Y(new A.mH(p,o),q),"xWrite",A.Y(new A.ml(p,o),q),"xTruncate",A.Y(new A.mm(p),q),"xSync",A.Y(new A.mn(p),q),"xFileSize",A.Y(new A.mo(p,o),q),"xLock",A.Y(new A.mp(p),q),"xUnlock",A.Y(new A.mq(p),q),"xCheckReservedLock",A.Y(new A.mr(p,o),q),"function_xFunc",A.Y(new A.ms(p),q),"function_xStep",A.Y(new A.mt(p),q),"function_xInverse",A.Y(new A.mu(p),q),"function_xFinal",A.Y(new A.mw(p),q),"function_xValue",A.Y(new A.mx(p),q),"function_forget",A.Y(new A.my(p),q),"function_compare",A.Y(new A.mz(p,o),q),"function_hook",A.Y(new A.mA(p,o),q)],s,r)],s,t.lK)))}, -sey(a){this.b=t.n2.a(a)}} -A.mi.prototype={ -$1(a){A.b_("[sqlite3] "+A.cm(this.a,A.h(a)))}, -$S:9} -A.mj.prototype={ -$5(a,b,c,d,e){var s,r,q -A.h(a) -A.h(b) -A.h(c) -A.h(d) -A.h(e) -s=this.a -r=s.d.e.i(0,a) -r.toString -q=this.b -return A.aK(new A.m9(s,r,new A.cY(A.oa(q,b,null)),d,q,c,e))}, -$C:"$5", -$R:5, -$S:26} -A.m9.prototype={ -$0(){var s=this,r=s.b.b6(s.c,s.d),q=t.a5.a(r.a),p=s.a.d.f,o=p.a -p.j(0,o,q) -q=s.e -A.hH(q,s.f,o) -p=s.r -if(p!==0)A.hH(q,p,r.b)}, -$S:0} -A.mk.prototype={ -$3(a,b,c){var s -A.h(a) -A.h(b) -A.h(c) -s=this.a.d.e.i(0,a) -s.toString -return A.aK(new A.m8(s,A.cm(this.b,b),c))}, -$C:"$3", -$R:3, -$S:18} -A.m8.prototype={ -$0(){return this.a.cS(this.b,this.c)}, -$S:0} -A.mv.prototype={ -$4(a,b,c,d){var s,r -A.h(a) -A.h(b) -A.h(c) -A.h(d) -s=this.a.d.e.i(0,a) -s.toString -r=this.b -return A.aK(new A.m7(s,A.cm(r,b),c,r,d))}, -$C:"$4", -$R:4, -$S:27} -A.m7.prototype={ -$0(){var s=this -A.hH(s.d,s.e,s.a.cR(s.b,s.c))}, -$S:0} -A.mB.prototype={ -$4(a,b,c,d){var s,r -A.h(a) -A.h(b) -A.h(c) -A.h(d) -s=this.a.d.e.i(0,a) -s.toString -r=this.b -return A.aK(new A.m6(s,A.cm(r,b),c,r,d))}, -$C:"$4", -$R:4, -$S:27} -A.m6.prototype={ -$0(){var s,r,q=this,p=t.O.h("ax.S").a(q.a.e9(q.b)),o=B.f.gaw().a4(p) -p=o.length -if(p>q.c)throw A.b(A.hx(14)) -s=A.b6(t.J.a(q.d.buffer),0,null) -r=q.e -B.e.a9(s,r,o) -p=r+p -if(!(p>=0&&p()","~(@)","I<@>()","~(@,@)","P()","P(d)","~(~())","d(d)","I

()","I<@>(aQ)","P(d,d,d)","~(aS,j,d)","d(d,d,d,r)","@()","d(d,d,d)","~(j,j)","~(r,aG)","I()","P(@)","I>()","~(r[aG?])","I<~>(m)","d(d,d,d,d,d)","d(d,d,d,d)","I()","@(@,@)","bh(j)","j(j?)","j?(r?)","d?()","d?(j)","~(d,@)","P(~())","@(@,j)","~(d2,@)","~(j,d)","J(bw)","~(@[@])","bw(@)","~(j,d?)","J<@,@>(d)","~(J<@,@>)","aS(@,@)","I(aQ)","I(aQ)","j(j)","I()","~(cF)","~(r?,r?)","a6(d,b7)","~(bC?,oc?,bC,~())","~(bp)","~(j,J)","~(j,r)","~(bA)","b9(b9?)","I<~>(d,aS)","I<~>(d)","aS()","I(aQ)","@(@)","j(r?)","P(@,aG)","P(d,d)","P(@,@)","d(d,r)","P(r,aG)","P(d,d,d,d,r)","d(@,@)","C<@>(@)","@(j)","I()"],interceptorsByTag:null,leafTags:null,arrayRti:Symbol("$ti"),rttc:{"2;file,outFlags":(a,b)=>c=>c instanceof A.dd&&a.b(c.a)&&b.b(c.b)}} -A.ul(v.typeUniverse,JSON.parse('{"fZ":"a2","bW":"a2","br":"a2","jp":"a2","jC":"a2","kd":"a2","m0":"a2","mL":"a2","jD":"a2","jA":"a2","de":"a2","cI":"a2","n0":"a2","jT":"a2","ls":"a2","b9":"a2","w9":"a","wa":"a","vS":"a","vQ":"m","w5":"m","vT":"bL","vR":"f","wf":"f","wj":"f","wb":"p","we":"bu","vU":"q","wc":"q","w7":"H","w4":"H","wD":"ao","w3":"bY","vV":"bd","wq":"bd","w8":"cc","vW":"O","vY":"b2","w_":"an","w0":"as","vX":"as","vZ":"as","a":{"k":[]},"fB":{"bh":[],"S":[]},"dH":{"P":[],"S":[]},"a2":{"a":[],"k":[],"de":[],"cI":[],"b9":[]},"M":{"n":["1"],"a":[],"l":["1"],"k":[],"e":["1"]},"jL":{"M":["1"],"n":["1"],"a":[],"l":["1"],"k":[],"e":["1"]},"dq":{"L":["1"]},"cN":{"N":[],"a_":[],"al":["a_"]},"dG":{"N":[],"d":[],"a_":[],"al":["a_"],"S":[]},"fD":{"N":[],"a_":[],"al":["a_"],"S":[]},"bR":{"j":[],"al":["j"],"k2":[],"S":[]},"c_":{"e":["2"]},"dt":{"L":["2"]},"c6":{"c_":["1","2"],"e":["2"],"e.E":"2"},"ej":{"c6":["1","2"],"c_":["1","2"],"l":["2"],"e":["2"],"e.E":"2"},"ef":{"i":["2"],"n":["2"],"c_":["1","2"],"l":["2"],"e":["2"]},"b1":{"ef":["1","2"],"i":["2"],"n":["2"],"c_":["1","2"],"l":["2"],"e":["2"],"i.E":"2","e.E":"2"},"du":{"D":["3","4"],"J":["3","4"],"D.K":"3","D.V":"4"},"cf":{"R":[]},"dv":{"i":["d"],"bX":["d"],"n":["d"],"l":["d"],"e":["d"],"i.E":"d","bX.E":"d"},"l":{"e":["1"]},"a5":{"l":["1"],"e":["1"]},"ci":{"a5":["1"],"l":["1"],"e":["1"],"a5.E":"1","e.E":"1"},"b5":{"L":["1"]},"bs":{"e":["2"],"e.E":"2"},"c8":{"bs":["1","2"],"l":["2"],"e":["2"],"e.E":"2"},"dM":{"L":["2"]},"ag":{"a5":["2"],"l":["2"],"e":["2"],"a5.E":"2","e.E":"2"},"lr":{"e":["1"],"e.E":"1"},"cl":{"L":["1"]},"bv":{"e":["1"],"e.E":"1"},"cE":{"bv":["1"],"l":["1"],"e":["1"],"e.E":"1"},"dY":{"L":["1"]},"c9":{"l":["1"],"e":["1"],"e.E":"1"},"dA":{"L":["1"]},"ea":{"e":["1"],"e.E":"1"},"eb":{"L":["1"]},"d3":{"i":["1"],"bX":["1"],"n":["1"],"l":["1"],"e":["1"]},"ib":{"a5":["d"],"l":["d"],"e":["d"],"a5.E":"d","e.E":"d"},"dJ":{"D":["d","1"],"c1":["d","1"],"J":["d","1"],"D.K":"d","D.V":"1"},"dX":{"a5":["1"],"l":["1"],"e":["1"],"a5.E":"1","e.E":"1"},"d1":{"d2":[]},"dd":{"dc":[],"cu":[]},"dx":{"e7":["1","2"],"dj":["1","2"],"cQ":["1","2"],"c1":["1","2"],"J":["1","2"]},"dw":{"J":["1","2"]},"c7":{"dw":["1","2"],"J":["1","2"]},"cs":{"e":["1"],"e.E":"1"},"el":{"L":["1"]},"fC":{"p7":[]},"dR":{"by":[],"R":[]},"fE":{"R":[]},"hr":{"R":[]},"ez":{"aG":[]},"bN":{"cb":[]},"f9":{"cb":[]},"fa":{"cb":[]},"hi":{"cb":[]},"hf":{"cb":[]},"cB":{"cb":[]},"hR":{"R":[]},"h6":{"R":[]},"hL":{"R":[]},"b3":{"D":["1","2"],"pe":["1","2"],"J":["1","2"],"D.K":"1","D.V":"2"},"b4":{"l":["1"],"e":["1"],"e.E":"1"},"dI":{"L":["1"]},"dc":{"cu":[]},"cO":{"tj":[],"k2":[]},"eq":{"dW":[],"cR":[]},"hJ":{"e":["dW"],"e.E":"dW"},"hK":{"L":["dW"]},"e4":{"cR":[]},"iF":{"e":["cR"],"e.E":"cR"},"iG":{"L":["cR"]},"cT":{"a":[],"k":[],"nK":[],"S":[]},"a7":{"a":[],"k":[]},"dN":{"a7":[],"a":[],"p0":[],"k":[],"S":[]},"ah":{"a7":[],"G":["1"],"a":[],"k":[]},"bS":{"ah":["N"],"i":["N"],"a7":[],"G":["N"],"n":["N"],"a":[],"l":["N"],"k":[],"e":["N"],"at":["N"]},"aM":{"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"]},"fN":{"bS":[],"ah":["N"],"i":["N"],"a7":[],"G":["N"],"n":["N"],"a":[],"l":["N"],"k":[],"e":["N"],"at":["N"],"S":[],"i.E":"N"},"fO":{"bS":[],"ah":["N"],"i":["N"],"a7":[],"G":["N"],"n":["N"],"a":[],"l":["N"],"k":[],"e":["N"],"at":["N"],"S":[],"i.E":"N"},"fP":{"aM":[],"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"fQ":{"aM":[],"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"fR":{"aM":[],"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"fS":{"aM":[],"ah":["d"],"i":["d"],"o7":[],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"fT":{"aM":[],"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"dO":{"aM":[],"ah":["d"],"i":["d"],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"dP":{"aM":[],"ah":["d"],"i":["d"],"aS":[],"a7":[],"G":["d"],"n":["d"],"a":[],"l":["d"],"k":[],"e":["d"],"at":["d"],"S":[],"i.E":"d"},"hY":{"R":[]},"eF":{"by":[],"R":[]},"C":{"I":["1"]},"ec":{"fc":["1"]},"eC":{"L":["1"]},"dg":{"e":["1"],"e.E":"1"},"ds":{"R":[]},"co":{"fc":["1"]},"cn":{"co":["1"],"fc":["1"]},"aa":{"co":["1"],"fc":["1"]},"df":{"pR":["1"],"cr":["1"]},"dh":{"iL":["1"],"df":["1"],"pR":["1"],"cr":["1"]},"d6":{"eB":["1"],"d_":["1"]},"d7":{"ee":["1"],"d0":["1"],"cr":["1"]},"ee":{"d0":["1"],"cr":["1"]},"eB":{"d_":["1"]},"cq":{"bD":["1"]},"eh":{"bD":["@"]},"hT":{"bD":["@"]},"eM":{"bC":[]},"it":{"eM":[],"bC":[]},"em":{"cV":["1"],"nX":["1"],"l":["1"],"e":["1"]},"ct":{"L":["1"]},"cP":{"e":["1"],"e.E":"1"},"en":{"L":["1"]},"i":{"n":["1"],"l":["1"],"e":["1"]},"D":{"J":["1","2"]},"d4":{"D":["1","2"],"c1":["1","2"],"J":["1","2"]},"eo":{"l":["2"],"e":["2"],"e.E":"2"},"ep":{"L":["2"]},"cQ":{"J":["1","2"]},"e7":{"dj":["1","2"],"cQ":["1","2"],"c1":["1","2"],"J":["1","2"]},"cV":{"nX":["1"],"l":["1"],"e":["1"]},"ew":{"cV":["1"],"nX":["1"],"l":["1"],"e":["1"]},"f4":{"ax":["n","j"],"ax.S":"n"},"fq":{"ax":["j","n"]},"e8":{"ax":["j","n"],"ax.S":"j"},"cA":{"al":["cA"]},"bP":{"al":["bP"]},"N":{"a_":[],"al":["a_"]},"bQ":{"al":["bQ"]},"d":{"a_":[],"al":["a_"]},"n":{"l":["1"],"e":["1"]},"a_":{"al":["a_"]},"dW":{"cR":[]},"j":{"al":["j"],"k2":[]},"a8":{"cA":[],"al":["cA"]},"dr":{"R":[]},"by":{"R":[]},"bc":{"R":[]},"cU":{"R":[]},"fy":{"R":[]},"fU":{"R":[]},"ht":{"R":[]},"hp":{"R":[]},"bx":{"R":[]},"fd":{"R":[]},"fY":{"R":[]},"e3":{"R":[]},"fA":{"R":[]},"iJ":{"aG":[]},"aj":{"tI":[]},"eK":{"hu":[]},"ix":{"hu":[]},"hS":{"hu":[]},"O":{"a":[],"k":[]},"m":{"a":[],"k":[]},"ay":{"bM":[],"a":[],"k":[]},"az":{"a":[],"k":[]},"aB":{"a":[],"k":[]},"H":{"f":[],"a":[],"k":[]},"aC":{"a":[],"k":[]},"aD":{"f":[],"a":[],"k":[]},"aE":{"a":[],"k":[]},"aF":{"a":[],"k":[]},"an":{"a":[],"k":[]},"aH":{"f":[],"a":[],"k":[]},"ao":{"f":[],"a":[],"k":[]},"aI":{"a":[],"k":[]},"q":{"H":[],"f":[],"a":[],"k":[]},"eX":{"a":[],"k":[]},"eY":{"H":[],"f":[],"a":[],"k":[]},"eZ":{"H":[],"f":[],"a":[],"k":[]},"bM":{"a":[],"k":[]},"bd":{"H":[],"f":[],"a":[],"k":[]},"fg":{"a":[],"k":[]},"cC":{"a":[],"k":[]},"as":{"a":[],"k":[]},"b2":{"a":[],"k":[]},"fh":{"a":[],"k":[]},"fi":{"a":[],"k":[]},"fj":{"a":[],"k":[]},"fn":{"a":[],"k":[]},"dy":{"i":["bg"],"A":["bg"],"n":["bg"],"G":["bg"],"a":[],"l":["bg"],"k":[],"e":["bg"],"A.E":"bg","i.E":"bg"},"dz":{"a":[],"bg":["a_"],"k":[]},"fo":{"i":["j"],"A":["j"],"n":["j"],"G":["j"],"a":[],"l":["j"],"k":[],"e":["j"],"A.E":"j","i.E":"j"},"fp":{"a":[],"k":[]},"p":{"H":[],"f":[],"a":[],"k":[]},"f":{"a":[],"k":[]},"cG":{"i":["ay"],"A":["ay"],"n":["ay"],"G":["ay"],"a":[],"l":["ay"],"k":[],"e":["ay"],"A.E":"ay","i.E":"ay"},"ft":{"f":[],"a":[],"k":[]},"fv":{"H":[],"f":[],"a":[],"k":[]},"fw":{"a":[],"k":[]},"cc":{"i":["H"],"A":["H"],"n":["H"],"G":["H"],"a":[],"l":["H"],"k":[],"e":["H"],"A.E":"H","i.E":"H"},"cK":{"a":[],"k":[]},"fH":{"a":[],"k":[]},"fJ":{"a":[],"k":[]},"cS":{"m":[],"a":[],"k":[]},"cg":{"f":[],"a":[],"k":[]},"fK":{"a":[],"D":["j","@"],"k":[],"J":["j","@"],"D.K":"j","D.V":"@"},"fL":{"a":[],"D":["j","@"],"k":[],"J":["j","@"],"D.K":"j","D.V":"@"},"fM":{"i":["aB"],"A":["aB"],"n":["aB"],"G":["aB"],"a":[],"l":["aB"],"k":[],"e":["aB"],"A.E":"aB","i.E":"aB"},"dQ":{"i":["H"],"A":["H"],"n":["H"],"G":["H"],"a":[],"l":["H"],"k":[],"e":["H"],"A.E":"H","i.E":"H"},"h_":{"i":["aC"],"A":["aC"],"n":["aC"],"G":["aC"],"a":[],"l":["aC"],"k":[],"e":["aC"],"A.E":"aC","i.E":"aC"},"h5":{"a":[],"D":["j","@"],"k":[],"J":["j","@"],"D.K":"j","D.V":"@"},"h7":{"H":[],"f":[],"a":[],"k":[]},"cW":{"a":[],"k":[]},"cX":{"f":[],"a":[],"k":[]},"h9":{"i":["aD"],"A":["aD"],"f":[],"n":["aD"],"G":["aD"],"a":[],"l":["aD"],"k":[],"e":["aD"],"A.E":"aD","i.E":"aD"},"ha":{"i":["aE"],"A":["aE"],"n":["aE"],"G":["aE"],"a":[],"l":["aE"],"k":[],"e":["aE"],"A.E":"aE","i.E":"aE"},"hg":{"a":[],"D":["j","j"],"k":[],"J":["j","j"],"D.K":"j","D.V":"j"},"hj":{"i":["ao"],"A":["ao"],"n":["ao"],"G":["ao"],"a":[],"l":["ao"],"k":[],"e":["ao"],"A.E":"ao","i.E":"ao"},"hk":{"i":["aH"],"A":["aH"],"f":[],"n":["aH"],"G":["aH"],"a":[],"l":["aH"],"k":[],"e":["aH"],"A.E":"aH","i.E":"aH"},"hl":{"a":[],"k":[]},"hm":{"i":["aI"],"A":["aI"],"n":["aI"],"G":["aI"],"a":[],"l":["aI"],"k":[],"e":["aI"],"A.E":"aI","i.E":"aI"},"hn":{"a":[],"k":[]},"hv":{"a":[],"k":[]},"hy":{"f":[],"a":[],"k":[]},"bY":{"f":[],"a":[],"k":[]},"hP":{"i":["O"],"A":["O"],"n":["O"],"G":["O"],"a":[],"l":["O"],"k":[],"e":["O"],"A.E":"O","i.E":"O"},"ei":{"a":[],"bg":["a_"],"k":[]},"i2":{"i":["az?"],"A":["az?"],"n":["az?"],"G":["az?"],"a":[],"l":["az?"],"k":[],"e":["az?"],"A.E":"az?","i.E":"az?"},"er":{"i":["H"],"A":["H"],"n":["H"],"G":["H"],"a":[],"l":["H"],"k":[],"e":["H"],"A.E":"H","i.E":"H"},"iA":{"i":["aF"],"A":["aF"],"n":["aF"],"G":["aF"],"a":[],"l":["aF"],"k":[],"e":["aF"],"A.E":"aF","i.E":"aF"},"iK":{"i":["an"],"A":["an"],"n":["an"],"G":["an"],"a":[],"l":["an"],"k":[],"e":["an"],"A.E":"an","i.E":"an"},"lJ":{"d_":["1"]},"ek":{"d0":["1"]},"dC":{"L":["1"]},"bO":{"a":[],"k":[]},"bo":{"bO":[],"a":[],"k":[]},"be":{"f":[],"a":[],"k":[]},"cJ":{"a":[],"k":[]},"bu":{"f":[],"a":[],"k":[]},"bA":{"m":[],"a":[],"k":[]},"dE":{"a":[],"k":[]},"dS":{"a":[],"k":[]},"e6":{"f":[],"a":[],"k":[]},"i7":{"th":[]},"aL":{"a":[],"k":[]},"aN":{"a":[],"k":[]},"aR":{"a":[],"k":[]},"fF":{"i":["aL"],"A":["aL"],"n":["aL"],"a":[],"l":["aL"],"k":[],"e":["aL"],"A.E":"aL","i.E":"aL"},"fW":{"i":["aN"],"A":["aN"],"n":["aN"],"a":[],"l":["aN"],"k":[],"e":["aN"],"A.E":"aN","i.E":"aN"},"h0":{"a":[],"k":[]},"hh":{"i":["j"],"A":["j"],"n":["j"],"a":[],"l":["j"],"k":[],"e":["j"],"A.E":"j","i.E":"j"},"ho":{"i":["aR"],"A":["aR"],"n":["aR"],"a":[],"l":["aR"],"k":[],"e":["aR"],"A.E":"aR","i.E":"aR"},"f1":{"a":[],"k":[]},"f2":{"a":[],"D":["j","@"],"k":[],"J":["j","@"],"D.K":"j","D.V":"@"},"f3":{"f":[],"a":[],"k":[]},"bL":{"f":[],"a":[],"k":[]},"fX":{"f":[],"a":[],"k":[]},"h1":{"cM":[]},"hw":{"cM":[]},"hG":{"cM":[]},"b7":{"di":["cA"],"di.T":"cA"},"e1":{"e0":[]},"fu":{"bp":[]},"fl":{"p2":[]},"cH":{"bp":[]},"cZ":{"fb":[]},"hI":{"dF":[],"cD":[],"L":["am"]},"am":{"hs":["j","@"],"D":["j","@"],"J":["j","@"],"D.K":"j","D.V":"@"},"dF":{"cD":[],"L":["am"]},"h4":{"i":["am"],"fV":["am"],"n":["am"],"l":["am"],"cD":[],"e":["am"],"i.E":"am"},"iq":{"L":["am"]},"ce":{"tH":[]},"f6":{"cj":[]},"f5":{"hz":[]},"hE":{"h2":[]},"hB":{"h3":[]},"hF":{"dV":[]},"d5":{"i":["bB"],"n":["bB"],"l":["bB"],"e":["bB"],"i.E":"bB"},"cd":{"cj":[]},"a9":{"af":["a9"]},"i6":{"hz":[]},"da":{"a9":[],"af":["a9"],"af.E":"a9"},"d9":{"a9":[],"af":["a9"],"af.E":"a9"},"cp":{"a9":[],"af":["a9"],"af.E":"a9"},"cw":{"a9":[],"af":["a9"],"af.E":"a9"},"fx":{"cj":[]},"i5":{"hz":[]},"f7":{"t2":[]},"rS":{"n":["d"],"l":["d"],"e":["d"]},"aS":{"n":["d"],"l":["d"],"e":["d"]},"tN":{"n":["d"],"l":["d"],"e":["d"]},"rQ":{"n":["d"],"l":["d"],"e":["d"]},"o7":{"n":["d"],"l":["d"],"e":["d"]},"rR":{"n":["d"],"l":["d"],"e":["d"]},"tM":{"n":["d"],"l":["d"],"e":["d"]},"rM":{"n":["N"],"l":["N"],"e":["N"]},"rN":{"n":["N"],"l":["N"],"e":["N"]}}')) -A.uk(v.typeUniverse,JSON.parse('{"d3":1,"eN":2,"ah":1,"bD":1,"d4":2,"ew":1,"ff":2,"ry":1}')) -var u={c:"Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type",f:"Tried to operate on a released prepared statement"} -var t=(function rtii(){var s=A.aw -return{ie:s("ry"),n:s("ds"),dz:s("cA"),w:s("bM"),J:s("nK"),bT:s("p2"),bP:s("al<@>"),i9:s("dx"),d5:s("O"),nT:s("bo"),E:s("be"),cs:s("bP"),jS:s("bQ"),Q:s("l<@>"),V:s("R"),A:s("m"),W:s("ay"),kL:s("cG"),m:s("bp"),Z:s("cb"),g7:s("I<@>"),gq:s("I<@>()"),ng:s("cI"),ad:s("cK"),cF:s("cd"),bg:s("p7"),bq:s("e"),id:s("e"),e7:s("e<@>"),fm:s("e"),eY:s("M"),iw:s("M>"),dO:s("M>"),C:s("M>"),ke:s("M>"),jP:s("M>"),bw:s("M"),lE:s("M"),s:s("M"),bs:s("M"),p8:s("M"),it:s("M"),b:s("M<@>"),t:s("M"),mf:s("M"),T:s("dH"),bp:s("k"),dY:s("br"),dX:s("G<@>"),d9:s("a"),bX:s("b3"),kT:s("aL"),h:s("cP"),fr:s("n"),a:s("n"),j:s("n<@>"),L:s("n"),kS:s("n"),ag:s("a6"),lK:s("J"),dV:s("J"),f:s("J<@,@>"),n2:s("J>"),lb:s("J"),iZ:s("ag"),hy:s("cS"),oA:s("cg"),ib:s("aB"),hH:s("cT"),dQ:s("bS"),aj:s("aM"),hK:s("a7"),G:s("H"),P:s("P"),ai:s("aN"),K:s("r"),d8:s("aC"),lZ:s("wh"),aK:s("+()"),q:s("bg"),lu:s("dW"),lq:s("wi"),B:s("bu"),hF:s("dX"),oy:s("am"),kI:s("cW"),aD:s("cX"),ls:s("aD"),cA:s("aE"),hI:s("aF"),cE:s("e0"),db:s("e1"),kY:s("he"),l:s("aG"),N:s("j"),lv:s("an"),bR:s("d2"),dR:s("aH"),gJ:s("ao"),ki:s("aI"),hk:s("aR"),aJ:s("S"),do:s("by"),p:s("aS"),cx:s("bW"),jJ:s("hu"),O:s("e8"),bo:s("bA"),e6:s("cj"),a5:s("hz"),n0:s("hA"),ax:s("hC"),es:s("hD"),cI:s("bB"),lS:s("ea"),x:s("bC"),ou:s("cn<~>"),ap:s("b7"),kg:s("a8"),oz:s("d8"),c6:s("d8"),bc:s("b9"),go:s("C"),g5:s("C"),c:s("C<@>"),g_:s("C"),D:s("C<~>"),ot:s("de"),lz:s("iB"),gL:s("eA"),my:s("aa"),ex:s("aa"),F:s("aa<~>"),y:s("bh"),iW:s("bh(r)"),i:s("N"),z:s("@"),mY:s("@()"),v:s("@(r)"),R:s("@(r,aG)"),ha:s("@(j)"),p1:s("@(@,@)"),S:s("d"),eK:s("0&*"),_:s("r*"),g9:s("bo?"),k5:s("be?"),iB:s("f?"),gK:s("I

?"),ef:s("az?"),kq:s("cJ?"),lH:s("n<@>?"),kR:s("n?"),h9:s("J?"),X:s("r?"),fw:s("aG?"),nh:s("aS?"),U:s("bC?"),r:s("oc?"),lT:s("bD<@>?"),jV:s("b9?"),d:s("bE<@,@>?"),g:s("ia?"),o:s("@(m)?"),I:s("d?"),e:s("~()?"),Y:s("~(m)?"),jM:s("~(bA)?"),hC:s("~(d,j,d)?"),cZ:s("a_"),H:s("~"),M:s("~()"),i6:s("~(r)"),k:s("~(r,aG)"),bm:s("~(j,j)"),u:s("~(j,@)")}})();(function constants(){var s=hunkHelpers.makeConstList -B.q=A.bo.prototype -B.h=A.be.prototype -B.X=A.dE.prototype -B.Y=J.cL.prototype -B.a=J.M.prototype -B.c=J.dG.prototype -B.j=J.cN.prototype -B.b=J.bR.prototype -B.Z=J.br.prototype -B.a_=J.a.prototype -B.a1=A.cg.prototype -B.G=A.dN.prototype -B.e=A.dP.prototype -B.i=A.dS.prototype -B.K=J.fZ.prototype -B.r=J.bW.prototype -B.aj=new A.js() -B.L=new A.f4() -B.M=new A.dA(A.aw("dA<0&>")) -B.N=new A.fA() -B.u=function getTagFallback(o) { - var s = Object.prototype.toString.call(o); - return s.substring(8, s.length - 1); -} -B.O=function() { - var toStringFunction = Object.prototype.toString; - function getTag(o) { - var s = toStringFunction.call(o); - return s.substring(8, s.length - 1); - } - function getUnknownTag(object, tag) { - if (/^HTML[A-Z].*Element$/.test(tag)) { - var name = toStringFunction.call(object); - if (name == "[object Object]") return null; - return "HTMLElement"; - } - } - function getUnknownTagGenericBrowser(object, tag) { - if (self.HTMLElement && object instanceof HTMLElement) return "HTMLElement"; - return getUnknownTag(object, tag); - } - function prototypeForTag(tag) { - if (typeof window == "undefined") return null; - if (typeof window[tag] == "undefined") return null; - var constructor = window[tag]; - if (typeof constructor != "function") return null; - return constructor.prototype; - } - function discriminator(tag) { return null; } - var isBrowser = typeof navigator == "object"; - return { - getTag: getTag, - getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, - prototypeForTag: prototypeForTag, - discriminator: discriminator }; -} -B.T=function(getTagFallback) { - return function(hooks) { - if (typeof navigator != "object") return hooks; - var ua = navigator.userAgent; - if (ua.indexOf("DumpRenderTree") >= 0) return hooks; - if (ua.indexOf("Chrome") >= 0) { - function confirm(p) { - return typeof window == "object" && window[p] && window[p].name == p; - } - if (confirm("Window") && confirm("HTMLElement")) return hooks; - } - hooks.getTag = getTagFallback; - }; -} -B.P=function(hooks) { - if (typeof dartExperimentalFixupGetTag != "function") return hooks; - hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); -} -B.Q=function(hooks) { - var getTag = hooks.getTag; - var prototypeForTag = hooks.prototypeForTag; - function getTagFixed(o) { - var tag = getTag(o); - if (tag == "Document") { - if (!!o.xmlVersion) return "!Document"; - return "!HTMLDocument"; - } - return tag; - } - function prototypeForTagFixed(tag) { - if (tag == "Document") return null; - return prototypeForTag(tag); - } - hooks.getTag = getTagFixed; - hooks.prototypeForTag = prototypeForTagFixed; -} -B.S=function(hooks) { - var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; - if (userAgent.indexOf("Firefox") == -1) return hooks; - var getTag = hooks.getTag; - var quickMap = { - "BeforeUnloadEvent": "Event", - "DataTransfer": "Clipboard", - "GeoGeolocation": "Geolocation", - "Location": "!Location", - "WorkerMessageEvent": "MessageEvent", - "XMLDocument": "!Document"}; - function getTagFirefox(o) { - var tag = getTag(o); - return quickMap[tag] || tag; - } - hooks.getTag = getTagFirefox; -} -B.R=function(hooks) { - var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; - if (userAgent.indexOf("Trident/") == -1) return hooks; - var getTag = hooks.getTag; - var quickMap = { - "BeforeUnloadEvent": "Event", - "DataTransfer": "Clipboard", - "HTMLDDElement": "HTMLElement", - "HTMLDTElement": "HTMLElement", - "HTMLPhraseElement": "HTMLElement", - "Position": "Geoposition" - }; - function getTagIE(o) { - var tag = getTag(o); - var newTag = quickMap[tag]; - if (newTag) return newTag; - if (tag == "Object") { - if (window.DataView && (o instanceof window.DataView)) return "DataView"; - } - return tag; - } - function prototypeForTagIE(tag) { - var constructor = window[tag]; - if (constructor == null) return null; - return constructor.prototype; - } - hooks.getTag = getTagIE; - hooks.prototypeForTag = prototypeForTagIE; -} -B.v=function(hooks) { return hooks; } - -B.U=new A.fY() -B.p=new A.kg() -B.f=new A.e8() -B.V=new A.lj() -B.w=new A.hT() -B.x=new A.mM() -B.d=new A.it() -B.W=new A.iJ() -B.y=new A.bQ(0) -B.k=A.u(s([0,0,24576,1023,65534,34815,65534,18431]),t.t) -B.l=A.u(s([0,0,26624,1023,65534,2047,65534,2047]),t.t) -B.a0=A.u(s([0,0,32722,12287,65534,34815,65534,18431]),t.t) -B.z=A.u(s([0,0,65490,12287,65535,34815,65534,18431]),t.t) -B.m=A.u(s([0,0,32776,33792,1,10240,0,0]),t.t) -B.A=A.u(s([0,0,32754,11263,65534,34815,65534,18431]),t.t) -B.B=A.u(s([]),t.s) -B.D=A.u(s([]),t.b) -B.C=A.u(s([]),A.aw("M")) -B.n=A.u(s(["files","blocks"]),t.s) -B.o=A.u(s([0,0,65490,45055,65535,34815,65534,18431]),t.t) -B.H={} -B.E=new A.c7(B.H,[],A.aw("c7")) -B.F=new A.c7(B.H,[],A.aw("c7")) -B.I=new A.dT("readOnly") -B.a2=new A.dT("readWrite") -B.J=new A.dT("readWriteCreate") -B.a3=new A.d1("call") -B.a4=A.b0("nK") -B.a5=A.b0("p0") -B.a6=A.b0("rM") -B.a7=A.b0("rN") -B.a8=A.b0("rQ") -B.a9=A.b0("rR") -B.aa=A.b0("rS") -B.ab=A.b0("k") -B.ac=A.b0("r") -B.ad=A.b0("o7") -B.ae=A.b0("tM") -B.af=A.b0("tN") -B.ag=A.b0("aS") -B.t=new A.lg(!1) -B.ah=new A.e9(522) -B.ai=new A.iT(B.d,A.vm(),A.aw("iT<~(bC,oc,bC,~())>"))})();(function staticFields(){$.mI=null -$.aU=A.u([],A.aw("M")) -$.qM=null -$.pk=null -$.oZ=null -$.oY=null -$.qG=null -$.qA=null -$.qN=null -$.nm=null -$.nv=null -$.oD=null -$.mK=A.u([],A.aw("M?>")) -$.dm=null -$.eP=null -$.eQ=null -$.ov=!1 -$.E=B.d -$.pE=null -$.pF=null -$.pG=null -$.pH=null -$.od=A.eg("_lastQuoRemDigits") -$.oe=A.eg("_lastQuoRemUsed") -$.ed=A.eg("_lastRemUsed") -$.of=A.eg("_lastRem_nsh") -$.px="" -$.py=null -$.qy=null -$.qo=null -$.qE=A.X(t.S,A.aw("aQ")) -$.j7=A.X(A.aw("j?"),A.aw("aQ")) -$.qp=0 -$.nw=0 -$.ap=null -$.qQ=A.X(t.N,t.X) -$.qx=null -$.eR="/shw2"})();(function lazyInitializers(){var s=hunkHelpers.lazyFinal,r=hunkHelpers.lazy -s($,"w1","oI",()=>A.vv("_$dart_dartClosure")) -s($,"x3","nG",()=>B.d.cL(new A.nz(),A.aw("I

"))) -s($,"wr","qW",()=>A.bz(A.lb({ -toString:function(){return"$receiver$"}}))) -s($,"ws","qX",()=>A.bz(A.lb({$method$:null, -toString:function(){return"$receiver$"}}))) -s($,"wt","qY",()=>A.bz(A.lb(null))) -s($,"wu","qZ",()=>A.bz(function(){var $argumentsExpr$="$arguments$" -try{null.$method$($argumentsExpr$)}catch(q){return q.message}}())) -s($,"wx","r1",()=>A.bz(A.lb(void 0))) -s($,"wy","r2",()=>A.bz(function(){var $argumentsExpr$="$arguments$" -try{(void 0).$method$($argumentsExpr$)}catch(q){return q.message}}())) -s($,"ww","r0",()=>A.bz(A.pv(null))) -s($,"wv","r_",()=>A.bz(function(){try{null.$method$}catch(q){return q.message}}())) -s($,"wA","r4",()=>A.bz(A.pv(void 0))) -s($,"wz","r3",()=>A.bz(function(){try{(void 0).$method$}catch(q){return q.message}}())) -s($,"wE","oK",()=>A.tS()) -s($,"w6","eV",()=>A.aw("C

").a($.nG())) -s($,"wB","r5",()=>new A.li().$0()) -s($,"wC","r6",()=>new A.lh().$0()) -s($,"wF","r7",()=>new Int8Array(A.uM(A.u([-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-2,-2,-2,-2,-2,62,-2,62,-2,63,52,53,54,55,56,57,58,59,60,61,-2,-2,-2,-1,-2,-2,-2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-2,-2,-2,-2,63,-2,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-2,-2,-2,-2,-2],t.t)))) -s($,"wK","bJ",()=>A.lz(0)) -s($,"wJ","jc",()=>A.lz(1)) -s($,"wH","oM",()=>$.jc().a8(0)) -s($,"wG","oL",()=>A.lz(1e4)) -r($,"wI","r8",()=>A.aV("^\\s*([+-]?)((0x[a-f0-9]+)|(\\d+)|([a-z0-9]+))\\s*$",!1)) -s($,"wL","r9",()=>typeof process!="undefined"&&Object.prototype.toString.call(process)=="[object process]"&&process.platform=="win32") -s($,"wX","nF",()=>A.oG(B.ac)) -s($,"wY","rd",()=>A.uL()) -s($,"wg","oJ",()=>{var q=new A.i7(new DataView(new ArrayBuffer(A.uI(8)))) -q.ew() -return q}) -s($,"x4","oP",()=>{var q=$.nE() -return new A.fe(q)}) -s($,"x0","oO",()=>new A.fe($.qU())) -s($,"wn","qV",()=>new A.h1(A.aV("/",!0),A.aV("[^/]$",!0),A.aV("^/",!0))) -s($,"wp","jb",()=>new A.hG(A.aV("[/\\\\]",!0),A.aV("[^/\\\\]$",!0),A.aV("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])",!0),A.aV("^[/\\\\](?![/\\\\])",!0))) -s($,"wo","nE",()=>new A.hw(A.aV("/",!0),A.aV("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$",!0),A.aV("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*",!0),A.aV("^/",!0))) -s($,"wm","qU",()=>A.tK()) -s($,"wW","rc",()=>A.nS()) -r($,"wM","oN",()=>A.u([new A.b7("BigInt")],A.aw("M"))) -r($,"wN","ra",()=>{var q=$.oN() -q=A.t1(q,A.ab(q).c) -return q.he(q,new A.n1(),t.N,t.ap)}) -r($,"wV","rb",()=>A.pz("sqlite3.wasm")) -s($,"x_","rf",()=>A.oW("-9223372036854775808")) -s($,"wZ","re",()=>A.oW("9223372036854775807")) -s($,"x2","jd",()=>new A.i0(new FinalizationRegistry(A.c4(A.vP(new A.nn(),t.m),1)),A.aw("i0"))) -s($,"w2","qT",()=>new A.fr(new WeakMap(),A.aw("fr")))})();(function nativeSupport(){!function(){var s=function(a){var m={} -m[a]=1 -return Object.keys(hunkHelpers.convertToFastObject(m))[0]} -v.getIsolateTag=function(a){return s("___dart_"+a+v.isolateTag)} -var r="___dart_isolate_tags_" -var q=Object[r]||(Object[r]=Object.create(null)) -var p="_ZxYxX" -for(var o=0;;o++){var n=s(p+"_"+o+"_") -if(!(n in q)){q[n]=1 -v.isolateTag=n -break}}v.dispatchPropertyName=v.getIsolateTag("dispatch_record")}() -hunkHelpers.setOrUpdateInterceptorsByTag({WebGL:J.cL,AnimationEffectReadOnly:J.a,AnimationEffectTiming:J.a,AnimationEffectTimingReadOnly:J.a,AnimationTimeline:J.a,AnimationWorkletGlobalScope:J.a,AuthenticatorAssertionResponse:J.a,AuthenticatorAttestationResponse:J.a,AuthenticatorResponse:J.a,BackgroundFetchFetch:J.a,BackgroundFetchManager:J.a,BackgroundFetchSettledFetch:J.a,BarProp:J.a,BarcodeDetector:J.a,BluetoothRemoteGATTDescriptor:J.a,Body:J.a,BudgetState:J.a,CacheStorage:J.a,CanvasGradient:J.a,CanvasPattern:J.a,CanvasRenderingContext2D:J.a,Client:J.a,Clients:J.a,CookieStore:J.a,Coordinates:J.a,Credential:J.a,CredentialUserData:J.a,CredentialsContainer:J.a,Crypto:J.a,CryptoKey:J.a,CSS:J.a,CSSVariableReferenceValue:J.a,CustomElementRegistry:J.a,DataTransfer:J.a,DataTransferItem:J.a,DeprecatedStorageInfo:J.a,DeprecatedStorageQuota:J.a,DeprecationReport:J.a,DetectedBarcode:J.a,DetectedFace:J.a,DetectedText:J.a,DeviceAcceleration:J.a,DeviceRotationRate:J.a,DirectoryEntry:J.a,webkitFileSystemDirectoryEntry:J.a,FileSystemDirectoryEntry:J.a,DirectoryReader:J.a,WebKitDirectoryReader:J.a,webkitFileSystemDirectoryReader:J.a,FileSystemDirectoryReader:J.a,DocumentOrShadowRoot:J.a,DocumentTimeline:J.a,DOMError:J.a,DOMImplementation:J.a,Iterator:J.a,DOMMatrix:J.a,DOMMatrixReadOnly:J.a,DOMParser:J.a,DOMPoint:J.a,DOMPointReadOnly:J.a,DOMQuad:J.a,DOMStringMap:J.a,Entry:J.a,webkitFileSystemEntry:J.a,FileSystemEntry:J.a,External:J.a,FaceDetector:J.a,FederatedCredential:J.a,FileEntry:J.a,webkitFileSystemFileEntry:J.a,FileSystemFileEntry:J.a,DOMFileSystem:J.a,WebKitFileSystem:J.a,webkitFileSystem:J.a,FileSystem:J.a,FontFace:J.a,FontFaceSource:J.a,FormData:J.a,GamepadButton:J.a,GamepadPose:J.a,Geolocation:J.a,Position:J.a,GeolocationPosition:J.a,Headers:J.a,HTMLHyperlinkElementUtils:J.a,IdleDeadline:J.a,ImageBitmap:J.a,ImageBitmapRenderingContext:J.a,ImageCapture:J.a,InputDeviceCapabilities:J.a,IntersectionObserver:J.a,IntersectionObserverEntry:J.a,InterventionReport:J.a,KeyframeEffect:J.a,KeyframeEffectReadOnly:J.a,MediaCapabilities:J.a,MediaCapabilitiesInfo:J.a,MediaDeviceInfo:J.a,MediaError:J.a,MediaKeyStatusMap:J.a,MediaKeySystemAccess:J.a,MediaKeys:J.a,MediaKeysPolicy:J.a,MediaMetadata:J.a,MediaSession:J.a,MediaSettingsRange:J.a,MemoryInfo:J.a,MessageChannel:J.a,Metadata:J.a,MutationObserver:J.a,WebKitMutationObserver:J.a,MutationRecord:J.a,NavigationPreloadManager:J.a,Navigator:J.a,NavigatorAutomationInformation:J.a,NavigatorConcurrentHardware:J.a,NavigatorCookies:J.a,NavigatorUserMediaError:J.a,NodeFilter:J.a,NodeIterator:J.a,NonDocumentTypeChildNode:J.a,NonElementParentNode:J.a,NoncedElement:J.a,OffscreenCanvasRenderingContext2D:J.a,OverconstrainedError:J.a,PaintRenderingContext2D:J.a,PaintSize:J.a,PaintWorkletGlobalScope:J.a,PasswordCredential:J.a,Path2D:J.a,PaymentAddress:J.a,PaymentInstruments:J.a,PaymentManager:J.a,PaymentResponse:J.a,PerformanceEntry:J.a,PerformanceLongTaskTiming:J.a,PerformanceMark:J.a,PerformanceMeasure:J.a,PerformanceNavigation:J.a,PerformanceNavigationTiming:J.a,PerformanceObserver:J.a,PerformanceObserverEntryList:J.a,PerformancePaintTiming:J.a,PerformanceResourceTiming:J.a,PerformanceServerTiming:J.a,PerformanceTiming:J.a,Permissions:J.a,PhotoCapabilities:J.a,PositionError:J.a,GeolocationPositionError:J.a,Presentation:J.a,PresentationReceiver:J.a,PublicKeyCredential:J.a,PushManager:J.a,PushMessageData:J.a,PushSubscription:J.a,PushSubscriptionOptions:J.a,Range:J.a,RelatedApplication:J.a,ReportBody:J.a,ReportingObserver:J.a,ResizeObserver:J.a,ResizeObserverEntry:J.a,RTCCertificate:J.a,RTCIceCandidate:J.a,mozRTCIceCandidate:J.a,RTCLegacyStatsReport:J.a,RTCRtpContributingSource:J.a,RTCRtpReceiver:J.a,RTCRtpSender:J.a,RTCSessionDescription:J.a,mozRTCSessionDescription:J.a,RTCStatsResponse:J.a,Screen:J.a,ScrollState:J.a,ScrollTimeline:J.a,Selection:J.a,SpeechRecognitionAlternative:J.a,SpeechSynthesisVoice:J.a,StaticRange:J.a,StorageManager:J.a,StyleMedia:J.a,StylePropertyMap:J.a,StylePropertyMapReadonly:J.a,SyncManager:J.a,TaskAttributionTiming:J.a,TextDetector:J.a,TextMetrics:J.a,TrackDefault:J.a,TreeWalker:J.a,TrustedHTML:J.a,TrustedScriptURL:J.a,TrustedURL:J.a,UnderlyingSourceBase:J.a,URLSearchParams:J.a,VRCoordinateSystem:J.a,VRDisplayCapabilities:J.a,VREyeParameters:J.a,VRFrameData:J.a,VRFrameOfReference:J.a,VRPose:J.a,VRStageBounds:J.a,VRStageBoundsPoint:J.a,VRStageParameters:J.a,ValidityState:J.a,VideoPlaybackQuality:J.a,VideoTrack:J.a,VTTRegion:J.a,WindowClient:J.a,WorkletAnimation:J.a,WorkletGlobalScope:J.a,XPathEvaluator:J.a,XPathExpression:J.a,XPathNSResolver:J.a,XPathResult:J.a,XMLSerializer:J.a,XSLTProcessor:J.a,Bluetooth:J.a,BluetoothCharacteristicProperties:J.a,BluetoothRemoteGATTServer:J.a,BluetoothRemoteGATTService:J.a,BluetoothUUID:J.a,BudgetService:J.a,Cache:J.a,DOMFileSystemSync:J.a,DirectoryEntrySync:J.a,DirectoryReaderSync:J.a,EntrySync:J.a,FileEntrySync:J.a,FileReaderSync:J.a,FileWriterSync:J.a,HTMLAllCollection:J.a,Mojo:J.a,MojoHandle:J.a,MojoWatcher:J.a,NFC:J.a,PagePopupController:J.a,Report:J.a,Request:J.a,Response:J.a,SubtleCrypto:J.a,USBAlternateInterface:J.a,USBConfiguration:J.a,USBDevice:J.a,USBEndpoint:J.a,USBInTransferResult:J.a,USBInterface:J.a,USBIsochronousInTransferPacket:J.a,USBIsochronousInTransferResult:J.a,USBIsochronousOutTransferPacket:J.a,USBIsochronousOutTransferResult:J.a,USBOutTransferResult:J.a,WorkerLocation:J.a,WorkerNavigator:J.a,Worklet:J.a,IDBKeyRange:J.a,IDBObservation:J.a,IDBObserver:J.a,IDBObserverChanges:J.a,SVGAngle:J.a,SVGAnimatedAngle:J.a,SVGAnimatedBoolean:J.a,SVGAnimatedEnumeration:J.a,SVGAnimatedInteger:J.a,SVGAnimatedLength:J.a,SVGAnimatedLengthList:J.a,SVGAnimatedNumber:J.a,SVGAnimatedNumberList:J.a,SVGAnimatedPreserveAspectRatio:J.a,SVGAnimatedRect:J.a,SVGAnimatedString:J.a,SVGAnimatedTransformList:J.a,SVGMatrix:J.a,SVGPoint:J.a,SVGPreserveAspectRatio:J.a,SVGRect:J.a,SVGUnitTypes:J.a,AudioListener:J.a,AudioParam:J.a,AudioTrack:J.a,AudioWorkletGlobalScope:J.a,AudioWorkletProcessor:J.a,PeriodicWave:J.a,WebGLActiveInfo:J.a,ANGLEInstancedArrays:J.a,ANGLE_instanced_arrays:J.a,WebGLBuffer:J.a,WebGLCanvas:J.a,WebGLColorBufferFloat:J.a,WebGLCompressedTextureASTC:J.a,WebGLCompressedTextureATC:J.a,WEBGL_compressed_texture_atc:J.a,WebGLCompressedTextureETC1:J.a,WEBGL_compressed_texture_etc1:J.a,WebGLCompressedTextureETC:J.a,WebGLCompressedTexturePVRTC:J.a,WEBGL_compressed_texture_pvrtc:J.a,WebGLCompressedTextureS3TC:J.a,WEBGL_compressed_texture_s3tc:J.a,WebGLCompressedTextureS3TCsRGB:J.a,WebGLDebugRendererInfo:J.a,WEBGL_debug_renderer_info:J.a,WebGLDebugShaders:J.a,WEBGL_debug_shaders:J.a,WebGLDepthTexture:J.a,WEBGL_depth_texture:J.a,WebGLDrawBuffers:J.a,WEBGL_draw_buffers:J.a,EXTsRGB:J.a,EXT_sRGB:J.a,EXTBlendMinMax:J.a,EXT_blend_minmax:J.a,EXTColorBufferFloat:J.a,EXTColorBufferHalfFloat:J.a,EXTDisjointTimerQuery:J.a,EXTDisjointTimerQueryWebGL2:J.a,EXTFragDepth:J.a,EXT_frag_depth:J.a,EXTShaderTextureLOD:J.a,EXT_shader_texture_lod:J.a,EXTTextureFilterAnisotropic:J.a,EXT_texture_filter_anisotropic:J.a,WebGLFramebuffer:J.a,WebGLGetBufferSubDataAsync:J.a,WebGLLoseContext:J.a,WebGLExtensionLoseContext:J.a,WEBGL_lose_context:J.a,OESElementIndexUint:J.a,OES_element_index_uint:J.a,OESStandardDerivatives:J.a,OES_standard_derivatives:J.a,OESTextureFloat:J.a,OES_texture_float:J.a,OESTextureFloatLinear:J.a,OES_texture_float_linear:J.a,OESTextureHalfFloat:J.a,OES_texture_half_float:J.a,OESTextureHalfFloatLinear:J.a,OES_texture_half_float_linear:J.a,OESVertexArrayObject:J.a,OES_vertex_array_object:J.a,WebGLProgram:J.a,WebGLQuery:J.a,WebGLRenderbuffer:J.a,WebGLRenderingContext:J.a,WebGL2RenderingContext:J.a,WebGLSampler:J.a,WebGLShader:J.a,WebGLShaderPrecisionFormat:J.a,WebGLSync:J.a,WebGLTexture:J.a,WebGLTimerQueryEXT:J.a,WebGLTransformFeedback:J.a,WebGLUniformLocation:J.a,WebGLVertexArrayObject:J.a,WebGLVertexArrayObjectOES:J.a,WebGL2RenderingContextBase:J.a,ArrayBuffer:A.cT,ArrayBufferView:A.a7,DataView:A.dN,Float32Array:A.fN,Float64Array:A.fO,Int16Array:A.fP,Int32Array:A.fQ,Int8Array:A.fR,Uint16Array:A.fS,Uint32Array:A.fT,Uint8ClampedArray:A.dO,CanvasPixelArray:A.dO,Uint8Array:A.dP,HTMLAudioElement:A.q,HTMLBRElement:A.q,HTMLBaseElement:A.q,HTMLBodyElement:A.q,HTMLButtonElement:A.q,HTMLCanvasElement:A.q,HTMLContentElement:A.q,HTMLDListElement:A.q,HTMLDataElement:A.q,HTMLDataListElement:A.q,HTMLDetailsElement:A.q,HTMLDialogElement:A.q,HTMLDivElement:A.q,HTMLEmbedElement:A.q,HTMLFieldSetElement:A.q,HTMLHRElement:A.q,HTMLHeadElement:A.q,HTMLHeadingElement:A.q,HTMLHtmlElement:A.q,HTMLIFrameElement:A.q,HTMLImageElement:A.q,HTMLInputElement:A.q,HTMLLIElement:A.q,HTMLLabelElement:A.q,HTMLLegendElement:A.q,HTMLLinkElement:A.q,HTMLMapElement:A.q,HTMLMediaElement:A.q,HTMLMenuElement:A.q,HTMLMetaElement:A.q,HTMLMeterElement:A.q,HTMLModElement:A.q,HTMLOListElement:A.q,HTMLObjectElement:A.q,HTMLOptGroupElement:A.q,HTMLOptionElement:A.q,HTMLOutputElement:A.q,HTMLParagraphElement:A.q,HTMLParamElement:A.q,HTMLPictureElement:A.q,HTMLPreElement:A.q,HTMLProgressElement:A.q,HTMLQuoteElement:A.q,HTMLScriptElement:A.q,HTMLShadowElement:A.q,HTMLSlotElement:A.q,HTMLSourceElement:A.q,HTMLSpanElement:A.q,HTMLStyleElement:A.q,HTMLTableCaptionElement:A.q,HTMLTableCellElement:A.q,HTMLTableDataCellElement:A.q,HTMLTableHeaderCellElement:A.q,HTMLTableColElement:A.q,HTMLTableElement:A.q,HTMLTableRowElement:A.q,HTMLTableSectionElement:A.q,HTMLTemplateElement:A.q,HTMLTextAreaElement:A.q,HTMLTimeElement:A.q,HTMLTitleElement:A.q,HTMLTrackElement:A.q,HTMLUListElement:A.q,HTMLUnknownElement:A.q,HTMLVideoElement:A.q,HTMLDirectoryElement:A.q,HTMLFontElement:A.q,HTMLFrameElement:A.q,HTMLFrameSetElement:A.q,HTMLMarqueeElement:A.q,HTMLElement:A.q,AccessibleNodeList:A.eX,HTMLAnchorElement:A.eY,HTMLAreaElement:A.eZ,Blob:A.bM,CDATASection:A.bd,CharacterData:A.bd,Comment:A.bd,ProcessingInstruction:A.bd,Text:A.bd,CSSPerspective:A.fg,CSSCharsetRule:A.O,CSSConditionRule:A.O,CSSFontFaceRule:A.O,CSSGroupingRule:A.O,CSSImportRule:A.O,CSSKeyframeRule:A.O,MozCSSKeyframeRule:A.O,WebKitCSSKeyframeRule:A.O,CSSKeyframesRule:A.O,MozCSSKeyframesRule:A.O,WebKitCSSKeyframesRule:A.O,CSSMediaRule:A.O,CSSNamespaceRule:A.O,CSSPageRule:A.O,CSSRule:A.O,CSSStyleRule:A.O,CSSSupportsRule:A.O,CSSViewportRule:A.O,CSSStyleDeclaration:A.cC,MSStyleCSSProperties:A.cC,CSS2Properties:A.cC,CSSImageValue:A.as,CSSKeywordValue:A.as,CSSNumericValue:A.as,CSSPositionValue:A.as,CSSResourceValue:A.as,CSSUnitValue:A.as,CSSURLImageValue:A.as,CSSStyleValue:A.as,CSSMatrixComponent:A.b2,CSSRotation:A.b2,CSSScale:A.b2,CSSSkew:A.b2,CSSTranslation:A.b2,CSSTransformComponent:A.b2,CSSTransformValue:A.fh,CSSUnparsedValue:A.fi,DataTransferItemList:A.fj,DOMException:A.fn,ClientRectList:A.dy,DOMRectList:A.dy,DOMRectReadOnly:A.dz,DOMStringList:A.fo,DOMTokenList:A.fp,MathMLElement:A.p,SVGAElement:A.p,SVGAnimateElement:A.p,SVGAnimateMotionElement:A.p,SVGAnimateTransformElement:A.p,SVGAnimationElement:A.p,SVGCircleElement:A.p,SVGClipPathElement:A.p,SVGDefsElement:A.p,SVGDescElement:A.p,SVGDiscardElement:A.p,SVGEllipseElement:A.p,SVGFEBlendElement:A.p,SVGFEColorMatrixElement:A.p,SVGFEComponentTransferElement:A.p,SVGFECompositeElement:A.p,SVGFEConvolveMatrixElement:A.p,SVGFEDiffuseLightingElement:A.p,SVGFEDisplacementMapElement:A.p,SVGFEDistantLightElement:A.p,SVGFEFloodElement:A.p,SVGFEFuncAElement:A.p,SVGFEFuncBElement:A.p,SVGFEFuncGElement:A.p,SVGFEFuncRElement:A.p,SVGFEGaussianBlurElement:A.p,SVGFEImageElement:A.p,SVGFEMergeElement:A.p,SVGFEMergeNodeElement:A.p,SVGFEMorphologyElement:A.p,SVGFEOffsetElement:A.p,SVGFEPointLightElement:A.p,SVGFESpecularLightingElement:A.p,SVGFESpotLightElement:A.p,SVGFETileElement:A.p,SVGFETurbulenceElement:A.p,SVGFilterElement:A.p,SVGForeignObjectElement:A.p,SVGGElement:A.p,SVGGeometryElement:A.p,SVGGraphicsElement:A.p,SVGImageElement:A.p,SVGLineElement:A.p,SVGLinearGradientElement:A.p,SVGMarkerElement:A.p,SVGMaskElement:A.p,SVGMetadataElement:A.p,SVGPathElement:A.p,SVGPatternElement:A.p,SVGPolygonElement:A.p,SVGPolylineElement:A.p,SVGRadialGradientElement:A.p,SVGRectElement:A.p,SVGScriptElement:A.p,SVGSetElement:A.p,SVGStopElement:A.p,SVGStyleElement:A.p,SVGElement:A.p,SVGSVGElement:A.p,SVGSwitchElement:A.p,SVGSymbolElement:A.p,SVGTSpanElement:A.p,SVGTextContentElement:A.p,SVGTextElement:A.p,SVGTextPathElement:A.p,SVGTextPositioningElement:A.p,SVGTitleElement:A.p,SVGUseElement:A.p,SVGViewElement:A.p,SVGGradientElement:A.p,SVGComponentTransferFunctionElement:A.p,SVGFEDropShadowElement:A.p,SVGMPathElement:A.p,Element:A.p,AbortPaymentEvent:A.m,AnimationEvent:A.m,AnimationPlaybackEvent:A.m,ApplicationCacheErrorEvent:A.m,BackgroundFetchClickEvent:A.m,BackgroundFetchEvent:A.m,BackgroundFetchFailEvent:A.m,BackgroundFetchedEvent:A.m,BeforeInstallPromptEvent:A.m,BeforeUnloadEvent:A.m,BlobEvent:A.m,CanMakePaymentEvent:A.m,ClipboardEvent:A.m,CloseEvent:A.m,CompositionEvent:A.m,CustomEvent:A.m,DeviceMotionEvent:A.m,DeviceOrientationEvent:A.m,ErrorEvent:A.m,ExtendableEvent:A.m,ExtendableMessageEvent:A.m,FetchEvent:A.m,FocusEvent:A.m,FontFaceSetLoadEvent:A.m,ForeignFetchEvent:A.m,GamepadEvent:A.m,HashChangeEvent:A.m,InstallEvent:A.m,KeyboardEvent:A.m,MediaEncryptedEvent:A.m,MediaKeyMessageEvent:A.m,MediaQueryListEvent:A.m,MediaStreamEvent:A.m,MediaStreamTrackEvent:A.m,MIDIConnectionEvent:A.m,MIDIMessageEvent:A.m,MouseEvent:A.m,DragEvent:A.m,MutationEvent:A.m,NotificationEvent:A.m,PageTransitionEvent:A.m,PaymentRequestEvent:A.m,PaymentRequestUpdateEvent:A.m,PointerEvent:A.m,PopStateEvent:A.m,PresentationConnectionAvailableEvent:A.m,PresentationConnectionCloseEvent:A.m,ProgressEvent:A.m,PromiseRejectionEvent:A.m,PushEvent:A.m,RTCDataChannelEvent:A.m,RTCDTMFToneChangeEvent:A.m,RTCPeerConnectionIceEvent:A.m,RTCTrackEvent:A.m,SecurityPolicyViolationEvent:A.m,SensorErrorEvent:A.m,SpeechRecognitionError:A.m,SpeechRecognitionEvent:A.m,SpeechSynthesisEvent:A.m,StorageEvent:A.m,SyncEvent:A.m,TextEvent:A.m,TouchEvent:A.m,TrackEvent:A.m,TransitionEvent:A.m,WebKitTransitionEvent:A.m,UIEvent:A.m,VRDeviceEvent:A.m,VRDisplayEvent:A.m,VRSessionEvent:A.m,WheelEvent:A.m,MojoInterfaceRequestEvent:A.m,ResourceProgressEvent:A.m,USBConnectionEvent:A.m,AudioProcessingEvent:A.m,OfflineAudioCompletionEvent:A.m,WebGLContextEvent:A.m,Event:A.m,InputEvent:A.m,SubmitEvent:A.m,AbsoluteOrientationSensor:A.f,Accelerometer:A.f,AccessibleNode:A.f,AmbientLightSensor:A.f,Animation:A.f,ApplicationCache:A.f,DOMApplicationCache:A.f,OfflineResourceList:A.f,BackgroundFetchRegistration:A.f,BatteryManager:A.f,BroadcastChannel:A.f,CanvasCaptureMediaStreamTrack:A.f,EventSource:A.f,FileReader:A.f,FontFaceSet:A.f,Gyroscope:A.f,XMLHttpRequest:A.f,XMLHttpRequestEventTarget:A.f,XMLHttpRequestUpload:A.f,LinearAccelerationSensor:A.f,Magnetometer:A.f,MediaDevices:A.f,MediaKeySession:A.f,MediaQueryList:A.f,MediaRecorder:A.f,MediaSource:A.f,MediaStream:A.f,MediaStreamTrack:A.f,MIDIAccess:A.f,MIDIInput:A.f,MIDIOutput:A.f,MIDIPort:A.f,NetworkInformation:A.f,Notification:A.f,OffscreenCanvas:A.f,OrientationSensor:A.f,PaymentRequest:A.f,Performance:A.f,PermissionStatus:A.f,PresentationAvailability:A.f,PresentationConnection:A.f,PresentationConnectionList:A.f,PresentationRequest:A.f,RelativeOrientationSensor:A.f,RemotePlayback:A.f,RTCDataChannel:A.f,DataChannel:A.f,RTCDTMFSender:A.f,RTCPeerConnection:A.f,webkitRTCPeerConnection:A.f,mozRTCPeerConnection:A.f,ScreenOrientation:A.f,Sensor:A.f,ServiceWorker:A.f,ServiceWorkerContainer:A.f,ServiceWorkerRegistration:A.f,SharedWorker:A.f,SpeechRecognition:A.f,webkitSpeechRecognition:A.f,SpeechSynthesis:A.f,SpeechSynthesisUtterance:A.f,VR:A.f,VRDevice:A.f,VRDisplay:A.f,VRSession:A.f,VisualViewport:A.f,WebSocket:A.f,Window:A.f,DOMWindow:A.f,Worker:A.f,WorkerPerformance:A.f,BluetoothDevice:A.f,BluetoothRemoteGATTCharacteristic:A.f,Clipboard:A.f,MojoInterfaceInterceptor:A.f,USB:A.f,AnalyserNode:A.f,RealtimeAnalyserNode:A.f,AudioBufferSourceNode:A.f,AudioDestinationNode:A.f,AudioNode:A.f,AudioScheduledSourceNode:A.f,AudioWorkletNode:A.f,BiquadFilterNode:A.f,ChannelMergerNode:A.f,AudioChannelMerger:A.f,ChannelSplitterNode:A.f,AudioChannelSplitter:A.f,ConstantSourceNode:A.f,ConvolverNode:A.f,DelayNode:A.f,DynamicsCompressorNode:A.f,GainNode:A.f,AudioGainNode:A.f,IIRFilterNode:A.f,MediaElementAudioSourceNode:A.f,MediaStreamAudioDestinationNode:A.f,MediaStreamAudioSourceNode:A.f,OscillatorNode:A.f,Oscillator:A.f,PannerNode:A.f,AudioPannerNode:A.f,webkitAudioPannerNode:A.f,ScriptProcessorNode:A.f,JavaScriptAudioNode:A.f,StereoPannerNode:A.f,WaveShaperNode:A.f,EventTarget:A.f,File:A.ay,FileList:A.cG,FileWriter:A.ft,HTMLFormElement:A.fv,Gamepad:A.az,History:A.fw,HTMLCollection:A.cc,HTMLFormControlsCollection:A.cc,HTMLOptionsCollection:A.cc,ImageData:A.cK,Location:A.fH,MediaList:A.fJ,MessageEvent:A.cS,MessagePort:A.cg,MIDIInputMap:A.fK,MIDIOutputMap:A.fL,MimeType:A.aB,MimeTypeArray:A.fM,Document:A.H,DocumentFragment:A.H,HTMLDocument:A.H,ShadowRoot:A.H,XMLDocument:A.H,Attr:A.H,DocumentType:A.H,Node:A.H,NodeList:A.dQ,RadioNodeList:A.dQ,Plugin:A.aC,PluginArray:A.h_,RTCStatsReport:A.h5,HTMLSelectElement:A.h7,SharedArrayBuffer:A.cW,SharedWorkerGlobalScope:A.cX,SourceBuffer:A.aD,SourceBufferList:A.h9,SpeechGrammar:A.aE,SpeechGrammarList:A.ha,SpeechRecognitionResult:A.aF,Storage:A.hg,CSSStyleSheet:A.an,StyleSheet:A.an,TextTrack:A.aH,TextTrackCue:A.ao,VTTCue:A.ao,TextTrackCueList:A.hj,TextTrackList:A.hk,TimeRanges:A.hl,Touch:A.aI,TouchList:A.hm,TrackDefaultList:A.hn,URL:A.hv,VideoTrackList:A.hy,DedicatedWorkerGlobalScope:A.bY,ServiceWorkerGlobalScope:A.bY,WorkerGlobalScope:A.bY,CSSRuleList:A.hP,ClientRect:A.ei,DOMRect:A.ei,GamepadList:A.i2,NamedNodeMap:A.er,MozNamedAttrMap:A.er,SpeechRecognitionResultList:A.iA,StyleSheetList:A.iK,IDBCursor:A.bO,IDBCursorWithValue:A.bo,IDBDatabase:A.be,IDBFactory:A.cJ,IDBIndex:A.dE,IDBObjectStore:A.dS,IDBOpenDBRequest:A.bu,IDBVersionChangeRequest:A.bu,IDBRequest:A.bu,IDBTransaction:A.e6,IDBVersionChangeEvent:A.bA,SVGLength:A.aL,SVGLengthList:A.fF,SVGNumber:A.aN,SVGNumberList:A.fW,SVGPointList:A.h0,SVGStringList:A.hh,SVGTransform:A.aR,SVGTransformList:A.ho,AudioBuffer:A.f1,AudioParamMap:A.f2,AudioTrackList:A.f3,AudioContext:A.bL,webkitAudioContext:A.bL,BaseAudioContext:A.bL,OfflineAudioContext:A.fX}) -hunkHelpers.setOrUpdateLeafTags({WebGL:true,AnimationEffectReadOnly:true,AnimationEffectTiming:true,AnimationEffectTimingReadOnly:true,AnimationTimeline:true,AnimationWorkletGlobalScope:true,AuthenticatorAssertionResponse:true,AuthenticatorAttestationResponse:true,AuthenticatorResponse:true,BackgroundFetchFetch:true,BackgroundFetchManager:true,BackgroundFetchSettledFetch:true,BarProp:true,BarcodeDetector:true,BluetoothRemoteGATTDescriptor:true,Body:true,BudgetState:true,CacheStorage:true,CanvasGradient:true,CanvasPattern:true,CanvasRenderingContext2D:true,Client:true,Clients:true,CookieStore:true,Coordinates:true,Credential:true,CredentialUserData:true,CredentialsContainer:true,Crypto:true,CryptoKey:true,CSS:true,CSSVariableReferenceValue:true,CustomElementRegistry:true,DataTransfer:true,DataTransferItem:true,DeprecatedStorageInfo:true,DeprecatedStorageQuota:true,DeprecationReport:true,DetectedBarcode:true,DetectedFace:true,DetectedText:true,DeviceAcceleration:true,DeviceRotationRate:true,DirectoryEntry:true,webkitFileSystemDirectoryEntry:true,FileSystemDirectoryEntry:true,DirectoryReader:true,WebKitDirectoryReader:true,webkitFileSystemDirectoryReader:true,FileSystemDirectoryReader:true,DocumentOrShadowRoot:true,DocumentTimeline:true,DOMError:true,DOMImplementation:true,Iterator:true,DOMMatrix:true,DOMMatrixReadOnly:true,DOMParser:true,DOMPoint:true,DOMPointReadOnly:true,DOMQuad:true,DOMStringMap:true,Entry:true,webkitFileSystemEntry:true,FileSystemEntry:true,External:true,FaceDetector:true,FederatedCredential:true,FileEntry:true,webkitFileSystemFileEntry:true,FileSystemFileEntry:true,DOMFileSystem:true,WebKitFileSystem:true,webkitFileSystem:true,FileSystem:true,FontFace:true,FontFaceSource:true,FormData:true,GamepadButton:true,GamepadPose:true,Geolocation:true,Position:true,GeolocationPosition:true,Headers:true,HTMLHyperlinkElementUtils:true,IdleDeadline:true,ImageBitmap:true,ImageBitmapRenderingContext:true,ImageCapture:true,InputDeviceCapabilities:true,IntersectionObserver:true,IntersectionObserverEntry:true,InterventionReport:true,KeyframeEffect:true,KeyframeEffectReadOnly:true,MediaCapabilities:true,MediaCapabilitiesInfo:true,MediaDeviceInfo:true,MediaError:true,MediaKeyStatusMap:true,MediaKeySystemAccess:true,MediaKeys:true,MediaKeysPolicy:true,MediaMetadata:true,MediaSession:true,MediaSettingsRange:true,MemoryInfo:true,MessageChannel:true,Metadata:true,MutationObserver:true,WebKitMutationObserver:true,MutationRecord:true,NavigationPreloadManager:true,Navigator:true,NavigatorAutomationInformation:true,NavigatorConcurrentHardware:true,NavigatorCookies:true,NavigatorUserMediaError:true,NodeFilter:true,NodeIterator:true,NonDocumentTypeChildNode:true,NonElementParentNode:true,NoncedElement:true,OffscreenCanvasRenderingContext2D:true,OverconstrainedError:true,PaintRenderingContext2D:true,PaintSize:true,PaintWorkletGlobalScope:true,PasswordCredential:true,Path2D:true,PaymentAddress:true,PaymentInstruments:true,PaymentManager:true,PaymentResponse:true,PerformanceEntry:true,PerformanceLongTaskTiming:true,PerformanceMark:true,PerformanceMeasure:true,PerformanceNavigation:true,PerformanceNavigationTiming:true,PerformanceObserver:true,PerformanceObserverEntryList:true,PerformancePaintTiming:true,PerformanceResourceTiming:true,PerformanceServerTiming:true,PerformanceTiming:true,Permissions:true,PhotoCapabilities:true,PositionError:true,GeolocationPositionError:true,Presentation:true,PresentationReceiver:true,PublicKeyCredential:true,PushManager:true,PushMessageData:true,PushSubscription:true,PushSubscriptionOptions:true,Range:true,RelatedApplication:true,ReportBody:true,ReportingObserver:true,ResizeObserver:true,ResizeObserverEntry:true,RTCCertificate:true,RTCIceCandidate:true,mozRTCIceCandidate:true,RTCLegacyStatsReport:true,RTCRtpContributingSource:true,RTCRtpReceiver:true,RTCRtpSender:true,RTCSessionDescription:true,mozRTCSessionDescription:true,RTCStatsResponse:true,Screen:true,ScrollState:true,ScrollTimeline:true,Selection:true,SpeechRecognitionAlternative:true,SpeechSynthesisVoice:true,StaticRange:true,StorageManager:true,StyleMedia:true,StylePropertyMap:true,StylePropertyMapReadonly:true,SyncManager:true,TaskAttributionTiming:true,TextDetector:true,TextMetrics:true,TrackDefault:true,TreeWalker:true,TrustedHTML:true,TrustedScriptURL:true,TrustedURL:true,UnderlyingSourceBase:true,URLSearchParams:true,VRCoordinateSystem:true,VRDisplayCapabilities:true,VREyeParameters:true,VRFrameData:true,VRFrameOfReference:true,VRPose:true,VRStageBounds:true,VRStageBoundsPoint:true,VRStageParameters:true,ValidityState:true,VideoPlaybackQuality:true,VideoTrack:true,VTTRegion:true,WindowClient:true,WorkletAnimation:true,WorkletGlobalScope:true,XPathEvaluator:true,XPathExpression:true,XPathNSResolver:true,XPathResult:true,XMLSerializer:true,XSLTProcessor:true,Bluetooth:true,BluetoothCharacteristicProperties:true,BluetoothRemoteGATTServer:true,BluetoothRemoteGATTService:true,BluetoothUUID:true,BudgetService:true,Cache:true,DOMFileSystemSync:true,DirectoryEntrySync:true,DirectoryReaderSync:true,EntrySync:true,FileEntrySync:true,FileReaderSync:true,FileWriterSync:true,HTMLAllCollection:true,Mojo:true,MojoHandle:true,MojoWatcher:true,NFC:true,PagePopupController:true,Report:true,Request:true,Response:true,SubtleCrypto:true,USBAlternateInterface:true,USBConfiguration:true,USBDevice:true,USBEndpoint:true,USBInTransferResult:true,USBInterface:true,USBIsochronousInTransferPacket:true,USBIsochronousInTransferResult:true,USBIsochronousOutTransferPacket:true,USBIsochronousOutTransferResult:true,USBOutTransferResult:true,WorkerLocation:true,WorkerNavigator:true,Worklet:true,IDBKeyRange:true,IDBObservation:true,IDBObserver:true,IDBObserverChanges:true,SVGAngle:true,SVGAnimatedAngle:true,SVGAnimatedBoolean:true,SVGAnimatedEnumeration:true,SVGAnimatedInteger:true,SVGAnimatedLength:true,SVGAnimatedLengthList:true,SVGAnimatedNumber:true,SVGAnimatedNumberList:true,SVGAnimatedPreserveAspectRatio:true,SVGAnimatedRect:true,SVGAnimatedString:true,SVGAnimatedTransformList:true,SVGMatrix:true,SVGPoint:true,SVGPreserveAspectRatio:true,SVGRect:true,SVGUnitTypes:true,AudioListener:true,AudioParam:true,AudioTrack:true,AudioWorkletGlobalScope:true,AudioWorkletProcessor:true,PeriodicWave:true,WebGLActiveInfo:true,ANGLEInstancedArrays:true,ANGLE_instanced_arrays:true,WebGLBuffer:true,WebGLCanvas:true,WebGLColorBufferFloat:true,WebGLCompressedTextureASTC:true,WebGLCompressedTextureATC:true,WEBGL_compressed_texture_atc:true,WebGLCompressedTextureETC1:true,WEBGL_compressed_texture_etc1:true,WebGLCompressedTextureETC:true,WebGLCompressedTexturePVRTC:true,WEBGL_compressed_texture_pvrtc:true,WebGLCompressedTextureS3TC:true,WEBGL_compressed_texture_s3tc:true,WebGLCompressedTextureS3TCsRGB:true,WebGLDebugRendererInfo:true,WEBGL_debug_renderer_info:true,WebGLDebugShaders:true,WEBGL_debug_shaders:true,WebGLDepthTexture:true,WEBGL_depth_texture:true,WebGLDrawBuffers:true,WEBGL_draw_buffers:true,EXTsRGB:true,EXT_sRGB:true,EXTBlendMinMax:true,EXT_blend_minmax:true,EXTColorBufferFloat:true,EXTColorBufferHalfFloat:true,EXTDisjointTimerQuery:true,EXTDisjointTimerQueryWebGL2:true,EXTFragDepth:true,EXT_frag_depth:true,EXTShaderTextureLOD:true,EXT_shader_texture_lod:true,EXTTextureFilterAnisotropic:true,EXT_texture_filter_anisotropic:true,WebGLFramebuffer:true,WebGLGetBufferSubDataAsync:true,WebGLLoseContext:true,WebGLExtensionLoseContext:true,WEBGL_lose_context:true,OESElementIndexUint:true,OES_element_index_uint:true,OESStandardDerivatives:true,OES_standard_derivatives:true,OESTextureFloat:true,OES_texture_float:true,OESTextureFloatLinear:true,OES_texture_float_linear:true,OESTextureHalfFloat:true,OES_texture_half_float:true,OESTextureHalfFloatLinear:true,OES_texture_half_float_linear:true,OESVertexArrayObject:true,OES_vertex_array_object:true,WebGLProgram:true,WebGLQuery:true,WebGLRenderbuffer:true,WebGLRenderingContext:true,WebGL2RenderingContext:true,WebGLSampler:true,WebGLShader:true,WebGLShaderPrecisionFormat:true,WebGLSync:true,WebGLTexture:true,WebGLTimerQueryEXT:true,WebGLTransformFeedback:true,WebGLUniformLocation:true,WebGLVertexArrayObject:true,WebGLVertexArrayObjectOES:true,WebGL2RenderingContextBase:true,ArrayBuffer:true,ArrayBufferView:false,DataView:true,Float32Array:true,Float64Array:true,Int16Array:true,Int32Array:true,Int8Array:true,Uint16Array:true,Uint32Array:true,Uint8ClampedArray:true,CanvasPixelArray:true,Uint8Array:false,HTMLAudioElement:true,HTMLBRElement:true,HTMLBaseElement:true,HTMLBodyElement:true,HTMLButtonElement:true,HTMLCanvasElement:true,HTMLContentElement:true,HTMLDListElement:true,HTMLDataElement:true,HTMLDataListElement:true,HTMLDetailsElement:true,HTMLDialogElement:true,HTMLDivElement:true,HTMLEmbedElement:true,HTMLFieldSetElement:true,HTMLHRElement:true,HTMLHeadElement:true,HTMLHeadingElement:true,HTMLHtmlElement:true,HTMLIFrameElement:true,HTMLImageElement:true,HTMLInputElement:true,HTMLLIElement:true,HTMLLabelElement:true,HTMLLegendElement:true,HTMLLinkElement:true,HTMLMapElement:true,HTMLMediaElement:true,HTMLMenuElement:true,HTMLMetaElement:true,HTMLMeterElement:true,HTMLModElement:true,HTMLOListElement:true,HTMLObjectElement:true,HTMLOptGroupElement:true,HTMLOptionElement:true,HTMLOutputElement:true,HTMLParagraphElement:true,HTMLParamElement:true,HTMLPictureElement:true,HTMLPreElement:true,HTMLProgressElement:true,HTMLQuoteElement:true,HTMLScriptElement:true,HTMLShadowElement:true,HTMLSlotElement:true,HTMLSourceElement:true,HTMLSpanElement:true,HTMLStyleElement:true,HTMLTableCaptionElement:true,HTMLTableCellElement:true,HTMLTableDataCellElement:true,HTMLTableHeaderCellElement:true,HTMLTableColElement:true,HTMLTableElement:true,HTMLTableRowElement:true,HTMLTableSectionElement:true,HTMLTemplateElement:true,HTMLTextAreaElement:true,HTMLTimeElement:true,HTMLTitleElement:true,HTMLTrackElement:true,HTMLUListElement:true,HTMLUnknownElement:true,HTMLVideoElement:true,HTMLDirectoryElement:true,HTMLFontElement:true,HTMLFrameElement:true,HTMLFrameSetElement:true,HTMLMarqueeElement:true,HTMLElement:false,AccessibleNodeList:true,HTMLAnchorElement:true,HTMLAreaElement:true,Blob:false,CDATASection:true,CharacterData:true,Comment:true,ProcessingInstruction:true,Text:true,CSSPerspective:true,CSSCharsetRule:true,CSSConditionRule:true,CSSFontFaceRule:true,CSSGroupingRule:true,CSSImportRule:true,CSSKeyframeRule:true,MozCSSKeyframeRule:true,WebKitCSSKeyframeRule:true,CSSKeyframesRule:true,MozCSSKeyframesRule:true,WebKitCSSKeyframesRule:true,CSSMediaRule:true,CSSNamespaceRule:true,CSSPageRule:true,CSSRule:true,CSSStyleRule:true,CSSSupportsRule:true,CSSViewportRule:true,CSSStyleDeclaration:true,MSStyleCSSProperties:true,CSS2Properties:true,CSSImageValue:true,CSSKeywordValue:true,CSSNumericValue:true,CSSPositionValue:true,CSSResourceValue:true,CSSUnitValue:true,CSSURLImageValue:true,CSSStyleValue:false,CSSMatrixComponent:true,CSSRotation:true,CSSScale:true,CSSSkew:true,CSSTranslation:true,CSSTransformComponent:false,CSSTransformValue:true,CSSUnparsedValue:true,DataTransferItemList:true,DOMException:true,ClientRectList:true,DOMRectList:true,DOMRectReadOnly:false,DOMStringList:true,DOMTokenList:true,MathMLElement:true,SVGAElement:true,SVGAnimateElement:true,SVGAnimateMotionElement:true,SVGAnimateTransformElement:true,SVGAnimationElement:true,SVGCircleElement:true,SVGClipPathElement:true,SVGDefsElement:true,SVGDescElement:true,SVGDiscardElement:true,SVGEllipseElement:true,SVGFEBlendElement:true,SVGFEColorMatrixElement:true,SVGFEComponentTransferElement:true,SVGFECompositeElement:true,SVGFEConvolveMatrixElement:true,SVGFEDiffuseLightingElement:true,SVGFEDisplacementMapElement:true,SVGFEDistantLightElement:true,SVGFEFloodElement:true,SVGFEFuncAElement:true,SVGFEFuncBElement:true,SVGFEFuncGElement:true,SVGFEFuncRElement:true,SVGFEGaussianBlurElement:true,SVGFEImageElement:true,SVGFEMergeElement:true,SVGFEMergeNodeElement:true,SVGFEMorphologyElement:true,SVGFEOffsetElement:true,SVGFEPointLightElement:true,SVGFESpecularLightingElement:true,SVGFESpotLightElement:true,SVGFETileElement:true,SVGFETurbulenceElement:true,SVGFilterElement:true,SVGForeignObjectElement:true,SVGGElement:true,SVGGeometryElement:true,SVGGraphicsElement:true,SVGImageElement:true,SVGLineElement:true,SVGLinearGradientElement:true,SVGMarkerElement:true,SVGMaskElement:true,SVGMetadataElement:true,SVGPathElement:true,SVGPatternElement:true,SVGPolygonElement:true,SVGPolylineElement:true,SVGRadialGradientElement:true,SVGRectElement:true,SVGScriptElement:true,SVGSetElement:true,SVGStopElement:true,SVGStyleElement:true,SVGElement:true,SVGSVGElement:true,SVGSwitchElement:true,SVGSymbolElement:true,SVGTSpanElement:true,SVGTextContentElement:true,SVGTextElement:true,SVGTextPathElement:true,SVGTextPositioningElement:true,SVGTitleElement:true,SVGUseElement:true,SVGViewElement:true,SVGGradientElement:true,SVGComponentTransferFunctionElement:true,SVGFEDropShadowElement:true,SVGMPathElement:true,Element:false,AbortPaymentEvent:true,AnimationEvent:true,AnimationPlaybackEvent:true,ApplicationCacheErrorEvent:true,BackgroundFetchClickEvent:true,BackgroundFetchEvent:true,BackgroundFetchFailEvent:true,BackgroundFetchedEvent:true,BeforeInstallPromptEvent:true,BeforeUnloadEvent:true,BlobEvent:true,CanMakePaymentEvent:true,ClipboardEvent:true,CloseEvent:true,CompositionEvent:true,CustomEvent:true,DeviceMotionEvent:true,DeviceOrientationEvent:true,ErrorEvent:true,ExtendableEvent:true,ExtendableMessageEvent:true,FetchEvent:true,FocusEvent:true,FontFaceSetLoadEvent:true,ForeignFetchEvent:true,GamepadEvent:true,HashChangeEvent:true,InstallEvent:true,KeyboardEvent:true,MediaEncryptedEvent:true,MediaKeyMessageEvent:true,MediaQueryListEvent:true,MediaStreamEvent:true,MediaStreamTrackEvent:true,MIDIConnectionEvent:true,MIDIMessageEvent:true,MouseEvent:true,DragEvent:true,MutationEvent:true,NotificationEvent:true,PageTransitionEvent:true,PaymentRequestEvent:true,PaymentRequestUpdateEvent:true,PointerEvent:true,PopStateEvent:true,PresentationConnectionAvailableEvent:true,PresentationConnectionCloseEvent:true,ProgressEvent:true,PromiseRejectionEvent:true,PushEvent:true,RTCDataChannelEvent:true,RTCDTMFToneChangeEvent:true,RTCPeerConnectionIceEvent:true,RTCTrackEvent:true,SecurityPolicyViolationEvent:true,SensorErrorEvent:true,SpeechRecognitionError:true,SpeechRecognitionEvent:true,SpeechSynthesisEvent:true,StorageEvent:true,SyncEvent:true,TextEvent:true,TouchEvent:true,TrackEvent:true,TransitionEvent:true,WebKitTransitionEvent:true,UIEvent:true,VRDeviceEvent:true,VRDisplayEvent:true,VRSessionEvent:true,WheelEvent:true,MojoInterfaceRequestEvent:true,ResourceProgressEvent:true,USBConnectionEvent:true,AudioProcessingEvent:true,OfflineAudioCompletionEvent:true,WebGLContextEvent:true,Event:false,InputEvent:false,SubmitEvent:false,AbsoluteOrientationSensor:true,Accelerometer:true,AccessibleNode:true,AmbientLightSensor:true,Animation:true,ApplicationCache:true,DOMApplicationCache:true,OfflineResourceList:true,BackgroundFetchRegistration:true,BatteryManager:true,BroadcastChannel:true,CanvasCaptureMediaStreamTrack:true,EventSource:true,FileReader:true,FontFaceSet:true,Gyroscope:true,XMLHttpRequest:true,XMLHttpRequestEventTarget:true,XMLHttpRequestUpload:true,LinearAccelerationSensor:true,Magnetometer:true,MediaDevices:true,MediaKeySession:true,MediaQueryList:true,MediaRecorder:true,MediaSource:true,MediaStream:true,MediaStreamTrack:true,MIDIAccess:true,MIDIInput:true,MIDIOutput:true,MIDIPort:true,NetworkInformation:true,Notification:true,OffscreenCanvas:true,OrientationSensor:true,PaymentRequest:true,Performance:true,PermissionStatus:true,PresentationAvailability:true,PresentationConnection:true,PresentationConnectionList:true,PresentationRequest:true,RelativeOrientationSensor:true,RemotePlayback:true,RTCDataChannel:true,DataChannel:true,RTCDTMFSender:true,RTCPeerConnection:true,webkitRTCPeerConnection:true,mozRTCPeerConnection:true,ScreenOrientation:true,Sensor:true,ServiceWorker:true,ServiceWorkerContainer:true,ServiceWorkerRegistration:true,SharedWorker:true,SpeechRecognition:true,webkitSpeechRecognition:true,SpeechSynthesis:true,SpeechSynthesisUtterance:true,VR:true,VRDevice:true,VRDisplay:true,VRSession:true,VisualViewport:true,WebSocket:true,Window:true,DOMWindow:true,Worker:true,WorkerPerformance:true,BluetoothDevice:true,BluetoothRemoteGATTCharacteristic:true,Clipboard:true,MojoInterfaceInterceptor:true,USB:true,AnalyserNode:true,RealtimeAnalyserNode:true,AudioBufferSourceNode:true,AudioDestinationNode:true,AudioNode:true,AudioScheduledSourceNode:true,AudioWorkletNode:true,BiquadFilterNode:true,ChannelMergerNode:true,AudioChannelMerger:true,ChannelSplitterNode:true,AudioChannelSplitter:true,ConstantSourceNode:true,ConvolverNode:true,DelayNode:true,DynamicsCompressorNode:true,GainNode:true,AudioGainNode:true,IIRFilterNode:true,MediaElementAudioSourceNode:true,MediaStreamAudioDestinationNode:true,MediaStreamAudioSourceNode:true,OscillatorNode:true,Oscillator:true,PannerNode:true,AudioPannerNode:true,webkitAudioPannerNode:true,ScriptProcessorNode:true,JavaScriptAudioNode:true,StereoPannerNode:true,WaveShaperNode:true,EventTarget:false,File:true,FileList:true,FileWriter:true,HTMLFormElement:true,Gamepad:true,History:true,HTMLCollection:true,HTMLFormControlsCollection:true,HTMLOptionsCollection:true,ImageData:true,Location:true,MediaList:true,MessageEvent:true,MessagePort:true,MIDIInputMap:true,MIDIOutputMap:true,MimeType:true,MimeTypeArray:true,Document:true,DocumentFragment:true,HTMLDocument:true,ShadowRoot:true,XMLDocument:true,Attr:true,DocumentType:true,Node:false,NodeList:true,RadioNodeList:true,Plugin:true,PluginArray:true,RTCStatsReport:true,HTMLSelectElement:true,SharedArrayBuffer:true,SharedWorkerGlobalScope:true,SourceBuffer:true,SourceBufferList:true,SpeechGrammar:true,SpeechGrammarList:true,SpeechRecognitionResult:true,Storage:true,CSSStyleSheet:true,StyleSheet:true,TextTrack:true,TextTrackCue:true,VTTCue:true,TextTrackCueList:true,TextTrackList:true,TimeRanges:true,Touch:true,TouchList:true,TrackDefaultList:true,URL:true,VideoTrackList:true,DedicatedWorkerGlobalScope:true,ServiceWorkerGlobalScope:true,WorkerGlobalScope:false,CSSRuleList:true,ClientRect:true,DOMRect:true,GamepadList:true,NamedNodeMap:true,MozNamedAttrMap:true,SpeechRecognitionResultList:true,StyleSheetList:true,IDBCursor:false,IDBCursorWithValue:true,IDBDatabase:true,IDBFactory:true,IDBIndex:true,IDBObjectStore:true,IDBOpenDBRequest:true,IDBVersionChangeRequest:true,IDBRequest:true,IDBTransaction:true,IDBVersionChangeEvent:true,SVGLength:true,SVGLengthList:true,SVGNumber:true,SVGNumberList:true,SVGPointList:true,SVGStringList:true,SVGTransform:true,SVGTransformList:true,AudioBuffer:true,AudioParamMap:true,AudioTrackList:true,AudioContext:true,webkitAudioContext:true,BaseAudioContext:false,OfflineAudioContext:true}) -A.ah.$nativeSuperclassTag="ArrayBufferView" -A.es.$nativeSuperclassTag="ArrayBufferView" -A.et.$nativeSuperclassTag="ArrayBufferView" -A.bS.$nativeSuperclassTag="ArrayBufferView" -A.eu.$nativeSuperclassTag="ArrayBufferView" -A.ev.$nativeSuperclassTag="ArrayBufferView" -A.aM.$nativeSuperclassTag="ArrayBufferView" -A.ex.$nativeSuperclassTag="EventTarget" -A.ey.$nativeSuperclassTag="EventTarget" -A.eD.$nativeSuperclassTag="EventTarget" -A.eE.$nativeSuperclassTag="EventTarget"})() -Function.prototype.$2=function(a,b){return this(a,b)} -Function.prototype.$1=function(a){return this(a)} -Function.prototype.$0=function(){return this()} -Function.prototype.$3$3=function(a,b,c){return this(a,b,c)} -Function.prototype.$2$2=function(a,b){return this(a,b)} -Function.prototype.$1$1=function(a){return this(a)} -Function.prototype.$2$1=function(a){return this(a)} -Function.prototype.$3=function(a,b,c){return this(a,b,c)} -Function.prototype.$4=function(a,b,c,d){return this(a,b,c,d)} -Function.prototype.$3$1=function(a){return this(a)} -Function.prototype.$1$0=function(){return this()} -Function.prototype.$5=function(a,b,c,d,e){return this(a,b,c,d,e)} -Function.prototype.$6=function(a,b,c,d,e,f){return this(a,b,c,d,e,f)} -Function.prototype.$2$3=function(a,b,c){return this(a,b,c)} -Function.prototype.$1$2=function(a,b){return this(a,b)} -convertAllToFastObject(w) -convertToFastObject($);(function(a){if(typeof document==="undefined"){a(null) -return}if(typeof document.currentScript!="undefined"){a(document.currentScript) -return}var s=document.scripts -function onLoad(b){for(var q=0;q:_DEBUG>") -endfunction() - -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - -# Flutter library and tool build rules. -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build -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() - -# 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/example/windows/flutter/CMakeLists.txt b/example/windows/flutter/CMakeLists.txt deleted file mode 100644 index b2e4bd8..0000000 --- a/example/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -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") - -# === 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" - windows-x64 $ - 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/example/windows/flutter/ephemeral/.plugin_symlinks/assecontservices b/example/windows/flutter/ephemeral/.plugin_symlinks/assecontservices deleted file mode 120000 index 1a6cc97..0000000 --- a/example/windows/flutter/ephemeral/.plugin_symlinks/assecontservices +++ /dev/null @@ -1 +0,0 @@ -C:/Users/gabri/StudioProjects/LibAppsFlutter/ \ No newline at end of file diff --git a/example/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows b/example/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows deleted file mode 120000 index bc05629..0000000 --- a/example/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows +++ /dev/null @@ -1 +0,0 @@ -C:/Users/gabri/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_windows-2.2.1/ \ No newline at end of file diff --git a/example/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows b/example/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows deleted file mode 120000 index cc6bbb7..0000000 --- a/example/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows +++ /dev/null @@ -1 +0,0 @@ -C:/Users/gabri/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences_windows-2.3.2/ \ No newline at end of file diff --git a/example/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows b/example/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows deleted file mode 120000 index f75533e..0000000 --- a/example/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows +++ /dev/null @@ -1 +0,0 @@ -C:/Users/gabri/AppData/Local/Pub/Cache/hosted/pub.dev/url_launcher_windows-3.1.0/ \ No newline at end of file diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index d5c9ee1..0000000 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,26 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - AssecontservicesPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("AssecontservicesPlugin")); - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - FileSelectorWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FileSelectorWindows")); - LocalAuthPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("LocalAuthPlugin")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); -} diff --git a/example/windows/flutter/generated_plugin_registrant.h b/example/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d8..0000000 --- a/example/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake deleted file mode 100644 index 47a51a8..0000000 --- a/example/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - assecontservices - connectivity_plus - file_selector_windows - local_auth_windows - url_launcher_windows -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/example/windows/runner/CMakeLists.txt b/example/windows/runner/CMakeLists.txt deleted file mode 100644 index de2d891..0000000 --- a/example/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -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_standard_settings(${BINARY_NAME}) -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/example/windows/runner/Runner.rc b/example/windows/runner/Runner.rc deleted file mode 100644 index 91fa361..0000000 --- a/example/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER -#else -#define VERSION_AS_NUMBER 1,0,0 -#endif - -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.assecont.servicos" "\0" - VALUE "FileDescription", "assecontservices_example" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "assecontservices_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 com.assecont.servicos. All rights reserved." "\0" - VALUE "OriginalFilename", "assecontservices_example.exe" "\0" - VALUE "ProductName", "assecontservices_example" "\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/example/windows/runner/flutter_window.cpp b/example/windows/runner/flutter_window.cpp deleted file mode 100644 index b43b909..0000000 --- a/example/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - 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/example/windows/runner/flutter_window.h b/example/windows/runner/flutter_window.h deleted file mode 100644 index 6da0652..0000000 --- a/example/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/example/windows/runner/main.cpp b/example/windows/runner/main.cpp deleted file mode 100644 index 512193d..0000000 --- a/example/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"assecontservices_example", 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/example/windows/runner/resource.h b/example/windows/runner/resource.h deleted file mode 100644 index 66a65d1..0000000 --- a/example/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/example/windows/runner/resources/app_icon.ico b/example/windows/runner/resources/app_icon.ico deleted file mode 100644 index c04e20c..0000000 Binary files a/example/windows/runner/resources/app_icon.ico and /dev/null differ diff --git a/example/windows/runner/runner.exe.manifest b/example/windows/runner/runner.exe.manifest deleted file mode 100644 index c977c4a..0000000 --- a/example/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - - - - - - - diff --git a/example/windows/runner/utils.cpp b/example/windows/runner/utils.cpp deleted file mode 100644 index d19bdbb..0000000 --- a/example/windows/runner/utils.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr); - if (target_length == 0) { - return std::string(); - } - std::string utf8_string; - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, utf8_string.data(), - target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/example/windows/runner/utils.h b/example/windows/runner/utils.h deleted file mode 100644 index 3879d54..0000000 --- a/example/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/example/windows/runner/win32_window.cpp b/example/windows/runner/win32_window.cpp deleted file mode 100644 index c10f08d..0000000 --- a/example/windows/runner/win32_window.cpp +++ /dev/null @@ -1,245 +0,0 @@ -#include "win32_window.h" - -#include - -#include "resource.h" - -namespace { - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -// 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 registar 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::CreateAndShow(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 | WS_VISIBLE, - 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; - } - - return OnCreate(); -} - -// 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; - } - - 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. -} diff --git a/example/windows/runner/win32_window.h b/example/windows/runner/win32_window.h deleted file mode 100644 index 17ba431..0000000 --- a/example/windows/runner/win32_window.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates and shows a win32 window with |title| and position and size 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 to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); - - // 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 - // responsponds 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; - - 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_ diff --git a/ios/assecontservices.podspec b/ios/assecontservices.podspec index 8fb935f..7edb727 100644 --- a/ios/assecontservices.podspec +++ b/ios/assecontservices.podspec @@ -15,7 +15,7 @@ A new Flutter project. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.platform = :ios, '9.0' + s.platform = :ios, '13.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/lib/assecontservices.dart b/lib/assecontservices.dart index c906ee2..cf2e4f6 100644 --- a/lib/assecontservices.dart +++ b/lib/assecontservices.dart @@ -1,19 +1,14 @@ import 'package:flutter/foundation.dart'; - import 'package:flutter/material.dart'; import 'package:nested/nested.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; - -import 'package:safe_device/safe_device.dart'; +import 'package:responsive_framework/responsive_framework.dart'; import 'package:device_preview/device_preview.dart'; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:responsive_framework/breakpoint.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; -import 'package:universal_io/io.dart' as io; +import 'package:hive_flutter/adapters.dart'; -import 'common/custom_textformfield.dart'; import 'controllers/controllers.dart'; +import 'core/service/database_hive.dart'; import 'services/services.dart'; import 'enums/enums.dart'; import 'helper/helper.dart'; @@ -40,7 +35,7 @@ export 'package:safe_device/safe_device.dart'; class Assecontservices { - static init({required ConfiguracoesModel config, required RouteFactory rotas, + static init({required ConfiguracoesModel config, required RouteFactory rotas, NavigatorObserver? observer, List? providers, bool devicePreview = false, String? titulo, Widget? myApp}) async { //io.HttpOverrides.global = MyHttpOverrides(); @@ -49,25 +44,16 @@ class Assecontservices { Provider.debugCheckInvalidValueType = null; Config.conf = config; - final packageInfo = await PackageInfo.fromPlatform(); - Config.versao = packageInfo.version; + bool ponto = Config.conf.nomeApp == VersaoApp.PontoApp || Config.conf.nomeApp == VersaoApp.PontoTablet; + if(ponto){ + await Hive.initFlutter(); + final DatabaseHive db = DatabaseHive(); + await db.initializeDatabase(); + } if(!kIsWeb){ - if(ponto){ - try { - if(Config.isIOS) { - Config.isJailBroken = await SafeDevice.isJailBroken; - } - if(!Config.isWin){ - Config.isRealDevice = await SafeDevice.isRealDevice; - Config.canMockLocation = await SafeDevice.canMockLocation; - } - } catch (e) {} - } - - try { final BiometriaServices _bio = BiometriaServices(); _bio.supportedBio(); @@ -76,147 +62,119 @@ class Assecontservices { List _providers = [ - if(ponto) - Provider( - lazy: false, - create: (_)=> DBPonto(), - ), - ChangeNotifierProvider( lazy: false, create: (_)=> Config(), ), - ChangeNotifierProvider( - lazy: false, - create: (_)=> FormProvider(), - ), if(Config.conf.nomeApp != VersaoApp.PontoTablet) ChangeNotifierProvider( lazy: false, create: (_)=> BiometriaManager(), ), - if(Config.conf.nomeApp != VersaoApp.AssewebApp) + + + if(Config.conf.nomeApp != VersaoApp.AssewebApp) ...[ ChangeNotifierProvider( - lazy: true, create: (_)=> HoleriteManager(), ), - if(Config.conf.nomeApp != VersaoApp.AssewebApp) ChangeNotifierProvider( lazy: false, create: (_)=> UserHoleriteManager(), ), + ], if(Config.conf.nomeApp == VersaoApp.HoleriteApp) ChangeNotifierProvider( - lazy: true, - create: (_)=> InformeManager(), - ), - - if(Config.conf.nomeApp == VersaoApp.HoleriteApp) - ChangeNotifierProvider( - lazy: true, - create: (_)=> PrimeiroAcessoHoleriteManager(), - ), - if(Config.conf.nomeApp == VersaoApp.HoleriteApp) - ChangeNotifierProvider( - lazy: true, create: (_)=> SenhaHoleriteManager(), ), - if(Config.conf.nomeApp == VersaoApp.PontoTablet) + + + if(Config.conf.nomeApp == VersaoApp.PontoTablet) ...[ ChangeNotifierProvider( lazy: false, create: (_)=> ConfigTabletManager(), ), - if(Config.conf.nomeApp == VersaoApp.PontoTablet) ChangeNotifierProvider( lazy: false, create: (_)=> EmpresaPontoManager(), ), - if(Config.conf.nomeApp == VersaoApp.PontoTablet) Provider( lazy: true, create: (_)=> UserPontoOffilineManager(), ), - if(Config.conf.nomeApp == VersaoApp.PontoTablet) + ChangeNotifierProvider( lazy: true, create: (_)=> HistoricoManager(), ), + ], + ///--------------------------------------------------------------------/// - if(ponto) + if(ponto) ...[ ChangeNotifierProvider( lazy: false, create: (_)=> UserPontoManager(), ), - if(ponto) + Provider( + lazy: false, + create: (_)=> DBPonto(), + ), ChangeNotifierProvider( create: (_)=> ComprovanteManagger(), ), - if(ponto) ChangeNotifierProvider( lazy: true, create: (_)=> BancoHorasManager(), ), - if(ponto) ChangeNotifierProvider( lazy: true, create: (_)=> MemorandosManager(), ), - if(ponto) ChangeNotifierProvider( //lazy: true, create: (_)=> EspelhoManager(), ), - if(ponto) ChangeNotifierProvider( lazy: true, create: (_)=> MarcacoesManager(), ), - if(ponto) ChangeNotifierProvider( lazy: true, create: (_)=> ApontamentoManager(), ), - if(ponto) Provider( lazy: true, create: (_)=> RegistroManger(), ), - if(ponto) ChangeNotifierProvider( create: (_)=> GetHora(), ), - if(ponto) ChangeNotifierProvider( lazy: false, create: (_)=> CameraPontoManager(), ), - if(ponto) ChangeNotifierProvider( lazy: true, create: (_)=> SenhaPontoManager(), ), + ], + ///-----------asseweb--------------/// - if(Config.conf.nomeApp == VersaoApp.AssewebApp) - ChangeNotifierProvider( - lazy: true, - create: (_) => HomeAssewebManager(), - ), + if(Config.conf.nomeApp == VersaoApp.AssewebApp) ChangeNotifierProvider( lazy: false, create: (_) => UserAssewebManager(), ), - if(Config.conf.nomeApp == VersaoApp.AssewebApp) - Provider( - lazy: false, - create: (context) => SenhaAssewebManager(), - ), ]; if(providers != null){ - _providers.addAll(providers); + try{ + _providers.addAll(providers); + }catch(e){ + + } } runApp( @@ -224,7 +182,9 @@ class Assecontservices { providers: _providers, child: DevicePreview( enabled: devicePreview, //!kReleaseMode, - builder: (context) => myApp ?? MyApp(titulo: titulo, rotas: rotas,), // Wrap your app + builder: (context) => myApp ?? MyApp( + titulo: titulo, rotas: rotas,observer: observer + ), // Wrap your app ), ) ); @@ -232,37 +192,32 @@ class Assecontservices { } -class MyApp extends StatefulWidget { - String? titulo; - RouteFactory? rotas; - - MyApp({required this.titulo, required this.rotas}); - - @override - State createState() => _MyAppState(); -} - -class _MyAppState extends State { +class MyApp extends StatelessWidget { + final String? titulo; + final RouteFactory rotas; + final NavigatorObserver? observer; + const MyApp({super.key, required this.titulo, required this.rotas, this.observer}); @override Widget build(BuildContext context) { return MaterialApp( - title: widget.titulo ?? '', + title: titulo ?? 'Assecont', debugShowCheckedModeBanner: false, + navigatorObservers: observer != null ? [observer!] : [], theme: context.watch().darkTemas ? ThemeData.dark(useMaterial3: true).copyWith( floatingActionButtonTheme: const FloatingActionButtonThemeData( foregroundColor: Colors.white, backgroundColor: Config.corPri, ), - appBarTheme: AppBarTheme( + appBarTheme: const AppBarTheme( centerTitle: true, elevation: 0, scrolledUnderElevation: 0, - backgroundColor: ThemeData.dark().primaryColor, - titleTextStyle: const TextStyle(color: Config.corPri,), - toolbarTextStyle: const TextStyle(color: Config.corPri,fontSize: 18), - iconTheme: const IconThemeData(color: Colors.white), - actionsIconTheme: const IconThemeData(color: Colors.white), + backgroundColor: Colors.black87, + titleTextStyle: TextStyle(color: Config.corPri,), + toolbarTextStyle: TextStyle(color: Config.corPri,fontSize: 18), + iconTheme: IconThemeData(color: Colors.white), + actionsIconTheme: IconThemeData(color: Colors.white), ), visualDensity: VisualDensity.adaptivePlatformDensity, ) : ThemeData.light(useMaterial3: true).copyWith( @@ -272,7 +227,8 @@ class _MyAppState extends State { ), primaryColor: Config.corPribar, scaffoldBackgroundColor: kIsWeb ? Colors.grey[100] : null, - colorScheme: ThemeData(useMaterial3: true).colorScheme.copyWith(surfaceTint: Colors.white), + colorScheme: const ColorScheme.light(surfaceTint: Colors.white), + cardColor: Colors.white, appBarTheme: const AppBarTheme( centerTitle: true, titleTextStyle: TextStyle(color: kIsWeb ? Config.corPribar : Config.corPri,), @@ -285,8 +241,9 @@ class _MyAppState extends State { ), builder: (context, child) { final MediaQueryData data = MediaQuery.of(context); + return MediaQuery( - data: data.copyWith(textScaleFactor: 1.0), + data: data.copyWith(textScaler: const TextScaler.linear(1.0)), child: ResponsiveBreakpoints.builder( child: child ?? Container(), breakpoints: const [ @@ -306,7 +263,7 @@ class _MyAppState extends State { ], supportedLocales: const [Locale('pt', 'BR')], initialRoute: '/', - onGenerateRoute: widget.rotas, + onGenerateRoute: rotas, ); } diff --git a/lib/common/actions/actions.dart b/lib/common/actions/actions.dart index 2b50e56..2d696be 100644 --- a/lib/common/actions/actions.dart +++ b/lib/common/actions/actions.dart @@ -1,75 +1,77 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; +import 'package:responsive_framework/responsive_framework.dart'; + import '../../controllers/controllers.dart'; import '../../config.dart'; import '../../common/common.dart'; import '../../enums/enums.dart'; -import 'func_alter_empresa.dart'; -import 'func_alter_user.dart'; import 'func_aponta.dart'; import 'func_config.dart'; import 'func_sair.dart'; import 'func_review.dart'; -actions(BuildContext context, {bool aponta = false, bool registro = false, bool config = false, - GlobalKey? keyMenu, GlobalKey? key1, GlobalKey? key2, GlobalKey? key3, GlobalKey? key4, GlobalKey? key5}){ +actions(BuildContext context, {bool aponta = false, bool registro = false, + bool config = false, Function()? onAlter, Function()? modalPass, GlobalKey? keyMenu, GlobalKey? key1, + GlobalKey? key2, GlobalKey? key3, GlobalKey? key4, GlobalKey? key5, GlobalKey? key6}){ + return Padding( padding: const EdgeInsets.only(right: 5), child: PopupMenuButton( key: keyMenu, + color: context.watch().darkTemas ? null : Colors.white, itemBuilder: (context) => [ - if(Config.conf.nomeApp == VersaoApp.HoleriteApp && aponta) + if(Config.conf.nomeApp == VersaoApp.HoleriteApp && aponta) ...[ PopupMenuItem( key: key1, value: 0, child: CustomText.text("Alterar Usuario"), ), - if(Config.conf.nomeApp == VersaoApp.AssewebApp && aponta) + ] else if(Config.conf.nomeApp == VersaoApp.AssewebApp && aponta) ...[ PopupMenuItem( key: key1, value: 0, child: CustomText.text("Alterar Empresa"), ), - if(Config.conf.nomeApp == VersaoApp.PontoApp && aponta && !registro) + ] else if(Config.conf.nomeApp == VersaoApp.PontoApp && aponta ) ...[ PopupMenuItem( key: key1, value: 1, child: CustomText.text("Apontamento"), ), - if(Config.conf.nomeApp != VersaoApp.PontoApp || !registro) - PopupMenuItem( - key: key2, - value: 2, - child: CustomText.text("Alterar Senha"), - ), + ], if(Config.conf.nomeApp == VersaoApp.PontoApp && registro) PopupMenuItem( - key: key1, + key: key2, value: 6, child: CustomText.text("Reenviar Marcações"), ), + if(Config.conf.nomeApp != VersaoApp.PontoTablet ) + PopupMenuItem( + key: key3, + value: 2, + child: CustomText.text("Alterar Senha"), + ), + if(!config) PopupMenuItem( - key: key3 , + key: key4 , value: 3, child: CustomText.text("Configurações"), ), - if(!kIsWeb && !Config.isWin && !registro) + if(!kIsWeb && !Config.isWin) PopupMenuItem( - key: key4 , + key: key5 , value: 4, child: CustomText.text("Avaliar App"), ), - if(!registro) PopupMenuItem( - key: key5 , + key: key6 , value: 5, child: CustomText.text("Sair"), ), - ], //initialValue: intvalue, offset: const Offset(10,5), @@ -77,16 +79,20 @@ actions(BuildContext context, {bool aponta = false, bool registro = false, bool switch( value ){ case 0 : if(Config.conf.nomeApp == VersaoApp.HoleriteApp) { - alterUser(context); + alterUser(context, onAlter); } else if(Config.conf.nomeApp == VersaoApp.AssewebApp) { - alterEmpresa(context); + alterEmpresa(context, onAlter); } break; case 1 : funcAponta(context); break; case 2 : - await AlterarSenhaModal(context); + if(modalPass != null) { + await modalPass(); + } else { + await AlterarSenhaModal(context); + } break; case 3 : funcConfig(context); @@ -98,12 +104,16 @@ actions(BuildContext context, {bool aponta = false, bool registro = false, bool funcSair(context); break; case 6 : - RegistroManger().enviarMarcacoesHistorico(context, UserPontoManager().usuario); + RegistroManger().enviarMarcacoesHistorico(context, UserPontoManager.susuario); break; } }, - child: Icon(Icons.more_vert, color: !context.watch().darkTemas && aponta && kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone - ? Colors.black : Colors.white,), + child: Icon(Icons.more_vert, + color: !context.watch().darkTemas && aponta && kIsWeb + && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? Colors.black : Colors.white, + ), ) ); } \ No newline at end of file diff --git a/lib/common/actions/apontamento/periodo_aponta.dart b/lib/common/actions/apontamento/periodo_aponta.dart index 195e070..1e31dc3 100644 --- a/lib/common/actions/apontamento/periodo_aponta.dart +++ b/lib/common/actions/apontamento/periodo_aponta.dart @@ -32,8 +32,6 @@ PeriodoApontamento(BuildContext context){ onPressed: (){ if(aponta.indice >= 0){ context.read().updateAponta(aponta.apontamento[aponta.indice]); - context.read().getHome(); - context.read().getEspelho(); context.read().memorandosUpdate(); context.read().getFuncionarioHistorico(); Navigator.pop(context); @@ -52,7 +50,7 @@ PeriodoApontamento(BuildContext context){ decoration: TextDecoration.none ),), SizedBox(height: 20,), - Container( + SizedBox( height: 200, child: ListWheelScrollView( itemExtent: 70, diff --git a/lib/common/actions/func_alter_empresa.dart b/lib/common/actions/func_alter_empresa.dart index d60d0f8..3582d0d 100644 --- a/lib/common/actions/func_alter_empresa.dart +++ b/lib/common/actions/func_alter_empresa.dart @@ -6,7 +6,7 @@ import '../../config.dart'; import '../../controllers/controllers.dart'; -alterEmpresa(BuildContext context){ +alterEmpresa(BuildContext context, Function()? onAlterEmp){ Widget child = Consumer( builder: (_,user,__){ return Container( @@ -33,7 +33,7 @@ alterEmpresa(BuildContext context){ decoration: TextDecoration.none ),), const SizedBox(height: 20,), - Container( + SizedBox( height: 200, child: ListView.builder( itemCount: user.user?.login?.companies?.length ?? 0, @@ -66,8 +66,7 @@ alterEmpresa(BuildContext context){ ), onTap: () async { user.companies = user.user?.login?.companies![index]; - context.read().getObrigacoesusuarios(); - context.read().getContatos(); + if(onAlterEmp != null) await onAlterEmp(); Navigator.pop(context); } ); diff --git a/lib/common/actions/func_alter_user.dart b/lib/common/actions/func_alter_user.dart index 20f9757..ac3ee24 100644 --- a/lib/common/actions/func_alter_user.dart +++ b/lib/common/actions/func_alter_user.dart @@ -6,7 +6,7 @@ import '../../config.dart'; import '../../controllers/controllers.dart'; -alterUser(BuildContext context){ +alterUser(BuildContext context, Function()? onAlterFunc){ Widget child = Consumer( builder: (_,user,__){ return Container( @@ -36,25 +36,31 @@ alterUser(BuildContext context){ Container( height: 200, child: ListView.builder( - itemCount: user.listuser?.length ?? 0, + itemCount: user.listFunc.length, itemBuilder: (context, index){ return InkWell( - child: Card(elevation: 0.2, + child: Card( + elevation: 0.2, child: ListTile( leading: Icon(CupertinoIcons.person_crop_circle, size: 40, - color: user.listuser![index] == context.watch().user ? Config.corPri : null,), + color: user.listFunc[index] == UserHoleriteManager.funcSelect + ? Config.corPri : null,), title: CustomText.text( - user.listuser![index].empresa?.toUpperCase() ?? "", + user.listFunc[index].attributes?.nome?.toUpperCase() ?? "", style: TextStyle(fontSize: 16, - color: user.listuser![index] == context.watch().user ? Config.corPri : null + color: user.listFunc[index] == UserHoleriteManager.funcSelect + ? Config.corPri : null ), overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, softWrap: true, maxLines: 1, ), - subtitle: CustomText.text('Registro: ${user.listuser![index].registro ?? ""}', + subtitle: CustomText.text(user.listFunc[index].attributes?.reg == null ? + user.listFunc[index].attributes?.office ?? "" + : 'Registro: ${user.listFunc[index].attributes?.reg ?? ""}', style: TextStyle(fontSize: 13, - color: user.listuser![index] == context.watch().user ? Config.corPri : null), + color: user.listFunc[index] == UserHoleriteManager.funcSelect + ? Config.corPri : null), overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, softWrap: true, maxLines: 1, @@ -62,8 +68,8 @@ alterUser(BuildContext context){ ), ), onTap: () async { - context.read().user = user.listuser![index]; - context.read().listcompetencias = await context.read().competencias(UserHoleriteManager.sUser); + UserHoleriteManager.funcSelect = user.listFunc[index]; + if(onAlterFunc != null) await onAlterFunc(); Navigator.pop(context); } ); diff --git a/lib/common/alterar_senha.dart b/lib/common/alterar_senha.dart index cd41a4d..6f71307 100644 --- a/lib/common/alterar_senha.dart +++ b/lib/common/alterar_senha.dart @@ -123,7 +123,7 @@ class _AlertSenhaState extends State { padding: const EdgeInsets.symmetric(horizontal: 10,), child: TextButton( style: TextButton.styleFrom( - primary: Colors.white, + foregroundColor: Colors.white, backgroundColor: Config.corPri, ), child: Center( @@ -175,8 +175,8 @@ class _AlertSenhaState extends State { ); }); } else if(Config.conf.nomeApp == VersaoApp.AssewebApp){ - await context.read().alteracaoPass( - context, senhaNova: senhaNova.text, + await context.read().alteracaoPass( + senhaNova: senhaNova.text, ).then((value){ if(value){ Navigator.pop(context); diff --git a/lib/common/column_or_row.dart b/lib/common/column_or_row.dart new file mode 100644 index 0000000..51894a5 --- /dev/null +++ b/lib/common/column_or_row.dart @@ -0,0 +1,41 @@ + + +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:responsive_framework/responsive_framework.dart'; + +class ColumnOrRow extends StatelessWidget { + const ColumnOrRow({super.key, required this.children, + this.mainAxisAlignment = MainAxisAlignment.start, + this.crossAxisAlignment = CrossAxisAlignment.center, + this.mainAxisSize = MainAxisSize.min, + this.isColumn = true, this.isWrap = false, + }); + + final List children; + final MainAxisAlignment mainAxisAlignment; + final CrossAxisAlignment crossAxisAlignment; + final MainAxisSize mainAxisSize; + final bool isColumn; + final bool isWrap; + + @override + Widget build(BuildContext context) { + return isColumn + ? Column( + mainAxisAlignment: mainAxisAlignment, + crossAxisAlignment: crossAxisAlignment, + mainAxisSize: mainAxisSize, + children: children, + ) : isWrap + ? Wrap( + children: children, + ) : Row( + mainAxisAlignment: mainAxisAlignment, + crossAxisAlignment: crossAxisAlignment, + mainAxisSize: mainAxisSize, + children: children, + ); + } +} diff --git a/lib/common/common.dart b/lib/common/common.dart index 98527dd..cfe4dfe 100644 --- a/lib/common/common.dart +++ b/lib/common/common.dart @@ -13,4 +13,15 @@ export 'custom_text.dart'; export 'custom_container.dart'; export 'expanded_or_container.dart'; export 'camera/foto_screen.dart'; -export 'custom_textformfield.dart'; \ No newline at end of file +export 'custom_textformfield.dart'; +export 'column_or_row.dart'; +export 'custom_list_tile.dart'; +export 'custom_livelist.dart'; +export 'custom_filter.dart'; +export 'custom_buttom.dart'; +export 'actions/func_alter_user.dart'; +export 'actions/func_alter_empresa.dart'; +export 'custom_load_shimmer.dart'; +export 'custom_date_range_selector.dart'; +export 'custom_date_selector.dart'; +export 'custom_dropdown.dart'; \ No newline at end of file diff --git a/lib/common/custom_alert.dart b/lib/common/custom_alert.dart index 24ccd16..8faa0a0 100644 --- a/lib/common/custom_alert.dart +++ b/lib/common/custom_alert.dart @@ -13,7 +13,7 @@ class CustomAlert { return SuccessAlertBox( context: context, title: 'Sucesso!', - messageText: mensage + '\n', + messageText: '$mensage\n', buttonText: 'OK' ); } @@ -22,7 +22,7 @@ class CustomAlert { return InfoAlertBox( context: context, title: 'Atenção!', - infoMessage: mensage + '\n', + infoMessage: '$mensage\n', buttonText: 'OK' ); } @@ -31,7 +31,7 @@ class CustomAlert { return WarningAlertBox( context: context, title: 'Falha!', - messageText: mensage + '\n', + messageText: '$mensage\n', buttonText: 'OK' ); } @@ -43,15 +43,17 @@ class CustomAlert { Widget? widgeTitulo, String? txtBotaoSucess, String? txtBotaoCancel, - VoidCallback? funcSucess, - VoidCallback? funcCancel}){ + Function? funcSucess, + Function? funcCancel, + bool quit = true, + }){ bool isDark = context.read().darkTemas; return showDialog( context: context, builder: (context){ return AlertDialog( - titlePadding: EdgeInsets.all(5), + titlePadding: const EdgeInsets.all(5), title: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -61,41 +63,40 @@ class CustomAlert { icon: Icon(Icons.clear, color: isDark ? Colors.white60 : Colors.black54,) ), ), - widgeTitulo != null ? widgeTitulo : - Padding( + widgeTitulo ?? Padding( padding: const EdgeInsets.symmetric(horizontal: 15), - child: CustomText.text(titulo?.toUpperCase() ?? '', style: TextStyle(fontSize: 20),textAlign: TextAlign.center,), + child: CustomText.text(titulo?.toUpperCase() ?? '', style: const TextStyle(fontSize: 20),textAlign: TextAlign.center,), ), ], ), content: corpo, - contentPadding: EdgeInsets.symmetric(horizontal: 24, vertical: 5), + contentPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 5), buttonPadding: EdgeInsets.zero, actions: [ - if(txtBotaoCancel != null) - TextButton( - onPressed: (){ - funcCancel!(); - Navigator.pop(context); - }, - child: Container( - //width: 100, alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: 12), - child: CustomText.text(txtBotaoCancel, style: TextStyle(color: isDark ? Colors.white54 : Colors.black45),)) + if(txtBotaoSucess != null) ...[ + CustomButtom.custom( + expand: true, + onPressed: () async { + if(funcSucess != null) await funcSucess(); + if(quit) Navigator.pop(context); + }, + title: txtBotaoSucess, + color: Config.corPri, ), - if(txtBotaoCancel != null) SizedBox(width: 10,), - if(txtBotaoSucess != null) - TextButton( - onPressed: (){ - funcSucess!(); - Navigator.pop(context); - }, - child: Container( - //width: 100, alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: 12), - child: CustomText.text(txtBotaoSucess, style: TextStyle(color: Colors.blue),)) + const SizedBox(width: 10,), + ], + if(txtBotaoCancel != null) ...[ + CustomButtom.custom( + expand: true, + onPressed: () async { + if(funcCancel != null) await funcCancel(); + if(quit) Navigator.pop(context); + }, + title: txtBotaoCancel, + color: Colors.red, ), - SizedBox(width: 10,), + const SizedBox(width: 10,), + ], ], ); } diff --git a/lib/common/custom_buttom.dart b/lib/common/custom_buttom.dart new file mode 100644 index 0000000..5468a2f --- /dev/null +++ b/lib/common/custom_buttom.dart @@ -0,0 +1,118 @@ + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:provider/provider.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../config.dart'; + + + +class CustomButtom { + + static Widget custom({String? title, Function? onPressed, double? height, + bool expand = false, Color? color, Color? borderColor, Widget? image, EdgeInsets? padding, + IconData? icon, double? width, TextStyle? style, double radius = 8,}){ + + return ChangeNotifierProvider( + create: (BuildContext context) => LoadButtomProvider(), + child: Consumer(builder: (context, load, __) { + return ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith( + (Set states) => states.any((e) => + e == MaterialState.disabled || e == MaterialState.error) + ? (color ?? Config.corPri).withOpacity(0.8) : color ?? Config.corPri, + ), + padding: MaterialStateProperty.resolveWith( + (Set states) => padding ?? const EdgeInsets.symmetric(horizontal: 15, vertical: 5), + ), + shape: MaterialStateProperty.resolveWith( + (Set states) => RoundedRectangleBorder( + side: BorderSide(color: borderColor ?? Colors.transparent), //the outline color + borderRadius: BorderRadius.all(Radius.circular(radius))), + ), + minimumSize: MaterialStateProperty.resolveWith( + (Set states) => const Size(0,0), + ), + ), + onPressed: onPressed == null || load.isLoad ? null : () async { + load.isLoad = true; + try { + await onPressed(); + } finally { + load.isLoad = false; + } + }, + child: SizedBox( + width: width, + height: height, + child: load.isLoad ? Row( + mainAxisSize: expand ? MainAxisSize.max: MainAxisSize.min, + mainAxisAlignment: width != null && icon != null ? + MainAxisAlignment.start : MainAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: color == Colors.white ? Colors.grey : Colors.white, + highlightColor: Colors.grey[600]!, + child: title != null && title != '' ? Text( + width != null && width < 101 ? '...' : 'AGUARDE..', + textAlign: TextAlign.center, maxLines: 1, + style: style ?? TextStyle( + color: color == Colors.white ? Config.corPri : Colors.white, + fontWeight: FontWeight.bold, + fontSize: 20 + ), + ) : image ?? Padding( + padding: EdgeInsets.symmetric(horizontal: (title != null && title != '' ? 0 : 10)), + child: Icon(icon, size: 20, + color: color == Colors.white ? Config.corPri : Colors.white,), + ), + ), + ], + ) : Row( + mainAxisSize: expand ? MainAxisSize.max: MainAxisSize.min, + mainAxisAlignment: width != null && (icon != null || image != null) ? + MainAxisAlignment.start : MainAxisAlignment.center, + children: [ + if(icon != null || image != null) + image ?? Icon(icon, size: 20, + color: color == Colors.white ? Config.corPri : Colors.white,), + if(title != null && title != '') + Expanded( + child: Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: (icon != null || width!= null ? 0 : 10)), + child: Text(title, textAlign: TextAlign.center, maxLines: 1, + style: style ?? TextStyle( + color: color == Colors.white ? Config.corPri : Colors.white, + fontWeight: FontWeight.bold, + fontSize: 20 + ), + ), + ), + ), + ) + ], + ), + ) + ); + } + ) + ); + } +} + +class LoadButtomProvider extends ChangeNotifier { + bool _isLoad = false; + bool get isLoad => _isLoad; + set isLoad(bool v) { + try { + _isLoad = v; + notifyListeners(); + } catch (e) { + // TODO + } + } +} \ No newline at end of file diff --git a/lib/common/custom_date_picker.dart b/lib/common/custom_date_picker.dart index 37e2ee9..d9c7745 100644 --- a/lib/common/custom_date_picker.dart +++ b/lib/common/custom_date_picker.dart @@ -531,10 +531,10 @@ class _DatePickerDialogState extends State with RestorationMix child: Column( children: [ const Spacer(), - CustomTextFormField.custom( + CustomTextFormField( //controller: _controller, //isClean: true, - onDateSubmitted: (v){ + onFieldSubmitted: (v){ final date = v.split('/'); _handleDateChanged(DateTime(int.parse(date.last),int.parse(date[1]),int.parse(date.first) )); }, @@ -620,7 +620,7 @@ class _DatePickerDialogState extends State with RestorationMix // layout issues. final double textScaleFactor = math.min(MediaQuery.textScaleFactorOf(context), 1.3); final Size dialogSize = _dialogSize(context) * textScaleFactor; - final DialogTheme dialogTheme = theme.dialogTheme; + final dialogTheme = theme.dialogTheme; return Dialog( backgroundColor: datePickerTheme.backgroundColor ?? defaults.backgroundColor, elevation: useMaterial3 @@ -1465,7 +1465,7 @@ class _DateRangePickerDialogState extends State with Rest : localizations.dateRangePickerHelpText.toUpperCase() ), ); - final DialogTheme dialogTheme = theme.dialogTheme; + final dialogTheme = theme.dialogTheme; size = orientation == Orientation.portrait ? (useMaterial3 ? _inputPortraitDialogSizeM3 : _inputPortraitDialogSizeM2) : _inputRangeLandscapeDialogSize; diff --git a/lib/common/custom_date_range_selector.dart b/lib/common/custom_date_range_selector.dart new file mode 100644 index 0000000..a6102fa --- /dev/null +++ b/lib/common/custom_date_range_selector.dart @@ -0,0 +1,207 @@ +import 'package:assecontservices/assecontservices.dart'; +import 'package:flutter/material.dart'; + + +class DateRangeSelector extends StatelessWidget { + final DateTime? initialStartDate; + final DateTime? initialEndDate; + final void Function(DateTimeRange) onChanged; + + const DateRangeSelector({ + super.key, + required this.initialStartDate, + required this.initialEndDate, + required this.onChanged, + }); + + void _showDateRangePicker(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Selecionar Período'), + content: BodyDataRange( + onChanged: onChanged, + initialStartDate: initialStartDate, + initialEndDate: initialEndDate, + ), + ); + }, + ); + } + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () => _showDateRangePicker(context), + child: Padding( + padding: const EdgeInsets.all(10), + child: Text('${initialStartDate.dateFormat(format: 'MM/yyyy')} - ${initialEndDate.dateFormat(format: 'MM/yyyy')}', + style: const TextStyle(color: Colors.white), + ), + ), + ); + } +} + +class BodyDataRange extends StatefulWidget { + const BodyDataRange({super.key, this.initialStartDate, this.initialEndDate, required this.onChanged}); + final DateTime? initialStartDate; + final DateTime? initialEndDate; + final void Function(DateTimeRange) onChanged; + + @override + State createState() => _BodyDataRangeState(); +} + +class _BodyDataRangeState extends State { + DateTime? startDate; + DateTime? endDate; + final int currentYear = DateTime.now().year; + final int currentMonth = DateTime.now().month; + + @override + void initState() { + super.initState(); + startDate = widget.initialStartDate; + endDate = widget.initialEndDate; + } + + + Widget _buildDatePicker(String title, bool isStartDate) { + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: const TextStyle(fontWeight: FontWeight.bold)), + const SizedBox(height: 10), + Row( + children: [ + Expanded( + child: DropdownButton( + hint: const Text('Ano'), + value: isStartDate ? startDate?.year : endDate?.year, + onChanged: (value) { + setState(() { + if (isStartDate) { + startDate = DateTime(value!, startDate?.month ?? 1); + } else { + endDate = DateTime(value!, endDate?.month ?? 1); + } + _adjustDates(isStartDate); + }); + }, + items: List.generate( + currentYear + 1 - 2020, + (index) => DropdownMenuItem( + value: 2020 + index, + child: Text((2020 + index).toString()), + ), + ), + ), + ), + const SizedBox(width: 10), + Expanded( + child: DropdownButton( + hint: const Text('Mês'), + value: isStartDate ? startDate?.month : endDate?.month, + onChanged: (value) { + setState(() { + if (isStartDate) { + startDate = DateTime(startDate?.year ?? currentYear, value!); + } else { + endDate = DateTime(endDate?.year ?? currentYear, value!); + } + _adjustDates(isStartDate); + }); + }, + items: List.generate(12, (index) { + return DropdownMenuItem( + value: index + 1, + child: Text(DateTime(0, index + 1).dateFormat(format: 'MMMM').toUpperCase()), + ); + }), + ), + ), + ], + ), + ], + ); + } + + void _adjustDates(bool isStartDate) { + if (startDate != null && endDate != null) { + // Se 'isStartDate' for verdadeiro, estamos ajustando a data de início + if (isStartDate) { + // Ajustar a data de início se ela for posterior à data de fim + if (startDate!.isAfter(endDate!)) { + startDate = endDate; + } + + // Verificar se o intervalo é maior que 12 meses e ajustar a data de fim + int monthDifference = (endDate!.year - startDate!.year) * 12 + (endDate!.month - startDate!.month); + if (monthDifference > 12) { + endDate = startDate.addMonths(12); + } + + } else { + // Caso 'isStartDate' seja falso, ajustamos a data de fim + // Ajustar a data de fim se for anterior à data de início + if (endDate!.isBefore(startDate!)) { + endDate = startDate; + } + + // Verificar se o intervalo é maior que 12 meses e ajustar a data de início + int monthDifference = (endDate!.year - startDate!.year) * 12 + (endDate!.month - startDate!.month); + if (monthDifference > 12) { + startDate = endDate.addMonths(-12); + } + } + + // Ajustar a data de fim para não exceder o mês atual + if (endDate!.year > currentYear || (endDate!.year == currentYear && endDate!.month > currentMonth)) { + endDate = DateTime(currentYear, currentMonth); + } + + // Ajustar a data de fim para não exceder o mês atual + if (startDate!.year > currentYear || (startDate!.year == currentYear && startDate!.month > currentMonth)) { + startDate = DateTime(currentYear, currentMonth); + } + } + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + _buildDatePicker('Início', true), + const SizedBox(height: 20), + _buildDatePicker('Fim', false), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text('Fechar'), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(); + // Chama o método onChanged apenas quando o botão de confirmar é clicado + if (startDate != null && endDate != null) { + widget.onChanged(DateTimeRange(start: startDate!, end: endDate!)); + } + }, + child: const Text('Confirmar'), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/common/custom_date_selector.dart b/lib/common/custom_date_selector.dart new file mode 100644 index 0000000..6c95969 --- /dev/null +++ b/lib/common/custom_date_selector.dart @@ -0,0 +1,143 @@ +import 'package:assecontservices/assecontservices.dart'; +import 'package:flutter/material.dart'; + + +class DateSelector extends StatelessWidget { + final DateTime? initialStartDate; + final void Function(DateTime) onChanged; + final String? title; + final Color? textColor; + + const DateSelector({ + super.key, + required this.initialStartDate, + required this.onChanged, + this.title, + this.textColor = Colors.white, + }); + + void _showDateRangePicker(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text(title ?? 'Selecionar Data'), + content: BodyData( + onChanged: onChanged, + initialStartDate: initialStartDate, + ), + ); + }, + ); + } + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () => _showDateRangePicker(context), + child: Padding( + padding: const EdgeInsets.all(10), + child: Text(initialStartDate?.dateFormat(format: 'MM/yyyy') ?? 'Selecione a competência', + style: TextStyle(color: textColor), + ), + ), + ); + } +} + +class BodyData extends StatefulWidget { + const BodyData({super.key, this.initialStartDate, required this.onChanged}); + final DateTime? initialStartDate; + final void Function(DateTime) onChanged; + + @override + State createState() => _BodyDataState(); +} + +class _BodyDataState extends State { + late DateTime startDate; + final int currentYear = DateTime.now().year; + final int currentMonth = DateTime.now().month; + + @override + void initState() { + super.initState(); + startDate = widget.initialStartDate ?? DateTime(DateTime.now().year, DateTime.now().month); + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Data', style: TextStyle(fontWeight: FontWeight.bold)), + const SizedBox(height: 10), + Row( + children: [ + Expanded( + child: DropdownButton( + hint: const Text('Ano'), + value: startDate.year , + onChanged: (value) { + setState(() { + startDate = DateTime(value!, startDate.month); + }); + }, + items: List.generate( + currentYear + 1 - 2020, + (index) => DropdownMenuItem( + value: 2020 + index, + child: Text((2020 + index).toString()), + ), + ), + ), + ), + const SizedBox(width: 10), + Expanded( + child: DropdownButton( + hint: const Text('Mês'), + value: startDate.month, + onChanged: (value) { + setState(() { + startDate = DateTime(startDate.year, value!); + }); + }, + items: List.generate(12, (index) { + return DropdownMenuItem( + value: index + 1, + child: Text(DateTime(0, index + 1).dateFormat(format: 'MMMM').toUpperCase()), + ); + }), + ), + ), + ], + ), + ], + ), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text('Fechar'), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(); + widget.onChanged(startDate); + }, + child: const Text('Confirmar'), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/common/custom_dropdown.dart b/lib/common/custom_dropdown.dart new file mode 100644 index 0000000..f642cd1 --- /dev/null +++ b/lib/common/custom_dropdown.dart @@ -0,0 +1,105 @@ + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../config.dart'; + + +class CustomDropDown extends StatelessWidget { + const CustomDropDown({super.key, required this.onChanged, this.value, + this.items, this.width, this.suffix, + this.height, this.textAlign = false, this.isBorder = true, this.title, this.txtColor = Colors.black, + this.fillColor = Colors.white, required this.onText, this.hintText}); + final void Function(T) onChanged; + final String Function(T) onText; + final List? items; + final T? value; + final double? width; + final double? height; + final bool textAlign; + final bool isBorder; + final String? title; + final Color txtColor; + final Widget? suffix; + final Color? fillColor; + final String? hintText; + + @override + Widget build(BuildContext context) { + + return SizedBox( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: textAlign ? CrossAxisAlignment.center : CrossAxisAlignment.start, + children: [ + if (title != null) ...[ + Padding( + padding: const EdgeInsets.only(left: 5, top: 5, bottom: 5), + child: Text(title!, + style: TextStyle( + color: context.watch().darkTemas + ? txtColor == Colors.black + ? Colors.white + : txtColor + : txtColor == Colors.white + ? Colors.black + : txtColor, + fontSize: textAlign ? 18 : 14, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + SizedBox( + height: height, width: width, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: DropdownButtonFormField( + isExpanded: true, + value: value, + elevation: 0, + style: const TextStyle(fontSize: 11, color: Colors.black), + iconEnabledColor: const Color(0xffB0B0B0), + padding: EdgeInsets.zero, + iconDisabledColor: const Color(0xffB0B0B0), + dropdownColor: Colors.white, + decoration: InputDecoration( + hintText: hintText ?? "Selecione", + hintStyle: const TextStyle(color: Colors.grey, fontSize: 10), + contentPadding: const EdgeInsets.only(left: 15), + fillColor: fillColor ?? Colors.white, + iconColor: const Color(0xffB0B0B0), + filled: fillColor != null, + enabledBorder: isBorder ? const OutlineInputBorder( + borderSide: BorderSide(color: Color(0xffB0B0B0)), + borderRadius: BorderRadius.all(Radius.circular(10)), // Adjust radius as needed + ) : InputBorder.none, + border: isBorder ? const OutlineInputBorder( + borderSide: BorderSide(color: Color(0xffB0B0B0)), + borderRadius: BorderRadius.all(Radius.circular(10)), // Adjust radius as needed + ) : InputBorder.none + ), + //itemHeight: height, + onChanged: (v){ + if(v != null){ + onChanged(v); + } + }, + items: items?.map((e) => DropdownMenuItem( + value: e, + child: Text(onText(e)), + )).toList() ?? [], + ), + ), + if(suffix != null) + suffix! + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/common/custom_filter.dart b/lib/common/custom_filter.dart new file mode 100644 index 0000000..ace5510 --- /dev/null +++ b/lib/common/custom_filter.dart @@ -0,0 +1,81 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + + +import 'package:responsive_framework/responsive_framework.dart'; + + +class FilterWidget extends StatelessWidget { + const FilterWidget({super.key, required this.onFiltro, this.padding, this.filtro = 3}); + + final Function(int) onFiltro; + final EdgeInsets? padding; + final int filtro; + + @override + Widget build(BuildContext context) { + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), + child: Row( + children: [ + Expanded(child: Container(),), + + Text(filtro == 0 ? 'Todos' + : filtro == 3 ? 'Ultimos 3' + : filtro == 6 ? 'Ultimos 6' + : 'Ultimos 12', style: TextStyle(fontSize: 16),), + + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + PopupMenuButton( + surfaceTintColor: Colors.white, + itemBuilder: (context) => [ + popupMenuEntry(3,"Ultimos 3", filtro == 3), + popupMenuEntry(6,"Ultimos 6", filtro == 6), + popupMenuEntry(12,"Ultimos 12", filtro == 12), + popupMenuEntry(0,"Todos", filtro == 0), + ], + initialValue: filtro, + offset: const Offset(10,5), + onSelected: (value) async { + await onFiltro(value); + }, + child: const Icon(Icons.filter_list_rounded,), + ), + ], + ), + ), + + ], + ), + ); + } + + + PopupMenuEntry popupMenuEntry(int value, String text, bool selected){ + return PopupMenuItem( + value: value, + child: Row( + children: [ + Stack( + alignment: Alignment.center, + children: [ + const Icon(Icons.circle_outlined, color: Colors.blue, size: 25,), + if(selected) + const Icon(Icons.circle, color: Colors.blue, size: 10) + ], + ), + const SizedBox(width: 5,), + Text(text), + ], + ), + ); + } +} + + diff --git a/lib/common/custom_list_tile.dart b/lib/common/custom_list_tile.dart new file mode 100644 index 0000000..aaf6952 --- /dev/null +++ b/lib/common/custom_list_tile.dart @@ -0,0 +1,23 @@ + + +import 'package:flutter/material.dart'; + +class CustomListTile extends StatelessWidget { + const CustomListTile({super.key, required this.child, this.height = 80, this.padding}); + final Widget child; + final double height; + final EdgeInsets? padding; + + @override + Widget build(BuildContext context) { + return SizedBox( + height: height, + child: Card( + child: Padding( + padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0), + child: child, + ) + ), + ); + } +} diff --git a/lib/common/custom_livelist.dart b/lib/common/custom_livelist.dart new file mode 100644 index 0000000..d052da1 --- /dev/null +++ b/lib/common/custom_livelist.dart @@ -0,0 +1,176 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:auto_animated/auto_animated.dart'; + +import 'column_or_row.dart'; +import 'custom_list_tile.dart'; +import 'custom_load_shimmer.dart'; + + + +class CustomLiveList extends StatefulWidget { + const CustomLiveList({super.key, required this.list, this.isLoad = false, this.padding, this.endScroll, + this.onTap, this.isList = true, this.scrollController, required this.content, this.txtListVazia, + this.onDismissed, + }); + final List list; + final Widget Function(T item) content; + final Function(T item)? onTap; + final Function()? endScroll; + final ScrollController? scrollController; + final bool isList; + final String? txtListVazia; + final bool isLoad; + final EdgeInsets? padding; + final Future Function(T)? onDismissed; + + @override + State> createState() => _CustomLiveListState(); +} + +class _CustomLiveListState extends State> { + + bool load = false; + + listner() async { + if(widget.scrollController!.position.atEdge){ + setState(() { + load = true; + }); + try { + await widget.endScroll!(); + } catch (e) {} + setState(() { + load = false; + }); + } + } + + @override + void initState() { + if(widget.scrollController != null && widget.endScroll != null){ + widget.scrollController!.addListener(listner); + } + super.initState(); + } + + @override + void dispose() { + if(widget.scrollController != null && widget.endScroll != null){ + widget.scrollController!.removeListener(listner); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: widget.isLoad ? CustomShimmerLoad( + isLoad: true, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: SingleChildScrollView( + child: ColumnOrRow( + isColumn: widget.isList, isWrap: true, + children: List.generate(6, + (index) => SizedBox( + width: widget.isList ? null : 80, + child: CustomListTile( + padding: widget.padding, + child: Container() + ), + ) + ) + ), + ), + ), + ) : LayoutBuilder( + builder: (_, constraints){ + if(widget.list.isEmpty){ + return Center(child: Text(widget.txtListVazia ?? 'Nenhum item carregado'),); + } + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Column( + children: [ + Expanded( + child: ListOrGrid( + width: constraints.maxWidth, + itemCount: widget.list.length, + controller: widget.scrollController, + itemBuilder: (BuildContext context, int index, Animation animation) { + final item = widget.list[index]; + return FadeTransition( + opacity: Tween( + begin: 0, + end: 1, + ).animate(animation), + child: SlideTransition( + position: Tween( + begin: const Offset(0, -0.1), + end: Offset.zero, + ).animate(animation), + child: Dismissible( + key: Key(index.toString()), + background: Container(color: Colors.red, alignment: Alignment.centerRight, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon(CupertinoIcons.delete, color: Colors.white), + )), + direction: widget.onDismissed == null + ? DismissDirection.none : DismissDirection.endToStart, + confirmDismiss: widget.onDismissed == null ? null : (v) async { + return await widget.onDismissed!(item); + }, + + child: GestureDetector( + onTap: widget.onTap == null ? null : (){ + widget.onTap!(item); + }, + child: CustomListTile( + padding: widget.padding, + child: widget.content(item) + ) + ), + ) + ), + ); + }, + ), + ), + if(load) + const Center(child: Padding( + padding: EdgeInsets.all(8.0), + child: CircularProgressIndicator(), + ),) + ], + ), + ); + } + ), + ); + } + + ListOrGrid({required Widget Function(BuildContext, int, Animation) itemBuilder, + ScrollController? controller, required double width, required int itemCount, + }){ + return widget.isList ? LiveList( + showItemInterval: const Duration(milliseconds: 0), + showItemDuration: const Duration(milliseconds: 180), + itemBuilder: itemBuilder, controller: controller, + itemCount: itemCount, + ) : LiveGrid( + showItemInterval: const Duration(milliseconds: 0), + showItemDuration: const Duration(milliseconds: 200), + itemBuilder: itemBuilder, controller: controller, + itemCount: itemCount, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: width ~/ 170 , + crossAxisSpacing: 10, + mainAxisSpacing: 10, + ), + ); + } +} diff --git a/lib/common/custom_load_shimmer.dart b/lib/common/custom_load_shimmer.dart new file mode 100644 index 0000000..cc07e95 --- /dev/null +++ b/lib/common/custom_load_shimmer.dart @@ -0,0 +1,21 @@ +import 'package:assecontservices/assecontservices.dart'; +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../config.dart'; + + +class CustomShimmerLoad extends StatelessWidget { + CustomShimmerLoad({super.key, this.isLoad = false, required this.child}); + final bool isLoad; + final Widget child; + + @override + Widget build(BuildContext context) { + return isLoad ? Shimmer.fromColors( + baseColor: context.watch().darkTemas ? Colors.grey[800]! : Colors.grey.shade200, + highlightColor: context.watch().darkTemas ? Colors.grey[600]! : Colors.grey, + child: child + ) : child; + } +} diff --git a/lib/common/custom_snackbar.dart b/lib/common/custom_snackbar.dart index cafccb8..18c9d82 100644 --- a/lib/common/custom_snackbar.dart +++ b/lib/common/custom_snackbar.dart @@ -90,26 +90,34 @@ class CustomSnackbar { } static home(String text, Color cor){ - ScaffoldMessenger.of(Config.scaffoldKey.currentContext!).showSnackBar(SnackBar( - backgroundColor: cor, - duration: const Duration(seconds: 3), - content: CustomText.text(text, style: const TextStyle(color: Colors.white),), - )); + if(Config.scaffoldKey.currentContext != null && Config.scaffoldKey.currentContext!.mounted){ + ScaffoldMessenger.of(Config.scaffoldKey.currentContext!).showSnackBar(SnackBar( + backgroundColor: cor, + duration: const Duration(seconds: 3), + content: CustomText.text(text, style: const TextStyle(color: Colors.white),), + )); + } } static scaffoldKey(GlobalKey scaffoldKey, String text, Color cor, ){ - ScaffoldMessenger.of(scaffoldKey.currentContext!).showSnackBar(SnackBar( - backgroundColor: cor, - duration: const Duration(seconds: 3), - content: CustomText.text(text, style: const TextStyle(color: Colors.white),), - )); + if(scaffoldKey.currentContext != null && scaffoldKey.currentContext!.mounted){ + ScaffoldMessenger.of(scaffoldKey.currentContext!).showSnackBar(SnackBar( + backgroundColor: cor, + duration: const Duration(seconds: 3), + content: CustomText.text(text, style: const TextStyle(color: Colors.white),), + )); + } + } static context(BuildContext context, String text, Color cor){ - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - backgroundColor: cor, - duration: const Duration(seconds: 3), - content: CustomText.text(text, style: const TextStyle(color: Colors.white),), - )); + if(context.mounted){ + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + backgroundColor: cor, + duration: const Duration(seconds: 3), + content: CustomText.text(text, style: const TextStyle(color: Colors.white),), + )); + } + } } \ No newline at end of file diff --git a/lib/common/custom_textformfield.dart b/lib/common/custom_textformfield.dart index a74411d..5949a33 100644 --- a/lib/common/custom_textformfield.dart +++ b/lib/common/custom_textformfield.dart @@ -11,368 +11,495 @@ import 'package:datetime_picker_formfield_new/datetime_picker_formfield.dart'; import '../../utils/validacoes.dart'; import '../config.dart'; -import '../cpf_rg_formatter.dart'; +import '../utils/cpf_email_formatter.dart'; +import '../utils/cpf_rg_formatter.dart'; +import '../utils/num_inputformatter.dart'; import 'custom_date_picker.dart'; -class CustomTextFormField { - static Widget custom({ - TextEditingController? controller, - String? title, - Widget? icon, - void Function(String)? onDateSubmitted, - void Function(DateTime)? onDateSaved, - bool textAlign = false, - bool isNext = false, - bool isBorder = true, - bool isClean = false, - String? hintText, - String? Function(String?)? validator, - FormType type = FormType.text, - double radius = 12, - double? width, - Color? txtColor, - }) { - return Consumer( - builder: (context, form, __) { - return SizedBox( - width: width, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: textAlign - ? CrossAxisAlignment.center - : CrossAxisAlignment.start, - children: [ - if (title != null) - Padding( - padding: EdgeInsets.only( - left: 5, top: 5, bottom: textAlign ? 5 : 0), - child: Text( - title, - style: TextStyle( - color: txtColor, +class CustomTextFormField extends StatelessWidget { + final TextEditingController? controller; + final String? title; + final Widget? icon; + final void Function(String)? onFieldSubmitted; + final void Function(DateTime)? onDateSaved; + final bool textAlign; + final bool isNext; + final bool isBorder; + final bool isClean; + final String? hintText; + final String? Function(String?)? validator; + final FormType type; + final double radius; + final double? width; + final Color? txtColor; + final FocusNode? focusNode; + + const CustomTextFormField({ + super.key, + this.controller, + this.title, + this.icon, + this.onFieldSubmitted, + this.onDateSaved, + this.textAlign = false, + this.isNext = false, + this.isBorder = true, + this.isClean = false, + this.hintText, + this.validator, + this.type = FormType.text, + this.radius = 12, + this.width, + this.txtColor = Colors.white, + this.focusNode, + }); + + @override + Widget build(BuildContext context) { + + return ChangeNotifierProvider( + create: (_) => FormProvider(), + child: Consumer(builder: (_, form, __) { + return SizedBox( + width: width, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: textAlign + ? CrossAxisAlignment.center + : CrossAxisAlignment.start, + children: [ + if (title != null) + Padding( + padding: const EdgeInsets.only(left: 5, top: 5, bottom: 5), + child: Text( + title!, + style: TextStyle( + color: context.watch().darkTemas + ? txtColor == Colors.black + ? Colors.white + : txtColor + : txtColor == Colors.white + ? Colors.black + : txtColor, fontSize: textAlign ? 18 : 14, - fontWeight: FontWeight.w600), + fontWeight: FontWeight.w600, + ), + ), ), - ), - TextFormField( - controller: controller, - style: TextStyle(fontSize: 12, color: Colors.black), - scrollPadding: EdgeInsets.zero, - onSaved: (v) { - if (onDateSaved != null && v != null) { - final date = v.split('/'); - onDateSaved(DateTime(int.parse(date.last), - int.parse(date[1]), int.parse(date.first))); - } - }, - onFieldSubmitted: onDateSubmitted, - textInputAction: - isNext ? TextInputAction.next : TextInputAction.done, - obscureText: type == FormType.pass, - keyboardType: type == FormType.text || type == FormType.pass - ? TextInputType.text - : type == FormType.email - ? TextInputType.emailAddress - : TextInputType.number, - decoration: InputDecoration( - suffixIcon: icon ?? - (!isClean - ? null - : IconButton( - onPressed: () { - controller?.clear(); - }, - icon: Icon( - Icons.clear, - color: Config.corPribar, - ))), - fillColor: form.isError ? Colors.red.shade100 : Colors.white, - filled: true, - contentPadding: - const EdgeInsets.symmetric(horizontal: 12, vertical: 0), - enabledBorder: OutlineInputBorder( - borderSide: isBorder - ? BorderSide(color: Colors.grey.shade300) - : BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(radius)) - ), - border: OutlineInputBorder( - borderSide: isBorder - ? BorderSide(color: Colors.grey.shade300) - : BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(radius)) - ), - focusedBorder: OutlineInputBorder( - borderSide: isBorder - ? const BorderSide(color: Config.corPribar,) - : BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(radius)) + TextFormField( + controller: controller, + style: const TextStyle(fontSize: 12, color: Colors.black), + scrollPadding: EdgeInsets.zero, + focusNode: focusNode, + onSaved: (v) { + if (onDateSaved != null && v != null) { + final date = v.split('/'); + onDateSaved!(DateTime( + int.parse(date.last), + int.parse(date[1]), + int.parse(date.first), + )); + } + }, + onFieldSubmitted: onFieldSubmitted, + textInputAction: + isNext ? TextInputAction.next : TextInputAction.done, + obscureText: type == FormType.pass, + keyboardType: type == FormType.text || type == FormType.pass + ? TextInputType.text + : type == FormType.email || type == FormType.emailcpf + ? TextInputType.emailAddress + : TextInputType.number, + decoration: InputDecoration( + suffixIcon: icon ?? + (!isClean + ? null + : IconButton( + onPressed: () { + controller?.clear(); + }, + icon: const Icon( + Icons.clear, + color: Config.corPribar, + ), + )), + fillColor: form.isError ? Colors.red.shade50 : Colors.white, + filled: true, + contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0), + enabledBorder: OutlineInputBorder( + borderSide: isBorder + ? BorderSide(color: Colors.grey.shade300) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + border: OutlineInputBorder( + borderSide: isBorder + ? BorderSide(color: Colors.grey.shade300) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + focusedBorder: OutlineInputBorder( + borderSide: isBorder + ? const BorderSide( + color: Config.corPribar, + ) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + errorBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.redAccent.shade100), + borderRadius: BorderRadius.all(Radius.circular(radius))), + errorStyle: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 11, + color: Colors.redAccent.shade100), + hintText: hintText ?? + (type == FormType.cpf + ? '000.000.000-00' + : type == FormType.dinheiro + ? 'R\$0,00' + : type == FormType.num || + type == FormType.numVigula + ? '0' + : type == FormType.rgcpf + ? 'RG/CPF' + : type == FormType.emailcpf + ? 'CPF/Email' + : type == FormType.pass + ? 'Digite a senha' + : type == FormType.phone + ? '(11) 98888-8888' + : type == FormType.email + ? 'email@email.com' + : type == + FormType.date + ? 'DD/MM/AAAA' + : type == + FormType.cnpj + ? '00.000.000/0001-00' + : type == + FormType.cep + ? '00000-000' + : 'Digite ${title ?? 'valor'}'), + hintStyle: const TextStyle(fontSize: 12, color: Colors.grey), ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.redAccent.shade100), - borderRadius: BorderRadius.all(Radius.circular(radius))), - errorStyle: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 11, - color: Colors.redAccent.shade100), - hintText: hintText ?? - (type == FormType.cpf - ? '000.000.000-00' - : type == FormType.rgcpf - ? 'RG/CPF' - : type == FormType.pass - ? '********' - : type == FormType.phone - ? '(11) 98888-8888' - : type == FormType.email - ? 'email@email.com' - : type == FormType.date - ? 'DD/MM/AAAA' - : type == FormType.cnpj - ? '00.000.000/0001-00' - : type == FormType.cep - ? '00000-000' - : null), - hintStyle: TextStyle(fontSize: 12, color: Colors.grey), + inputFormatters: _getInputFormatters(), + validator: validator ?? _getDefaultValidator(context, form), + autovalidateMode: AutovalidateMode.onUserInteraction, ), - inputFormatters: type == FormType.cpf - ? [ - FilteringTextInputFormatter.digitsOnly, - CpfInputFormatter(), - ] - : type == FormType.rgcpf - ? [ - FilteringTextInputFormatter.digitsOnly, - CpfOrRGFormatter(), - ] - : type == FormType.cep - ? [ - FilteringTextInputFormatter.digitsOnly, - CepInputFormatter(), - ] - : type == FormType.cnpj - ? [ - FilteringTextInputFormatter.digitsOnly, - CnpjInputFormatter(), - ] - : type == FormType.phone - ? [ - FilteringTextInputFormatter.digitsOnly, - TelefoneInputFormatter(), - ] - : type == FormType.date - ? [ - FilteringTextInputFormatter - .digitsOnly, - DataInputFormatter(), - ] - : null, - validator: validator ?? - (type == FormType.cpf - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite o seu CPF'; - } else if (!Validacoes.isCPF(v)) { - form.isError = true; - return 'Digite CPF valido'; - } - form.isError = false; - return null; - } - : type == FormType.cnpj - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite o seu CNPJ'; - } else if (v.length < 18) { - form.isError = true; - return 'Digite o seu CNPJ'; - } - form.isError = false; - return null; - } - : type == FormType.cep - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite o seu CEP'; - } else if (v.length < 10) { - form.isError = true; - return 'Digite o seu CEP'; - } - form.isError = false; - return null; - } - : type == FormType.rgcpf - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite o seu documento'; - } else if (v.length == 13) { - form.isError = true; - return 'Digite o seu CPF'; - } else if (v.length < 12) { - form.isError = true; - return 'Digite o seu RG/CPF'; - } - form.isError = false; - return null; - } - : type == FormType.phone - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite o seu telefone'; - } else if (v.length < 14) { - form.isError = true; - return 'Digite o seu telefone'; - } - form.isError = false; - return null; - } - : type == FormType.email - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite seu email novo'; - } else if (!Validacoes - .emailValid(v)) { - form.isError = true; - return 'Digite email valido!'; - } - form.isError = false; - return null; - } - : type == FormType.pass - ? (v) { - if (v == null || v == '') { - form.isError = true; - return 'Digite sua senha'; - }else if (v.length < 6) { - form.isError = true; - return 'Senha deve conter no minimo 6 caracteres'; - } - form.isError = false; - return null; - } - : type == FormType.date - ? (v) { - if (v == null || - v == '' || - v.length != 10) { - form.isError = true; - return 'Digite a data'; - } else if (!Validacoes - .isDate(v)) { - form.isError = true; - return 'Digite uma data valida'; - } - form.isError = false; - return null; - } - : (v) { - if (v == null || - v == '') { - form.isError = true; - return 'Digite o $title'; - } - form.isError = false; - return null; - }), - ), - ], - ), - ); + ], + ), + ); + }), + ); + } + + List? _getInputFormatters() { + return type == FormType.cpf + ? [ + FilteringTextInputFormatter.digitsOnly, + CpfInputFormatter(), + ] + : type == FormType.rgcpf + ? [ + FilteringTextInputFormatter.digitsOnly, + CpfOrRGFormatter(), + ] + : type == FormType.emailcpf + ? [ + CpfOrEmailFormatter(), + ] + : type == FormType.cep + ? [ + FilteringTextInputFormatter.digitsOnly, + CepInputFormatter(), + ] + : type == FormType.cnpj + ? [ + FilteringTextInputFormatter.digitsOnly, + CnpjInputFormatter(), + ] + : type == FormType.phone + ? [ + FilteringTextInputFormatter.digitsOnly, + TelefoneInputFormatter(), + ] + : type == FormType.date + ? [ + FilteringTextInputFormatter.digitsOnly, + DataInputFormatter(), + ] + : type == FormType.dinheiro ? [ + FilteringTextInputFormatter.digitsOnly, + CentavosInputFormatter(), + ] : type == FormType.num ? [ + FilteringTextInputFormatter.digitsOnly, + ] : type == FormType.numVigula ? [ + NumInputFormatter.digitsOnly, + NumInputFormatter(), + ] : null; + } + + String? Function(String?) _getDefaultValidator(BuildContext context, FormProvider form) { + return (type == FormType.emailcpf ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu CPF/Email'; + } else if (!Validacoes.isCPF(v) && !Validacoes.emailValid(v)) { + form.isError = true; + return 'Digite CPF/Email valido'; + } + form.isError = false; + return null; + } : type == FormType.cpf ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu CPF'; + } else if (!Validacoes.isCPF(v)) { + form.isError = true; + return 'Digite CPF valido'; + } + form.isError = false; + return null; + } : type == FormType.dinheiro ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o valor'; + } + form.isError = false; + return null; + } : type == FormType.num ? (v) { + if (v == null || v == '' || !Validacoes.isNumeric(v)) { + form.isError = true; + return 'Digite numero'; + } + form.isError = false; + return null; + } : type == FormType.numVigula ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o valor'; + } + form.isError = false; + return null; + } : type == FormType.cnpj ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu CNPJ'; + } else if (v.length < 18) { + form.isError = true; + return 'Digite o seu CNPJ'; + } + form.isError = false; + return null; + } : type == FormType.cep ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu CEP'; + } else if (v.length < 10) { + form.isError = true; + return 'Digite o seu CEP'; + } + form.isError = false; + return null; + } : type == FormType.rgcpf ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu documento'; + } else if (v.length == 13) { + form.isError = true; + return 'Digite o seu CPF'; + } else if (v.length < 12) { + form.isError = true; + return 'Digite o seu RG/CPF'; + } + form.isError = false; + return null; + } : type == FormType.phone ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o seu telefone'; + } else if (v.length < 14) { + form.isError = true; + return 'Digite o seu telefone'; + } + form.isError = false; + return null; + } : type == FormType.email ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite seu email novo'; + } else if (!Validacoes + .emailValid(v)) { + form.isError = true; + return 'Digite email valido!'; + } + form.isError = false; + return null; + } : type == FormType.pass ? (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite sua senha'; + } + form.isError = false; + return null; + } : type == FormType.date ? (v) { + if (v == null || v == '' || v.length != 10) { + form.isError = true; + return 'Digite a data'; + } else if (!Validacoes.isDate(v)) { + form.isError = true; + return 'Digite uma data valida'; + } + form.isError = false; + return null; + } : (v) { + if (v == null || v == '') { + form.isError = true; + return 'Digite o $title'; + } + form.isError = false; + return null; }); } +} + +class CustomDateFormField extends StatelessWidget { + final String title; + final TextEditingController? controller; + final DateTime? initDate; + final bool textAlign; + final bool isBorder; + final Color? txtColor; + final String? hintText; + final double radius; + final double? width; + final DateTime? lastDate; + final DateTime? firstDate; + final void Function(DateTime?)? onFieldSubmitted; + final void Function(DateTime?)? onChanged; + final void Function(DateTime?)? onSaved; + + const CustomDateFormField({ + super.key, + required this.title, + this.controller, + this.initDate, + this.textAlign = false, + this.isBorder = true, + this.txtColor, + this.hintText, + this.radius = 12, + this.width, + this.lastDate, + this.firstDate, + this.onFieldSubmitted, + this.onChanged, + this.onSaved, + }); - static Widget date( - {required TextEditingController controller, - required String title, - bool textAlign = false, - bool isBorder = false, - Color? txtColor, - String? hintText, - double radius = 12, - double? width}) { - return Consumer( - builder: (context, form, __) { - return SizedBox( - width: width, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: textAlign - ? CrossAxisAlignment.center - : CrossAxisAlignment.start, - children: [ - Padding( - padding: - EdgeInsets.only(left: 5, top: 5, bottom: textAlign ? 5 : 0), - child: Text( - title, - style: TextStyle( - color: txtColor, + @override + Widget build(BuildContext context) { + + return ChangeNotifierProvider( + create: (_) => FormProvider(), + child: Consumer(builder: (_, form, __) { + return SizedBox( + width: width, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: textAlign + ? CrossAxisAlignment.center + : CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 5, top: 5, bottom: 5), + child: Text(title, + style: TextStyle( + color: context.watch().darkTemas + ? txtColor == Colors.black + ? Colors.white + : txtColor + : txtColor == Colors.white + ? Colors.black + : txtColor, fontSize: textAlign ? 18 : 14, - fontWeight: FontWeight.w600), + fontWeight: FontWeight.w600, + ), + ), ), - ), - DateTimeField( - format: DateFormat("dd/MM/yyyy"), - keyboardType: TextInputType.datetime, - style: const TextStyle(fontSize: 12), - controller: controller, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, - DataInputFormatter(), - ], - decoration: InputDecoration( - hintText: "DD/MM/AAAA", - contentPadding: const EdgeInsets.only(left: 15, top: 6), - fillColor: form.isError ? Colors.red.shade100 : Colors.white, - filled: true, - border: OutlineInputBorder( - borderSide: isBorder - ? BorderSide(color: Config.corPribar,) - : BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(radius))), - errorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.redAccent.shade100), - borderRadius: BorderRadius.all(Radius.circular(radius))), - errorStyle: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 11, - color: Colors.redAccent.shade100), - suffixIcon: Icon( - Icons.calendar_month, - color: Config.corPribar, + DateTimeField( + format: DateFormat("dd/MM/yyyy"), + keyboardType: TextInputType.datetime, + style: const TextStyle(fontSize: 12, color: Colors.black), + controller: controller, + initialValue: initDate, + onFieldSubmitted: onFieldSubmitted, + onChanged: onChanged, + onSaved: onSaved, + autovalidateMode: AutovalidateMode.onUserInteraction, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + DataInputFormatter(), + ], + decoration: InputDecoration( + hintText: hintText ?? "DD/MM/AAAA", + hintStyle: const TextStyle(fontSize: 12, color: Colors.grey), + fillColor: form.isError ? Colors.red.shade50 : Colors.white, + filled: true, + contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0), + enabledBorder: OutlineInputBorder( + borderSide: isBorder + ? BorderSide(color: Colors.grey.shade300) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + border: OutlineInputBorder( + borderSide: isBorder + ? BorderSide(color: Colors.grey.shade300) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + focusedBorder: OutlineInputBorder( + borderSide: isBorder + ? const BorderSide( + color: Config.corPribar, + ) + : BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(radius))), + errorBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.redAccent.shade100), + borderRadius: BorderRadius.all(Radius.circular(radius))), + errorStyle: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 11, + color: Colors.redAccent.shade100), + suffixIcon: const Icon( + Icons.calendar_month, + color: Colors.grey, + ), ), + validator: (v) { + if (v == null) { + form.isError = true; + return 'Selecione uma data'; + } + form.isError = false; + return null; + }, + onShowPicker: (context, currentValue) { + return showCustomDatePicker( + context: context, + initialEntryMode: DatePickerEntryMode.calendar, + initialDate: currentValue ?? DateTime.now(), + lastDate: lastDate ?? DateTime.now(), + firstDate: firstDate ?? DateTime(1900), + ); + }, ), - validator: (v) { - if (v == null || v == '') { - form.isError = true; - return 'Selecione sua data de aniversario'; - } - form.isError = false; - return null; - }, - onShowPicker: (context, currentValue) { - return showCustomDatePicker( - context: context, - initialEntryMode: DatePickerEntryMode.calendar, - initialDate: currentValue ?? - DateTime.now().subtract(const Duration(days: 6570)), - lastDate: DateTime.now(), - firstDate: DateTime(1900), - ); - }, - ), - ], - ), - ); - }); + ], + ), + ); + }), + ); } } @@ -380,9 +507,15 @@ class FormProvider extends ChangeNotifier { bool _isError = false; bool get isError => _isError; set isError(bool v) { - if (_isError != v) { + try { + if (_isError != v) { + WidgetsBinding.instance.addPostFrameCallback((_) { + _isError = v; + notifyListeners(); + }); + } + } catch (e) { _isError = v; - notifyListeners(); } } } @@ -394,7 +527,11 @@ enum FormType { rgcpf, phone, email, + emailcpf, pass, date, + num, + numVigula, + dinheiro, text; } diff --git a/lib/common/heros_file.dart b/lib/common/heros_file.dart index 173e150..3897c94 100644 --- a/lib/common/heros_file.dart +++ b/lib/common/heros_file.dart @@ -8,14 +8,14 @@ import 'package:flutter/rendering.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; -import 'package:share_extend/share_extend.dart'; -import 'package:filesystem_picker/filesystem_picker.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:responsive_framework/responsive_framework.dart'; import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; import 'package:universal_io/io.dart'; import 'package:universal_html/html.dart' as html; import '../config.dart'; +import '../utils/external_share.dart'; import '../utils/get_file.dart'; import 'load_screen.dart'; @@ -27,10 +27,11 @@ class FileHero extends StatefulWidget { final String? html; final String name; final Widget? menu; - FileHero(this.name, {this.menu, this.file,this.memori, this.html}); + final bool isImage; + const FileHero(this.name, {super.key, this.isImage = false, this.menu, this.file,this.memori, this.html}); @override - _FileHeroState createState() => _FileHeroState(); + State createState() => _FileHeroState(); } class _FileHeroState extends State { @@ -103,28 +104,36 @@ class _FileHeroState extends State { } ),*/ IconButton( - icon: Icon(Icons.send, color: Colors.white,), + icon: const Icon(Icons.send, color: Colors.white,), onPressed: () async { if(kIsWeb){ if(widget.memori != null){ - salvarArquivo(widget.memori!, "${widget.name}.pdf"); + salvarArquivo(widget.memori!, "${widget.name}.${widget.isImage ? 'jpg' : 'pdf'}"); } }else if(widget.file != null){ - ShareExtend.share(widget.file!.path, "file", - sharePanelTitle: "Enviar PDF", - subject: "${widget.name}.pdf"); + ExternalShare.shareFile( + path: widget.file!.path, + titulo: "Enviar ${widget.isImage ? 'jpg' : 'pdf'}", + nomeFile: "${widget.name}.${widget.isImage ? 'jpg' : 'pdf'}", + tipo: widget.isImage ? SheredType.image : SheredType.pdf, + ); }else{ carregar(context); Uint8List? rawPath = widget.memori ?? await _capturePng(); Navigator.pop(context); if(rawPath != null){ - final file = await CustomFile.fileTemp('pdf', memori: rawPath, nome: widget.name); - ShareExtend.share(file.path, "file", - sharePanelTitle: "Enviar PDF", - subject: "${widget.name}.pdf"); + final file = await CustomFile.fileTemp( + widget.isImage ? 'jpg' : 'pdf', + memori: rawPath, nome: widget.name + ); + ExternalShare.shareFile( + path: file.path, + titulo: "Enviar ${widget.isImage ? 'jpg' : 'pdf'}", + nomeFile: "${widget.name}.${widget.isImage ? 'jpg' : 'pdf'}", + tipo: widget.isImage ? SheredType.image : SheredType.pdf, + ); } } - } ), ], @@ -135,29 +144,29 @@ class _FileHeroState extends State { alignment: Alignment.bottomCenter, children: [ Container( - height: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top - AppBar().preferredSize.height : null, margin: widget.menu != null ? const EdgeInsets.only(bottom: 120) : null, alignment: Alignment.center, color: Colors.black, - child: widget.memori != null ? SfPdfViewer.memory(widget.memori!, ) : - widget.file == null ? Container() : SfPdfViewer.file(widget.file!), + child: widget.memori != null ? widget.isImage ? PhotoView( + imageProvider: MemoryImage(widget.memori!) + ) : SfPdfViewer.memory(widget.memori!, ) : + widget.file == null ? Container() : widget.isImage ? PhotoView( + imageProvider: FileImage(widget.file!) + ) : SfPdfViewer.file(widget.file!), ), - menus() + + if(widget.menu != null) ...[ + SizedBox( + height: 120, + child: widget.menu! + ) + ] ], ) ) ); } - - Widget menus(){ - if(widget.menu != null){ - return Container( - height: 120, - child: widget.menu!); - } - return Container(); - } } \ No newline at end of file diff --git a/lib/common/load_screen.dart b/lib/common/load_screen.dart index e68b16f..a62b8eb 100644 --- a/lib/common/load_screen.dart +++ b/lib/common/load_screen.dart @@ -5,7 +5,7 @@ carregar(BuildContext context){ barrierDismissible: false, context: context, builder: (context){ - return Center(child: CircularProgressIndicator(backgroundColor: Colors.transparent,), + return const Center(child: CircularProgressIndicator(backgroundColor: Colors.transparent,), ); } ); diff --git a/lib/config.dart b/lib/config.dart index a026559..7012360 100644 --- a/lib/config.dart +++ b/lib/config.dart @@ -1,6 +1,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:safe_device/safe_device.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:external_path/external_path.dart'; @@ -13,7 +15,7 @@ import 'model/model.dart'; class Config extends ChangeNotifier { Config() {_init();} - static ConfiguracoesModel conf = ConfiguracoesModel(); + static ConfiguracoesModel conf = const ConfiguracoesModel(); static final GlobalKey scaffoldKey = GlobalKey(); @@ -28,11 +30,11 @@ class Config extends ChangeNotifier { static bool isReenvioMarc = false; static bool primeiroAcesso = true; - static bool isJailBroken = true; - static bool canMockLocation = true; + static bool isJailBroken = false; + static bool canMockLocation = false; static bool isRealDevice = true; - static String versao = '0.0.0'; + static String versao = '99.0.0'; static String documentos = ''; static String? usenha; @@ -65,18 +67,37 @@ class Config extends ChangeNotifier { _init() async { try{ + final packageInfo = await PackageInfo.fromPlatform(); + versao = packageInfo.version; + final prefs = await SharedPreferences.getInstance(); primeiroAcesso = prefs.getBool("priacesso") ?? true; darkTemas = prefs.getBool("darkTemas") ?? false; - if(!kIsWeb){ - documentos = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOCUMENTS); - if(documentos == ''){ - documentos = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS); + /*if(Platform.isAndroid){ + try { + documentos = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOCUMENTS); + if(documentos == ''){ + documentos = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS); + } + } catch (e) { + // TODO + } + }*/ + + if(conf.nomeApp == VersaoApp.PontoApp && !kIsWeb){ + if(!Config.isWin){ + isRealDevice = await SafeDevice.isRealDevice; + canMockLocation = await SafeDevice.canMockLocation; } + + /*if(Config.isIOS) { + Config.isJailBroken = await SafeDevice.isJailBroken; + }*/ } }catch(e){ debugPrint(e.toString()); } + notifyListeners(); } } diff --git a/lib/controllers/asseweb/home_manager.dart b/lib/controllers/asseweb/home_manager.dart deleted file mode 100644 index bba672b..0000000 --- a/lib/controllers/asseweb/home_manager.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:flutter/material.dart'; - - -import '../../model/model.dart'; -import '../../services/services.dart'; -import 'user_manager.dart'; - -class HomeAssewebManager extends ChangeNotifier { - final HomeAssewebService _service = HomeAssewebService(); - List listContatos = []; - List listObrigacoes = []; - - void getHomePage(){ - getContatos(); - getObrigacoesusuarios(); - } - - Future getContatos() async { - listContatos = await _service.contatos( - token: UserAssewebManager.sUser?.token ?? '', - id: UserAssewebManager.sCompanies?.id ?? 0, - ); - notifyListeners(); - } - - Future getObrigacoesusuarios() async { - listObrigacoes = await _service.obrigacoesusuarios( - token: UserAssewebManager.sUser?.token ?? '', - idcliente: UserAssewebManager.sCompanies?.id ?? 0, - idusuario: UserAssewebManager.sUser?.login?.id ?? 0, - ); - listObrigacoes.sort((a,b) => a.obrigacaoClientePeriodo?.deadLine?.compareTo(b.obrigacaoClientePeriodo!.deadLine!) ?? 0); - - notifyListeners(); - } -} \ No newline at end of file diff --git a/lib/controllers/asseweb/senha_manager.dart b/lib/controllers/asseweb/senha_manager.dart deleted file mode 100644 index 425164a..0000000 --- a/lib/controllers/asseweb/senha_manager.dart +++ /dev/null @@ -1,28 +0,0 @@ - -import 'package:assecontservices/assecontservices.dart'; -import 'package:assecontservices/services/asseweb/senha.dart'; -import 'package:flutter/material.dart'; - -import '../../config.dart'; - -class SenhaAssewebManager { - final SenhaAssewebService _service = SenhaAssewebService(); - - - Future sendPass(String email) async { - String? result = await _service.sendPass(email: email); - return result; - } - - - Future alteracaoPass(BuildContext context, {required String senhaNova,}) async { - bool? result = await _service.alteracaoPass( senha: senhaNova,); - if(result ?? false){ - Config.usenha = senhaNova; - context.read().senha.text = senhaNova; - context.read().memorizar(); - } - return result ?? false; - } - -} \ No newline at end of file diff --git a/lib/controllers/asseweb/user_manager.dart b/lib/controllers/asseweb/user_manager.dart index 4f644f0..7a6951c 100644 --- a/lib/controllers/asseweb/user_manager.dart +++ b/lib/controllers/asseweb/user_manager.dart @@ -13,9 +13,10 @@ import '../../services/services.dart'; class UserAssewebManager extends ChangeNotifier { final UserAssewebService _service = UserAssewebService(); final BiometriaServices _serviceBio = BiometriaServices(); + final SenhaAssewebService _servicePass = SenhaAssewebService(); UserAssewebManager(){ - loadBio(); + init(); } static Company? sCompanies; @@ -27,6 +28,8 @@ class UserAssewebManager extends ChangeNotifier { } + static String? fcmToken; + static UsuarioAsseweb? sUser; UsuarioAsseweb? get user => sUser; set user(UsuarioAsseweb? v){ @@ -47,11 +50,30 @@ class UserAssewebManager extends ChangeNotifier { notifyListeners(); } - memorizar() async { + + Future sendPass() async { + String? result = await _servicePass.sendPass(email: email.text); + return result; + } + + + Future alteracaoPass({required String senhaNova,}) async { + bool? result = await _servicePass.alteracaoPass( senha: senhaNova,); + print(result); + if(result ?? false){ + memorizar(senhaNova); + } + return result ?? false; + } + + memorizar(String v) async { final prefs = await SharedPreferences.getInstance(); + senha.text = v; + Config.usenha = v; await prefs.setString("user", email.text); - await prefs.setString("usenha", senha.text); + await prefs.setString("usenha", v); await prefs.setBool("autologin", status); + notifyListeners(); } Future auth(BuildContext context, {String? email, String? senha, bool bio = false}) async { @@ -76,18 +98,24 @@ class UserAssewebManager extends ChangeNotifier { Future signInAuth({required String email, required String senha}) async { sUser = await _service.signInAuth(email: email, senha: senha); if (user != null && (user!.login?.companies?.isNotEmpty ?? false)) { - sCompanies = user!.login?.companies?.firstWhere((e) => e.id == user?.login?.lastCompanyId) ?? user!.login?.companies?.first; + sCompanies = user!.login?.companies?.any((e) => e.id == user?.login?.lastCompanyId) ?? false ? + user!.login?.companies?.firstWhere((e) => e.id == user?.login?.lastCompanyId) : + user!.login?.companies?.firstOrNull; } - memorizar(); + memorizar(senha); notifyListeners(); return true; } + Future updateEmpresa() async { + return await _service.lastcompanyupdate(companyId: companies?.id); + } + Future autoLogin() async { bool result = false; try { if (uemail != '' && usenha != '') { - result = await signInAuth(email: uemail, senha: usenha); + result = await signInAuth(email: uemail, senha: usenha, ); } } catch (e) { debugPrint(e.toString()); @@ -116,12 +144,16 @@ class UserAssewebManager extends ChangeNotifier { } } - loadBio() async { + init() async { + final prefs = await SharedPreferences.getInstance(); + status = prefs.getBool("autologin") ?? false; + } + + Future loadBio() async { try{ final prefs = await SharedPreferences.getInstance(); uemail = kReleaseMode ? prefs.getString("user") ?? '' : email.text; usenha = kReleaseMode ? prefs.getString("usenha") ?? '' : senha.text; - status = prefs.getBool("autologin") ?? false; if(kReleaseMode){ senha.text = ''; diff --git a/lib/controllers/controllers.dart b/lib/controllers/controllers.dart index bb21fed..4e56174 100644 --- a/lib/controllers/controllers.dart +++ b/lib/controllers/controllers.dart @@ -14,17 +14,14 @@ export 'ponto/comprovante_manager.dart'; export 'ponto/gethora.dart'; export 'holerite/holerite_manager.dart'; -export 'holerite/informe_manager.dart'; export 'holerite/user_manager.dart'; -export 'holerite/primeiro_acesso_manager.dart'; export 'holerite/senha_manager.dart'; export 'tablet/empresa_manager.dart'; export 'tablet/config_manager.dart'; export 'tablet/historico_manager.dart'; export 'tablet/user_manager_offiline.dart'; export 'asseweb/user_manager.dart'; -export 'asseweb/senha_manager.dart'; -export 'asseweb/home_manager.dart'; + export 'update_app_manager.dart'; diff --git a/lib/controllers/holerite/holerite_manager.dart b/lib/controllers/holerite/holerite_manager.dart index 2ea474b..84f740c 100644 --- a/lib/controllers/holerite/holerite_manager.dart +++ b/lib/controllers/holerite/holerite_manager.dart @@ -1,6 +1,5 @@ import 'dart:typed_data'; -import 'package:universal_io/io.dart'; import 'package:flutter/material.dart'; import '../../model/model.dart'; @@ -11,57 +10,99 @@ import '../../services/services.dart'; class HoleriteManager extends ChangeNotifier { final HoleriteService _service = HoleriteService(); - List _listcompetencias = []; - List get listcompetencias => _listcompetencias; - set listcompetencias(List v){ - _listcompetencias = v; + HoleriteModel? holerites; + List get listHolerites => holerites?.data ?? []; + + + bool _load = false; + bool get load => _load; + set load(bool v){ + _load = v; notifyListeners(); } - Future> resumoscreen(int? idholerite, int mes, int ano) async { - if(idholerite == null ) return []; - List result = await _service.resumoscreen(idholerite, mes, ano); - return result; + int _page = 0; + int get page => _page; + set page(int v){ + _page = v; + notifyListeners(); } - - Future> competencias(UsuarioHolerite? user) async { - if(user == null ) return []; - List result = await _service.competencias(user); - if(result.isNotEmpty){ - listcompetencias = result; - //listcompetencias = listcompetencias.reversed.toList(); - dropdowndata = result.first.descricao ?? 'Holerites'; + + int _pageSize = 3; + int get pageSize => _pageSize; + set pageSize(int v){ + if(_pageSize != v){ + _page = 0; + _pageSize = v; + listHolerite(); + notifyListeners(); } - return result; } - Future holeriteresumo(UsuarioHolerite? user, int idholerite, int mes, int ano, int? tipo) async { - File? result = await _service.holeriteresumo(user, idholerite, mes, ano, tipo); - return result; + Future init({bool update = false}) async { + if(listHolerites.isNotEmpty && !update) return; + _page = 0; + _pageSize = 3; + _load = true; + await listHolerite(isLoad: false); } - Future holeriteresumoBytes(UsuarioHolerite? user, int idholerite, int mes, int ano, int? tipo) async { - Uint8List? result = await _service.holeriteresumoBytes(user, idholerite, mes, ano, tipo); - return result; + List filtroHolerite(DatumHolerite holerite, int filtro){ + final l = listHolerites.where((e) => e.attributes?.type == holerite.attributes?.type).toList(); + int end = l.indexWhere((e) => e.id == holerite.id); + int start = 0; + if(end+1 - filtro > 0){ + start = end+1 - filtro; + } + final list = l.getRange(start, end+1).toList(); + return list.map((e) + => ChartColum(e.id ?? 0, '${e.attributes?.competence ?? ''}\n${e.id ?? 0}', + e.attributes?.data?.funcionarioResumo?.liquido ?? 0)).toList(); } + DatumHolerite selectHolerite(int id) => listHolerites.firstWhere((e) => e.id == id); - String _dropdowndata = "Holerites"; - String get dropdowndata => _dropdowndata; - set dropdowndata(String v){ - _dropdowndata = v; - notifyListeners(); - } - dropdowntipoInit(String v){ - _dropdowntipo = v; + Future listHolerite({bool isLoad = true}) async { + try{ + if(isLoad) load = true; + final result = await _service.listHolerite(_page, _pageSize); + holerites = result; + holerites!.data?.sort((a, b) { + try { + if (a.attributes!.year != b.attributes!.year) { + return b.attributes!.year!.compareTo(a.attributes!.year!); + } else { + return b.attributes!.month!.compareTo(a.attributes!.month!); + } + } catch (e) { + return 999; + } + }); + } catch (e) { + debugPrint(e.toString()); + }finally{ + load = false; + notifyListeners(); + } } - String _dropdowntipo = ""; - String get dropdowntipo => _dropdowntipo; - set dropdowntipo(String v){ - _dropdowntipo = v; - notifyListeners(); + Future newPageHolerite() async { + _page += 1; + final result = await _service.newPageHolerite(_page, _pageSize); + if(result.isNotEmpty){ + holerites?.data?.addAll(result); + notifyListeners(); + } } + Future holeriteresumoBytes(int? idholerite, bool isSign, String comp) async { + try { + Uint8List? result = await _service.holeriteresumoBytes(idholerite, isSign, comp); + return result; + } catch (e) { + debugPrint(e.toString()); + return null; + } + } } \ No newline at end of file diff --git a/lib/controllers/holerite/informe_manager.dart b/lib/controllers/holerite/informe_manager.dart deleted file mode 100644 index 99dfbce..0000000 --- a/lib/controllers/holerite/informe_manager.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:universal_io/io.dart'; -import 'dart:async'; -import 'package:flutter/material.dart'; - - -import '../../model/model.dart'; -import '../../services/services.dart'; - - -class InformeManager extends ChangeNotifier { - InformeService _service = InformeService(); - - InformeRendimentosModel? _competencia; - InformeRendimentosModel? get competencia => _competencia; - set competencia(InformeRendimentosModel? v){ - _competencia = v; - notifyListeners(); - } - - List _listcompetencias = []; - List get listcompetencias => _listcompetencias; - set listcompetencias(List v){ - _listcompetencias = v; - notifyListeners(); - } - - Future competencias(UsuarioHolerite user) async { - try{ - listcompetencias = await _service.competencias(user) ; - competencia = listcompetencias.first; - } catch(e){ - debugPrint('catch ' + e.toString()); - } - } - - Future informeRendimentosPDF(UsuarioHolerite user, int? ano) async { - try{ - File? file = await _service.informeRendimentosPDF(user, ano); - return file; - } catch(e){ - debugPrint(e.toString()); - return null; - } - } - -} \ No newline at end of file diff --git a/lib/controllers/holerite/primeiro_acesso_manager.dart b/lib/controllers/holerite/primeiro_acesso_manager.dart deleted file mode 100644 index 979a5bf..0000000 --- a/lib/controllers/holerite/primeiro_acesso_manager.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/material.dart'; - - -import '../../model/model.dart'; -import '../../services/services.dart'; - - -class PrimeiroAcessoHoleriteManager extends ChangeNotifier{ - final PrimeiroAcessoHoleriteService _service = PrimeiroAcessoHoleriteService(); - - PrimeiroAcessoHoleriteModel? acessoModel; - - Future verificar(BuildContext context , {required String cnpj, required String registro, }) async { - acessoModel = await _service.verificar(cnpj: cnpj, registro: registro); - notifyListeners(); - return acessoModel?.id != 0; - } - - Future esqueceuEmail(BuildContext context , {required String cnpj, required String registro, required String cpf, }) async { - acessoModel = await _service.esqueceuEmail(cnpj: cnpj, registro: registro, cpf: cpf); - notifyListeners(); - return acessoModel?.id != 0; - } - - Future cadastrar(BuildContext context, {required String email, - required String senha, required String cpf, String? cel,}) async { - bool result = await _service.cadastrar(id: acessoModel!.id!, cel: cel, email: email, senha: senha, cpf: cpf); - acessoModel = null; - notifyListeners(); - return result; - } -} \ No newline at end of file diff --git a/lib/controllers/holerite/senha_manager.dart b/lib/controllers/holerite/senha_manager.dart index 1ea1f60..f0cf479 100644 --- a/lib/controllers/holerite/senha_manager.dart +++ b/lib/controllers/holerite/senha_manager.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:assecontservices/assecontservices.dart'; +import '../../config.dart'; +import '../../services/holerite/senha.dart'; +import '../controllers.dart'; class SenhaHoleriteManager extends ChangeNotifier { @@ -20,19 +22,20 @@ class SenhaHoleriteManager extends ChangeNotifier { notifyListeners(); } - Future sendPass({String? email, String? cpf, }) async { - String? result = await _service.sendPass(email: email, cpf: cpf); + Future sendPass({String? email, String? cpf, }) async { + bool? result = await _service.sendPass(email: email, cpf: cpf); return result; } Future alteracaoPass(BuildContext context, {required String senha, required String senhaNova,}) async { - bool? result = await _service.alteracaoPass(id: UserHoleriteManager.sUser!.id!, senha: senha, senhaNova: senhaNova); - if(result ?? false){ + final result = await _service.alteracaoPass(senha: senha, senhaNova: senhaNova); + if(result != null){ Config.usenha = senhaNova; context.read().senha.text = senhaNova; + UserHoleriteManager.user?.copyWith(user: result); context.read().memorizar(); } - return result ?? false; + return result != null; } ofuscarEmail(String e){ diff --git a/lib/controllers/holerite/user_manager.dart b/lib/controllers/holerite/user_manager.dart index 9502283..8511f68 100644 --- a/lib/controllers/holerite/user_manager.dart +++ b/lib/controllers/holerite/user_manager.dart @@ -5,7 +5,9 @@ import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../../common/common.dart'; +import '../../model/holerite/usuario/funcionarios.dart'; import '../../model/model.dart'; +import '../../services/holerite/funcionarios.dart'; import '../../services/services.dart'; import '../../config.dart'; @@ -13,20 +15,18 @@ import '../../config.dart'; class UserHoleriteManager extends ChangeNotifier { final UserHoleriteService _service = UserHoleriteService(); + final FuncionariosHoleriteService _serviceFunc = FuncionariosHoleriteService(); final BiometriaServices _serviceBio = BiometriaServices(); UserHoleriteManager(){ loadBio(); } - List? listuser; + List listFunc = []; + static DatumFuncionarios? funcSelect; - static UsuarioHolerite? sUser; - UsuarioHolerite? get user => sUser; - set user(UsuarioHolerite? v){ - sUser = v; - notifyListeners(); - } + static String? token; + static UsuarioHoleriteModel? user; final TextEditingController email = TextEditingController(); final TextEditingController cpf = TextEditingController(); @@ -34,17 +34,41 @@ class UserHoleriteManager extends ChangeNotifier { String uemail = ''; String usenha = ''; - bool _status = false; + bool _status = true; bool get status => _status; set status(bool v){ _status = v; notifyListeners(); } + loadBio() async { + try{ + final prefs = await SharedPreferences.getInstance(); + uemail = prefs.getString("user") ?? ''; + usenha = prefs.getString("usenha") ?? ''; + senha.text = prefs.getString("senha") ?? ''; + email.text = uemail; + Config.usenha = usenha; + await autoLogin(); + } catch(e) { + debugPrint(e.toString()); + } + } + memorizar() async { final prefs = await SharedPreferences.getInstance(); + await memorizarEmail(prefs); + await memorizarSenha(prefs); + } + + memorizarEmail(SharedPreferences prefs) async { await prefs.setString("user", email.text); + if(uemail == '') uemail = email.text; + } + + memorizarSenha(SharedPreferences prefs) async { await prefs.setString("usenha", senha.text); + if(usenha == '') usenha = senha.text; Config.usenha = usenha; if(status){ await prefs.setString("senha", senha.text); @@ -71,14 +95,6 @@ class UserHoleriteManager extends ChangeNotifier { } } - Future signInAuth({required String email, required String senha}) async { - listuser = await _service.signInAuth(email: email, senha: senha); - user = listuser!.last; - memorizar(); - return true; - } - - Future autoLogin() async { bool result = false; try { @@ -91,8 +107,52 @@ class UserHoleriteManager extends ChangeNotifier { return result; } + Future signInAuth({required String email, required String senha}) async { + user = await _service.signInAuth(email: email, senha: senha, token: token); + if(user?.user?.cpf != null && user?.user?.cpf != ''){ + listFunc = await _serviceFunc.listFuncionarios(); + if(listFunc.isNotEmpty) funcSelect = listFunc.last; + } + memorizar(); + notifyListeners(); + return true; + } + + Future registerUser({required String email, + required String senha,required String nome, required String cpf}) async { + user = await _service.registerUser(email: email, senha: senha, nome: nome, cpf: cpf, ); + listFunc = await _serviceFunc.listFuncionarios(); + if(listFunc.isNotEmpty) funcSelect = listFunc.last; + memorizar(); + notifyListeners(); + return true; + } + + Future updateUser({String? cpf, String? email, String? username}) async { + bool result = await _service.updateUser(cpf: cpf, + //email: email ?? user?.user?.email, + //username: username ?? user?.user?.username, + // senha: usenha + ); + if(result){ + if(cpf != null){ + user!.user!.cpf = cpf; + listFunc = await _serviceFunc.listFuncionarios(); + if(listFunc.isNotEmpty) funcSelect = listFunc.last; + } + if(username != null) user!.user!.username = username; + if(email != null){ + user!.user!.username = email; + final prefs = await SharedPreferences.getInstance(); + await memorizarEmail(prefs); + } + notifyListeners(); + } + return result; + } + Future deleteUser() async { - bool result = await _service.deleteUser(user?.id); + bool result = await _service.deleteUser(); if(result){ signOut(); } @@ -102,7 +162,8 @@ class UserHoleriteManager extends ChangeNotifier { signOut(){ cleanPreferebces(); user = null; - listuser = null; + listFunc.clear(); + funcSelect = null; _status = false; uemail = ''; usenha = ''; @@ -119,17 +180,22 @@ class UserHoleriteManager extends ChangeNotifier { debugPrint(e.toString()); } } - loadBio() async { - try{ - final prefs = await SharedPreferences.getInstance(); - uemail = prefs.getString("user") ?? ''; - usenha = prefs.getString("usenha") ?? ''; - senha.text = prefs.getString("senha") ?? ''; - email.text = uemail; - Config.usenha = usenha; - await autoLogin(); - } catch(e) { - debugPrint(e.toString()); + + + Future updateFunc({String? accountBank, String? pixKeyBank, String? email, + String? phone, String? agencyBank, String? typeBank, String? codeBank, }) async { + + final result = await _serviceFunc.updateFuncionario( + id: funcSelect?.id, phone: phone, email: email, accountBank: accountBank, + typeBank: typeBank, codeBank: codeBank, pixKeyBank: pixKeyBank, agencyBank: agencyBank, + ); + if(result != null){ + funcSelect = result; + listFunc = listFunc.map((e) => e.id == result.id ? result : e).toList(); + notifyListeners(); + return true; + }else{ + return false; } } } \ No newline at end of file diff --git a/lib/controllers/ponto/apontamento_manager.dart b/lib/controllers/ponto/apontamento_manager.dart index ee55f29..c9c4ba8 100644 --- a/lib/controllers/ponto/apontamento_manager.dart +++ b/lib/controllers/ponto/apontamento_manager.dart @@ -1,13 +1,11 @@ -import 'package:assecontservices/controllers/controllers.dart'; import 'package:flutter/material.dart'; import '../../model/model.dart'; import '../../services/services.dart'; -import '../../config.dart'; class ApontamentoManager extends ChangeNotifier { - ApontamentoService _service = ApontamentoService(); + final ApontamentoService _service = ApontamentoService(); List apontamento = []; int _indice = 0; diff --git a/lib/controllers/ponto/camera_manager.dart b/lib/controllers/ponto/camera_manager.dart index f91cf43..0b6eae1 100644 --- a/lib/controllers/ponto/camera_manager.dart +++ b/lib/controllers/ponto/camera_manager.dart @@ -9,7 +9,7 @@ import '../../services/ponto/foto.dart'; class CameraPontoManager extends ChangeNotifier { final CameraPontoService _service = CameraPontoService(); - Future setPhoto(UsuarioPonto user, List img, String? faceId) async { + Future setPhoto(UsuarioPonto user, Uint8List img, String? faceId) async { bool result = await _service.setPhoto(user, img, faceId); return result; } diff --git a/lib/controllers/ponto/marcacao_manager.dart b/lib/controllers/ponto/marcacao_manager.dart index 51e2da9..8b65726 100644 --- a/lib/controllers/ponto/marcacao_manager.dart +++ b/lib/controllers/ponto/marcacao_manager.dart @@ -9,8 +9,7 @@ import '../controllers.dart'; class MarcacoesManager extends ChangeNotifier { final MarcacoesService _service = MarcacoesService(); - List listamarcacao = []; - List listdecoration = []; + DateTime _data = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day); DateTime get data => _data; set data(DateTime v){ @@ -18,115 +17,7 @@ class MarcacoesManager extends ChangeNotifier { notifyListeners(); } - - bool _load = true; - bool get load => _load; - set load(v){ - _load = v; - notifyListeners(); - } - - MarcacaoManager(){ - marcacaoUpdate(); - } - - marcacaoUpdate(){ - getEspelho(); - } - - signOut(){ - listamarcacao = []; - } - - Future getMarcacaoDia() async { - Marcacao? _marcacao; - try{ - if(listamarcacao.any((e) { - if(e.datahora != null){ - return DateTime(e.datahora!.year, e.datahora!.month, e.datahora!.day) == data; - } - return false; - })){ - _marcacao = listamarcacao.firstWhere((e) { - if(e.datahora != null){ - return DateTime(e.datahora!.year, e.datahora!.month, e.datahora!.day) == data; - } - return false; - }); - } - }catch (e){ - debugPrint(e.toString()); - } - return _marcacao; - } - - getEspelho({int? filtro}) async { - try{ - listamarcacao = await _service.getEspelho(UserPontoManager.susuario); - if(listamarcacao.isNotEmpty){ - listamarcacao.map((element) { - if(((element.resultado?.atrasosmin ?? 0) > 0 || (element.resultado?.faltasDias ?? 0) > 0) - && (element.resultado?.extrasmin ?? 0) > 0){ - listdecoration.add( - DecorationItem( - decoration: Icon(Icons.circle, color: Config.corPri,), - date: element.datahora - ) - ); - }else if((element.resultado?.atrasosmin ?? 0) > 0 || (element.resultado?.faltasDias ?? 0) > 0){ - listdecoration.add( - DecorationItem( - decoration: const Icon(Icons.circle, color: Colors.red,), - date: element.datahora - ) - ); - - }else if((element.resultado?.extrasmin ?? 0) > 0){ - listdecoration.add( - DecorationItem( - decoration: const Icon(Icons.circle, color: Colors.green,), - date: element.datahora - ) - ); - }else if((element.resultado?.abonosmin ?? 0) > 0){ - listdecoration.add( - DecorationItem( - decoration: const Icon(Icons.circle, color: Colors.white,), - date: element.datahora - ) - ); - } - }).toList(); - if(filtro != null){ - DateTime? _d = listamarcacao.lastWhere((element) { - if(filtro == 1 && (element.resultado?.atrasosmin ?? 0) > 0){ - return true; - }else if(filtro == 2 && (element.resultado?.extrasmin ?? 0 ) > 0){ - return true; - }else if(filtro == 3 && (element.resultado?.abonosmin ?? 0 ) > 0){ - return true; - }else if(filtro == 4 && (element.resultado?.faltasDias ?? 0 ) > 0){ - return true; - }else{ - return false; - } - }).datahora; - if(_d != null){ - _data = DateTime(_d.year, _d.month, _d.day); - }else{ - _data = DateTime(listamarcacao.last.datahora!.year, listamarcacao.last.datahora!.month, listamarcacao.last.datahora!.day); - } - } - else if(listamarcacao.last.datahora != null && - DateTime(listamarcacao.last.datahora!.year, listamarcacao.last.datahora!.month, listamarcacao.last.datahora!.day).compareTo(_data) < 0){ - _data = DateTime(listamarcacao.last.datahora!.year, listamarcacao.last.datahora!.month, listamarcacao.last.datahora!.day); - } - } - notifyListeners(); - }catch(e){ - debugPrint("MarcacoesManager getEspelho Erro Try ${e.toString()}"); - } + Future getMarcacaoDia() async { + return await _service.getEspelho(UserPontoManager.susuario, data); } - - } \ No newline at end of file diff --git a/lib/controllers/ponto/memorando_manager.dart b/lib/controllers/ponto/memorando_manager.dart index 8b49e23..db08d91 100644 --- a/lib/controllers/ponto/memorando_manager.dart +++ b/lib/controllers/ponto/memorando_manager.dart @@ -59,9 +59,9 @@ class MemorandosManager extends ChangeNotifier { TextEditingController(text: DateFormat("dd/MM/yyyy").format(DateTime.now())); memorandosUpdate(){ - if(UserPontoManager().usuario != null){ + if(UserPontoManager.susuario != null){ getMemorandos( - UserPontoManager().usuario!, + UserPontoManager.susuario!, UserPontoManager.susuario!.periodo!.dataInicial!, UserPontoManager.susuario!.periodo!.dataFinal! ); diff --git a/lib/controllers/ponto/registro_ponto_manager.dart b/lib/controllers/ponto/registro_ponto_manager.dart index 014f3aa..54e6cdf 100644 --- a/lib/controllers/ponto/registro_ponto_manager.dart +++ b/lib/controllers/ponto/registro_ponto_manager.dart @@ -18,8 +18,10 @@ class RegistroManger { File? image; int auth = 0; - Future postPontoMarcar(BuildContext context, UsuarioPonto user, double? latitude, double? longitude) async { - bool result = await _service.postPontoMarcar(user, latitude, longitude); + Future postPontoMarcar(BuildContext context, UsuarioPonto user, + double? latitude, double? longitude, String? endereco, String? token) async { + + bool result = await _service.postPontoMarcar(user, latitude, longitude, endereco, token); if(result){ CustomAlert.sucess( context: context, @@ -41,9 +43,9 @@ class RegistroManger { } postPontoMarcacoesOffline(BuildContext context, UsuarioPonto usuario, - List> listmarcacao, {bool delete = true}) async { + List> listmarcacao, {bool delete = true, String? token}) async { - final result = await _service.postPontoMarcacoesOffline(usuario, listmarcacao, delete: delete); + final result = await _service.postPontoMarcacoesOffline(usuario, listmarcacao, delete: delete, token: token); if(result == MarcacaoOffStatus.Erro){ CustomAlert.erro( context: context, @@ -57,37 +59,38 @@ class RegistroManger { } } - enviarMarcacoesHistorico(BuildContext context, UsuarioPonto? usuario) async { + enviarMarcacoesHistorico(BuildContext context, UsuarioPonto? usuario, {String? token}) async { try{ if (usuario != null) { - List>? marcacao = await _sqlitePonto.getHistoricoFormatado(UserPontoManager.susuario?.funcionario?.funcionarioId) ; + List>? marcacao = await _sqlitePonto.getHistoricoFormatado( + UserPontoManager.susuario?.funcionario?.funcionarioId) ; if(marcacao != null && marcacao.isNotEmpty){ debugPrint(marcacao.toString()); - postPontoMarcacoesOffline(context, usuario, marcacao, delete: false); + postPontoMarcacoesOffline(context, usuario, marcacao, delete: false, token: token ); }else{ CustomAlert.info( context: context, - mensage: 'Não foi possivel enviar suas marcações\n', + mensage: 'Você não possui marcações para ser enviadas\n', ); } } else { CustomAlert.info( context: context, - mensage: 'Não foi possivel enviar suas marcações\n', + mensage: 'Falha na autenticacao, nao foi possivel enviar as marcações\n', ); } }catch(e){ debugPrint("erro enviarMarcacoes offline $e"); CustomAlert.erro( context: context, - mensage: 'Não foi possivel enviar suas marcações\n', + mensage: 'Não foi possivel enviar suas marcações\n$e', ); } } - enviarMarcacoes() async { - debugPrint('enviarMarcacoes off ' + (Config.isReenvioMarc ? '45 dias' : '1 dia')); + enviarMarcacoes({String? token}) async { + debugPrint('enviarMarcacoes off ${Config.isReenvioMarc ? '45 dias' : '1 dia'}'); try{ List>? marcacao = await ( Config.isReenvioMarc ? _sqlitePonto.getHistoricoFormatado(UserPontoManager.susuario?.funcionario?.funcionarioId) @@ -96,7 +99,8 @@ class RegistroManger { final result = await _service.postPontoMarcacoesOffline( UserPontoManager.susuario, marcacao, - delete: !Config.isReenvioMarc + delete: !Config.isReenvioMarc, + token: token ); if(result == MarcacaoOffStatus.Sucess){ debugPrint('sucess'); @@ -112,9 +116,11 @@ class RegistroManger { }catch(e){ debugPrint("erro enviarMarcacoes offline ${e.toString()}"); } + + deleteHistorico(); } - enviarMarcacoesNotificacao() async { + enviarMarcacoesNotificacao({required String? token}) async { try{ final _user = await UserPontoService().authNotificacao(); @@ -122,7 +128,7 @@ class RegistroManger { if(marcacao != null && marcacao.isNotEmpty) { final result = await _service.postPontoMarcacoesOffline( UserPontoManager.susuario, marcacao, - delete: false + delete: false, token: token ); if(result == MarcacaoOffStatus.Sucess){ debugPrint('enviarMarcacoesNotificacao sucess'); @@ -136,8 +142,10 @@ class RegistroManger { } deleteHistorico() async { - if(!Config.isReenvioMarc){ - _sqlitePonto.deleteHistorico(UserPontoManager.susuario?.funcionario?.funcionarioId); - } + try { + if(!Config.isReenvioMarc){ + _sqlitePonto.deleteHistorico(UserPontoManager.susuario?.funcionario?.funcionarioId); + } + } catch (e) {} } } \ No newline at end of file diff --git a/lib/controllers/ponto/senha_manager.dart b/lib/controllers/ponto/senha_manager.dart index a505b68..25586b4 100644 --- a/lib/controllers/ponto/senha_manager.dart +++ b/lib/controllers/ponto/senha_manager.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../common/common.dart'; import '../../config.dart'; +import '../../data/local/user_local_sources.dart'; import '../../model/model.dart'; import '../../services/services.dart'; import '../controllers.dart'; @@ -28,9 +29,9 @@ class SenhaPontoManager extends ChangeNotifier { context.read().senha.text = nova; context.read().memorizar(); - final SqlitePontoService _sqlService = SqlitePontoService(); + final UserLocalSources _sqlService = UserLocalSources(); - _sqlService.salvarNovoUsuario( usuario.toMap() ); + _sqlService.saveUser(user: usuario); } return result; } diff --git a/lib/controllers/ponto/users_manager.dart b/lib/controllers/ponto/users_manager.dart index 4ce709d..1269938 100644 --- a/lib/controllers/ponto/users_manager.dart +++ b/lib/controllers/ponto/users_manager.dart @@ -3,6 +3,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../../common/common.dart'; import '../../config.dart'; +import '../../data/local/user_local_sources.dart'; +import '../../enums/versao_app.dart'; import '../../model/model.dart'; import '../../services/services.dart'; import '../controllers.dart'; @@ -12,7 +14,8 @@ class UserPontoManager extends ChangeNotifier { final UserPontoService _service = UserPontoService(); final BiometriaServices _serviceBio = BiometriaServices(); final HomePontoService _homeservice = HomePontoService(); - final SqlitePontoService _sqlService = SqlitePontoService(); + final UserLocalSources _sqlService = UserLocalSources(); + final UsuarioPontoCodigoService _serviceCodigo = UsuarioPontoCodigoService(); static final UserPontoManager _userManager = UserPontoManager._internal(); @@ -35,6 +38,13 @@ class UserPontoManager extends ChangeNotifier { notifyListeners(); } + bool _load = false; + bool get load => _load; + set load(bool v){ + _load = v; + notifyListeners(); + } + static UsuarioPonto? susuario; UsuarioPonto? get usuario => susuario; set usuario(UsuarioPonto? valor){ @@ -51,13 +61,24 @@ class UserPontoManager extends ChangeNotifier { notifyListeners(); } - HomePontoModel? _homeModel; - HomePontoModel? get homeModel => _homeModel; - set homeModel(HomePontoModel? valor){ - _homeModel = valor; + HomePontoModel? _expediente; + HomePontoModel? get expediente => _expediente; + set expediente(HomePontoModel? valor){ + _expediente = valor; notifyListeners(); } + Future geExpedientes() async { + _expediente = null; + try { + HomePontoModel? _home = await _homeservice.getExpedientes(usuario!); + expediente = _home; + } catch (e) { + debugPrint('try erro getHome $e'); + expediente = null; + } + } + bool _regButtom = false; bool get regButtom => _regButtom; set regButtom(bool valor){ @@ -69,19 +90,19 @@ class UserPontoManager extends ChangeNotifier { final prefs = await SharedPreferences.getInstance(); await prefs.setString("login", email.text); await prefs.setString("usenha", usenha); - await prefs.setBool("autologin", status); + //await prefs.setBool("autologin", status); } - Future auth(BuildContext context, String email, String senha, bool bio, String? token) async { + Future auth(BuildContext context, String email, String senha, bool bio, String? token, Function(String)? onError) async { bool result = false; try { if(bio){ bool _resultBio = await _serviceBio.authbiometria(); if(_resultBio){ - result = await signInAuth(email: email, senha: usenha, token: token); + result = await signInAuth(email: email, senha: usenha, token: token, onError: onError); } }else{ - result = await signInAuth(email: email, senha: senha, token: token); + result = await signInAuth(email: email, senha: senha, token: token, onError: onError); } return result; } catch(e) { @@ -90,35 +111,61 @@ class UserPontoManager extends ChangeNotifier { } } - Future signInAuth({required String email,required String senha, String? token}) async { - usuario = await _service.signInAuth(email: email, senha: senha, token: token); - if(usuario?.app ?? false){ - UserHoleriteManager.sUser = UsuarioHolerite.fromPonto(usuario!); + Future signInAuth({required String email,required String senha, String? token, Function(String)? onError}) async { + final u = await _service.signInAuth(email: email, senha: senha, token: token, onError: onError); + if(u != null){ + usuario = u; + Config.usenha = senha; + usenha = senha; + _sqlService.saveUser(user: usuario!); + memorizar(); + return true; + }else{ + return false; } - Config.usenha = senha; - usenha = senha; - _sqlService.salvarNovoUsuario( usuario!.toMap() ); - memorizar(); - return true; } - Future getHome() async { + Future signInAuthCodigo(int databaseId, String cnpj, String codigo, + Function? onSucess, Function(String)? onError) async { try { - HomePontoModel? _home = await _homeservice.getHome(usuario!); - homeModel = _home; - + final u = await _serviceCodigo.verificarcodigo( + databaseId, + cnpj, + codigo + ); + if(u != null){ + usuario = u; + _sqlService.saveUserTablet(user: usuario!); + if(onSucess != null) onSucess(); + return true; + }else{ + usuario = null; + if(onError != null) onError('Código inválido!'); + return false; + } } catch (e) { - debugPrint('try erro getHome ' + e.toString()); - homeModel = null; + if(onError != null) onError(e.toString()); + return false; + } + } + + Future signInAuthAuto({required String email,required String senha}) async { + bool result = false; + usuario = await _service.authOffiline(email, senha); + if(usuario?.funcionario?.funcionarioId == null){ + result = await signInAuth(email: uemail, senha: usenha); + }else{ + signInAuth(email: uemail, senha: usenha); } + Config.usenha = senha; + usenha = senha; + return result; } Future autoLogin() async { bool result = false; try { - if (uemail != '' && usenha != '') { - result = await signInAuth(email: uemail, senha: usenha); - } + result = await signInAuthAuto(email: uemail, senha: usenha); } catch (e) { debugPrint(e.toString()); } @@ -130,10 +177,10 @@ class UserPontoManager extends ChangeNotifier { final prefs = await SharedPreferences.getInstance(); uemail = prefs.getString("login") ?? ''; usenha = prefs.getString("usenha") ?? ''; - _status = prefs.getBool("autologin") ?? false; + //_status = prefs.getBool("autologin") ?? false; email.text = uemail; Config.usenha = usenha; - if(_status){ + if(uemail != ''){ await autoLogin(); } } catch(e) { @@ -142,10 +189,10 @@ class UserPontoManager extends ChangeNotifier { } signOut() { - cleanPreferences(); + if(Config.conf.nomeApp != VersaoApp.PontoTablet) cleanPreferences(); usuario = null; - homeModel = null; _status = false; + _expediente = null; uemail = ''; usenha = ''; Config.usenha = ''; @@ -153,8 +200,11 @@ class UserPontoManager extends ChangeNotifier { cleanPreferences() async { try{ + await _service.deleteUser(); final prefs = await SharedPreferences.getInstance(); prefs.remove("autologin"); + prefs.remove("login"); + prefs.remove("usenha"); } catch(e) { debugPrint(e.toString()); } diff --git a/lib/controllers/tablet/config_manager.dart b/lib/controllers/tablet/config_manager.dart index e94035b..ffe6e0e 100644 --- a/lib/controllers/tablet/config_manager.dart +++ b/lib/controllers/tablet/config_manager.dart @@ -25,6 +25,35 @@ class ConfigTabletManager extends ChangeNotifier { status: ConfigBackup.Semanal, hora: '23:00', local: Config.documentos); Timer? timer; + + static int convertStatusInt(ConfigBackup? status){ + switch (status) { + case ConfigBackup.Diario : + return 1; + case ConfigBackup.Semanal : + return 2; + case ConfigBackup.Mensal : + return 3; + default : + return 2; + } + } + + static ConfigBackup convertStatusEnum(int? status){ + switch (status) { + case 1 : + return ConfigBackup.Diario; + case 2 : + return ConfigBackup.Semanal; + case 3 : + return ConfigBackup.Mensal; + default : + return ConfigBackup.Semanal; + } + } + + + initConfig(EmpresaPontoModel empresa) async { try{ List? config = await _sqlitePonto.initConfig(); diff --git a/lib/controllers/tablet/empresa_manager.dart b/lib/controllers/tablet/empresa_manager.dart index c28825c..acb8681 100644 --- a/lib/controllers/tablet/empresa_manager.dart +++ b/lib/controllers/tablet/empresa_manager.dart @@ -13,8 +13,8 @@ class EmpresaPontoManager extends ChangeNotifier { static EmpresaPontoModel? empresa; static bool autologin = false; - final TextEditingController email = TextEditingController(text: kReleaseMode ? '' : 'reginal@assecont.com.br'); - final TextEditingController senha = TextEditingController(text: kReleaseMode ? '' : '1'); + final TextEditingController email = TextEditingController(text: kReleaseMode ? '' : 'rilda@assecont.com.br'); + final TextEditingController senha = TextEditingController(text: kReleaseMode ? '' : 'ponto'); bool _load = false; bool get load => _load; set load(bool v){ @@ -50,14 +50,20 @@ class EmpresaPontoManager extends ChangeNotifier { ); } - Future signIn(String email, String pass) async { + Future signIn(String email, String pass, {Function? onSuccess, Function? onError}) async { try{ empresa = await _service.signIn(email, pass); if(empresa != null){ UserPontoOffilineManager().getFuncionariosTablet(empresa!); + if(onSuccess != null) onSuccess(); + }else{ + if(onError != null) onError('Nenhum usuário encontrado!'); + return; } notifyListeners(); + } catch (e){ + if(onError != null) onError(e); debugPrint("Erro Try verificarcodigo $e"); } } diff --git a/lib/controllers/tablet/user_manager_offiline.dart b/lib/controllers/tablet/user_manager_offiline.dart index ebe7c08..3e1c71a 100644 --- a/lib/controllers/tablet/user_manager_offiline.dart +++ b/lib/controllers/tablet/user_manager_offiline.dart @@ -5,7 +5,7 @@ import '../../services/services.dart'; import '../controllers.dart'; class UserPontoOffilineManager { - UserPontoOffilineServices _services = UserPontoOffilineServices(); + final UserPontoOffilineServices _services = UserPontoOffilineServices(); final SqlitePontoService _sqlitePonto = SqlitePontoService(); UserOffilineManager(){ diff --git a/lib/controllers/update_app_manager.dart b/lib/controllers/update_app_manager.dart index bec54f4..82606dd 100644 --- a/lib/controllers/update_app_manager.dart +++ b/lib/controllers/update_app_manager.dart @@ -3,8 +3,8 @@ import 'package:universal_io/io.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:launch_app_store/launch_app_store.dart'; -import 'package:launch_review/launch_review.dart'; import '../common/common.dart'; import '../services/services.dart'; @@ -12,7 +12,7 @@ import '../config.dart'; class UpdateAppManager { - UpdateAppService _service = UpdateAppService(); + final UpdateAppService _service = UpdateAppService(); checkVersion(BuildContext context) async { if(kIsWeb){ @@ -21,14 +21,16 @@ class UpdateAppManager { try{ if(Config.isWin) throw 'executando no windowns'; - if(kReleaseMode && ((Config.isIOS && Config.isJailBroken) || (!Config.isIOS && !Config.isRealDevice))){ + if(kReleaseMode && ( (!Config.isIOS && !Config.isRealDevice))){ CustomAlert.custom( context: context, titulo: 'Atenção!', corpo: CustomText.text('Não é possivel executar este app neste dispositivo!', maxLines: 2, softWrap: true, textAlign: TextAlign.center,), txtBotaoSucess: 'OK', - funcSucess: _funcExit() + funcSucess: (){ + _funcExit(); + } ); }else{ final bool appStatus = await _service.postUpdateApp(); @@ -55,14 +57,14 @@ class UpdateAppManager { } ); }else{ - Future.delayed(Duration(seconds: 2), (){ + Future.delayed(const Duration(seconds: 2), (){ Navigator.pushNamedAndRemoveUntil(context, '/login', (route) => false); }); } } } catch(e){ debugPrint(e.toString()); - Future.delayed(Duration(seconds: 2), (){ + Future.delayed(const Duration(seconds: 2), (){ Navigator.pushNamedAndRemoveUntil(context, '/login', (route) => false); }); } diff --git a/lib/core/repositories/local_service.dart b/lib/core/repositories/local_service.dart new file mode 100644 index 0000000..f987037 --- /dev/null +++ b/lib/core/repositories/local_service.dart @@ -0,0 +1,8 @@ + + + +import '../service/database_service.dart'; + +abstract class LocalServiceRepo { + final DatabaseService service = DatabaseService(); +} \ No newline at end of file diff --git a/lib/core/service/database_hive.dart b/lib/core/service/database_hive.dart new file mode 100644 index 0000000..9b02db5 --- /dev/null +++ b/lib/core/service/database_hive.dart @@ -0,0 +1,67 @@ +import 'package:assecontservices/assecontservices.dart'; +import 'package:hive/hive.dart'; +import 'package:hive_flutter/adapters.dart'; + +import '../../data/model/db_model.dart'; + +export 'package:hive/hive.dart'; + +class DatabaseHive { + static final DatabaseHive _instance = DatabaseHive._internal(); + factory DatabaseHive() => _instance; + DatabaseHive._internal(); + + Box? _userBox; + //Box? _confBox; + //Box? _marcBox; + + Future initializeDatabase() async { + // Registering adapters (if needed) + if(!Hive.isAdapterRegistered(0)) Hive.registerAdapter(UserDBAdapter()); + //if(!Hive.isAdapterRegistered(1)) Hive.registerAdapter(ConfigDBAdapter()); + //if(!Hive.isAdapterRegistered(2)) Hive.registerAdapter(MarcacaoDBAdapter()); + + // Opening boxes + try { + //if(!Hive.isBoxOpen('confBox')) _confBox = await Hive.openBox('confBox'); + } catch (e) {} + try{ + if(!Hive.isBoxOpen('userBox')) _userBox = await Hive.openBox('userBox'); + } catch (e) {} + try { + //if(!Hive.isBoxOpen('marcBox')) _marcBox = await Hive.openBox('marcBox'); + } catch (e) {} + } + + Future> get userBox async { + if (_userBox == null) { + await initializeDatabase(); + } + return _userBox!; + } + +/* Future> get confBox async { + if (_confBox == null) { + await initializeDatabase(); + } + return _confBox!; + } + + Future> get marcBox async { + if (_marcBox == null) { + await initializeDatabase(); + } + return _marcBox!; + }*/ +} + +// Example data classes (if using Hive type adapters) + +enum DBTableName { + users('USERS'), + conf('CONFIG'), + marcacoes('MARCACOES'); + + final String value; + const DBTableName(this.value); +} \ No newline at end of file diff --git a/lib/core/service/database_service.dart b/lib/core/service/database_service.dart new file mode 100644 index 0000000..ad243ec --- /dev/null +++ b/lib/core/service/database_service.dart @@ -0,0 +1,76 @@ + + + +import 'database_hive.dart'; + +class DatabaseService { + final DatabaseHive _service = DatabaseHive(); + + Future> query(DBTableName table, {bool Function(T)? where}) async { + final box = await _getBox(table); + final values = box.values.cast().toList(); + if (where != null) { + return values.where(where).toList(); + } + return values; + } + + Future insert(DBTableName table, T values) async { + final box = await _getBox(table); + final key = await box.add(values); + return key; + } + + Future insertAll(DBTableName table, List values) async { + final box = await _getBox(table); + final keys = await box.addAll(values); + return keys.isNotEmpty; + } + + Future update(DBTableName table, int key, T values) async { + final box = await _getBox(table); + await box.put(key, values); + } + + Future updateWhere(DBTableName table, T values, bool Function(T) where) async { + final box = await _getBox(table); + final keys = box.values.where((v) { + return where(v as T); + }).toList(); + for (dynamic key in keys as List) { + /*if(T is MarcacaoDB){ + key = key as MarcacaoDB; + key = key.copyWith(marc: values as MarcacaoDB); + }*/ + await box.put(key.key, key); + } + } + + Future delete(DBTableName table, int key) async { + final box = await _getBox(table); + await box.delete(key); + } + + Future deleteWhere(DBTableName table, bool Function(T) where) async { + final box = await _getBox(table); + final keys = box.keys.where((key) { + final value = box.get(key) as T; + return where(value); + }).toList(); + for (final key in keys) { + await box.delete(key); + } + } + + Future> _getBox(DBTableName table) async { + switch (table) { + case DBTableName.users: + return await _service.userBox; + //case DBTableName.conf: + //return await _service.confBox; + default: + throw Exception('Unknown table'); + } + } +} + diff --git a/lib/data/local/user_local_sources.dart b/lib/data/local/user_local_sources.dart new file mode 100644 index 0000000..a06e3eb --- /dev/null +++ b/lib/data/local/user_local_sources.dart @@ -0,0 +1,72 @@ + + +import 'package:flutter/material.dart'; + +import '../../core/repositories/local_service.dart'; +import '../../core/service/database_hive.dart'; +import '../../model/model.dart'; +import '../model/db_model.dart'; + + +class UserLocalSources extends LocalServiceRepo { + + Future getUser({int? id, String? email, String? senha}) async { + List result; + if (id != null) { + result = await service.query(DBTableName.users, + where: (UserDB user) => user.funcionarioId == id + ); + } else if (email != null && senha != null) { + result = await service.query(DBTableName.users, + where: (user) => user.email == email && user.senha == senha + ); + } else { + result = await service.query(DBTableName.users); + } + + if (result.isNotEmpty) { + UsuarioPonto model = result.first.ponto; + return model; + } + return null; + } + + Future saveUser({required UsuarioPonto user}) async { + await deleteUser(); + final u = UserDB.fromPonto(user); + final result = await service.insert(DBTableName.users, u); + return result; + } + + Future saveUserTablet({required UsuarioPonto user}) async { + if(user.funcionario?.funcionarioId != null){ + final existUser = await getUser(id: user.funcionario!.funcionarioId); + if(existUser == null) { + final u = UserDB.fromPonto(user); + final result = await service.insert(DBTableName.users, u); + return result; + } + } + return 0; + } + + Future saveUserAll({required List users}) async { + try { + await deleteUser(); + final u = users.map((e) => UserDB.fromPonto(e)).toList(); + final result = await service.insertAll(DBTableName.users, u); + return result; + } catch (e) { + debugPrint(e.toString()); + } + return false; + } + + Future deleteUser({String? cpf}) async { + if(cpf != null){ + await service.deleteWhere(DBTableName.users, (v)=> v.cpf == cpf); + }else{ + await service.deleteWhere(DBTableName.users, (v)=> true); + } + } +} diff --git a/lib/data/model/db_model.dart b/lib/data/model/db_model.dart new file mode 100644 index 0000000..1b9580d --- /dev/null +++ b/lib/data/model/db_model.dart @@ -0,0 +1,151 @@ +import 'package:hive/hive.dart'; + +import '../../config.dart'; +import '../../model/model.dart'; + +part 'db_model.g.dart'; + +@HiveType(typeId: 0) +class UserDB extends HiveObject { + @HiveField(0) + String? cpf; + + @HiveField(1) + int? funcionarioId; + + @HiveField(2) + String? nome; + + @HiveField(3) + String? registro; + + @HiveField(4) + String? cargo; + + @HiveField(5) + String? foto; + + @HiveField(6) + String? email; + + @HiveField(7) + String? pis; + + @HiveField(8) + bool? permitirMarcarPontoWeb; + + @HiveField(9) + bool? permitirMarcarPonto; + + @HiveField(10) + bool? permitirMarcarPontoOffline; + + @HiveField(11) + bool? capturarGps; + + @HiveField(12) + DateTime? ultimaMarcacao; + + @HiveField(13) + int? setorId; + + @HiveField(14) + String? cnpj; + + @HiveField(15) + DateTime? dataInicial; + + @HiveField(16) + DateTime? dataFinal; + + @HiveField(17) + String? descricaoPeriodo; + + @HiveField(18) + bool? app; + + @HiveField(19) + int? databaseId; + + @HiveField(20) + String? senha; + + factory UserDB.fromPonto(UsuarioPonto values) => UserDB( + databaseId: values.databaseId, + funcionarioId: values.funcionario?.funcionarioId, + app: values.app, + nome: values.funcionario?.nome, + registro: values.funcionario?.registro, + cpf: values.funcionario?.cpf, + cargo: values.funcionario?.cargo, + email: values.funcionario?.email, + pis: values.funcionario?.pis, + foto: values.funcionario?.foto, + permitirMarcarPontoWeb: values.funcionario?.permitirMarcarPontoWeb, + permitirMarcarPonto: values.funcionario?.permitirMarcarPonto, + permitirMarcarPontoOffline: values.funcionario?.permitirMarcarPontoOffline, + capturarGps: values.funcionario?.capturarGps, + ultimaMarcacao: values.funcionario?.ultimaMarcacao, + setorId: values.funcionario?.setorId, + cnpj: values.funcionario?.cnpj, + dataFinal: values.periodo?.dataFinal, + dataInicial: values.periodo?.dataInicial, + descricaoPeriodo: values.periodo?.descricao, + senha: Config.usenha + ); + + + UsuarioPonto get ponto { + Config.usenha = senha; + return UsuarioPonto( + databaseId: databaseId, + app: app, + periodo: Periodo( + dataFinal: dataFinal, + dataInicial: dataInicial, + descricao: descricaoPeriodo + ), + funcionario: Funcionario( + funcionarioId: funcionarioId, + nome: nome, + registro: registro, + cpf: cpf, + cargo: cargo, + email: email, + pis: pis, + foto: foto, + permitirMarcarPontoWeb: permitirMarcarPontoWeb, + permitirMarcarPonto: permitirMarcarPonto, + permitirMarcarPontoOffline: permitirMarcarPontoOffline, + capturarGps: capturarGps, + ultimaMarcacao: ultimaMarcacao, + setorId: setorId, + cnpj: cnpj + ) + ); + } + + UserDB({ + this.databaseId, + this.cpf, + this.funcionarioId, + this.nome, + this.registro, + this.cargo, + this.foto, + this.email, + this.pis, + this.permitirMarcarPontoWeb, + this.permitirMarcarPonto, + this.permitirMarcarPontoOffline, + this.capturarGps, + this.ultimaMarcacao, + this.setorId, + this.cnpj, + this.dataInicial, + this.dataFinal, + this.descricaoPeriodo, + this.app, + this.senha + }); +} diff --git a/lib/data/model/db_model.g.dart b/lib/data/model/db_model.g.dart new file mode 100644 index 0000000..f108eab --- /dev/null +++ b/lib/data/model/db_model.g.dart @@ -0,0 +1,101 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'db_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class UserDBAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + UserDB read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return UserDB( + databaseId: fields[19] as int?, + cpf: fields[0] as String?, + funcionarioId: fields[1] as int?, + nome: fields[2] as String?, + registro: fields[3] as String?, + cargo: fields[4] as String?, + foto: fields[5] as String?, + email: fields[6] as String?, + pis: fields[7] as String?, + permitirMarcarPontoWeb: fields[8] as bool?, + permitirMarcarPonto: fields[9] as bool?, + permitirMarcarPontoOffline: fields[10] as bool?, + capturarGps: fields[11] as bool?, + ultimaMarcacao: fields[12] as DateTime?, + setorId: fields[13] as int?, + cnpj: fields[14] as String?, + dataInicial: fields[15] as DateTime?, + dataFinal: fields[16] as DateTime?, + descricaoPeriodo: fields[17] as String?, + app: fields[18] as bool?, + senha: fields[20] as String?, + ); + } + + @override + void write(BinaryWriter writer, UserDB obj) { + writer + ..writeByte(21) + ..writeByte(0) + ..write(obj.cpf) + ..writeByte(1) + ..write(obj.funcionarioId) + ..writeByte(2) + ..write(obj.nome) + ..writeByte(3) + ..write(obj.registro) + ..writeByte(4) + ..write(obj.cargo) + ..writeByte(5) + ..write(obj.foto) + ..writeByte(6) + ..write(obj.email) + ..writeByte(7) + ..write(obj.pis) + ..writeByte(8) + ..write(obj.permitirMarcarPontoWeb) + ..writeByte(9) + ..write(obj.permitirMarcarPonto) + ..writeByte(10) + ..write(obj.permitirMarcarPontoOffline) + ..writeByte(11) + ..write(obj.capturarGps) + ..writeByte(12) + ..write(obj.ultimaMarcacao) + ..writeByte(13) + ..write(obj.setorId) + ..writeByte(14) + ..write(obj.cnpj) + ..writeByte(15) + ..write(obj.dataInicial) + ..writeByte(16) + ..write(obj.dataFinal) + ..writeByte(17) + ..write(obj.descricaoPeriodo) + ..writeByte(18) + ..write(obj.app) + ..writeByte(19) + ..write(obj.databaseId) + ..writeByte(20) + ..write(obj.senha); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UserDBAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/enums/enums.dart b/lib/enums/enums.dart index 76bdca4..6355252 100644 --- a/lib/enums/enums.dart +++ b/lib/enums/enums.dart @@ -5,4 +5,5 @@ export 'marcacao_offline_status.dart'; export 'config_backup.dart'; export 'shared_tipes.dart'; export 'obrigacao_tipo.dart'; -export 'status_timeline.dart'; \ No newline at end of file +export 'status_timeline.dart'; +export 'regime_empresa.dart'; \ No newline at end of file diff --git a/lib/enums/holerite_tipo.dart b/lib/enums/holerite_tipo.dart new file mode 100644 index 0000000..0fe57aa --- /dev/null +++ b/lib/enums/holerite_tipo.dart @@ -0,0 +1,73 @@ + + +enum HoleriteTipo +{ + Nenhum(0), + Salario(1), + ProLabore(2), + Adiantamento(3), + PrimeiraDecimo(4), + SegundaDecimo(5), + PLR(6), + Abono(7), + Domestica(8), + ReciboComplementar(9); + + final int value; + + String get toName { + switch(value) { + case 0: + return 'Recibo'; + case 1: + return 'Recibo de Salário'; + case 2: + return 'Recibo de Pró Labore'; + case 3: + return 'Recibo de Adiantamento'; + case 4: + return 'Recibo de 1ª Parcela 13º Salário'; + case 5: + return 'Recibo de 2ª Parcela 13º Salário'; + case 6: + return 'Participação Remunerada nos Resultados'; + case 7: + return 'Recibo de Abono'; + case 8: + return 'Recibo de Domestica'; + case 9: + return 'Recibo Complementar'; + default: + return 'Recibo de Salário'; + } + } + + static HoleriteTipo getEnum(int? x) { + switch(x) { + case 0: + return Nenhum; + case 1: + return Salario; + case 2: + return ProLabore; + case 3: + return Adiantamento; + case 4: + return PrimeiraDecimo; + case 5: + return SegundaDecimo; + case 6: + return PLR; + case 7: + return Abono; + case 8: + return Domestica; + case 9: + return ReciboComplementar; + default: + return Nenhum; + } + } + + const HoleriteTipo(this.value); +} \ No newline at end of file diff --git a/lib/enums/obrigacao_status.dart b/lib/enums/obrigacao_status.dart new file mode 100644 index 0000000..c98f53f --- /dev/null +++ b/lib/enums/obrigacao_status.dart @@ -0,0 +1,23 @@ +enum ObrigacaoStatus { + Nenhum(-1, "Nenhum"), + EmAberto(0, "Em Aberto"), + Concluido(1, "Concluído"), + SemMovimentoNaoAvaliado(2, "Sem Movimento Não Avaliado"), + SemMovimentoRejeitado(3, "Sem Movimento Rejeitado"), + Provisorio(4, "Provisório"), + SemMovimento(5, "Sem Movimento"), + AguardandoAprovacao(6, "Aguardando Aprovação"), + ArquivoComDivergencia(7, "Arquivo com divergência"); + + final int value; + final String description; + + const ObrigacaoStatus(this.value, this.description); + + static ObrigacaoStatus fromInt(int value) { + return ObrigacaoStatus.values.firstWhere( + (status) => status.value == value, + orElse: () => Nenhum, + ); + } +} diff --git a/lib/enums/regime_empresa.dart b/lib/enums/regime_empresa.dart new file mode 100644 index 0000000..3b1630e --- /dev/null +++ b/lib/enums/regime_empresa.dart @@ -0,0 +1,35 @@ + + +enum RegimeEmpresa { + Outras(0), + LucroPresumido(1), + LucroReal(2), + Simples(3), + Imunes(4), + Mei(5), + Isenta(6); + + static RegimeEmpresa getEnum(int? x) { + switch(x) { + case 0: + return Outras; + case 1: + return LucroPresumido; + case 2: + return LucroReal; + case 3: + return Simples; + case 4: + return Imunes; + case 5: + return Mei; + case 6: + return Isenta; + default: + return Outras; + } + } + + final int value; + const RegimeEmpresa(this.value); +} \ No newline at end of file diff --git a/lib/enums/status_timeline.dart b/lib/enums/status_timeline.dart index 14b4f5d..5cbd9b2 100644 --- a/lib/enums/status_timeline.dart +++ b/lib/enums/status_timeline.dart @@ -3,11 +3,10 @@ import '../model/model.dart'; enum StatusTimeLine{ + Nenhum(0), Disponibilizado(1), - Vizualizado(4), Email(2), - Sms(3), - Nenhum(0); + Vizualizado(3); String img(){ switch(value){ @@ -15,9 +14,8 @@ enum StatusTimeLine{ return 'assets/imagens/dispo.png'; case 2: return 'assets/imagens/email.png'; + //case 3: return 'assets/imagens/sms.png'; case 3: - return 'assets/imagens/sms.png'; - case 4: return 'assets/imagens/visualizado.png'; default: return 'assets/imagens/dispo.png'; @@ -27,9 +25,7 @@ enum StatusTimeLine{ static StatusTimeLine statusTimeLine(ObrigacoesDetalhesModel obrg) { if(obrg.visualizadoEm != null){ return StatusTimeLine.Vizualizado; - }else if(obrg.smsEnviadoEm != null){ - return StatusTimeLine.Sms; - }else if(obrg.emailEnviadoEm != null){ + } else if(obrg.emailEnviadoEm != null){ return StatusTimeLine.Email; }else if(obrg.disponivelEm != null){ return StatusTimeLine.Disponibilizado; diff --git a/lib/helper/conn.dart b/lib/helper/conn.dart index 4484c7d..34610fb 100644 --- a/lib/helper/conn.dart +++ b/lib/helper/conn.dart @@ -31,7 +31,7 @@ class ConnectionStatusSingleton { if (Config.conf.nomeApp == VersaoApp.PontoApp || Config.conf.nomeApp == VersaoApp.PontoTablet) { Timer.periodic(const Duration(minutes: 1), (T) async { - debugPrint('Timer ${T.tick} ' + hasConnection.toString()); + debugPrint('Timer ${T.tick} $hasConnection'); if (hasConnection) { await RegistroManger().enviarMarcacoes(); } @@ -48,7 +48,7 @@ class ConnectionStatusSingleton { connectionChangeController.close(); } - void _connectionChange(ConnectivityResult result) { + void _connectionChange(List result) { checkConnection(); } diff --git a/lib/helper/db_ponto.dart b/lib/helper/db_ponto.dart index b8849d8..3f4ab09 100644 --- a/lib/helper/db_ponto.dart +++ b/lib/helper/db_ponto.dart @@ -19,8 +19,8 @@ class DBPonto{ } Future init() async { - versao = await getVersion(); try { + versao = await getVersion(); db; } catch (e) {} } @@ -165,21 +165,34 @@ class DBPonto{ Future inicializarDB(int v, {bool init = false}) async { if(kIsWeb){ var factory = databaseFactoryFfiWeb; - Database db = await factory.openDatabase(Config.conf.nomeApp == VersaoApp.PontoApp ? "pontoapp2.db" : "pontotab.db", + Database db = await factory.openDatabase( + Config.conf.nomeApp == VersaoApp.PontoApp ? "pontoapp2.db" : "pontotab.db", options: OpenDatabaseOptions(onCreate: _criardb, version: v, onUpgrade: _onUpgrade)); return db; }else { - final camilhodb = Config.isWin ? await win.databaseFactoryFfi.getDatabasesPath() : await getDatabasesPath(); - final localdb = join(camilhodb, Config.conf.nomeApp == VersaoApp.PontoApp ? "pontoapp2.db" : "pontotab.db"); + final camilhodb = Config.isWin + ? await win.databaseFactoryFfi.getDatabasesPath() + : await getDatabasesPath(); + + final localdb = join(camilhodb, + Config.conf.nomeApp == VersaoApp.PontoApp ? "pontoapp2.db" : "pontotab.db" + ); if(Config.isWin){ DatabaseFactory databaseFactory = win.databaseFactoryFfi; Database db = await databaseFactory.openDatabase(localdb, - options: OpenDatabaseOptions(onCreate: _criardb, version: v, onUpgrade: init ? null : _onUpgrade)); + options: OpenDatabaseOptions( + onCreate: _criardb, version: v, + onUpgrade: init ? null : _onUpgrade + ) + ); return db; } else{ - Database db = await openDatabase(localdb, version: v, onCreate: _criardb , onUpgrade: init ? null : _onUpgrade); + Database db = await openDatabase( + localdb, version: v, onCreate: _criardb , + onUpgrade: init ? null : _onUpgrade + ); return db; } } diff --git a/lib/helper/helper.dart b/lib/helper/helper.dart index 55df559..00a216a 100644 --- a/lib/helper/helper.dart +++ b/lib/helper/helper.dart @@ -1,4 +1,4 @@ export 'db_ponto.dart'; export 'conn.dart'; -export 'validators.dart'; \ No newline at end of file + diff --git a/lib/helper/validators.dart b/lib/helper/validators.dart deleted file mode 100644 index 122dc21..0000000 --- a/lib/helper/validators.dart +++ /dev/null @@ -1,5 +0,0 @@ -bool emailValid(String email){ - final RegExp regex = RegExp( - r"^(([^<>()[\]\\.,;:\s@\']+(\.[^<>()[\]\\.,;:\s@\']+)*)|(\'.+\'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"); - return regex.hasMatch(email.trim().replaceAll(' ', '')); -} diff --git a/lib/model/asseweb/obrigacoes/obrigacoes.dart b/lib/model/asseweb/obrigacoes/obrigacoes.dart index 058d3fe..4d7d04a 100644 --- a/lib/model/asseweb/obrigacoes/obrigacoes.dart +++ b/lib/model/asseweb/obrigacoes/obrigacoes.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import '../../../enums/enums.dart'; +import '../../../enums/obrigacao_status.dart'; import '../../../utils/utils.dart'; class ObrigacaoModel { @@ -13,7 +14,7 @@ class ObrigacaoModel { this.descricao, this.responsavel, this.cliente, - this.status, + this.status = ObrigacaoStatus.Nenhum, this.vencimento, this.prazo, this.concluidoEm, @@ -49,7 +50,7 @@ class ObrigacaoModel { String? descricao; String? responsavel; int? cliente; - int? status; + ObrigacaoStatus status; DateTime? vencimento; DateTime? prazo; DateTime? concluidoEm; @@ -89,7 +90,7 @@ class ObrigacaoModel { descricao: json["descricao"], responsavel: json["responsavel"], cliente: json["cliente"], - status: json["status"], + status: ObrigacaoStatus.fromInt( int.tryParse(json["status"].toString()) ?? -1 ), vencimento: Validacoes.stringToDataBr(json["vencimento"].toString()), prazo: Validacoes.stringToDataBr(json["prazo"].toString()), concluidoEm: Validacoes.stringToDataBr(json["concluidoEm"].toString()), @@ -126,7 +127,7 @@ class ObrigacaoModel { "descricao": descricao, "responsavel": responsavel, "cliente": cliente, - "status": status, + "status": status.value, "vencimento": vencimento, "prazo": prazo, "concluidoEm": concluidoEm, diff --git a/lib/model/asseweb/obrigacoes/obrigacoes_detalhes.dart b/lib/model/asseweb/obrigacoes/obrigacoes_detalhes.dart index 79e8bb0..64f3398 100644 --- a/lib/model/asseweb/obrigacoes/obrigacoes_detalhes.dart +++ b/lib/model/asseweb/obrigacoes/obrigacoes_detalhes.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import '../../../enums/enums.dart'; +import '../../../enums/obrigacao_status.dart'; import '../../../utils/utils.dart'; @@ -20,6 +21,7 @@ class ObrigacoesDetalhesModel { this.emailEnviadoEm, this.smsEnviadoEm, this.ativo, + this.status = ObrigacaoStatus.Nenhum, }); String? obrigacaoDescricao; @@ -37,7 +39,7 @@ class ObrigacoesDetalhesModel { DateTime? smsEnviadoEm; StatusTimeLine? statusTimeLine; bool? ativo; - + ObrigacaoStatus status; factory ObrigacoesDetalhesModel.fromJson(String str) => ObrigacoesDetalhesModel.fromMap(json.decode(str)); @@ -58,6 +60,7 @@ class ObrigacoesDetalhesModel { emailEnviadoEm: json["emailEnviadoEm"] == null ? null : Validacoes.stringToDataBr(json["emailEnviadoEm"].toString()), smsEnviadoEm: json["smsEnviadoEm"] == null ? null : Validacoes.stringToDataBr(json["smsEnviadoEm"].toString()), ativo: json["ativo"], + status: ObrigacaoStatus.fromInt(int.tryParse(json["status"].toString()) ?? -1) , ); Map toMap() => { @@ -75,5 +78,6 @@ class ObrigacoesDetalhesModel { "emailEnviadoEm": emailEnviadoEm, "smsEnviadoEm": smsEnviadoEm, "ativo": ativo, + 'status': status.value }; } diff --git a/lib/model/asseweb/obrigacoes/obrigacoes_home.dart b/lib/model/asseweb/obrigacoes/obrigacoes_home.dart index e7339e9..22d48d9 100644 --- a/lib/model/asseweb/obrigacoes/obrigacoes_home.dart +++ b/lib/model/asseweb/obrigacoes/obrigacoes_home.dart @@ -1,6 +1,8 @@ import 'dart:convert'; -import 'package:assecontservices/assecontservices.dart'; + +import '../../../enums/obrigacao_status.dart'; +import '../../../utils/validacoes.dart'; class ObrigacoesHomeModel { ObrigacoesHomeModel({ @@ -55,12 +57,14 @@ class ObrigacaoClientePeriodo { this.deadLine, this.finishedIn, this.completedBy, + this.status = ObrigacaoStatus.Nenhum, }); int? id; DateTime? deadLine; DateTime? finishedIn; int? completedBy; + ObrigacaoStatus status; factory ObrigacaoClientePeriodo.fromJson(String str) => ObrigacaoClientePeriodo.fromMap(json.decode(str)); @@ -69,6 +73,7 @@ class ObrigacaoClientePeriodo { deadLine: json["deadLine"] == null ? null : Validacoes.stringToDataBr( json["deadLine"].toString() ), finishedIn: json["finishedIn"] == null ? null : DateTime.parse(json["finishedIn"]), completedBy: json["completedBy"], + status: ObrigacaoStatus.fromInt( int.tryParse(json["completedBy"].toString()) ?? -1 ), ); } \ No newline at end of file diff --git a/lib/model/asseweb/usuario/usuario.dart b/lib/model/asseweb/usuario/usuario.dart index 4c8a5e7..83deef2 100644 --- a/lib/model/asseweb/usuario/usuario.dart +++ b/lib/model/asseweb/usuario/usuario.dart @@ -4,32 +4,28 @@ import 'dart:convert'; +import '../../../enums/regime_empresa.dart'; +import '../contatos/contatos.dart'; + class UsuarioAsseweb { - UsuarioAsseweb({ + const UsuarioAsseweb({ this.login, this.token, }); - Login? login; - String? token; + final Login? login; + final String? token; factory UsuarioAsseweb.fromJson(String str) => UsuarioAsseweb.fromMap(json.decode(str)); - String toJson() => json.encode(toMap()); - factory UsuarioAsseweb.fromMap(Map json) => UsuarioAsseweb( login: json["login"] == null ? null : Login.fromMap(json["login"]), token: json["token"], ); - - Map toMap() => { - "login": login?.toMap(), - "token": token, - }; } class Login { - Login({ + const Login({ this.id, this.name, this.email, @@ -46,25 +42,23 @@ class Login { this.companies, }); - int? id; - String? name; - String? email; - String? phoneNumber; - String? ddd; - String? password; - DateTime? lastAcess; - DateTime? birthday; - String? version; - dynamic resignation; - String? uid; - bool? master; - int? lastCompanyId; - List? companies; + final int? id; + final String? name; + final String? email; + final String? phoneNumber; + final String? ddd; + final String? password; + final DateTime? lastAcess; + final DateTime? birthday; + final String? version; + final DateTime? resignation; + final String? uid; + final bool? master; + final int? lastCompanyId; + final List? companies; factory Login.fromJson(String str) => Login.fromMap(json.decode(str)); - String toJson() => json.encode(toMap()); - factory Login.fromMap(Map json) => Login( id: json["id"], name: json["name"], @@ -82,60 +76,39 @@ class Login { companies: json["companies"] == null ? [] : List.from(json["companies"]!.map((x) => Company.fromMap(x))), ); - Map toMap() => { - "id": id, - "name": name, - "email": email, - "phoneNumber": phoneNumber, - "ddd": ddd, - "password": password, - "lastAcess": lastAcess?.toIso8601String(), - "birthday": birthday, - "version": version, - "resignation": resignation, - "uid": uid, - "master": master, - "lastCompanyId": lastCompanyId, - "companies": companies == null ? [] : List.from(companies!.map((x) => x.toMap())), - }; } class Company { - Company({ + const Company({ this.id, this.number, this.name, this.fantasyName, + this.inicio, this.cnpj, this.conntacts, + this.regime = RegimeEmpresa.Outras }); - int? id; - int? number; - String? name; - String? fantasyName; - String? cnpj; - dynamic conntacts; + final int? id; + final int? number; + final String? name; + final String? fantasyName; + final String? cnpj; + final DateTime? inicio; + final List? conntacts; + final RegimeEmpresa regime; factory Company.fromJson(String str) => Company.fromMap(json.decode(str)); - String toJson() => json.encode(toMap()); - factory Company.fromMap(Map json) => Company( id: json["id"], + regime: RegimeEmpresa.getEnum(json["classificacao"]), + inicio: json["inicio"] == null ? null : DateTime.parse(json["inicio"]), number: json["number"], name: json["name"], fantasyName: json["fantasyName"], cnpj: json["cnpj"], - conntacts: json["conntacts"], + conntacts: json["conntacts"] == null ? [] : List.from(json["conntacts"]!.map((x) => ContatosAsseweb.fromMap(x))), ); - - Map toMap() => { - "id": id, - "number": number, - "name": name, - "fantasyName": fantasyName, - "cnpj": cnpj, - "conntacts": conntacts, - }; } diff --git a/lib/model/configuracoes.dart b/lib/model/configuracoes.dart index ba99b1c..d87e943 100644 --- a/lib/model/configuracoes.dart +++ b/lib/model/configuracoes.dart @@ -2,25 +2,29 @@ import '../enums/enums.dart'; class ConfiguracoesModel { - String? apiAsseweb; - String? apiHolerite; - String? apiHoleriteEmail; - String? apiAsseponto; - String? apiAssepontoNova; - String? apiEspelho; - String? apiBoletos; - String? androidAppId ; - String? iosAppId; - String? iosAppIdNum ; + final String? apiAsseweb; + final String? apiHolerite; + final String? apiHoleriteEmail; + final String? apiAsseponto; + final String? apiAssepontoNova; + final String? apiEspelho; + final String? apiBoletos; + final String? apiRelatorioFechamento; + final String? apiLeituraArquivos; + final String? androidAppId ; + final String? iosAppId; + final String? iosAppIdNum ; - VersaoApp? nomeApp; + final VersaoApp? nomeApp; - ConfiguracoesModel( + const ConfiguracoesModel( {this.apiAsseweb, this.apiHolerite, this.apiHoleriteEmail, this.apiAsseponto, this.apiAssepontoNova, + this.apiRelatorioFechamento, + this.apiLeituraArquivos, this.apiBoletos, this.apiEspelho, this.androidAppId, diff --git a/lib/model/holerite/holerite/holerite.dart b/lib/model/holerite/holerite/holerite.dart index 7115904..7a0cd85 100644 --- a/lib/model/holerite/holerite/holerite.dart +++ b/lib/model/holerite/holerite/holerite.dart @@ -1,199 +1,521 @@ -import 'dart:convert'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:intl/intl.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; +import 'package:assecontservices/assecontservices.dart'; + +import '../../../enums/holerite_tipo.dart'; class ChartPizza { final String desc; final double valor; - ChartPizza(this.desc, this.valor); + const ChartPizza(this.desc, this.valor); } class ChartColum { final int ind; final String data; final double valor; - ChartColum(this.ind, this.data, this.valor); + const ChartColum(this.ind, this.data, this.valor); } -// To parse this JSON data, do -// -// final holeriteModel = holeriteModelFromMap(jsonString); - class HoleriteModel { - HoleriteModel({ - this.holeriteTipo, - this.holeriteTipoCod, - this.vencimentos, - this.descontos, - this.liquido, - this.dataCriacao, - this.dataVisualizacao, - this.historicos, + final List? data; + final MetaHolerite? meta; + + const HoleriteModel({ + this.data, + this.meta, }); - final String? holeriteTipo; - final int? holeriteTipoCod; - final double? vencimentos; - final double? descontos; - final double? liquido; - final String? dataCriacao; - final String? dataVisualizacao; - final List? historicos; + factory HoleriteModel.fromMap(Map json) => HoleriteModel( + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => DatumHolerite.fromMap(x))), + meta: json["meta"] == null ? null : MetaHolerite.fromMap(json["meta"]), + ); - factory HoleriteModel.fromJson(String str) => HoleriteModel.fromMap(json.decode(str)); + Map toMap() => { + "data": data == null ? [] : List.from(data!.map((x) => x.toMap())), + "meta": meta?.toMap(), + }; +} +class DatumHolerite { + final int? id; + final DatumAttributes? attributes; - String toJson() => json.encode(toMap()); + const DatumHolerite({ + this.id, + this.attributes, + }); - factory HoleriteModel.fromMap(Map json) => HoleriteModel( - holeriteTipo: json["holeriteTipo"], - holeriteTipoCod: json["HoleriteTipoId"] ?? competenciaCodigo(json["holeriteTipo"]), - vencimentos: json["vencimentos"] == null ? null : double.tryParse(json["vencimentos"].toString().replaceAll('.', '').replaceAll(',', '.')), - descontos: json["descontos"] == null ? null : double.tryParse(json["descontos"].toString().replaceAll('.', '').replaceAll(',', '.')), - liquido: json["liquido"] == null ? null : double.tryParse(json["liquido"].toString().replaceAll('.', '').replaceAll(',', '.')), - dataCriacao: json["dataCriacao"], - dataVisualizacao: json["dataVisualizacao"], - historicos: json["historicos"] == null ? null : List.from(json["historicos"].map((x) => Historico.fromMap(x))), + factory DatumHolerite.fromMap(Map json) => DatumHolerite( + id: json["id"], + attributes: json["attributes"] == null ? null : DatumAttributes.fromMap(json["attributes"]), ); Map toMap() => { - "holeriteTipo": holeriteTipo, - "holeriteTipoCod": holeriteTipoCod, - "vencimentos": vencimentos, - "descontos": descontos, - "liquido": liquido, - "dataCriacao": dataCriacao, - "dataVisualizacao": dataVisualizacao, - "historicos": historicos == null ? null : List.from(historicos!.map((x) => x.toMap())), + "id": id, + "attributes": attributes?.toMap(), }; - static int competenciaCodigo(String? comp){ - switch (comp) { - case "Salário": - return 1; - case "Pró Labore": - return 2; - case "Adiantamento": - return 3; - case "1ª Parcela 13º Salário": - return 4; - case "2ª Parcela 13º Salário": - return 5; - case "PLR": - return 6; - case "Abono": - return 7; - case "Salário Domestica": - return 8; - case "1ª Parcela 13º Domestica": - return 9; - case "2ª Parcela 13º Domestica": - return 10; - default: - return 1; - } + ChartColum chartColum(){ + return ChartColum(id ?? 0, + '${attributes?.competence ?? ''}\n${attributes?.type.toName + .replaceAll('Recibo de ', '').replaceAll('13º Salário', '13º') + .replaceAll('Participação Remunerada nos Resultados', 'PLR') ?? ''}', + attributes?.data?.funcionarioResumo?.liquido ?? 0 + ); } +} - List toColum(List list, BuildContext context){ - int i = 0; - List listmap = []; - if(list.isNotEmpty){ - while(i < ((list.length) > (kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? 6 : 3) ? - (kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone? 6 : 3) : (list.length )) ){ - listmap.add(ChartColum(i, list[i].competencia!, list[i].liquido! ),); - i++; - } - } - listmap.sort((a, b) => b.ind.compareTo(a.ind)); - return listmap; - } +class DatumAttributes { + final String? cpf; + final String? name; + final String? office; + final AttributesData? data; + final DateTime? createdAt; + final DateTime? updatedAt; + final HoleriteTipo type; + final String? month; + final String? year; + final DateTime? createDate; + final String? registration; + final String? competence; + final dynamic rg; + final dynamic phone; + final dynamic baseSalary; + final dynamic agencyAccount; + final dynamic email; + final dynamic sindicate; + final dynamic depIr; + final dynamic depSf; + final dynamic ctps; + final String? uploadId; + final String? importingUser; + final String? sheetType; + final bool? isSigned; + final DateTime? signedAt; + final FileClass? file; + + const DatumAttributes({ + this.cpf, + this.name, + this.office, + this.data, + this.createdAt, + this.updatedAt, + this.type = HoleriteTipo.Nenhum, + this.month, + this.year, + this.createDate, + this.registration, + this.competence, + this.rg, + this.phone, + this.baseSalary, + this.agencyAccount, + this.email, + this.sindicate, + this.depIr, + this.depSf, + this.ctps, + this.uploadId, + this.importingUser, + this.sheetType, + this.isSigned, + this.signedAt, + this.file, + }); + + factory DatumAttributes.fromMap(Map json) => DatumAttributes( + cpf: json["cpf"], + name: json["name"], + office: json["office"], + data: json["data"] == null ? null : AttributesData.fromMap(json["data"]), + createdAt: json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]), + updatedAt: json["updatedAt"] == null ? null : DateTime.parse(json["updatedAt"]), + type: HoleriteTipo.getEnum(int.tryParse(json["type"])), + month: json["month"], + year: json["year"], + createDate: json["create_date"] == null ? null : DateTime.parse(json["create_date"]), + registration: json["registration"], + competence: json["competence"], + rg: json["rg"], + phone: json["phone"], + baseSalary: json["baseSalary"], + agencyAccount: json["agencyAccount"], + email: json["email"], + sindicate: json["sindicate"], + depIr: json["depIr"], + depSf: json["depSf"], + ctps: json["ctps"], + uploadId: json["uploadId"], + importingUser: json["importingUser"], + sheetType: json["sheetType"], + isSigned: json["isSigned"], + signedAt: json["signedAt"] == null ? null : DateTime.parse(json["signedAt"]), + file: json["file"] == null ? null : FileClass.fromMap(json["file"]), + ); + + Map toMap() => { + "cpf": cpf, + "name": name, + "office": office, + "data": data?.toMap(), + "createdAt": createdAt?.toIso8601String(), + "updatedAt": updatedAt?.toIso8601String(), + "type": type, + "month": month, + "year": year, + "create_date": createDate?.toIso8601String(), + "registration": registration, + "competence": competence, + "rg": rg, + "phone": phone, + "baseSalary": baseSalary, + "agencyAccount": agencyAccount, + "email": email, + "sindicate": sindicate, + "depIr": depIr, + "depSf": depSf, + "ctps": ctps, + "uploadId": uploadId, + "importingUser": importingUser, + "sheetType": sheetType, + "isSigned": isSigned, + "signedAt": signedAt?.toIso8601String(), + "file": file?.toMap(), + }; } -class Historico { - Historico({ - this.competencia, - this.liquido, +class AttributesData { + final int? cbo; + final String? cpf; + final String? reg; + final bool? erro; + final String? nome; + final dynamic chapa; + final String? cnpjcpf; + final String? admissao; + final List? rawLines; + final int? setorLocal; + final List? errorFields; + final dynamic mensagemErro; + final FuncionarioResumo? funcionarioResumo; + final List? funcionarioEventos; + + const AttributesData({ + this.cbo, + this.cpf, + this.reg, + this.erro, + this.nome, + this.chapa, + this.cnpjcpf, + this.admissao, + this.rawLines, + this.setorLocal, + this.errorFields, + this.mensagemErro, + this.funcionarioResumo, + this.funcionarioEventos, }); - String? competencia; - double? liquido; + factory AttributesData.fromMap(Map json) => AttributesData( + cbo: json["cbo"], + cpf: json["cpf"], + reg: json["reg"], + erro: json["erro"], + nome: json["nome"], + chapa: json["chapa"], + cnpjcpf: json["cnpjcpf"], + admissao: json["admissao"], + rawLines: json["rawLines"] == null ? [] : List.from(json["rawLines"]!.map((x) => x)), + setorLocal: json["setorLocal"], + errorFields: json["errorFields"] == null ? [] : List.from(json["errorFields"]!.map((x) => x)), + mensagemErro: json["mensagemErro"], + funcionarioResumo: json["funcionarioResumo"] == null ? null : FuncionarioResumo.fromMap(json["funcionarioResumo"]), + funcionarioEventos: json["funcionarioEventos"] == null ? [] : List.from(json["funcionarioEventos"]!.map((x) => FuncionarioEvento.fromMap(x))), + ); - factory Historico.fromJson(String str) => Historico.fromMap(json.decode(str)); + Map toMap() => { + "cbo": cbo, + "cpf": cpf, + "reg": reg, + "erro": erro, + "nome": nome, + "chapa": chapa, + "cnpjcpf": cnpjcpf, + "admissao": admissao, + "rawLines": rawLines == null ? [] : List.from(rawLines!.map((x) => x)), + "setorLocal": setorLocal, + "errorFields": errorFields == null ? [] : List.from(errorFields!.map((x) => x)), + "mensagemErro": mensagemErro, + "funcionarioResumo": funcionarioResumo?.toMap(), + "funcionarioEventos": funcionarioEventos == null ? [] : List.from(funcionarioEventos!.map((x) => x.toMap())), + }; +} - String toJson() => json.encode(toMap()); +class FuncionarioEvento { + final String? codigo; + final String? desconto; + final String? descricao; + final String? referencia; + final String? vencimento; - factory Historico.fromMap(Map json) { - String _data = ''; - List s = json["competencia"].toString().split("/"); - if(s.length == 3){ - _data = DateFormat("MMMM y", 'Pt-Br').format( - DateTime(int.parse(s[2].toString().split(' ').first), int.parse(s[1]), int.parse(s[0]) )).toUpperCase(); - } - return Historico( - competencia: _data, - liquido: json["liquido"] == null ? null : double.tryParse(json["liquido"].toString().replaceAll('.', '').replaceAll(',', '.')), - ); - } + const FuncionarioEvento({ + this.codigo, + this.desconto, + this.descricao, + this.referencia, + this.vencimento, + }); + + factory FuncionarioEvento.fromMap(Map json) => FuncionarioEvento( + codigo: json["codigo"]?.toString(), + desconto: json["desconto"]?.toString(), + descricao: json["descricao"]?.toString(), + referencia: json["referencia"]?.toString(), + vencimento: json["vencimento"]?.toString(), + ); Map toMap() => { - "competencia": competencia, - "liquido": liquido, + "codigo": codigo, + "desconto": desconto, + "descricao": descricao, + "referencia": referencia, + "vencimento": vencimento, }; +} + +class FuncionarioResumo { + final String? banco; + final String? conta; + final String? frase; + final String? baseIr; + final String? funcao; + final String? credito; + final String? divisao; + final double? liquido; + final String? mesFgts; + final String? baseFgts; + final String? competencia; + final double? salarioBase; + final double? totalDescontos; + final double? salContribuicao; + final double? totalVencimentos; + + const FuncionarioResumo({ + this.banco, + this.conta, + this.frase, + this.baseIr, + this.funcao, + this.credito, + this.divisao, + this.liquido, + this.mesFgts, + this.baseFgts, + this.competencia, + this.salarioBase, + this.totalDescontos, + this.salContribuicao, + this.totalVencimentos, + }); + factory FuncionarioResumo.fromMap(Map json) => FuncionarioResumo( + banco: json["banco"], + conta: json["conta"], + frase: json["frase"], + baseIr: json["baseIR"], + funcao: json["funcao"], + credito: json["credito"], + divisao: json["divisao"], + liquido: json["liquido"]?.toString().toDouble(), + mesFgts: json["mesFGTS"], + baseFgts: json["baseFGTS"], + competencia: json["competencia"], + salarioBase: json["salarioBase"]?.toString().toDouble(), + totalDescontos: json["totalDescontos"]?.toString().toDouble(), + salContribuicao: json["salContribuicao"]?.toString().toDouble(), + totalVencimentos: json["totalVencimentos"]?.toString().toDouble(), + ); + + Map toMap() => { + "banco": banco, + "conta": conta, + "frase": frase, + "baseIR": baseIr, + "funcao": funcao, + "credito": credito, + "divisao": divisao, + "liquido": liquido, + "mesFGTS": mesFgts, + "baseFGTS": baseFgts, + "competencia": competencia, + "salarioBase": salarioBase, + "totalDescontos": totalDescontos, + "salContribuicao": salContribuicao, + "totalVencimentos": totalVencimentos, + }; } +class FileClass { + final FileData? data; + + const FileClass({ + this.data, + }); + + factory FileClass.fromMap(Map json) => FileClass( + data: json["data"] == null ? null : FileData.fromMap(json["data"]), + ); + + Map toMap() => { + "data": data?.toMap(), + }; +} -// To parse this JSON data, do -// -// final competenciasModel = competenciasModelFromMap(jsonString); +class FileData { + final int? id; + final DataAttributes? attributes; -class CompetenciasModel { - CompetenciasModel({ + const FileData({ this.id, - this.mes, - this.ano, - this.descricao, - this.data, + this.attributes, }); - int? id; - int? mes; - int? ano; - DateTime? data; - String? descricao; - - List fromList(List json) { - if(json.isNotEmpty){ - List list = json.map((e) => CompetenciasModel?.fromString(e)).toList(); - try{ - list.sort((a,b) => b.data!.compareTo(a.data!) ); - }catch(e){ - debugPrint(e.toString()); - } - return list; - }else{ - return []; - } - } + factory FileData.fromMap(Map json) => FileData( + id: json["id"], + attributes: json["attributes"] == null ? null : DataAttributes.fromMap(json["attributes"]), + ); - factory CompetenciasModel.fromString(Map json) { - List _data = json['comp'].split("/"); - return CompetenciasModel( - id: int.tryParse(json['idUser'].toString()), - mes: int.tryParse(_data.first), - ano: int.tryParse(_data.last), - data: DateTime(int.tryParse(_data.last) ?? 0, int.tryParse(_data.first) ?? 0), - descricao: DateFormat("MMMM yyyy", 'Pt-Br').format( - DateTime(int.tryParse(_data.last) ?? 0, int.tryParse(_data.first) ?? 0)).toUpperCase(), - ); - } + Map toMap() => { + "id": id, + "attributes": attributes?.toMap(), + }; +} + +class DataAttributes { + final String? name; + final String? alternativeText; + final String? caption; + final dynamic width; + final dynamic height; + final dynamic formats; + final String? hash; + final String? ext; + final String? mime; + final double? size; + final String? url; + final dynamic previewUrl; + final String? provider; + final dynamic providerMetadata; + final String? folderPath; + final DateTime? createdAt; + final DateTime? updatedAt; + + const DataAttributes({ + this.name, + this.alternativeText, + this.caption, + this.width, + this.height, + this.formats, + this.hash, + this.ext, + this.mime, + this.size, + this.url, + this.previewUrl, + this.provider, + this.providerMetadata, + this.folderPath, + this.createdAt, + this.updatedAt, + }); + + factory DataAttributes.fromMap(Map json) => DataAttributes( + name: json["name"], + alternativeText: json["alternativeText"], + caption: json["caption"], + width: json["width"], + height: json["height"], + formats: json["formats"], + hash: json["hash"], + ext: json["ext"], + mime: json["mime"], + size: json["size"]?.toString().toDouble(), + url: json["url"], + previewUrl: json["previewUrl"], + provider: json["provider"], + providerMetadata: json["provider_metadata"], + folderPath: json["folderPath"], + createdAt: json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]), + updatedAt: json["updatedAt"] == null ? null : DateTime.parse(json["updatedAt"]), + ); + + Map toMap() => { + "name": name, + "alternativeText": alternativeText, + "caption": caption, + "width": width, + "height": height, + "formats": formats, + "hash": hash, + "ext": ext, + "mime": mime, + "size": size, + "url": url, + "previewUrl": previewUrl, + "provider": provider, + "provider_metadata": providerMetadata, + "folderPath": folderPath, + "createdAt": createdAt?.toIso8601String(), + "updatedAt": updatedAt?.toIso8601String(), + }; +} + +class MetaHolerite { + final PaginationHolerite? pagination; + + const MetaHolerite({ + this.pagination, + }); + + factory MetaHolerite.fromMap(Map json) => MetaHolerite( + pagination: json["pagination"] == null ? null : PaginationHolerite.fromMap(json["pagination"]), + ); + + Map toMap() => { + "pagination": pagination?.toMap(), + }; } +class PaginationHolerite { + final int? page; + final int? pageSize; + final int? pageCount; + final int? total; + + const PaginationHolerite({ + this.page, + this.pageSize, + this.pageCount, + this.total, + }); + + factory PaginationHolerite.fromMap(Map json) => PaginationHolerite( + page: json["page"], + pageSize: json["pageSize"], + pageCount: json["pageCount"], + total: json["total"], + ); + + Map toMap() => { + "page": page, + "pageSize": pageSize, + "pageCount": pageCount, + "total": total, + }; +} \ No newline at end of file diff --git a/lib/model/holerite/informe/informe.dart b/lib/model/holerite/informe/informe.dart deleted file mode 100644 index b59669b..0000000 --- a/lib/model/holerite/informe/informe.dart +++ /dev/null @@ -1,230 +0,0 @@ -// To parse this JSON data, do -// -// final informeRendimentosModel = informeRendimentosModelFromMap(jsonString); - -import 'dart:convert'; - -class InformeRendimentosModel { - InformeRendimentosModel({ - this.id, - this.ano, - this.anoReferencia, - this.naturezaRendimento, - this.total, - this.contribuicaoPrevidenciaria, - this.contribuicaoPrevidenciariaPrivada, - this.pensaoAlimenticia, - this.impostoRendaRetido, - this.parcialIsenta, - this.ajudaDeCusto, - this.pensao, - this.lucro, - this.pagosTitular, - this.recisaoContratoTrabalho, - this.isentosOutros, - this.salario13, - this.retidoSalario13, - this.liquidoOutros, - this.totalTributavel, - this.exclusaoAcaoJudicial, - this.deducaoPrevidenciaria, - this.deducaoPensaoAlimenticia, - this.impostoRetidoFonte, - this.isentosPensao, - this.informacoesComplemetares, - this.responsavelNome, - this.data, - this.cnpj, - this.razaoSocial, - this.cpf, - this.nome, - this.disponiblizado, - this.visualizado, - }); - - int? id; - dynamic ano; - String? anoReferencia; - dynamic naturezaRendimento; - int? total; - int? contribuicaoPrevidenciaria; - int? contribuicaoPrevidenciariaPrivada; - int? pensaoAlimenticia; - int? impostoRendaRetido; - int? parcialIsenta; - int? ajudaDeCusto; - int? pensao; - int? lucro; - int? pagosTitular; - int? recisaoContratoTrabalho; - int? isentosOutros; - int? salario13; - int? retidoSalario13; - int? liquidoOutros; - int? totalTributavel; - int? exclusaoAcaoJudicial; - int? deducaoPrevidenciaria; - int? deducaoPensaoAlimenticia; - int? impostoRetidoFonte; - int? isentosPensao; - dynamic informacoesComplemetares; - dynamic responsavelNome; - dynamic data; - dynamic cnpj; - dynamic razaoSocial; - dynamic cpf; - dynamic nome; - String? disponiblizado; - String? visualizado; - - InformeRendimentosModel copyWith({ - int? id, - dynamic ano, - String? anoReferencia, - dynamic naturezaRendimento, - int? total, - int? contribuicaoPrevidenciaria, - int? contribuicaoPrevidenciariaPrivada, - int? pensaoAlimenticia, - int? impostoRendaRetido, - int? parcialIsenta, - int? ajudaDeCusto, - int? pensao, - int? lucro, - int? pagosTitular, - int? recisaoContratoTrabalho, - int? isentosOutros, - int? salario13, - int? retidoSalario13, - int? liquidoOutros, - int? totalTributavel, - int? exclusaoAcaoJudicial, - int? deducaoPrevidenciaria, - int? deducaoPensaoAlimenticia, - int? impostoRetidoFonte, - int? isentosPensao, - dynamic informacoesComplemetares, - dynamic responsavelNome, - dynamic data, - dynamic cnpj, - dynamic razaoSocial, - dynamic cpf, - dynamic nome, - String? disponiblizado, - String? visualizado, - }) => - InformeRendimentosModel( - id: id ?? this.id, - ano: ano ?? this.ano, - anoReferencia: anoReferencia ?? this.anoReferencia, - naturezaRendimento: naturezaRendimento ?? this.naturezaRendimento, - total: total ?? this.total, - contribuicaoPrevidenciaria: contribuicaoPrevidenciaria ?? this.contribuicaoPrevidenciaria, - contribuicaoPrevidenciariaPrivada: contribuicaoPrevidenciariaPrivada ?? this.contribuicaoPrevidenciariaPrivada, - pensaoAlimenticia: pensaoAlimenticia ?? this.pensaoAlimenticia, - impostoRendaRetido: impostoRendaRetido ?? this.impostoRendaRetido, - parcialIsenta: parcialIsenta ?? this.parcialIsenta, - ajudaDeCusto: ajudaDeCusto ?? this.ajudaDeCusto, - pensao: pensao ?? this.pensao, - lucro: lucro ?? this.lucro, - pagosTitular: pagosTitular ?? this.pagosTitular, - recisaoContratoTrabalho: recisaoContratoTrabalho ?? this.recisaoContratoTrabalho, - isentosOutros: isentosOutros ?? this.isentosOutros, - salario13: salario13 ?? this.salario13, - retidoSalario13: retidoSalario13 ?? this.retidoSalario13, - liquidoOutros: liquidoOutros ?? this.liquidoOutros, - totalTributavel: totalTributavel ?? this.totalTributavel, - exclusaoAcaoJudicial: exclusaoAcaoJudicial ?? this.exclusaoAcaoJudicial, - deducaoPrevidenciaria: deducaoPrevidenciaria ?? this.deducaoPrevidenciaria, - deducaoPensaoAlimenticia: deducaoPensaoAlimenticia ?? this.deducaoPensaoAlimenticia, - impostoRetidoFonte: impostoRetidoFonte ?? this.impostoRetidoFonte, - isentosPensao: isentosPensao ?? this.isentosPensao, - informacoesComplemetares: informacoesComplemetares ?? this.informacoesComplemetares, - responsavelNome: responsavelNome ?? this.responsavelNome, - data: data ?? this.data, - cnpj: cnpj ?? this.cnpj, - razaoSocial: razaoSocial ?? this.razaoSocial, - cpf: cpf ?? this.cpf, - nome: nome ?? this.nome, - disponiblizado: disponiblizado ?? this.disponiblizado, - visualizado: visualizado ?? this.visualizado, - ); - - factory InformeRendimentosModel.fromJson(String str) => InformeRendimentosModel.fromMap(json.decode(str)); - - String toJson() => json.encode(toMap()); - - factory InformeRendimentosModel.fromMap(Map json) => InformeRendimentosModel( - id: json["id"] == null ? null : json["id"], - ano: json["ano"], - anoReferencia: json["anoReferencia"] == null ? null : json["anoReferencia"], - naturezaRendimento: json["naturezaRendimento"], - total: json["total"] == null ? null : json["total"], - contribuicaoPrevidenciaria: json["contribuicaoPrevidenciaria"] == null ? null : json["contribuicaoPrevidenciaria"], - contribuicaoPrevidenciariaPrivada: json["contribuicaoPrevidenciariaPrivada"] == null ? null : json["contribuicaoPrevidenciariaPrivada"], - pensaoAlimenticia: json["pensaoAlimenticia"] == null ? null : json["pensaoAlimenticia"], - impostoRendaRetido: json["impostoRendaRetido"] == null ? null : json["impostoRendaRetido"], - parcialIsenta: json["parcialIsenta"] == null ? null : json["parcialIsenta"], - ajudaDeCusto: json["ajudaDeCusto"] == null ? null : json["ajudaDeCusto"], - pensao: json["pensao"] == null ? null : json["pensao"], - lucro: json["lucro"] == null ? null : json["lucro"], - pagosTitular: json["pagosTitular"] == null ? null : json["pagosTitular"], - recisaoContratoTrabalho: json["recisaoContratoTrabalho"] == null ? null : json["recisaoContratoTrabalho"], - isentosOutros: json["isentosOutros"] == null ? null : json["isentosOutros"], - salario13: json["salario13"] == null ? null : json["salario13"], - retidoSalario13: json["retidoSalario13"] == null ? null : json["retidoSalario13"], - liquidoOutros: json["liquidoOutros"] == null ? null : json["liquidoOutros"], - totalTributavel: json["totalTributavel"] == null ? null : json["totalTributavel"], - exclusaoAcaoJudicial: json["exclusaoAcaoJudicial"] == null ? null : json["exclusaoAcaoJudicial"], - deducaoPrevidenciaria: json["deducaoPrevidenciaria"] == null ? null : json["deducaoPrevidenciaria"], - deducaoPensaoAlimenticia: json["deducaoPensaoAlimenticia"] == null ? null : json["deducaoPensaoAlimenticia"], - impostoRetidoFonte: json["impostoRetidoFonte"] == null ? null : json["impostoRetidoFonte"], - isentosPensao: json["isentosPensao"] == null ? null : json["isentosPensao"], - informacoesComplemetares: json["informacoesComplemetares"], - responsavelNome: json["responsavelNome"], - data: json["data"], - cnpj: json["cnpj"], - razaoSocial: json["razaoSocial"], - cpf: json["cpf"], - nome: json["nome"], - disponiblizado: json["disponiblizado"] == null ? null : json["disponiblizado"], - visualizado: json["visualizado"] == null ? null : json["visualizado"], - ); - - Map toMap() => { - "id": id == null ? null : id, - "ano": ano, - "anoReferencia": anoReferencia == null ? null : anoReferencia, - "naturezaRendimento": naturezaRendimento, - "total": total == null ? null : total, - "contribuicaoPrevidenciaria": contribuicaoPrevidenciaria == null ? null : contribuicaoPrevidenciaria, - "contribuicaoPrevidenciariaPrivada": contribuicaoPrevidenciariaPrivada == null ? null : contribuicaoPrevidenciariaPrivada, - "pensaoAlimenticia": pensaoAlimenticia == null ? null : pensaoAlimenticia, - "impostoRendaRetido": impostoRendaRetido == null ? null : impostoRendaRetido, - "parcialIsenta": parcialIsenta == null ? null : parcialIsenta, - "ajudaDeCusto": ajudaDeCusto == null ? null : ajudaDeCusto, - "pensao": pensao == null ? null : pensao, - "lucro": lucro == null ? null : lucro, - "pagosTitular": pagosTitular == null ? null : pagosTitular, - "recisaoContratoTrabalho": recisaoContratoTrabalho == null ? null : recisaoContratoTrabalho, - "isentosOutros": isentosOutros == null ? null : isentosOutros, - "salario13": salario13 == null ? null : salario13, - "retidoSalario13": retidoSalario13 == null ? null : retidoSalario13, - "liquidoOutros": liquidoOutros == null ? null : liquidoOutros, - "totalTributavel": totalTributavel == null ? null : totalTributavel, - "exclusaoAcaoJudicial": exclusaoAcaoJudicial == null ? null : exclusaoAcaoJudicial, - "deducaoPrevidenciaria": deducaoPrevidenciaria == null ? null : deducaoPrevidenciaria, - "deducaoPensaoAlimenticia": deducaoPensaoAlimenticia == null ? null : deducaoPensaoAlimenticia, - "impostoRetidoFonte": impostoRetidoFonte == null ? null : impostoRetidoFonte, - "isentosPensao": isentosPensao == null ? null : isentosPensao, - "informacoesComplemetares": informacoesComplemetares, - "responsavelNome": responsavelNome, - "data": data, - "cnpj": cnpj, - "razaoSocial": razaoSocial, - "cpf": cpf, - "nome": nome, - "disponiblizado": disponiblizado == null ? null : disponiblizado, - "visualizado": visualizado == null ? null : visualizado, - }; -} diff --git a/lib/model/holerite/primeiro_acesso/primeiro_acesso_model.dart b/lib/model/holerite/primeiro_acesso/primeiro_acesso_model.dart deleted file mode 100644 index 9480a22..0000000 --- a/lib/model/holerite/primeiro_acesso/primeiro_acesso_model.dart +++ /dev/null @@ -1,12 +0,0 @@ - -class PrimeiroAcessoHoleriteModel{ - int? id; - String? name; - String? email; - - PrimeiroAcessoHoleriteModel.fromMap(Map map){ - this.id = map["id"] == null ? null : map["id"]; - this.email = map["email"] == null ? null : map["email"]; - this.name = map["name"] == null ? null : map["name"]; - } -} \ No newline at end of file diff --git a/lib/model/holerite/usuario/funcionarios.dart b/lib/model/holerite/usuario/funcionarios.dart new file mode 100644 index 0000000..cb904ea --- /dev/null +++ b/lib/model/holerite/usuario/funcionarios.dart @@ -0,0 +1,242 @@ + + +class FuncionariosHoleriteModel { + final List? data; + final MetaFuncionarios? meta; + + const FuncionariosHoleriteModel({ + this.data, + this.meta, + }); + + FuncionariosHoleriteModel copyWith({ + List? data, + MetaFuncionarios? meta, + }) => + FuncionariosHoleriteModel( + data: data ?? this.data, + meta: meta ?? this.meta, + ); + + factory FuncionariosHoleriteModel.fromMap(Map json) => FuncionariosHoleriteModel( + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => DatumFuncionarios.fromMap(x))), + meta: json["meta"] == null ? null : MetaFuncionarios.fromMap(json["meta"]), + ); + + Map toMap() => { + "data": data == null ? [] : List.from(data!.map((x) => x.toMap())), + "meta": meta?.toMap(), + }; +} + +class DatumFuncionarios { + final int? id; + final AttributesFuncionarios? attributes; + + const DatumFuncionarios({ + this.id, + this.attributes, + }); + + DatumFuncionarios copyWith({ + int? id, + AttributesFuncionarios? attributes, + }) => + DatumFuncionarios( + id: id ?? this.id, + attributes: attributes ?? this.attributes, + ); + + factory DatumFuncionarios.fromMap(Map json) => DatumFuncionarios( + id: json["id"], + attributes: json["attributes"] == null ? null : AttributesFuncionarios.fromMap(json["attributes"]), + ); + + Map toMap() => { + "id": id, + "attributes": attributes?.toMap(), + }; +} + +class AttributesFuncionarios { + final String? nome; + final String? cpf; + final String? phone; + final String? email; + final int? baseSalary; + final String? office; + final String? sector; + final String? ctps; + final String? syndicate; + final String? codeBank; + final String? accountBank; + final String? typeBank; + final String? pixKeyBank; + final String? agencyBank; + final DateTime? createdAt; + final DateTime? updatedAt; + final String? reg; + final bool? isPreRegistered; + + const AttributesFuncionarios({ + this.nome, + this.cpf, + this.phone, + this.email, + this.baseSalary, + this.office, + this.sector, + this.ctps, + this.syndicate, + this.codeBank, + this.accountBank, + this.typeBank, + this.pixKeyBank, + this.agencyBank, + this.createdAt, + this.updatedAt, + this.reg, + this.isPreRegistered, + }); + + AttributesFuncionarios copyWith({ + String? nome, + String? cpf, + String? phone, + String? email, + int? baseSalary, + String? office, + String? sector, + String? ctps, + String? syndicate, + String? codeBank, + String? accountBank, + String? typeBank, + String? pixKeyBank, + String? agencyBank, + DateTime? createdAt, + DateTime? updatedAt, + String? reg, + bool? isPreRegistered, + }) => + AttributesFuncionarios( + nome: nome ?? this.nome, + cpf: cpf ?? this.cpf, + phone: phone ?? this.phone, + email: email ?? this.email, + baseSalary: baseSalary ?? this.baseSalary, + office: office ?? this.office, + sector: sector ?? this.sector, + ctps: ctps ?? this.ctps, + syndicate: syndicate ?? this.syndicate, + codeBank: codeBank ?? this.codeBank, + accountBank: accountBank ?? this.accountBank, + typeBank: typeBank ?? this.typeBank, + pixKeyBank: pixKeyBank ?? this.pixKeyBank, + agencyBank: agencyBank ?? this.agencyBank, + createdAt: createdAt ?? this.createdAt, + updatedAt: updatedAt ?? this.updatedAt, + reg: reg ?? this.reg, + isPreRegistered: isPreRegistered ?? this.isPreRegistered, + ); + + factory AttributesFuncionarios.fromMap(Map json) => AttributesFuncionarios( + nome: json["nome"], + cpf: json["cpf"], + phone: json["phone"], + email: json["email"], + baseSalary: json["baseSalary"], + office: json["office"], + sector: json["sector"], + ctps: json["ctps"], + syndicate: json["syndicate"], + codeBank: json["codeBank"], + accountBank: json["accountBank"], + typeBank: json["typeBank"], + pixKeyBank: json["pixKeyBank"], + agencyBank: json["agencyBank"], + createdAt: json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]), + updatedAt: json["updatedAt"] == null ? null : DateTime.parse(json["updatedAt"]), + reg: json["reg"], + isPreRegistered: json["isPreRegistered"], + ); + + Map toMap() => { + "nome": nome, + "cpf": cpf, + "phone": phone, + "email": email, + "baseSalary": baseSalary, + "office": office, + "sector": sector, + "ctps": ctps, + "syndicate": syndicate, + "codeBank": codeBank, + "accountBank": accountBank, + "typeBank": typeBank, + "pixKeyBank": pixKeyBank, + "agencyBank": agencyBank, + "createdAt": createdAt?.toIso8601String(), + "updatedAt": updatedAt?.toIso8601String(), + "reg": reg, + "isPreRegistered": isPreRegistered, + }; +} + +class MetaFuncionarios { + final PaginationFuncionarios? pagination; + + const MetaFuncionarios({ + this.pagination, + }); + + MetaFuncionarios copyWith({ + PaginationFuncionarios? pagination, + }) => + MetaFuncionarios( + pagination: pagination ?? this.pagination, + ); + + factory MetaFuncionarios.fromMap(Map json) => MetaFuncionarios( + pagination: json["pagination"] == null ? null : PaginationFuncionarios.fromMap(json["pagination"]), + ); + + Map toMap() => { + "pagination": pagination?.toMap(), + }; +} + +class PaginationFuncionarios { + final int? start; + final int? limit; + final int? total; + + const PaginationFuncionarios({ + this.start, + this.limit, + this.total, + }); + + PaginationFuncionarios copyWith({ + int? start, + int? limit, + int? total, + }) => + PaginationFuncionarios( + start: start ?? this.start, + limit: limit ?? this.limit, + total: total ?? this.total, + ); + + factory PaginationFuncionarios.fromMap(Map json) => PaginationFuncionarios( + start: json["start"], + limit: json["limit"], + total: json["total"], + ); + + Map toMap() => { + "start": start, + "limit": limit, + "total": total, + }; +} diff --git a/lib/model/holerite/usuario/usuario.dart b/lib/model/holerite/usuario/usuario.dart index d36dc6e..e20ecb6 100644 --- a/lib/model/holerite/usuario/usuario.dart +++ b/lib/model/holerite/usuario/usuario.dart @@ -2,65 +2,174 @@ import '../../model.dart'; -class UsuarioHolerite { + +class UsuarioHoleriteModel { + final String? jwt; + UserHolerite? user; + + UsuarioHoleriteModel({ + this.jwt, + this.user, + }); + + UsuarioHoleriteModel copyWith({ + UsuarioHoleriteModel? user, + }) => + UsuarioHoleriteModel( + jwt: user?.jwt ?? this.jwt, + user: this.user == null ? user?.user : this.user?.copyWith( + id: user?.user?.id, + username: user?.user?.username, + email: user?.user?.email, + provider: user?.user?.provider, + confirmed: user?.user?.confirmed, + blocked: user?.user?.blocked, + cpf: user?.user?.cpf, + fantasyName: user?.user?.fantasyName, + enterpriseName: user?.user?.enterpriseName, + phone: user?.user?.phone, + stateRegistration: user?.user?.stateRegistration, + createdAt: user?.user?.createdAt, + updatedAt: user?.user?.updatedAt, + name: user?.user?.name, + office: user?.user?.office, + department: user?.user?.department, + isManager: user?.user?.isManager, + ), + ); + + factory UsuarioHoleriteModel.fromMap(Map json) => UsuarioHoleriteModel( + jwt: json["jwt"], + user: json["user"] == null ? null : UserHolerite.fromMap(json["user"]), + ); + + Map toMap() => { + "jwt": jwt, + "user": user?.toMap(), + }; +} + +class UserHolerite { int? id; - String? nome; - String? empresa; - String? cnpj; - String? registro; - String? cpf; + String? username; String? email; - String? ddd; - String? celular; + String? provider; + bool? confirmed; + bool? blocked; + String? cpf; + String? fantasyName; + String? enterpriseName; + String? phone; + String? stateRegistration; + String? name; + String? office; + String? department; + bool? isManager; + DateTime? createdAt; + DateTime? updatedAt; - UsuarioHolerite({this.id, this.nome, this.empresa, this.email, this.cnpj, this.cpf, this.registro, this.ddd, this.celular}); + UserHolerite({ + this.id, + this.username, + this.email, + this.provider, + this.confirmed, + this.blocked, + this.cpf, + this.fantasyName, + this.enterpriseName, + this.phone, + this.stateRegistration, + this.name, + this.office, + this.department, + this.isManager, + this.createdAt, + this.updatedAt, + }); - UsuarioHolerite copyWith({ - String? email, String? nome, String? empresa, String? cpf, String? cnpj, String? registro, String? celular - }) => UsuarioHolerite( - id: id ?? this.id, - nome: nome ?? this.nome, - empresa: empresa ?? this.empresa, - email: email ?? this.email, - cpf: cpf ?? this.cpf, - cnpj: cnpj ?? this.cnpj, - registro: registro ?? this.registro, - ddd: ddd ?? this.ddd, - celular: celular ?? this.celular + factory UserHolerite.fromMap(Map json) => UserHolerite( + id: json["id"], + username: json["username"], + email: json["email"], + provider: json["provider"], + confirmed: json["confirmed"], + blocked: json["blocked"], + cpf: json["cpf"], + fantasyName: json["fantasyName"], + enterpriseName: json["enterpriseName"], + phone: json["phone"], + stateRegistration: json["stateRegistration"], + name: json["name"], + office: json["office"], + department: json["department"], + isManager: json["isManager"], + createdAt: json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]), + updatedAt: json["updatedAt"] == null ? null : DateTime.parse(json["updatedAt"]), ); - UsuarioHolerite.fromMap(Map map){ - this.id = map["id"]; - this.email = map["email"]; - this.empresa = map["empresa"]; - this.nome = map["nome"]; - this.cpf = map["cpf"]; - this.cnpj = map["cnpj"]; - this.registro = map["registro"]; - this.ddd = map["ddd"]; - this.celular = map["celular"]; - } - - UsuarioHolerite.fromPonto(UsuarioPonto user){ - this.id = user.funcionario?.funcionarioId; + UserHolerite.fromPonto(UsuarioPonto user){ this.email = user.funcionario?.email; - this.nome = user.funcionario?.nome; + this.name = user.funcionario?.nome; this.cpf = user.funcionario?.cpf; - this.cnpj = user.funcionario?.cnpj; - this.registro = user.funcionario?.registro; } - Map toMap(){ - return { - 'id': id, - 'email': email, - 'empresa': empresa, - 'nome': nome, - 'cpf': cpf, - 'cnpj': cnpj, - 'registro': registro, - 'ddd': ddd, - 'celular': celular, - }; - } -} \ No newline at end of file + UserHolerite copyWith({ + int? id, + String? username, + String? email, + dynamic provider, + bool? confirmed, + bool? blocked, + String? cpf, + dynamic fantasyName, + dynamic enterpriseName, + dynamic phone, + dynamic stateRegistration, + dynamic name, + dynamic office, + dynamic department, + bool? isManager, + DateTime? createdAt, + DateTime? updatedAt, + }) => + UserHolerite( + id: id ?? this.id, + username: username ?? this.username, + email: email ?? this.email, + provider: provider ?? this.provider, + confirmed: confirmed ?? this.confirmed, + blocked: blocked ?? this.blocked, + cpf: cpf ?? this.cpf, + fantasyName: fantasyName ?? this.fantasyName, + enterpriseName: enterpriseName ?? this.enterpriseName, + phone: phone ?? this.phone, + stateRegistration: stateRegistration ?? this.stateRegistration, + name: name ?? this.name, + office: office ?? this.office, + department: department ?? this.department, + isManager: isManager ?? this.isManager, + createdAt: createdAt ?? this.createdAt, + updatedAt: updatedAt ?? this.updatedAt, + ); + + Map toMap() => { + "id": id, + "username": username, + "email": email, + "provider": provider, + "confirmed": confirmed, + "blocked": blocked, + "cpf": cpf, + "fantasyName": fantasyName, + "enterpriseName": enterpriseName, + "phone": phone, + "stateRegistration": stateRegistration, + "createdAt": createdAt?.toIso8601String(), + "updatedAt": updatedAt?.toIso8601String(), + "name": name, + "office": office, + "department": department, + "isManager": isManager, + }; +} diff --git a/lib/model/model.dart b/lib/model/model.dart index 7fdac18..a70067a 100644 --- a/lib/model/model.dart +++ b/lib/model/model.dart @@ -1,7 +1,6 @@ export 'holerite/holerite/holerite.dart'; export 'holerite/usuario/usuario.dart'; -export 'holerite/informe/informe.dart'; -export 'holerite/primeiro_acesso/primeiro_acesso_model.dart'; + export 'tablet/config/config.dart'; export 'tablet/empresa/empresa.dart'; @@ -9,6 +8,7 @@ export 'tablet/historico_marcacoes/historico_marcacoes_model.dart'; export 'tablet/usuario/user_offiline.dart'; export 'ponto/apontamento/apontamento.dart'; +export 'ponto/apontamento/apontamento_dia.dart'; export 'ponto/banco_horas/banco_horas.dart'; export 'ponto/home/home_model.dart'; export 'ponto/marcacao/marcacao.dart'; diff --git a/lib/model/ponto/apontamento/apontamento_dia.dart b/lib/model/ponto/apontamento/apontamento_dia.dart new file mode 100644 index 0000000..c50c17d --- /dev/null +++ b/lib/model/ponto/apontamento/apontamento_dia.dart @@ -0,0 +1,112 @@ + +// To parse this JSON data, do +// +// final apontamentoDiaModel = apontamentoDiaModelFromMap(jsonString); + +import 'dart:convert'; + +ApontamentoDiaModel apontamentoDiaModelFromMap(String str) => ApontamentoDiaModel.fromMap(json.decode(str)); + +String apontamentoDiaModelToMap(ApontamentoDiaModel data) => json.encode(data.toMap()); + +class ApontamentoDiaModel { + final List? marcacoes; + final List? marcacoesInvalidas; + final String? expediente; + final String? trabalhar; + final String? extras; + final String? extrasFolga; + final String? desconto; + final String? adcNot; + final String? abono; + final String? falta; + + const ApontamentoDiaModel({ + this.marcacoes, + this.marcacoesInvalidas, + this.expediente, + this.trabalhar, + this.extras, + this.extrasFolga, + this.desconto, + this.adcNot, + this.abono, + this.falta, + }); + + factory ApontamentoDiaModel.fromMap(Map json) => ApontamentoDiaModel( + marcacoes: json["Marcacoes"] == null ? [] : List.from(json["Marcacoes"]!.map((x) => MarcacoeDia.fromMap(x))), + marcacoesInvalidas: json["MarcacoesInvalidas"] == null ? [] : List.from(json["MarcacoesInvalidas"]!.map((x) => MarcacoeDia.fromMap(x))), + expediente: json["Expediente"], + trabalhar: json["Trabalhar"], + extras: json["Extras"], + extrasFolga: json["ExtrasFolga"], + desconto: json["Desconto"], + adcNot: json["AdcNot"], + abono: json["Abono"], + falta: json["Falta"], + ); + + Map toMap() => { + "Marcacoes": marcacoes == null ? [] : List.from(marcacoes!.map((x) => x.toMap())), + "MarcacoesInvalidas": marcacoesInvalidas == null ? [] : List.from(marcacoesInvalidas!.map((x) => x.toMap())), + "Expediente": expediente, + "Trabalhar": trabalhar, + "Extras": extras, + "ExtrasFolga": extrasFolga, + "Desconto": desconto, + "AdcNot": adcNot, + "Falta": falta, + "Abono": abono, + }; +} + +class MarcacoeDia { + final String? horario; + final MarcacaoStatus status; + + const MarcacoeDia({ + this.horario, + this.status = MarcacaoStatus.none, + }); + + factory MarcacoeDia.fromMap(Map json) => MarcacoeDia( + horario: json["Horario"], + status: MarcacaoStatus.fromInt(int.tryParse(json["Status"].toString()) ?? 0) , + ); + + Map toMap() => { + "Horario": horario, + "Status": status.value, + }; +} + + +enum MarcacaoStatus { + none(0, ""), + entradaOk(1, "Entrada"), + saidaOk(2, "Saída"), + foraFaixa(3, "Fora do Intervalo Permitido"), + crachaInvalido(4, "Crachá Inválido"), + desconsiderado(5, "Desconsiderada"), + preAssinalado(6, "Pré-Assinalada no Intervalo"), + jaImportada(7, "Já Importada"), + pisInvalido(8, "Pis Inválido"), + inclusaoFolga(9, "Incluída em Folga"), + foraPerimetroOnline(10, "Fora do Perímetro Online"), + foraPerimetroOffline(11, "Fora do Perímetro Offline"), + cpfInvalido(12, "CPF Inválido"), + erro(20, "Erro"); + + final int value; + final String description; + + const MarcacaoStatus(this.value, this.description); + + static MarcacaoStatus fromInt(int value) { + return MarcacaoStatus.values.firstWhere( + (e) => e.value == value, + orElse: () => MarcacaoStatus.none, + ); + } +} diff --git a/lib/model/ponto/marcacao/marcacao.dart b/lib/model/ponto/marcacao/marcacao.dart index 86a4b7e..f2539a8 100644 --- a/lib/model/ponto/marcacao/marcacao.dart +++ b/lib/model/ponto/marcacao/marcacao.dart @@ -100,7 +100,7 @@ class Marcacao { datahora = DateTime.tryParse(map["datahora"].toString()); latitude = map["latitude"] == null ? null : double.tryParse(map["latitude"]); longitude = map["longitude"] == null ? null : double.tryParse(map["longitude"]); - endereco = map["Endereco"] == null ? null : map["Endereco"].toString(); + endereco = map["Endereco"]?.toString(); } Marcacao.fromReSql(Map map) { @@ -108,7 +108,7 @@ class Marcacao { datahora = DateTime.tryParse(map["Marcacao"].toString()); latitude = map["Latitude"] == null ? null : double.tryParse(map["Latitude"]); longitude = map["Longitude"] == null ? null : double.tryParse(map["Longitude"]); - endereco = map["Endereco"] == null ? null : map["Endereco"].toString(); + endereco = map["Endereco"]?.toString(); } Map toMap() { diff --git a/lib/model/tablet/empresa/empresa.dart b/lib/model/tablet/empresa/empresa.dart index 6573855..f97cbf0 100644 --- a/lib/model/tablet/empresa/empresa.dart +++ b/lib/model/tablet/empresa/empresa.dart @@ -12,8 +12,8 @@ class EmpresaPontoModel { EmpresaPontoModel.fromJson(Map map, String senha, String email) { this.nome = map["Nome"]; - this.database = map["Database"]; - this.cnpj = map["Cnpj"]; + this.database = map["DatabaseId"]; + this.cnpj = map["CNPJ"]; this.ativado = map["Tablet"].toString() == 'true'; this.email = email; this.senha = senha; diff --git a/lib/model/tablet/usuario/user_offiline.dart b/lib/model/tablet/usuario/user_offiline.dart index 90c8b71..e820262 100644 --- a/lib/model/tablet/usuario/user_offiline.dart +++ b/lib/model/tablet/usuario/user_offiline.dart @@ -8,14 +8,14 @@ class UserPontoOffine { UserPontoOffine({this.id, this.nome, this.pis, this.registro}); UserPontoOffine.fromMap(Map map) { - this.id = (int?.parse(map["Id"].toString())); + this.id = (int.parse(map["Id"].toString())); this.nome = map["Nome"]; this.pis = map["Pis"]; this.registro = map["Registro"]; } UserPontoOffine.fromSQL(Map map) { - this.id = (int?.parse(map["iduser"].toString())); + this.id = (int.parse(map["userId"].toString())); this.nome = map["nome"]; this.pis = map["pis"]; this.registro = map["registro"]; diff --git a/lib/services/asseweb/boletos.dart b/lib/services/asseweb/boletos.dart deleted file mode 100644 index 5129f31..0000000 --- a/lib/services/asseweb/boletos.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:universal_io/io.dart'; -import 'dart:typed_data'; -import 'package:flutter/material.dart'; -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; -import 'package:intl/intl.dart'; -import 'package:path_provider/path_provider.dart'; - -import '../../config.dart'; -import '../../controllers/controllers.dart'; -import '../../model/model.dart'; -import '../../utils/get_file.dart'; -import '../http/http.dart'; - -class BoletosAssewebService { - final HttpCli _http = HttpCli(); - - Future> getListBoletos({String? cnpj}) async { - String _metodo = '/api/Boletos'; - - try { - MyHttpResponse response = await _http.post( - url: Config.conf.apiBoletos! + _metodo, - headers: { - 'Content-Type': 'application/json', - }, - body: { - 'CnpjCpf': cnpj, - } - ); - - if (response.isSucess) { - List result = response.data; - List listBoletos = result.map((e) => BoletosModel.fromMap(e)).toList(); - listBoletos.sort((a,b) => b.dataVencimento!.compareTo(a.dataVencimento!) ); - - return listBoletos; - }else{ - debugPrint('BoletosAssewebService - getListBoletos: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint('BoletosAssewebService - getListBoletos: ' + e.toString()); - } - return []; - } - - Future boletoFile(BoletosModel boleto, ) async { - - try { - MyHttpResponse response = await _http.get( - url: boleto.url ?? '', decoder: false, bits: true, - ); - - if (response.isSucess) { - Uint8List u = response.data; - File result = await CustomFile.fileTemp('pdf',memori: u, - nome: "boleto_${boleto.numero}_${DateFormat('ddMMyyyy').format(boleto.dataVencimento!)}"); - return result; - }else{ - debugPrint('BoletosAssewebService - boletoFile: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint('BoletosAssewebService - boletoFile: ' + e.toString()); - } - } - -} diff --git a/lib/services/asseweb/home.dart b/lib/services/asseweb/home.dart deleted file mode 100644 index 9843bcd..0000000 --- a/lib/services/asseweb/home.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../../config.dart'; -import '../../model/model.dart'; -import '../http/http.dart'; - -class HomeAssewebService { - final HttpCli _http = HttpCli(); - - Future> contatos( - {required String token, required int id}) async { - String _metodo = '/api/Client/contacts?clientId=${id}'; - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + token - }, - ); - - if (response.isSucess) { - List result = response.data; - - List ListaContatos = - result.map((e) => ContatosAsseweb.fromMap(e)).toList(); - - return ListaContatos; - } - } catch (e) { - debugPrint(e.toString()); - } - return []; - } - - Future> obrigacoesusuarios( - {required String token, required int idcliente, required int idusuario}) async { - String _metodo = '/api/Obrigacao/obrbyuser?userId=${idusuario}&clientId=${idcliente}&days=20'; - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + token - }, - ); - - if (response.isSucess) { - List result = response.data; - - List obrigacoes = - result.map((e) => ObrigacoesHomeModel.fromMap(e)).toList(); - - return obrigacoes; - }else{ - debugPrint('HomeAssewebService - obrigacoesusuarios: ${response.codigo}\n${response.data}'); - } - } catch (e) { - debugPrint('HomeAssewebService - obrigacoesusuarios: ' + e.toString()); - } - return []; - } - -} diff --git a/lib/services/asseweb/obrigacoes.dart b/lib/services/asseweb/obrigacoes.dart deleted file mode 100644 index 6b72d97..0000000 --- a/lib/services/asseweb/obrigacoes.dart +++ /dev/null @@ -1,128 +0,0 @@ -import 'package:universal_io/io.dart'; -import 'dart:typed_data'; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; - -import '../../config.dart'; -import '../../controllers/controllers.dart'; -import '../../enums/enums.dart'; -import '../../model/model.dart'; -import '../../utils/get_file.dart'; -import '../../utils/utils.dart'; -import '../http/http.dart'; - -class ObrigacoesAssewebService { - final HttpCli _http = HttpCli(); - - Future obrigacoesdetalhes({int? obrcliperId,}) async { - String _metodo = '/api/Obrigacao/obrdetails?obrcliperId=${obrcliperId}'; - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ${UserAssewebManager.sUser?.token}' - }, - ); - - if (response.isSucess) { - final List result = response.data; - - ObrigacoesDetalhesModel obrigacoesDetalhes = ObrigacoesDetalhesModel.fromMap(result.first); - obrigacoesDetalhes.statusTimeLine = StatusTimeLine.statusTimeLine(obrigacoesDetalhes); - return obrigacoesDetalhes; - }else{ - debugPrint('ObrigacoesAssewebService - obrigacoesdetalhes: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint(e.toString()); - } - } - - Future> obrigacoesMes( - {int? tipo, required DateTime inicio, required DateTime termino}) async { - String _metodo = '/api/Obrigacao/obrmonthbyuser?userId=${UserAssewebManager.sUser?.login?.id}&clientId=${UserAssewebManager.sCompanies?.id}&obrType=${tipo ?? 0}&startDate=${DateFormat('yyyy-MM-dd').format(inicio)}&endDate=${DateFormat('yyyy-MM-dd').format(termino)}'; - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ${UserAssewebManager.sUser?.token}' - }, - ); - - if (response.isSucess) { - List result = response.data; - if(result.isNotEmpty){ - List obrigacoes = result.map((e) => Validacoes.stringToDataBr(e.toString())! ).toList(); - return obrigacoes; - } - }else{ - debugPrint('ObrigacoesAssewebService - obrigacoesMes: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint('ObrigacoesAssewebService - obrigacoesMes: ${e.toString()}'); - } - return []; - } - - Future> obrigacoesdata({required DateTime date, int? tipo}) async { - String _metodo = '/api/Obrigacao/obrbydate?userId=${UserAssewebManager.sUser?.login?.id}&clientId=${UserAssewebManager.sCompanies?.id}&obrType=${tipo ?? 0}&date=${DateFormat("yyyy-MM-dd").format(date)}'; - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ${UserAssewebManager.sUser?.token}' - }, - ); - - if (response.isSucess) { - List result = response.data; - List obrigacoes = result.map((e) => ObrigacaoModel.fromMap(e)).toList(); - return obrigacoes; - }else{ - debugPrint('ObrigacoesAssewebService - obrigacoesdata: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint(e.toString()); - } - return []; - } - - Future obrigacaoFile({int? idfileObg}) async { - String _metodo = '/api/Obrigacao/obrfile?obrAqrId=${idfileObg}&clientId=${UserAssewebManager.sCompanies?.id}&recalculo=false'; - - - try { - MyHttpResponse response = await _http.get( - url: Config.conf.apiAsseweb! + _metodo, - decoder: false, bits: true, - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ${UserAssewebManager.sUser?.token}' - }, - ); - - if (response.isSucess) { - Uint8List u = response.data; - if(response.extencao == 'html'){ - File file = await CustomFile.fileTemp('html',memori: u); - File result = await CustomFile.fileHtml(file); - return result; - }else{ - File result = await CustomFile.fileTemp(response.extencao ?? 'pdf', memori: u); - return result; - } - }else{ - debugPrint('ObrigacoesAssewebService - obrigacaoFile: ${response.codigo} ${response.data}'); - } - } catch (e) { - debugPrint('ObrigacoesAssewebService - obrigacaoFile: ${e.toString()}'); - } - } - -} diff --git a/lib/services/asseweb/senha.dart b/lib/services/asseweb/senha.dart index 4dbac3a..eaaf60c 100644 --- a/lib/services/asseweb/senha.dart +++ b/lib/services/asseweb/senha.dart @@ -6,7 +6,7 @@ import '../http/http.dart'; class SenhaAssewebService { - HttpCli _http = HttpCli(); + final HttpCli _http = HttpCli(); Future sendPass({String? email,}) async { String _metodo = '/api/ExternalLogin/passwordrecover'; @@ -51,7 +51,6 @@ class SenhaAssewebService { headers: { 'Content-Type' : 'application/json', 'Authorization' : 'Bearer ${UserAssewebManager.sUser?.token}' - }, body: { "email": UserAssewebManager.sUser?.login?.email, diff --git a/lib/services/asseweb/usuario.dart b/lib/services/asseweb/usuario.dart index 615a70d..6af1f41 100644 --- a/lib/services/asseweb/usuario.dart +++ b/lib/services/asseweb/usuario.dart @@ -15,7 +15,8 @@ class UserAssewebService { url: Config.conf.apiAsseweb! + _metodo, body: { "email": email, - "password": senha + "password": senha, + "token" : UserAssewebManager.fcmToken } ); @@ -29,7 +30,7 @@ class UserAssewebService { throw response.codigo.toString(); } } catch (e){ - debugPrint('UserAssewebService signInAuth: ' + e.toString()); + debugPrint('UserAssewebService signInAuth: $e'); switch(e){ case HttpError.unexpected : throw 'Erro inesperado, tente novamente!'; @@ -46,8 +47,12 @@ class UserAssewebService { Future lastcompanyupdate({required int? companyId}) async { String _metodo = '/api/ExternalLogin/lastcompanyupdate'; try{ - MyHttpResponse response = await _http.put( - url: Config.conf.apiAsseweb! + _metodo, + MyHttpResponse response = await _http.post( + url: Config.conf.apiAsseweb! + _metodo, decoder: false, + headers: { + 'Content-Type' : 'application/json', + 'Authorization' : 'Bearer ${UserAssewebManager.sUser?.token}' + }, body: { "id": UserAssewebManager.sUser?.login?.id, "lastCompanyId": companyId @@ -55,7 +60,7 @@ class UserAssewebService { ); return response.isSucess; } catch (e){ - debugPrint('UserAssewebService lastcompanyupdate: ' + e.toString()); + debugPrint('UserAssewebService lastcompanyupdate: $e'); } return false; } diff --git a/lib/services/biometria.dart b/lib/services/biometria.dart index f1ebfa6..d6212e4 100644 --- a/lib/services/biometria.dart +++ b/lib/services/biometria.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; import 'package:local_auth_android/local_auth_android.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; + import '../enums/enums.dart'; import '../config.dart'; @@ -31,16 +32,13 @@ class BiometriaServices { debugPrint('Tem biometria cadastrada: $canCheckBiometrics'); if (canCheckBiometrics) { List availableBiometrics = await localAuth.getAvailableBiometrics(); - debugPrint('Lista de biometria cadastrada: $availableBiometrics.isNotEmpty'); - if (availableBiometrics.isNotEmpty) { - return true; - } + debugPrint('Lista de biometria cadastrada: ${availableBiometrics.isNotEmpty}'); + return availableBiometrics.isNotEmpty; } } catch (e) { debugPrint(e.toString()); } } - return false; } @@ -57,7 +55,8 @@ class BiometriaServices { cancelButton : 'Cancelar' , goToSettingsButton : 'Configurações' , goToSettingsDescription : 'Configure seu ID' , - lockOut : ' Reative seu ID' ); + lockOut : ' Reative seu ID' + ); const andStrings = AndroidAuthMessages( cancelButton: 'Cancelar', diff --git a/lib/services/holerite/funcionarios.dart b/lib/services/holerite/funcionarios.dart new file mode 100644 index 0000000..26b7975 --- /dev/null +++ b/lib/services/holerite/funcionarios.dart @@ -0,0 +1,98 @@ + +import 'package:assecontservices/assecontservices.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'dart:async'; + +import '../../controllers/holerite/user_manager.dart'; +import '../../model/holerite/usuario/funcionarios.dart'; +import '../http/http.dart'; +import '../../config.dart'; + +class FuncionariosHoleriteService { + final HttpCli _http = HttpCli(); + + Future> listFuncionarios() async { + final String _api = "/employees?pagination[limit]=50&filters[cpf]=${Validacoes.numeric(UserHoleriteManager.user?.user?.cpf)}"; + + final MyHttpResponse response = await _http.get( + url: Config.conf.apiHoleriteEmail! + _api, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' + }, + ); + + try{ + if(response.isSucess) { + final data = response.data; + if(data != null) { + FuncionariosHoleriteModel model = FuncionariosHoleriteModel.fromMap(data); + return model.data ?? []; + } + } + + } catch(e) { + debugPrint('Erro FuncionariosHoleriteService listFuncionarios: $e'); + } + return []; + } + + Future updateFuncionario( + {int? id, + String? phone, + String? email, + String? typeBank, + String? codeBank, + String? accountBank, + String? pixKeyBank, + String? agencyBank}) async { + + final String _api = "/employees/$id"; + Map body = {}; + + if(phone != null){ + body['phone'] = phone; + } + if(email != null){ + body['email'] = email; + } + if(codeBank != null){ + body['codeBank'] = codeBank; + } + if(accountBank != null){ + body['accountBank'] = accountBank; + } + if(typeBank != null){ + body['typeBank'] = typeBank; + } + if(pixKeyBank != null){ + body['pixKeyBank'] = pixKeyBank; + } + if(agencyBank != null){ + body['agencyBank'] = agencyBank; + } + + final MyHttpResponse response = await _http.put( + url: Config.conf.apiHoleriteEmail! + _api, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' + }, + body: { + "data": body + } + ); + + try{ + if(response.isSucess) { + Map? data = response.data; + if(data != null && data.containsKey('data')) { + DatumFuncionarios model = DatumFuncionarios.fromMap(data['data']); + return model; + } + } + } catch(e) { + debugPrint(e.toString()); + } + } + +} \ No newline at end of file diff --git a/lib/services/holerite/holerite.dart b/lib/services/holerite/holerite.dart index 16dd9e3..d037fe5 100644 --- a/lib/services/holerite/holerite.dart +++ b/lib/services/holerite/holerite.dart @@ -5,12 +5,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'dart:async'; -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:universal_io/io.dart'; - -import '../../enums/versao_app.dart'; +import '../../controllers/holerite/user_manager.dart'; import '../http/http.dart'; import '../../model/model.dart'; import '../../config.dart'; @@ -18,51 +14,36 @@ import '../../config.dart'; class HoleriteService { final HttpCli _http = HttpCli(); - Future> resumoscreen(int idholerite, int mes, int ano) async { - String _api = "/holeriteresumo/resumoscreen"; + Future listHolerite(int page, int pageSize) async { + String _api = "/holerites/by-employee/${UserHoleriteManager.funcSelect?.id}"; - final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, - body: { - "Id": idholerite, //'13369340000136', - "month": mes, - "year": ano, - } + final MyHttpResponse response = await _http.get( + url: Config.conf.apiHoleriteEmail! + _api, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' + }, ); try{ if(response.isSucess) { - List list = response.data; - if(list.length > 0) { - List comp = list.map((e) => HoleriteModel.fromMap(e)).toList(); - return comp; + final data = response.data; + + if(data != null) { + HoleriteModel? model = HoleriteModel.fromMap(data); + return model; } } } catch(e) { - debugPrint(e.toString()); + debugPrint('HoleriteService listHolerite $e'); } - return []; - } - Future> competencias(UsuarioHolerite user) async { - String _api = "/holeriteresumo/competenciasid"; - - final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, - body: { - "cnpj": user.cnpj.toString(), - "register": user.registro.toString(), - "cpf": Config.conf.nomeApp == VersaoApp.HoleriteApp ? null : user.cpf, - } - ); - + Future> newPageHolerite(int page, int pageSize) async { try{ - if(response.isSucess) { - List list = response.data; - List comp = CompetenciasModel().fromList(list); - return comp; + final result = await listHolerite(page, pageSize); + if(result != null && result.data != null && result.data!.isNotEmpty) { + return result.data!; } } catch(e){ debugPrint(e.toString()); @@ -70,65 +51,57 @@ class HoleriteService { return []; } - Future holeriteresumo(UsuarioHolerite? user, int idholerite, int mes, int ano, int? tipo) async { - String _api = "/holeriteresumo"; + Future holeriteresumoBytes(int? id, bool isSign, String comp) async { + String _api = "/holerites/generate-pdf"; try{ + if(!isSign) await holeriteAss(id, comp); + final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, decoder: false, - body: { - "Id": idholerite, - "cnpj": user?.cnpj, - "register": user?.registro, - "cpf": Config.conf.nomeApp == VersaoApp.HoleriteApp ? null : user?.cpf, - "month": mes, - "year": ano, - "holeriteType": tipo - } + url: Config.conf.apiHoleriteEmail! + _api, isbyte: true, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}', + 'Accept': '*/*', + 'Accept-Encoding': 'gzip, deflate, br', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + }, + body: { + "ids": id + } ); + if(response.isSucess) { - var htmlContent = ''' - - - ${response.data.toString().replaceAll(' ', '').replaceAll(' ', '')} - - '''; - - Directory tempDir = await getTemporaryDirectory(); - String savedPath = "holerite" + DateTime.now().microsecondsSinceEpoch.toString(); - File? file = await FlutterHtmlToPdf.convertFromHtmlContent( - htmlContent, tempDir.path, savedPath - ); - - return file; + final dados = response.data; + return dados; } } catch(e){ debugPrint(e.toString()); } } - Future holeriteresumoBytes(UsuarioHolerite? user, int idholerite, int mes, int ano, int? tipo) async { - String _api = "/holeriteresumo/holeriteresumoBytes"; + + Future holeriteAss(int? id, String comp) async { + String _api = "/holerites/sign-by-employee?employee=${UserHoleriteManager.funcSelect?.id}&competence=$comp"; try{ - final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, + //print(Config.conf.apiHoleriteEmail! + _api); + //print('Bearer ${UserHoleriteManager.user?.jwt}'); + + final MyHttpResponse response = await _http.put( + url: Config.conf.apiHoleriteEmail! + _api, decoder: false, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}', + 'Content-Type': 'application/json', + }, body: { - "Id": idholerite, - "cnpj": user?.cnpj, - "register": user?.registro, - "cpf": Config.conf.nomeApp == VersaoApp.HoleriteApp ? null : user?.cpf, - "month": mes, - "year": ano, - "holeriteType": tipo + "isSigned": true } ); - - if(response.isSucess) { - final dados = response.data; - return base64.decode(dados); - } + //print(response.data); + //print(response.codigo); + return response.isSucess; } catch(e){ debugPrint(e.toString()); + return false; } } - } \ No newline at end of file diff --git a/lib/services/holerite/informe.dart b/lib/services/holerite/informe.dart deleted file mode 100644 index 7eb7bcc..0000000 --- a/lib/services/holerite/informe.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:universal_io/io.dart'; -import 'dart:async'; -import 'package:flutter/material.dart'; - -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; -import 'package:path_provider/path_provider.dart'; - -import '../../model/model.dart'; -import '../../config.dart'; -import '../http/http.dart'; - - - -class InformeService { - final HttpCli _http = HttpCli(); - - Future> competencias(UsuarioHolerite? user) async { - String _api = "/informeRendimentos/competencias"; - try{ - final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, - body:{ - "cnpj": user?.cnpj , - "register": user?.registro , - "cpf": user?.registro != null ? null : user?.cpf, - } - ); - if(response.isSucess) { - List list = response.data; - List comp = list.map((e) => InformeRendimentosModel.fromMap(e)).toList(); - return comp.reversed.toList(); - } else { - debugPrint(response.codigo.toString()); - debugPrint(response.data.toString()); - } - } catch(e){ - debugPrint('catch ' + e.toString()); - } - return []; - } - - Future informeRendimentosPDF(UsuarioHolerite user, int? ano) async { - String _api = "/informeRendimentos"; - try{ - final MyHttpResponse response = await _http.post( - url: Config.conf.apiHolerite! + _api, decoder: false, - body: { - "cnpj": user.cnpj , - "register": user.registro , - "cpf": user.registro != null ? null : user.cpf, - "year": ano, - } - ); - if(response.isSucess) { - var htmlContent = ''' - - - ${response.data} - - '''; - Directory tempDir = await getTemporaryDirectory(); - String savedPath = "Informe de Rendimentos - " + ano.toString(); - File? file = await FlutterHtmlToPdf.convertFromHtmlContent( - htmlContent, tempDir.path, savedPath - ); - return file; - } else { - debugPrint(response.codigo.toString()); - return null; - } - } catch(e){ - debugPrint('catch erro informeRendimentosPDF ' + e.toString()); - return null; - } - } -} \ No newline at end of file diff --git a/lib/services/holerite/primeiro_acesso.dart b/lib/services/holerite/primeiro_acesso.dart deleted file mode 100644 index 341637e..0000000 --- a/lib/services/holerite/primeiro_acesso.dart +++ /dev/null @@ -1,135 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../../model/model.dart'; -import '../../config.dart'; -import '../http/http.dart'; - - -class PrimeiroAcessoHoleriteService { - final HttpCli _http = HttpCli(); - - Future verificar({required String cnpj, required String registro, }) async { - String _metodo = '/holerite/novo/verificar'; - try{ - MyHttpResponse response = await _http.post( - url: Config.conf.apiHoleriteEmail! + _metodo, - body: { - "Cnpj": cnpj, - "Registro": registro - } - ); - - if(response.isSucess){ - Map result = response.data; - if(result.containsKey('id')){ - PrimeiroAcessoHoleriteModel acessoModel = PrimeiroAcessoHoleriteModel.fromMap(result); - return acessoModel; - } - if(result.containsKey('iscliente')){ - if(result['iscliente']){ - throw "404"; - }else{ - throw "205"; - } - } - } - throw response.codigo.toString(); - - } catch (e){ - debugPrint(e.toString()); - switch(e){ - case HttpError.unexpected : - throw 'Erro inesperado, tente novamente!'; - case HttpError.timeout : - throw 'Tempo limite de login excedido, verifique sua internet!'; - case "404" : - throw 'Funcionario não cadastrado, verifique os dados e tente novamente!'; - case "205" : - throw 'Empresa não cadastrada!'; - default: - throw 'Erro inesperado, tente novamente!'; - } - } - } - - Future esqueceuEmail( - {required String cnpj, required String registro, required String cpf, }) async { - String _metodo = '/holerite/novo/recadastro'; - try{ - MyHttpResponse response = await _http.post( - url: Config.conf.apiHoleriteEmail! + _metodo, - body: { - "Cnpj": cnpj, - "Registro": registro, - "Cpf": cpf.replaceAll(".", "").replaceAll("-", "") - } - ); - - if(response.isSucess){ - Map result = response.data; - if(result.containsKey('id')){ - PrimeiroAcessoHoleriteModel acessoModel = PrimeiroAcessoHoleriteModel.fromMap(result); - return acessoModel; - } - if(result.containsKey('iscliente')){ - if(result['iscliente']){ - throw "404"; - }else{ - throw "205"; - } - } - } - throw response.codigo.toString(); - - } catch (e){ - debugPrint(e.toString()); - switch(e){ - case HttpError.unexpected : - throw 'Erro inesperado, tente novamente!'; - case HttpError.timeout : - throw 'Tempo limite de login excedido, verifique sua internet!'; - case "404" : - throw 'Funcionario não cadastrado, verifique os dados e tente novamente!'; - case "205" : - throw 'Empresa não cadastrada!'; - default: - throw 'Erro inesperado, tente novamente!'; - } - } - } - - Future cadastrar({required int id, required String email, required String senha, - required String cpf, required String? cel,}) async { - String _metodo = '/holerite/novo/cadastro'; - Map body = { - "Id": id, - "Email": email, - "Senha": senha, - "Cel": cel, - "Cpf": cpf.replaceAll(".", "").replaceAll("-", "") - }; - try{ - MyHttpResponse response = await _http.post( - url: Config.conf.apiHoleriteEmail! + _metodo, - body: body - ); - if(response.isSucess) { - return response.isSucess; - } - - throw response.codigo.toString(); - } catch (e){ - debugPrint(e.toString()); - switch(e){ - case HttpError.unexpected : - throw 'Erro inesperado, tente novamente!'; - case HttpError.timeout : - throw 'Tempo limite de login excedido, verifique sua internet!'; - case "404" : - throw 'Funcionario não cadastrado, verifique os dados e tente novamente!'; - default: - throw 'Erro inesperado, tente novamente!'; - } - } - } -} \ No newline at end of file diff --git a/lib/services/holerite/senha.dart b/lib/services/holerite/senha.dart index 9360eff..fdcc6e9 100644 --- a/lib/services/holerite/senha.dart +++ b/lib/services/holerite/senha.dart @@ -1,26 +1,29 @@ +import 'package:assecontservices/assecontservices.dart'; import 'package:flutter/material.dart'; import '../../config.dart'; +import '../../controllers/holerite/user_manager.dart'; +import '../../model/holerite/usuario/usuario.dart'; import '../http/http.dart'; class SenhaHoleriteService { final HttpCli _http = HttpCli(); - Future sendPass({String? email, String? cpf, }) async { - String _metodo = '/holerite/email/senha'; + Future sendPass({String? email, String? cpf, }) async { + String _metodo = '/auth/forgot-password'; try{ - String? _cpf = cpf != null ? cpf.replaceAll('.', '').replaceAll('-', '') : null; Map body = { - "Email": email, - "Cpf": _cpf + "email": email ?? Validacoes.numeric(cpf), + //"Cpf": _cpf }; MyHttpResponse response = await _http.post( url: Config.conf.apiHoleriteEmail! + _metodo, body: body ); + if(response.isSucess){ - return response.data['email']; + return true; } throw response.codigo.toString(); } catch (e){ @@ -31,32 +34,34 @@ class SenhaHoleriteService { case HttpError.timeout : throw 'Tempo limite de login excedido, verifique sua internet!'; case "404" : - throw 'Email ou Cpf não cadastrado!'; + throw 'Email não cadastrado!'; + case "400" : + throw 'Email não cadastrado!'; default: throw 'Erro inesperado, tente novamente!'; } } } - Future alteracaoPass({required int id, required String senha, required String senhaNova,}) async { - String _metodo = '/holerite/email/alterarSenha'; + Future alteracaoPass({required String senha, required String senhaNova,}) async { + String _metodo = '/auth/change-password'; MyHttpResponse? response; try{ response = await _http.post( url: Config.conf.apiHoleriteEmail! + _metodo, headers: { - 'Content-Type': 'application/json; charset=utf-8', - 'Accept': '*/*', - 'Accept-Encoding': 'gzip, deflate, br', + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' }, body: { - "Id": id, - "Senha": senha, - "NovaSenha": senhaNova + "password": senhaNova, + "currentPassword": senha, + "passwordConfirmation": senhaNova } ); if(response.isSucess){ - return response.isSucess; + final user = response.data; + final UsuarioHoleriteModel _user = UsuarioHoleriteModel.fromMap(user); + return _user; } throw response.codigo.toString(); } catch (e){ diff --git a/lib/services/holerite/usuario.dart b/lib/services/holerite/usuario.dart index 6503f4f..347f9fe 100644 --- a/lib/services/holerite/usuario.dart +++ b/lib/services/holerite/usuario.dart @@ -3,37 +3,39 @@ import 'package:flutter/material.dart'; import 'package:cpf_cnpj_validator/cpf_validator.dart'; +import '../../controllers/holerite/user_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; +import '../../utils/validacoes.dart'; import '../http/http.dart'; class UserHoleriteService { final HttpCli _http = HttpCli(); - Future?> signInAuth({required String email, required String senha}) async { - String _metodo = '/holerite/login'; + Future signInAuth({required String email, required String senha, String? token}) async { + String _metodo = '/auth/local'; try{ - String _email = CPFValidator.isValid(email) ? - email.replaceAll('.', '').replaceAll('-', '').replaceAll('/', '') : email; + String _email = CPFValidator.isValid(email) ? Validacoes.numeric(email): email; MyHttpResponse response = await _http.post( url: Config.conf.apiHoleriteEmail! + _metodo, body: { - "Email": _email, - "Senha": senha + "identifier": _email, + "password": senha, + "token": token } ); if (response.isSucess) { - List user = response.data; - final List _user = user.map((e) => UsuarioHolerite.fromMap(e)).toList(); + final user = response.data; + final UsuarioHoleriteModel _user = UsuarioHoleriteModel.fromMap(user); return _user; }else{ throw response.codigo.toString(); } } catch (e){ - debugPrint(e.toString()); + debugPrint('Erro UserHoleriteService signInAuth: $e'); switch(e){ case HttpError.unexpected : throw 'Erro inesperado, tente novamente!'; @@ -41,25 +43,85 @@ class UserHoleriteService { throw 'Tempo limite de login excedido, verifique sua internet!'; case "404" : throw 'Usuário ou senha inválidos!'; + case "400" : + throw 'Usuário ou senha inválidos!'; default: throw 'Erro inesperado, tente novamente!'; } } } - Future deleteUser(int? idUser) async { - String _metodo = '/holerite/novo/delete'; + Future registerUser({required String nome, + required String email, required String senha, required String cpf}) async { + String _metodo = '/auth/local/register'; + Map body = { + "username": nome, + "email": email, + "password": senha, + "cpf": cpf.replaceAll(".", "").replaceAll("-", "") + }; try{ MyHttpResponse response = await _http.post( url: Config.conf.apiHoleriteEmail! + _metodo, - body: { - "Id": idUser - } + body: body + ); + if (response.isSucess) { + final user = response.data; + final UsuarioHoleriteModel _user = UsuarioHoleriteModel.fromMap(user); + return _user; + }else{ + throw response.codigo.toString(); + } + } catch (e){ + debugPrint(e.toString()); + switch(e){ + case HttpError.unexpected : + throw 'Erro inesperado, tente novamente!'; + case HttpError.timeout : + throw 'Tempo limite de login excedido, verifique sua internet!'; + case "400" : + throw 'Funcionario já cadastrado'; + default: + throw 'Erro inesperado, tente novamente!'; + } + } + } + + Future deleteUser() async { + String _metodo = '/users/${UserHoleriteManager.user?.user?.id}'; + try{ + MyHttpResponse response = await _http.delete( + url: Config.conf.apiHoleriteEmail! + _metodo, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' + }, ); return response.isSucess; } catch (e){ - debugPrint(e.toString()); + debugPrint('Erro UserHoleriteService deleteUser: $e'); + return false; + } + } + + Future updateUser({String? cpf, String? email, String? username, String? senha }) async { + String _metodo = '/users/${UserHoleriteManager.user?.user?.id}'; + Map body = {}; + if(cpf != null) body['cpf'] = Validacoes.numeric(cpf); + if(email != null) body['email'] = email; + if(username != null) body['username'] = username; + if(senha != null) body['password'] = senha; + try{ + MyHttpResponse response = await _http.put( + url: Config.conf.apiHoleriteEmail! + _metodo, + headers: { + 'Authorization': 'Bearer ${UserHoleriteManager.user?.jwt}' + }, + body: body + ); + return response.isSucess; + } catch (e){ + debugPrint('Erro UserHoleriteService updateUser: $e'); return false; } } diff --git a/lib/services/http/http_cliente.dart b/lib/services/http/http_cliente.dart index 1bae5c7..74232a1 100644 --- a/lib/services/http/http_cliente.dart +++ b/lib/services/http/http_cliente.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:assecontservices/services/http/http_response.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import "package:http/http.dart" as http; @@ -13,7 +14,7 @@ class HttpCli { final ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); Future get( - {required String url, Map? headers, bool decoder = true, bool bits = false, bool isCon = true,}) async { + {required String url, Map? headers, bool decoder = true, int timeout = 15, bool bits = false, bool isCon = true,}) async { if(isCon && !connectionStatus.hasConnection){ return MyHttpResponse( @@ -22,6 +23,10 @@ class HttpCli { data: 'Falha de conexão com internet' ); } + + if (kDebugMode) { + print(Uri.parse(url ?? '')); + } try { final http.Response response = await http.get( Uri.parse(url), @@ -29,7 +34,7 @@ class HttpCli { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin':'*' } - ).timeout(const Duration(seconds: 15), onTimeout : () { + ).timeout(Duration(seconds: timeout), onTimeout : () { debugPrint('get timeout'); throw HttpError.timeout; }); @@ -37,26 +42,36 @@ class HttpCli { try{ if(response.statusCode >= 200 && response.statusCode < 300){ var result = bits ? response.bodyBytes : decoder ? json.decode(response.body) : response.body; + + final String? content = response.headers['content-disposition'] ?? + response.request?.url.path.split(".").last; + debugPrint('Sucesso no post'); return MyHttpResponse( isSucess: true, codigo: 200, data: result, - extencao: !response.headers.containsKey('content-disposition') ? null : - response.headers['content-disposition']!.contains('html') ? 'html' : - response.headers['content-disposition']!.contains('pdf') ? 'pdf' : - response.headers['content-disposition']!.contains('txt') ? 'txt' : - response.headers['content-disposition']!.contains('xlsx') ? 'xlsx' : - response.headers['content-disposition']!.contains('xls') ? 'xls' : - response.headers['content-disposition']!.contains('docx') ? 'docx' : - response.headers['content-disposition']!.contains('doc') ? 'doc' : - response.headers['content-disposition']!.contains('json') ? 'json' : null + extencao: content == null ? null : + content.contains('html') ? 'html' : + content.contains('pdf') ? 'pdf' : + content.contains('txt') ? 'txt' : + content.contains('xlsx') ? 'xlsx' : + content.contains('xls') ? 'xls' : + content.contains('docx') ? 'docx' : + content.contains('doc') ? 'doc' : + content.contains('json') ? 'json' : + content.contains('jpg') ? 'jpg' : + content.contains('jpeg') ? 'jpg' : + content.contains('png') ? 'png' : content ); } else { + throw HttpError.statusCode; } } catch(e){ - debugPrint('catch ' + e.toString()); + debugPrint('catch $e'); + debugPrint(response.statusCode.toString()); + debugPrint(response.body); bool r = e == HttpError.statusCode; return MyHttpResponse( isSucess: false, @@ -66,7 +81,7 @@ class HttpCli { ); } } catch (error) { - debugPrint('onError ' + error.toString()); + debugPrint('onError $error'); return MyHttpResponse( isSucess: false, httpError: error == HttpError.timeout ? HttpError.timeout : HttpError.unexpected, @@ -77,8 +92,9 @@ class HttpCli { } - Future post({required String url, Map? headers, - Map? body, bool decoder = true, bool isbyte = false, int timeout = 55}) async { + Future post({Uri? uri, String? url, Map? headers, + Object? body, bool decoder = true, + bool isbyte = false, int timeout = 55}) async { if(!connectionStatus.hasConnection){ return MyHttpResponse( @@ -88,9 +104,14 @@ class HttpCli { ); } + if (kDebugMode) { + print(uri ?? Uri.parse(url ?? '')); + print(jsonEncode(body)); + } + try { final http.Response response = await http.post( - Uri.parse(url), + uri ?? Uri.parse(url ?? ''), headers: headers ?? { 'Content-Type': 'application/json; charset=UTF-8', 'charset': 'UTF-8', @@ -104,6 +125,7 @@ class HttpCli { try{ if(response.statusCode >= 200 && response.statusCode < 300){ final result = isbyte ? response.bodyBytes : decoder ? json.decode(response.body) : response.body; + debugPrint('Sucesso no post'); return MyHttpResponse( isSucess: true, codigo: 200, @@ -124,7 +146,7 @@ class HttpCli { } } catch(e){ - debugPrint('post catch ' + e.toString()); + debugPrint('post catch $e'); bool r = e == HttpError.statusCode; return MyHttpResponse( isSucess: false, @@ -134,7 +156,7 @@ class HttpCli { ); } } catch (error) { - debugPrint('post onError ' + error.toString()); + debugPrint('post onError $error'); return MyHttpResponse( isSucess: false, httpError: error == HttpError.timeout ? HttpError.timeout : HttpError.unexpected, @@ -189,7 +211,7 @@ class HttpCli { } } catch(e){ - debugPrint('catch ' + e.toString()); + debugPrint('catch $e'); bool r = e == HttpError.statusCode; return MyHttpResponse( isSucess: false, @@ -199,8 +221,67 @@ class HttpCli { ); } } catch (error) { - debugPrint('onError ' + error.toString()); + debugPrint('onError $error'); + + return MyHttpResponse( + isSucess: false, + httpError: error == HttpError.timeout ? HttpError.timeout : HttpError.unexpected, + data: error == HttpError.timeout ? + 'Tempo limite de conexão excedido' : 'Erro inesperado, tente novamente mais tarde' + ); + } + } + + + Future delete({required String url, Map? headers, + Map? body, bool decoder = false}) async { + + if(!connectionStatus.hasConnection){ + return MyHttpResponse( + isSucess: false, + httpError: HttpError.conection, + data: 'Falha de conexão com internet' + ); + } + try { + final http.Response response = await http.delete( + Uri.parse(url), + headers: headers ?? { + 'Content-Type': 'application/json; charset=UTF-8', + 'charset': 'UTF-8', + }, + body: jsonEncode(body) + ).timeout(Duration(seconds: 60), onTimeout : () { + debugPrint('delete timeout'); + throw HttpError.timeout; + }); + + try{ + if(response.statusCode >= 200 && response.statusCode < 300){ + final result = decoder ? json.decode(response.body) : response.body; + return MyHttpResponse( + isSucess: true, + codigo: 200, + data: result, + ); + } else { + debugPrint(response.body); + throw HttpError.statusCode; + } + + } catch(e){ + debugPrint('delete catch $e'); + bool r = e == HttpError.statusCode; + return MyHttpResponse( + isSucess: false, + httpError: r ? HttpError.statusCode : HttpError.unexpected, + codigo: response.statusCode, + data: r ? response.body : 'Erro inesperado, tente novamente mais tarde' + ); + } + } catch (error) { + debugPrint('delete onError $error'); return MyHttpResponse( isSucess: false, httpError: error == HttpError.timeout ? HttpError.timeout : HttpError.unexpected, diff --git a/lib/services/ponto/apontamento.dart b/lib/services/ponto/apontamento.dart index 0dd3719..3a343bc 100644 --- a/lib/services/ponto/apontamento.dart +++ b/lib/services/ponto/apontamento.dart @@ -1,3 +1,4 @@ +import 'package:assecontservices/controllers/tablet/empresa_manager.dart'; import 'package:flutter/material.dart'; @@ -18,7 +19,7 @@ class ApontamentoService { body: { "User": { "UserId": user?.funcionario?.funcionarioId.toString(), - "Database": user?.databaseId.toString() + "Database": user?.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, } } ); diff --git a/lib/services/ponto/bancohoras.dart b/lib/services/ponto/bancohoras.dart index 4b6ade8..a5c0a75 100644 --- a/lib/services/ponto/bancohoras.dart +++ b/lib/services/ponto/bancohoras.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; import '../http/http.dart'; @@ -18,7 +19,7 @@ class BancoHorasService { body: { "User": { "UserId": user.funcionario?.funcionarioId.toString(), - "Database": user.databaseId.toString() + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "Periodo": { "DataInicial": DateFormat('yyyy-MM-dd').format(user.periodo!.dataInicial!), diff --git a/lib/services/ponto/comprovante.dart b/lib/services/ponto/comprovante.dart index e99f7b9..4158ecf 100644 --- a/lib/services/ponto/comprovante.dart +++ b/lib/services/ponto/comprovante.dart @@ -1,18 +1,15 @@ import 'dart:convert'; -import 'package:universal_io/io.dart'; import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; + import '../../model/model.dart'; import '../../config.dart'; -import '../../utils/get_file.dart'; import '../http/http.dart'; diff --git a/lib/services/ponto/foto.dart b/lib/services/ponto/foto.dart index 05823d1..a4d0cf0 100644 --- a/lib/services/ponto/foto.dart +++ b/lib/services/ponto/foto.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:flutter/material.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; import '../http/http.dart'; @@ -17,7 +18,7 @@ class CameraPontoService { body: { "user":{ "UserId": user.funcionario?.funcionarioId.toString(), - "Database": user.databaseId.toString(), + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, "Array": img }, } diff --git a/lib/services/ponto/homepage.dart b/lib/services/ponto/homepage.dart index 40950a3..de2688c 100644 --- a/lib/services/ponto/homepage.dart +++ b/lib/services/ponto/homepage.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; import '../http/http.dart'; @@ -19,7 +20,7 @@ class HomePontoService { body: { "User": { "UserId": user.funcionario?.funcionarioId.toString(), - "Database": user.databaseId.toString() + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "Periodo": { "DataInicial": DateFormat('yyyy-MM-dd').format(user.periodo!.dataInicial!), @@ -37,4 +38,33 @@ class HomePontoService { debugPrint("HomePontoService getHome erro ${e.toString()}"); } } + + + Future getExpedientes(UsuarioPonto user) async { + String _api = "/api/apontamento/expedientes"; + try{ + final MyHttpResponse response = await _http.post( + url: Config.conf.apiAssepontoNova! + _api, + body: { + "User": { + "UserId": user.funcionario?.funcionarioId.toString(), + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, + }, + "Periodo": { + "DataInicial": DateFormat('yyyy-MM-dd').format(user.periodo!.dataInicial!), + "DataFinal": DateFormat('yyyy-MM-dd').format(user.periodo!.dataFinal!) + } + } + ); + + if(response.isSucess){ + Map dadosJson = response.data; + HomePontoModel homeModel = HomePontoModel.fromMap(dadosJson); + return homeModel; + } + } catch(e){ + debugPrint("HomePontoService getHome erro ${e.toString()}"); + } + } + } \ No newline at end of file diff --git a/lib/services/ponto/marcacao.dart b/lib/services/ponto/marcacao.dart index 6cdc76b..dca85ab 100644 --- a/lib/services/ponto/marcacao.dart +++ b/lib/services/ponto/marcacao.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; +import '../../model/ponto/apontamento/apontamento_dia.dart'; import '../http/http.dart'; @@ -10,38 +12,33 @@ class MarcacoesService { final HttpCli _http = HttpCli(); - Future> getEspelho(UsuarioPonto? user) async { + Future getEspelho(UsuarioPonto? user, DateTime data) async { if(user != null){ - String _api = "/api/apontamento/Marcacoes"; + String _api = "/api/apontamento/dia"; final MyHttpResponse response = await _http.post( url: Config.conf.apiAssepontoNova! + _api, body: { "User": { "UserId": user.funcionario?.funcionarioId.toString(), - "Database": user.databaseId.toString() + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "Periodo": { - "DataInicial": DateFormat('yyyy-MM-dd').format(user.periodo!.dataInicial!), - "DataFinal": DateFormat('yyyy-MM-dd').format(user.periodo!.dataFinal!) + "DataInicial": DateFormat('yyyy-MM-dd').format(data), } } ); + print(response.data); try{ if(response.isSucess){ var dadosJson = response.data; - List temp = dadosJson['Apontamento']; - if(temp.isNotEmpty){ - List listaTemporaria = []; - listaTemporaria = temp.map((e) => Marcacao.fromMap(e)).toList(); - return listaTemporaria; - } + final model = ApontamentoDiaModel.fromMap(dadosJson); + return model; } }catch(e){ debugPrint("MarcacoesService getEspelho Erro Try ${e.toString()}"); } } - return []; } diff --git a/lib/services/ponto/memorando.dart b/lib/services/ponto/memorando.dart index 228475c..92b0ea9 100644 --- a/lib/services/ponto/memorando.dart +++ b/lib/services/ponto/memorando.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../model/model.dart'; import '../../config.dart'; import '../http/http.dart'; @@ -20,7 +21,7 @@ class MemorandosServices { body = { "user": { "UserId": usuario.funcionario?.funcionarioId.toString(), - "Database": usuario.databaseId.toString() + "Database": usuario.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "data": "${data}", "tipo": tipo, @@ -35,7 +36,7 @@ class MemorandosServices { body = { "user": { "UserId": usuario.funcionario?.funcionarioId.toString(), - "Database": usuario.databaseId.toString() + "Database": usuario.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "data": "${data}", "tipo": tipo, @@ -71,7 +72,7 @@ class MemorandosServices { body: { "User": { "UserId": usuario?.funcionario?.funcionarioId.toString(), - "Database": usuario?.databaseId.toString() + "Database": usuario?.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, }, "Periodo": { "DataInicial": DateFormat('yyyy-MM-dd').format(inicio), diff --git a/lib/services/ponto/registro_ponto.dart b/lib/services/ponto/registro_ponto.dart index 056d8c6..3330921 100644 --- a/lib/services/ponto/registro_ponto.dart +++ b/lib/services/ponto/registro_ponto.dart @@ -1,10 +1,9 @@ import 'dart:async'; -import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import '../../controllers/controllers.dart'; +import '../../controllers/tablet/empresa_manager.dart'; import '../../enums/enums.dart'; import '../../model/model.dart'; import '../../config.dart'; @@ -18,26 +17,20 @@ class RegistroService { final SqlitePontoService _sqlitePonto = SqlitePontoService(); - Future postPontoMarcar(UsuarioPonto user, double? latitude, double? longitude) async { + Future postPontoMarcar(UsuarioPonto user, double? latitude, double? longitude, String? endereco, String? token) async { String _api = "/api/marcacao/verificarMarcacoesFuncionario"; - String? endereco; - if(latitude != null && longitude != null){ - try { - endereco = await Conversoes.getEndereco(latitude, longitude); - } catch (e) { - debugPrint('erro endereco $e'); - } - } - DateTime now = DateTime.now(); final MyHttpResponse response = await _http.post( url: Config.conf.apiAssepontoNova! + _api, decoder: false, timeout: 8, body: { "UserId": user.funcionario?.funcionarioId.toString(), - "Database": user.databaseId.toString(), + "Database": user.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database, "Origem": kIsWeb ? 4 : 3, - "ListaMarcacoes": [ + "setorId": user.funcionario?.setorId, + "Email": user.funcionario?.email, + if(token != null) "Token": token, + if(latitude != null) "ListaMarcacoes": [ { "Latitude": latitude, "Longitude": longitude, @@ -114,20 +107,23 @@ class RegistroService { } Future postPontoMarcacoesOffline(UsuarioPonto? usuario, - List> listOff, {bool delete = false}) async { + List> listOff, {bool delete = false, String? token}) async { String _api = "/api/marcacao/verificarMarcacoesFuncionario"; if(usuario?.databaseId != null){ try{ final body = { - "Database": "${usuario!.databaseId}", - "UserId": usuario.funcionario?.funcionarioId.toString(), + "Database": "${usuario?.databaseId?.toString() ?? EmpresaPontoManager.empresa?.database}", + "UserId": usuario?.funcionario?.funcionarioId.toString(), "Origem": kIsWeb ? 4 : 7, + "setorId": usuario?.funcionario?.setorId, + "Email": usuario?.funcionario?.email, + "Token": token, "ListaMarcacoes": listOff }; final MyHttpResponse response = await _http.post( - url: (Config.conf.apiAssepontoNova ?? 'https://www.asseponto.com.br/ApiAsseponto') + _api, + url: Config.conf.apiAssepontoNova! + _api, body: body, decoder: false ); diff --git a/lib/services/ponto/usuario.dart b/lib/services/ponto/usuario.dart index 1214081..1701707 100644 --- a/lib/services/ponto/usuario.dart +++ b/lib/services/ponto/usuario.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import '../../data/local/user_local_sources.dart'; import '../../model/model.dart'; import '../../config.dart'; import '../http/http.dart'; @@ -9,14 +10,15 @@ import '../sqlite_ponto.dart'; class UserPontoService { final HttpCli _http = HttpCli(); - final SqlitePontoService _pontoService = SqlitePontoService(); + final UserLocalSources _pontoService = UserLocalSources(); - Future signInAuth({required String email,required String senha,String? token}) async { + Future signInAuth({required String email, + required String senha,String? token, Function(String)? onError}) async { String _api = "/api/login"; UsuarioPonto? _user; try { final MyHttpResponse response = await _http.post( - url: Config.conf.apiAssepontoNova! + _api, timeout: 5, + url: Config.conf.apiAssepontoNova! + _api, timeout: 10, body: { "Email": email.trim().replaceAll(' ', ''), "Senha": senha.trim().replaceAll(' ', ''), @@ -30,7 +32,13 @@ class UserPontoService { UsuarioPonto user = UsuarioPonto.fromMap(json, false); return user; }else{ - throw json['StatusLogin']['Descricao']; + _user = await authOffiline( + email.trim().replaceAll(' ', ''), + senha.trim().replaceAll(' ', '') + ); + if (_user != null) { + return _user; + } } }else { _user = await authOffiline( @@ -42,38 +50,55 @@ class UserPontoService { } } debugPrint('${response.codigo} signInAuth'); - throw "Login ou Senha Invalido"; + + if(response.codigo == 404){ + throw "Login ou Senha Invalido"; + } + if(onError != null) { + onError('Email:$email, Senha:$senha - \nCodigo:${response.codigo} - \nDados:${response.data}'); + } + throw "Falha no login, tente novamente mais tarde!"; } catch (e) { - _user = await authOffiline(email.trim().replaceAll(' ', ''), senha.trim().replaceAll(' ', '')); + _user = await authOffiline( + email.trim().replaceAll(' ', ''), + senha.trim().replaceAll(' ', '') + ); if(_user != null){ return _user; }else { + if(e != "Login ou Senha Invalido" && onError != null) { + onError('Email:$email, Senha:$senha - \nErro:$e'); + } debugPrint('$e signInAuth'); - throw e.toString(); + rethrow; } } } Future authOffiline(String _email, String _senha) async { try{ - List? _user = await _pontoService.getUser(email: _email, senha: _senha); - if(_user != null && _user.isNotEmpty){ - UsuarioPonto user = UsuarioPonto.fromMap(_user.first, true); - return user; - } + final user = await _pontoService.getUser(email: _email, senha: _senha); + return user; }catch(e) { debugPrint(e.toString()); } return null; } + Future deleteUser() async { + try{ + await _pontoService.deleteUser(); + return true; + }catch(e) { + debugPrint(e.toString()); + } + return false; + } + Future authNotificacao() async { try{ - List? _user = await _pontoService.getUser(); - if(_user != null && _user.isNotEmpty){ - UsuarioPonto user = UsuarioPonto.fromMap(_user.first, true); - return user; - } + final user = await _pontoService.getUser(); + return user; }catch(e) { debugPrint(e.toString()); } diff --git a/lib/services/services.dart b/lib/services/services.dart index 91cc7c2..fc0ea72 100644 --- a/lib/services/services.dart +++ b/lib/services/services.dart @@ -13,8 +13,6 @@ export 'ponto/registro_ponto.dart'; export 'ponto/comprovante.dart'; export 'holerite/holerite.dart'; -export 'holerite/informe.dart'; -export 'holerite/primeiro_acesso.dart'; export 'holerite/usuario.dart'; export 'holerite/senha.dart'; @@ -23,16 +21,16 @@ export 'tablet/usuario_offiline.dart'; export 'tablet/usuario_codigo.dart'; export 'asseweb/usuario.dart'; -export 'asseweb/home.dart'; -export 'asseweb/obrigacoes.dart'; export 'asseweb/senha.dart'; -export 'asseweb/boletos.dart'; + export 'biometria.dart'; export 'sendmail.dart'; export 'update_app.dart'; export 'sqlite_ponto.dart'; +export 'http/http.dart'; + abstract class Services { final HttpCli http = HttpCli(); diff --git a/lib/services/sqlite_ponto.dart b/lib/services/sqlite_ponto.dart index 7ea4302..37acfaf 100644 --- a/lib/services/sqlite_ponto.dart +++ b/lib/services/sqlite_ponto.dart @@ -11,7 +11,7 @@ class SqlitePontoService { final DBPonto _service = DBPonto(); - Future salvarNovoUsuario(Map toMap) async { + /*Future salvarNovoUsuario(Map toMap) async { try{ Database bancoDados = await _service.db; await bancoDados.delete("users"); @@ -21,14 +21,28 @@ class SqlitePontoService { debugPrint(e.toString()); } } +*/ + + Future getUser({String? email, String? senha}) async { + try{ + Database bancoDados = await _service.db; + String where = ''; + if(email != null) where = "where email = '$email' and senha = '$senha' "; + String sql = "SELECT * FROM users $where "; + List users = await bancoDados.rawQuery(sql); + return users; + }catch(e){ + debugPrint(e.toString()); + } + } + Future salvarUsers(List dados) async { try{ Database bancoDados = await _service.db; await bancoDados.delete('users'); - await bancoDados.execute('INSERT INTO users(iduser, nome, pis, registro) VALUES ' + - dados.map((e) => e.toMap()).toList().toString().replaceAll('[', '').replaceAll(']', '') ); + await bancoDados.execute('INSERT INTO users(userId, nome, pis, registro) VALUES ${dados.map((e) => e.toMap()).toList().toString().replaceAll('[', '').replaceAll(']', '')}' ); String sql = "SELECT * FROM users"; List _emp = await bancoDados.rawQuery(sql); if(_emp.isNotEmpty){ @@ -41,19 +55,6 @@ class SqlitePontoService { } } - Future getUser({String? email, String? senha}) async { - try{ - Database bancoDados = await _service.db; - String where = ''; - if(email != null) where = "where email = '$email' and senha = '$senha' "; - String sql = "SELECT * FROM users $where "; - List users = await bancoDados.rawQuery(sql); - return users; - }catch(e){ - debugPrint(e.toString()); - } - } - Future getEmpresa() async { try{ Database bancoDados = await _service.db; @@ -110,7 +111,7 @@ class SqlitePontoService { } } - deleteSalvarMarcacoes(List del, int? user) async { + Future deleteSalvarMarcacoes(List del, int? user) async { try { var bancoDados = await _service.db; String sql = "delete FROM marcacao where iduser = ?"; @@ -164,7 +165,7 @@ class SqlitePontoService { } } - deleteHistorico(int? user) async { + Future deleteHistorico(int? user) async { if(Config.conf.nomeApp == VersaoApp.PontoApp){ try{ var bancoDados = await _service.db; diff --git a/lib/services/tablet/empresa.dart b/lib/services/tablet/empresa.dart index e2f6d5c..10858e4 100644 --- a/lib/services/tablet/empresa.dart +++ b/lib/services/tablet/empresa.dart @@ -24,19 +24,19 @@ class EmpresaPontoService { } Future signIn(String email, String pass) async { - String _api = "/api/database/GetDatabaseGestor"; + String _api = "/api/emp/login"; try{ final response = await _http.post( - url: Config.conf.apiAsseponto! + _api, + url: Config.conf.apiAssepontoNova! + _api, body: { - "email": email, - "pass": pass + "Email": email, + "Senha": pass } ); if(response.isSucess){ Map dadosJson = response.data; - if(dadosJson.isNotEmpty && dadosJson.containsKey('Database')){ + if(dadosJson.isNotEmpty){ EmpresaPontoModel empresa = EmpresaPontoModel.fromJson(dadosJson, pass, email); if(empresa.ativado ?? false){ bool result = await salvarEmpresa(empresa); diff --git a/lib/services/tablet/usuario_codigo.dart b/lib/services/tablet/usuario_codigo.dart index b3a0f1f..e049d6f 100644 --- a/lib/services/tablet/usuario_codigo.dart +++ b/lib/services/tablet/usuario_codigo.dart @@ -9,23 +9,22 @@ import '../http/http.dart'; class UsuarioPontoCodigoService { final HttpCli _http = HttpCli(); - verificarcodigo(EmpresaPontoModel empresa, String codigo, int tipo) async { - String _api = "/api/funcionario/RegistroLogin"; + Future verificarcodigo(int database, String cnpj, String codigo) async { + String _api = "/api/codigo"; UsuarioPonto? user; try{ final MyHttpResponse response = await _http.post( - url: Config.conf.apiAsseponto! + _api, + url: Config.conf.apiAssepontoNova! + _api, body: { - "database": empresa.database.toString(), - "registro": codigo + "database": database, + "cnpj": cnpj, + "cod": codigo } ); if(response.isSucess){ - Map dadosJson = response.data ; - if(dadosJson.toString() != "Registro inálido" && dadosJson.containsKey('Id')){ - user = UsuarioPonto.fromMapTab(dadosJson, codigo); - } + Map dadosJson = response.data ; + user = UsuarioPonto.fromMap(dadosJson, false); }else{ user = await verificarCodigoOff(codigo); } diff --git a/lib/services/tablet/usuario_offiline.dart b/lib/services/tablet/usuario_offiline.dart index 42780a6..b30e4aa 100644 --- a/lib/services/tablet/usuario_offiline.dart +++ b/lib/services/tablet/usuario_offiline.dart @@ -22,7 +22,7 @@ class UserPontoOffilineServices { ); if (response.isSucess) { List dadosJson = response.data; - if (dadosJson.isNotEmpty && dadosJson.first.containsKey('Id')) { + if (dadosJson.isNotEmpty) { List listUsers = dadosJson.map((e) => UserPontoOffine.fromMap(e)).toList(); _sqlitePonto.salvarUsers(listUsers); return listUsers; diff --git a/lib/services/update_app.dart b/lib/services/update_app.dart index e9d06cc..2d3aa0b 100644 --- a/lib/services/update_app.dart +++ b/lib/services/update_app.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import '../../config.dart'; import 'http/http.dart'; @@ -10,6 +11,11 @@ class UpdateAppService { Future postUpdateApp() async { String _api = "/api/Versoes"; + if(Config.versao == "99.0.0"){ + final packageInfo = await PackageInfo.fromPlatform(); + Config.versao = packageInfo.version; + } + Map bod = { "App": Config.conf.nomeApp.toString().replaceAll('VersaoApp.', ''), "Versao": Config.versao, diff --git a/lib/ui/smartphone/config/config_screen.dart b/lib/ui/smartphone/config/config_screen.dart index 19ef88f..a38bcb0 100644 --- a/lib/ui/smartphone/config/config_screen.dart +++ b/lib/ui/smartphone/config/config_screen.dart @@ -10,8 +10,10 @@ import '../../../controllers/controllers.dart'; import '../../../../config.dart'; class ConfigScreen extends StatefulWidget { + const ConfigScreen({super.key}); + @override - _ScreenConfigState createState() => _ScreenConfigState(); + State createState() => _ScreenConfigState(); } class _ScreenConfigState extends State { @@ -20,93 +22,90 @@ class _ScreenConfigState extends State { Widget build(BuildContext context) { bool color = context.watch().darkTemas; - return CustomScaffold.custom( - context: context, - height: 40, conf: true, + return HomeIoWidget( + height: 30, conf: true, appTitle: 'Configurações', - body: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children:[ - Container( - padding: EdgeInsets.all(10), - child: Column( - children: [ - SwitchListTile( - title: CustomText.text("Modo Escuro"), - value: color, - onChanged: (bool valor){ - context.read().darkTemas = valor; + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children:[ + Container( + padding: const EdgeInsets.all(10), + child: Column( + children: [ + SwitchListTile( + title: CustomText.text("Modo Escuro"), + value: color, + onChanged: (bool valor){ + context.read().darkTemas = valor; + } + ), + if(!kIsWeb) + const Divider(height: 2,), + if(!kIsWeb) + Consumer( + builder: (_, bio, __) { + return SwitchListTile( + title: CustomText.text("Login com Bio/Face"), + value: bio.bio, + onChanged: (bool valor) { + if(bio.checkbio){ + bio.perguntar = !valor; + bio.bio = valor; + } } - ), - if(!kIsWeb) - Divider(height: 2,), - if(!kIsWeb) - Consumer( - builder: (_, bio, __) { - return SwitchListTile( - title: CustomText.text("Login com Bio/Face"), - value: bio.bio, - onChanged: (bool valor) { - if(bio.checkbio){ - bio.perguntar = !valor; - bio.bio = valor; - } - } - ); - }, - ), - Divider(height: 2,), - ], + ); + }, ), - ), + const Divider(height: 2,), + ], + ), + ), - Column( - children: [ - if(Config.conf.nomeApp == VersaoApp.HoleriteApp) - Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.red), - borderRadius: const BorderRadius.all(Radius.circular(8)) + Column( + children: [ + if(Config.conf.nomeApp == VersaoApp.HoleriteApp) + Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.red), + borderRadius: const BorderRadius.all(Radius.circular(8)) + ), + margin: const EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text("Deletar sua conta!", + style: TextStyle(color: Colors.redAccent)), + const Text("Esta ação excluirá permanentemente sua conta e não poderá ser desfeita.", + style: TextStyle(color: Colors.redAccent)), + const SizedBox(height: 8), + ElevatedButton( + style: const ButtonStyle( + backgroundColor: WidgetStatePropertyAll(Colors.red), + ), + onPressed: () async { + _showDeleteDialog(context); + }, + child: const Center(child: Text("Excluir", + style: TextStyle(color: Colors.white),),), ), - margin: EdgeInsets.symmetric(horizontal: 20), - padding: const EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text("Deletar sua conta!", - style: TextStyle(color: Colors.redAccent)), - const Text("Esta ação excluirá permanentemente sua conta e não poderá ser desfeita.", - style: TextStyle(color: Colors.redAccent)), - const SizedBox(height: 8), - ElevatedButton( - style: const ButtonStyle( - backgroundColor: MaterialStatePropertyAll(Colors.red), - ), - onPressed: () async { - _showDeleteDialog(context); - }, - child: const Center(child: Text("Excluir", - style: TextStyle(color: Colors.white),),), - ), - ], - ), - ), - if(Config.conf.nomeApp == VersaoApp.HoleriteApp) - SizedBox(height: 20,), + ], + ), + ), + if(Config.conf.nomeApp == VersaoApp.HoleriteApp) + const SizedBox(height: 20,), - Padding( - padding: const EdgeInsets.only(bottom: 15, right: 25), - child: Row(mainAxisAlignment: MainAxisAlignment.end, - children: [ - CustomText.text('Versao '+ Config.versao), - ], - ), - ) - ], + Padding( + padding: const EdgeInsets.only(bottom: 15, right: 25), + child: Row(mainAxisAlignment: MainAxisAlignment.end, + children: [ + CustomText.text('Versao ${Config.versao}'), + ], + ), ) - ] - ) + ], + ) + ] ) ); } @@ -123,17 +122,17 @@ class _ScreenConfigState extends State { style: TextStyle(color: Colors.redAccent), ), ), - content: SingleChildScrollView( + content: const SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ Text("Depois de excluir esta conta, não há como voltar atrás.",), SizedBox(height: 25), Text("Deseja excluir sua conta?",), ], ), ), - actionsPadding: EdgeInsets.symmetric(horizontal: 15), + actionsPadding: const EdgeInsets.symmetric(horizontal: 15), actions: [ TextButton( child: const Text("Cancelar", ), diff --git a/lib/ui/smartphone/holerite/detelhes_holerite.dart b/lib/ui/smartphone/holerite/detelhes_holerite.dart index 4ae1dc6..7c10893 100644 --- a/lib/ui/smartphone/holerite/detelhes_holerite.dart +++ b/lib/ui/smartphone/holerite/detelhes_holerite.dart @@ -1,62 +1,28 @@ -import 'dart:typed_data'; - -import 'package:flutter/foundation.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; -import 'package:universal_io/io.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; -import 'package:intl/intl.dart'; -import 'package:flutter_awesome_alert_box/flutter_awesome_alert_box.dart'; -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:charts_common/common.dart' as common; -import 'package:charts_common/src/common/color.dart' as colors; +import 'package:responsive_framework/responsive_framework.dart'; -import '../../../common/common.dart'; -import '../../../config.dart'; +import '../../../common/custom_snackbar.dart'; +import '../../../common/heros_file.dart'; +import '../../../common/load_screen.dart'; import '../../../controllers/controllers.dart'; import '../../../model/model.dart'; +import 'graficos_holerite.dart'; class DetalhesHolerite extends StatefulWidget { - final List holerite; - final int idComp; - final int mes; - final int ano; - DetalhesHolerite(this.holerite, this.idComp, this.mes, this.ano); + DatumHolerite holerite; + DetalhesHolerite(this.holerite, {super.key}); @override - _DetalhesHoleriteState createState() => _DetalhesHoleriteState(); + State createState() => _DetalhesHoleriteState(); } class _DetalhesHoleriteState extends State { - bool load = false; - HoleriteModel? holerite; - var mask = NumberFormat.currency(locale: 'pt_Br', customPattern: 'R\$#,##0.00'); - - init(){ - if(context.read().dropdowntipo != ''){ - List? _temp = widget.holerite.where((e) => - e.holeriteTipo == context.read().dropdowntipo).toList(); - if(_temp.isNotEmpty){ - holerite = _temp.first; - } - } - if(widget.holerite.isNotEmpty){ - holerite ??= widget.holerite.first; - context.read().dropdowntipoInit(holerite?.holeriteTipo ?? ''); - } - } - - @override - void initState() { - init(); - super.initState(); - } - - double getPorcentagem(double valor, double total){ if(total == 0){ return 0.0; @@ -72,385 +38,46 @@ class _DetalhesHoleriteState extends State { @override Widget build(BuildContext context) { - double height = MediaQuery.of(context).size.height - (WidgetsBinding.instance.window.padding.top); - double width = MediaQuery.of(context).size.width; - - return Scaffold( - body: Container( - decoration: BoxDecoration( - border: Border(bottom: BorderSide(width: 70, - color: Theme.of(context).scaffoldBackgroundColor)) - ), - width: width, - height: height, - alignment: Alignment.topRight, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12), - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - mainAxisSize: MainAxisSize.max, - children: [ - if(kIsWeb) - Row( - mainAxisAlignment: !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? - width >= 1500 ? MainAxisAlignment.center : - MainAxisAlignment.end : MainAxisAlignment.center, - children: [ - Container( - height: 35, - margin: const EdgeInsets.symmetric(horizontal: 40,), - padding: const EdgeInsets.symmetric(horizontal: 10), - constraints: BoxConstraints( - maxWidth: !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone - ? width >= 1052 ? 400 : 200 : 250 ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - value: context.watch().dropdowntipo, - iconSize: 20, - elevation: 0, - dropdownColor: Colors.white, - icon: Icon(Icons.arrow_drop_down, color: Colors.black,), - style: TextStyle(color: Colors.black), - underline: Container(), - onChanged: (newValue) async { - setState(() { - context.read().dropdowntipo = newValue!; - holerite = widget.holerite.firstWhere((e) => e.holeriteTipo == newValue); - }); - }, - items: widget.holerite.map((e) => e.holeriteTipo).toList() - .map>(( value) { - return DropdownMenuItem( - value: value, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: CustomText.text(value ?? ''), - ), - ); - }).toList(), - ), - ), - ], - ), - if(kIsWeb) - SizedBox(height: 20,), - - if(!kIsWeb) - Container( - height: 35, - margin: const EdgeInsets.symmetric(horizontal: 40,), - padding: const EdgeInsets.symmetric(horizontal: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - value: context.watch().dropdowntipo, - iconSize: 20, - elevation: 0, - icon: Icon(Icons.arrow_drop_down, color: Colors.black,), - style: TextStyle(color: Colors.black), - underline: Container(), - onChanged: (newValue) async { - setState(() { - context.read().dropdowntipo = newValue!; - holerite = widget.holerite.firstWhere((e) => e.holeriteTipo == newValue); - }); - }, - items: widget.holerite.map((e) => e.holeriteTipo).toList() - .map>(( value) { - return DropdownMenuItem( - value: value, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: CustomText.text(value ?? ''), - ), - ); - }).toList(), - ), - ), - - Container( - height: 195, width: width, - padding: EdgeInsets.symmetric( - horizontal: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? 20 : 0), - decoration: BoxDecoration( - color: kIsWeb ? Colors.white : null, - borderRadius: BorderRadius.circular(15), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - width: 110, - padding: EdgeInsets.symmetric( - vertical: 10, - horizontal: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? 40 : 0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: const EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.blue[900], - borderRadius: BorderRadius.circular(30) - ), - child: Center( - child: CustomText.text("Proventos\n${mask.format(holerite?.vencimentos ?? 0)}", - textAlign: TextAlign.center, autoSize: true, - style: const TextStyle(color: Colors.white), - ), - ), - ), - const SizedBox(height: 10,), - Container( - padding: const EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.red[900], - borderRadius: BorderRadius.circular(30) - ), - child: Center( - child: CustomText.text("Descontos\n${mask.format(holerite?.descontos ?? 0)}", - textAlign: TextAlign.center, autoSize: true, - style: const TextStyle(color: Colors.white), - ), - ), - ), - const SizedBox(height: 10,), - Container( - padding: const EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.orange, - borderRadius: BorderRadius.circular(30) - ), - child: Center( - child: CustomText.text("Liquido\n${mask.format(holerite?.liquido ?? 0)}", - textAlign: TextAlign.center, autoSize: true, - style: const TextStyle(color: Colors.white), - ), - ), - ), - ], - ), - ), - - Container( - alignment: Alignment.center, - padding: const EdgeInsets.only(top: 5, left: 10, right: 10), - width: width * 0.59 > width - 110 ? width - 110 : width * 0.59, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - CustomText.text('Proventos'.toUpperCase(), - style: const TextStyle(color: Colors.black),), - const SizedBox(height: 4,), - Container( - height: 138, - constraints: kIsWeb - && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? BoxConstraints(maxWidth: width >= 852 ? 400 : 300) : null, - child: charts.PieChart([charts.Series( - id: 'Pizza', - domainFn: (ChartPizza sales, _) => sales.desc, - measureFn: (ChartPizza sales, _) => sales.valor, - colorFn: (ChartPizza sales, cor) { - if(sales.desc != 'Proventos'){ - return colors.Color.fromHex( code: 'fFF9800'); - }else{ - return colors.Color.fromHex( code: 'f0D47A1'); - } - }, - data: [ - ChartPizza('Proventos', - getPorcentagem(holerite?.vencimentos ?? 10.0, - holerite?.vencimentos != null && holerite?.liquido != null - ? (holerite?.vencimentos ?? 0) + (holerite?.liquido ?? 0) : - holerite?.vencimentos != null || holerite?.liquido != null - ? (holerite?.vencimentos ?? 0) + (holerite?.liquido ?? 0) : 100.0), - ), - ChartPizza('Liquido', - getPorcentagem(holerite?.liquido ?? 0.0, - holerite?.vencimentos != null && holerite?.liquido != null - ? (holerite?.vencimentos ?? 0) + (holerite?.liquido ?? 0) : - holerite?.vencimentos != null || holerite?.liquido != null - ? (holerite?.vencimentos ?? 0) + (holerite?.liquido ?? 0) : 100.0),) - ], - labelAccessorFn: (ChartPizza sales, _) => '${sales.valor.toString()}%') - ], - animate: true, - layoutConfig: charts.LayoutConfig( - leftMarginSpec: common.MarginSpec.fixedPixel(0), - rightMarginSpec: common.MarginSpec.fixedPixel(0), - topMarginSpec: common.MarginSpec.fixedPixel(12), - bottomMarginSpec: common.MarginSpec.fixedPixel(2), - ), - behaviors: [ - charts.DatumLegend( - position: charts.BehaviorPosition.bottom, - horizontalFirst: true, - cellPadding: EdgeInsets.only(left: width * 0.06, bottom: 2), - entryTextStyle: common.TextStyleSpec( - fontSize: (11).toInt(), color: charts.MaterialPalette.black, - ), - showMeasures: false, - legendDefaultMeasure: charts.LegendDefaultMeasure.none, - ), - ], - defaultRenderer: charts.ArcRendererConfig( - arcRendererDecorators: [ - charts.ArcLabelDecorator( - insideLabelStyleSpec: charts.TextStyleSpec( - fontSize: (12).toInt(), color: charts.MaterialPalette.white, - ), - outsideLabelStyleSpec: charts.TextStyleSpec( - fontSize: (11).toInt(), color: charts.MaterialPalette.black, - ), - labelPosition: charts.ArcLabelPosition.auto, - ) - ]) - ), - ) - ], - ) - ), - ], - ), - ), - const SizedBox(height: 10,), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? Colors.white : Colors.grey[100], - borderRadius: BorderRadius.circular(15) - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - CustomText.text('Líquido nos ultimos ${kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? '6' : '3'} meses', style: const TextStyle(color: Colors.black),), - const SizedBox(height: 10,), - Container(height: height * 0.25, - child: charts.BarChart( - [charts.Series( - id: 'Holerites', - displayName: 'Líquido nos ultimos ${kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone ? '6' : '3'} meses', - domainFn: (ChartColum sales, _) => sales.data, - measureFn: (ChartColum sales, _) => sales.valor, - colorFn: (_, __) => colors.Color.fromHex( code: 'f0D47A1'), - data: HoleriteModel().toColum(holerite!.historicos!.toList(), context), - labelAccessorFn: (ChartColum sales, _) => - 'R\$${sales.valor.toInt()}', - ), - ], - selectionModels: [ - charts.SelectionModelConfig( - type: charts.SelectionModelType.info, - updatedListener: (v){ - if(v.selectedDatum.length > 0){ - context.read().dropdowndata = v.selectedDatum.first.datum.data; - } - } - ) - ], - animate: true, - vertical: true, - domainAxis: charts.OrdinalAxisSpec( - renderSpec: charts.SmallTickRendererSpec( + return GraficosHolerite( + titulo: '${widget.holerite.attributes?.type ?? ''} ${widget.holerite.attributes?.competence ?? ''}', + totalVencimentos: widget.holerite.attributes?.data?.funcionarioResumo!.totalVencimentos, + totalDescontos: widget.holerite.attributes?.data?.funcionarioResumo?.totalDescontos, + liquido: widget.holerite.attributes?.data?.funcionarioResumo?.liquido, + listChartColum: context.read().filtroHolerite(widget.holerite, kIsWeb + && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? 6 : 3), + updatedChartColum: (v){ + if(v.selectedDatum.isNotEmpty){ + setState(() { + widget.holerite = context.read() + .selectHolerite(v.selectedDatum.first.datum.ind); + }); + } + }, + onPressfloatingButton: () async { + try { + carregar(context); + final file = await context.read().holeriteresumoBytes( + widget.holerite.id, + widget.holerite.attributes?.isSigned ?? false, + '${widget.holerite.attributes?.month}/${widget.holerite.attributes?.year}' + ); + Navigator.pop(context); + if(file != null){ + await Navigator.push(context, MaterialPageRoute( + builder: (context)=> FileHero( + 'holerite-${widget.holerite.attributes?.year}-${widget.holerite.attributes?.month}', + memori: file, ))); + }else{ + CustomSnackbar.error(text: 'Não foi possivel carregar o holerite, verifique sua conexão com internet!', context: context); + } + } catch(e){ + debugPrint(e.toString()); + } - // Tick and Label styling here. - labelStyle: charts.TextStyleSpec( - fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 12 : (width * 0.03).toInt(), // size in Pts. - color: charts.MaterialPalette.black), - - // Change the line colors to match text color. - lineStyle: const charts.LineStyleSpec( - color: charts.MaterialPalette.black))), - defaultRenderer: common.BarRendererConfig( - barRendererDecorator: charts.BarLabelDecorator( - labelPadding: (height * 0.020).toInt(), - labelPlacement: common.BarLabelPlacement.opposeAxisBaseline, - insideLabelStyleSpec: charts.TextStyleSpec( - fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 12 : (width * 0.03).toInt(), color: charts.MaterialPalette.white, - ), - outsideLabelStyleSpec: charts.TextStyleSpec( - fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 12 : (width * 0.03).toInt(), color: charts.MaterialPalette.black, - ) - ), - cornerStrategy: const charts.ConstCornerStrategy(20), - ), - ), - ), - ], - ) - ), - const SizedBox(height: 15,), - CustomText.text("Disponibilizado\n${holerite?.dataCriacao ?? ''}", textAlign: TextAlign.center,), - ], - ), - ), - ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: FloatingActionButton.extended( - heroTag: 'File', - backgroundColor: Config.corPri, - focusColor: Colors.blue, - foregroundColor: Colors.amber, - hoverColor: Colors.green, - splashColor: Colors.tealAccent, - // focusColor: Settings.corPri.withOpacity(0.5), - onPressed: () async { - File? a; - Uint8List? b; - String? html; - try { - carregar(context); - b = await context.read().holeriteresumoBytes( - UserHoleriteManager.sUser, widget.idComp, widget.mes, widget.ano, holerite?.holeriteTipoCod ); - - /*if(kIsWeb){ - - }else{ - a = await context.read().holeriteresumo( - UserHoleriteManager.sUser, widget.idComp, widget.mes, widget.ano, holerite?.holeriteTipoCod ); - }*/ - } catch(e){ - debugPrint(e.toString()); - } finally { - Navigator.pop(context); - } - if(b != null){ - await Navigator.push(context, MaterialPageRoute( - builder: (context)=> FileHero( 'holerite-${widget.ano}-${widget.mes}', - file: a, memori: b, html: html,))); - }else{ - InfoAlertBox( - context: context, - title: 'Atenção', - infoMessage: 'Não foi possivel carregar o holerite\nverifique sua conexão com internet!', - buttonText: 'ok' - ); - } - }, - label: CustomText.text('Visualizar e Assinar'.toUpperCase(), - style: const TextStyle(fontSize: 20, color: Colors.white),) - - ), + } ); } } diff --git a/lib/ui/smartphone/holerite/detelhes_holerite_pdf.dart b/lib/ui/smartphone/holerite/detelhes_holerite_pdf.dart deleted file mode 100644 index f3bb9b8..0000000 --- a/lib/ui/smartphone/holerite/detelhes_holerite_pdf.dart +++ /dev/null @@ -1,113 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - - -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:charts_common/common.dart' as common; -import 'package:charts_common/src/common/color.dart' as colors; - -import '../../../common/common.dart'; -import '../../../config.dart'; -import '../../../controllers/controllers.dart'; -import '../../../model/model.dart'; -import 'detelhes_holerite.dart'; - - -class DetalhesHoleritePDF extends StatefulWidget { - BoxConstraints constraints; - DetalhesHoleritePDF(this.constraints); - - @override - _DetalhesHoleriteState createState() => _DetalhesHoleriteState(); -} - -class _DetalhesHoleriteState extends State { - bool load = false; - CompetenciasModel? _comp; - - @override - void initState() { - super.initState(); - } - - - @override - Widget build(BuildContext context) { - //double height = MediaQuery.of(context).size.height - (WidgetsBinding.instance.window.padding.top); - double width = MediaQuery.of(context).size.width; - - - return Consumer2( - builder: (_, use, holerite, __){ - Future?> dadosHolerite() async { - List? _holerite; - try{ - if(holerite.listcompetencias.isEmpty){ - holerite.listcompetencias = await holerite.competencias(UserHoleriteManager.sUser, ); - } - if(holerite.listcompetencias.isNotEmpty){ - _comp = holerite.listcompetencias.firstWhere( - (e) => e.descricao == holerite.dropdowndata); - if(_comp != null){ - _holerite = await holerite.resumoscreen(_comp!.id!, _comp!.mes!, _comp!.ano!); - } - } - } catch(e){ - _holerite = null; - } - return _holerite; - } - - return Scaffold( - body: Container( - constraints: widget.constraints, - height: widget.constraints.maxHeight, - width: width, - alignment: Alignment.topCenter, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), - child: FutureBuilder?>( - future: dadosHolerite(), - builder: (_, snapshot){ - Widget resultado; - switch( snapshot.connectionState ){ - case ConnectionState.none : - case ConnectionState.waiting : - resultado = Center( - child: Container( - width: 50, - child: const LinearProgressIndicator(minHeight: 10, backgroundColor: Colors.transparent,) - ), - ); - break; - case ConnectionState.active : - case ConnectionState.done : - if( snapshot.hasError || !snapshot.hasData || snapshot.data == null){ - resultado = GestureDetector( - child: const Icon(Icons.autorenew_outlined, - color: Config.corPri, size: 70,), - onTap: (){ - dadosHolerite(); - } - ); - }else { - if(snapshot.data != null){ - resultado = Center( - child: DetalhesHolerite( - snapshot.data!.reversed.toList(),_comp!.id!, _comp!.mes!, _comp!.ano! - ), - ); - }else{ - resultado = Center(child: CustomText.text('')); - } - } - break; - } - return resultado; - } - ), - ), - ); - } - ); - } -} diff --git a/lib/ui/smartphone/holerite/graficos_holerite.dart b/lib/ui/smartphone/holerite/graficos_holerite.dart new file mode 100644 index 0000000..0362113 --- /dev/null +++ b/lib/ui/smartphone/holerite/graficos_holerite.dart @@ -0,0 +1,353 @@ +import 'package:assecontservices/utils/extensions.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:charts_common/common.dart' as common; +import 'package:charts_common/src/common/color.dart' as colors; +import 'package:responsive_framework/responsive_framework.dart'; + + +import '../../../common/common.dart'; +import '../../../config.dart'; +import '../../../model/model.dart'; + + +class GraficosHolerite extends StatefulWidget { + final String? titulo; + final double? totalVencimentos; + final double? liquido; + final double? totalDescontos; + final List? listChartColum; + final Function(charts.SelectionModel)? updatedChartColum; + final Function()? onPressfloatingButton; + final String? createDate; + final bool isLoad; + + + const GraficosHolerite( + {super.key, this.titulo, + this.totalVencimentos, + this.liquido, + this.totalDescontos, + this.listChartColum, + this.updatedChartColum, + this.createDate, + this.onPressfloatingButton, + this.isLoad = false, + }); + + @override + State createState() => _DetalhesHoleriteState(); +} + +class _DetalhesHoleriteState extends State { + double getPorcentagem(double valor, double total){ + if(total == 0){ + return 0.0; + } + double result = 0; + try{ + result = (valor/total) * 100.0; + }catch(e){ + result = 0; + } + return double.parse(result.toStringAsFixed(1)); + } + + @override + Widget build(BuildContext context) { + double height = MediaQuery.of(context).size.height - (WidgetsBinding.instance.window.padding.top); + double width = MediaQuery.of(context).size.width; + + return Scaffold( + appBar: widget.titulo == null ? null : AppBar( + title: Text(widget.titulo ?? ''), + ), + body: Container( + decoration: widget.titulo == null ? null : BoxDecoration( + border: Border(bottom: BorderSide(width: 70, + color: Theme.of(context).scaffoldBackgroundColor)) + ), + width: width, + height: height, + alignment: Alignment.topRight, + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12), + child: CustomShimmerLoad( + isLoad: widget.isLoad, + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + height: 195, width: width, + padding: EdgeInsets.symmetric( + horizontal: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? 20 : 0), + decoration: BoxDecoration( + color: kIsWeb ? Colors.white : null, + borderRadius: BorderRadius.circular(15), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 110, + padding: EdgeInsets.symmetric( + vertical: 10, + horizontal: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? 40 : 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: const EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.blue[900], + borderRadius: BorderRadius.circular(30) + ), + child: Center( + child: CustomText.text("Proventos\n${ + widget.totalVencimentos.real()}", + textAlign: TextAlign.center, autoSize: true, + style: const TextStyle(color: Colors.white), + ), + ), + ), + const SizedBox(height: 10,), + Container( + padding: const EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.red[900], + borderRadius: BorderRadius.circular(30) + ), + child: Center( + child: CustomText.text("Descontos\n${ + widget.totalDescontos.real()}", + textAlign: TextAlign.center, autoSize: true, + style: const TextStyle(color: Colors.white), + ), + ), + ), + const SizedBox(height: 10,), + Container( + padding: const EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.orange, + borderRadius: BorderRadius.circular(30) + ), + child: Center( + child: CustomText.text("Liquido\n${ + widget.liquido.real()}", + textAlign: TextAlign.center, autoSize: true, + style: const TextStyle(color: Colors.white), + ), + ), + ), + ], + ), + ), + + Container( + alignment: Alignment.center, + padding: const EdgeInsets.only(top: 5, left: 10, right: 10), + width: width * 0.59 > width - 110 ? width - 110 : width * 0.59, + decoration: BoxDecoration( + color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? Colors.white : Colors.grey[100], + borderRadius: BorderRadius.circular(15) + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + CustomText.text('Proventos'.toUpperCase(), + style: const TextStyle(color: Colors.black),), + const SizedBox(height: 4,), + Container( + height: 138, + constraints: kIsWeb + && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? BoxConstraints(maxWidth: width >= 852 ? 400 : 300) : null, + child: charts.PieChart([charts.Series( + id: 'Pizza', + domainFn: (ChartPizza sales, _) => sales.desc, + measureFn: (ChartPizza sales, _) => sales.valor, + colorFn: (ChartPizza sales, cor) { + if(sales.desc != 'Proventos'){ + return colors.Color.fromHex( code: 'fFF9800'); + }else{ + return colors.Color.fromHex( code: 'f0D47A1'); + } + }, + data: [ + ChartPizza('Proventos', + getPorcentagem(widget.totalVencimentos ?? 10.0, + widget.totalVencimentos != null && widget.liquido != null + ? (widget.totalVencimentos ?? 0) + (widget.liquido ?? 0) : + widget.totalVencimentos != null || widget.liquido != null + ? (widget.totalVencimentos ?? 0) + (widget.liquido ?? 0) : 100.0), + ), + ChartPizza('Liquido', + getPorcentagem(widget.liquido ?? 0.0, + widget.totalVencimentos != null && widget.liquido != null + ? (widget.totalVencimentos ?? 0) + (widget.liquido ?? 0) : + widget.totalVencimentos != null || widget.liquido != null + ? (widget.totalVencimentos ?? 0) + (widget.liquido ?? 0) : 100.0),) + ], + labelAccessorFn: (ChartPizza sales, _) => '${sales.valor.toString()}%') + ], + animate: true, + layoutConfig: charts.LayoutConfig( + leftMarginSpec: common.MarginSpec.fixedPixel(0), + rightMarginSpec: common.MarginSpec.fixedPixel(0), + topMarginSpec: common.MarginSpec.fixedPixel(12), + bottomMarginSpec: common.MarginSpec.fixedPixel(2), + ), + behaviors: [ + charts.DatumLegend( + position: charts.BehaviorPosition.bottom, + horizontalFirst: true, + cellPadding: EdgeInsets.only(left: width * 0.06, bottom: 2), + entryTextStyle: common.TextStyleSpec( + fontSize: (11).toInt(), + color: charts.MaterialPalette.black, + ), + showMeasures: false, + legendDefaultMeasure: charts.LegendDefaultMeasure.none, + ), + ], + defaultRenderer: charts.ArcRendererConfig( + arcRendererDecorators: [ + charts.ArcLabelDecorator( + insideLabelStyleSpec: charts.TextStyleSpec( + fontSize: (12).toInt(), + color: charts.MaterialPalette.white, + ), + outsideLabelStyleSpec: charts.TextStyleSpec( + fontSize: (11).toInt(), + color: charts.MaterialPalette.black, + ), + labelPosition: charts.ArcLabelPosition.auto, + ) + ]) + ), + ) + ], + ) + ), + ], + ), + ), + const SizedBox(height: 10,), + if(widget.listChartColum != null && widget.listChartColum!.isNotEmpty) ...[ + Container( + alignment: Alignment.center, + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? Colors.white : Colors.grey[100], + borderRadius: BorderRadius.circular(15) + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + CustomText.text('Líquido nos ultimos ${kIsWeb + && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? '6' : '3'} meses', + style: const TextStyle(color: Colors.black),), + const SizedBox(height: 10,), + SizedBox( + height: height * 0.25, + child: charts.BarChart( + [charts.Series( + id: 'Holerites', + displayName: 'Líquido nos ultimos ${kIsWeb + && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? '6' : '3'} meses', + domainFn: (ChartColum sales, _) => sales.data, + measureFn: (ChartColum sales, _) => sales.valor, + colorFn: (_, __) => colors.Color.fromHex( code: 'f0D47A1'), + data: widget.listChartColum ?? [], + labelAccessorFn: (ChartColum sales, _) => + 'R\$${sales.valor.toInt()}', + ), + ], + selectionModels: [ + charts.SelectionModelConfig( + type: charts.SelectionModelType.info, + updatedListener: widget.updatedChartColum + ) + ], + animate: true, + vertical: true, + domainAxis: charts.OrdinalAxisSpec( + renderSpec: charts.SmallTickRendererSpec( + labelStyle: charts.TextStyleSpec( + fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? 12 : (width * 0.03).toInt(), // size in Pts. + color: charts.MaterialPalette.black), + + // Change the line colors to match text color. + lineStyle: const charts.LineStyleSpec( + color: charts.MaterialPalette.black))), + defaultRenderer: common.BarRendererConfig( + barRendererDecorator: charts.BarLabelDecorator( + labelPadding: (height * 0.020).toInt(), + labelPlacement: common.BarLabelPlacement.opposeAxisBaseline, + insideLabelStyleSpec: charts.TextStyleSpec( + fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? 12 : (width * 0.03).toInt(), + color: charts.MaterialPalette.white, + ), + outsideLabelStyleSpec: charts.TextStyleSpec( + fontSize: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? 12 : (width * 0.03).toInt(), + color: charts.MaterialPalette.black, + ) + ), + cornerStrategy: const charts.ConstCornerStrategy(20), + ), + ), + ), + ], + ) + ), + const SizedBox(height: 15,), + ], + + if(widget.createDate != null) + CustomText.text("Disponibilizado\n${widget.createDate ?? ''}", + textAlign: TextAlign.center,), + ], + ), + ), + ), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, + floatingActionButton: widget.onPressfloatingButton == null ? null + : FloatingActionButton.extended( + heroTag: 'File', + backgroundColor: Config.corPri, + focusColor: Colors.blue, + foregroundColor: Colors.amber, + hoverColor: Colors.green, + splashColor: Colors.tealAccent, + // focusColor: Settings.corPri.withOpacity(0.5), + onPressed: widget.onPressfloatingButton, + label: CustomText.text('Visualizar e Assinar'.toUpperCase(), + style: const TextStyle(fontSize: 20, color: Colors.white),) + ), + ); + } +} diff --git a/lib/ui/smartphone/holerite/holerite_screen.dart b/lib/ui/smartphone/holerite/holerite_screen.dart index 336dfb8..d8d5051 100644 --- a/lib/ui/smartphone/holerite/holerite_screen.dart +++ b/lib/ui/smartphone/holerite/holerite_screen.dart @@ -1,213 +1,79 @@ - -import 'package:flutter/foundation.dart'; +import 'package:assecontservices/utils/utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; import '../../../common/common.dart'; -import '../../../config.dart'; +import '../../../common/custom_livelist.dart'; import '../../../helper/helper.dart'; -import '../../../model/model.dart'; import '../../../controllers/controllers.dart'; +import '../../../model/holerite/holerite/holerite.dart'; +import '../../../utils/custom_navigator.dart'; import '../../ui.dart'; import 'detelhes_holerite.dart'; class HoleriteScreen extends StatefulWidget { + const HoleriteScreen({super.key}); @override - _HoleriteScreenState createState() => _HoleriteScreenState(); + State createState() => _HoleriteScreenState(); } class _HoleriteScreenState extends State { final GlobalKey _scaffoldKey = GlobalKey(); - CompetenciasModel? _comp; - ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); - - + final ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); + final ScrollController scrollController = ScrollController(); @override void initState() { - context.read().competencias(UserHoleriteManager.sUser); - + context.read().init(); super.initState(); } @override Widget build(BuildContext context) { - //double width = MediaQuery.of(context).size.width; - double width = MediaQuery.of(context).size.width; - - return Consumer2( - builder: (_, use, holerite, __){ - - Future?> dadosHolerite() async { - List? _holerite; - try{ - if(holerite.listcompetencias.isEmpty){ - holerite.listcompetencias = await holerite.competencias(UserHoleriteManager.sUser); - } - if(holerite.listcompetencias.isNotEmpty){ - _comp = holerite.listcompetencias.firstWhere( - (e) => e.descricao == holerite.dropdowndata); - if(_comp != null){ - _holerite = await holerite.resumoscreen(_comp!.id!, _comp!.mes!, _comp!.ano!); - } - } - } catch(e){ - _holerite = null; - } - return _holerite; - } - return CustomScaffold.custom( + return Consumer( + builder: (_, holerite, __){ + return HomeIoWidget( key: _scaffoldKey, - context: context, - height: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? 0 : 70, - appTitle: 'Meu Holerite', - appbar: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? null : Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + height: 30, + appTitle: 'Meus Holerites', + body: Column( children: [ + /*FilterWidget( + onFiltro: (filtro ) { + holerite.pageSize = filtro; + }, + filtro: holerite.pageSize, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + ),*/ Container( - alignment: Alignment.topLeft, - child: Container( - height: 40, - constraints: BoxConstraints(maxWidth: 400), - margin: const EdgeInsets.only(left: 30, right: 30, bottom: 20, top: 5), - padding: const EdgeInsets.symmetric(horizontal: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - dropdownColor: Colors.white, - value: holerite.dropdowndata, - iconSize: 20, - elevation: 0, - icon: const Icon(Icons.arrow_drop_down, color: Colors.black,), - style: const TextStyle(color: Colors.black), - underline: Container(), - onChanged: ( newValue) { - holerite.dropdowndata = newValue!; - dadosHolerite(); - }, - items: holerite.listcompetencias.map((e) => e.descricao). - toList().map>(( value) { - return DropdownMenuItem( - value: value ?? '', - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: CustomText.text(value ?? ''), - ), - ); - }).toList(), - ), - ), - ), - ], - ), - body: Stack( - children: [ - - Container( - //height: MediaQuery.of(context).size.height - 100 - AppBar().preferredSize.height -MediaQuery.of(context).padding.top, child: !connectionStatus.hasConnection ? - Center(child: CustomText.text('Verifique sua Conexão com Internet')) : - holerite.dropdowndata == 'Holerites' ? - Center( - child: CustomText.text('Usuário não tem Holerites', - style: TextStyle(fontSize: 20),), - ) : FutureBuilder?>( - future: dadosHolerite(), - builder: (context, snapshot){ - Widget resultado; - switch( snapshot.connectionState ){ - case ConnectionState.none : - case ConnectionState.waiting : - resultado = Center( - child: Container( - width: 50, - child: const LinearProgressIndicator( - minHeight: 10, backgroundColor: Colors.transparent,) - ), - ); - break; - case ConnectionState.active : - case ConnectionState.done : - if( snapshot.hasError || !snapshot.hasData || snapshot.data == null){ - resultado = GestureDetector( - child: Icon(Icons.autorenew_outlined, - color: Config.corPri, size: 70,), - onTap: (){ - dadosHolerite(); - } - ); - }else { - if(snapshot.data?.isNotEmpty ?? false){ - resultado = Center( - child: DetalhesHolerite( - snapshot.data!.reversed.toList(), - _comp!.id!, _comp!.mes!, _comp!.ano! - ) - ); - }else{ - resultado = Center(child: CustomText.text('Nenhum Holerite disponivel')); - } - } - break; - } - return resultado; - }, - ) + Center(child: CustomText.text('Verifique sua Conexão com Internet')) : + CustomLiveList( + scrollController: scrollController, + list: holerite.listHolerites, + isLoad: holerite.load, + content: (DatumHolerite item) { + return ListTile( + leading: Text('${item.attributes?.month ?? ''}\n${item.attributes?.year ?? ''}', + textAlign: TextAlign.center,), + title: Text(item.attributes?.type.toName ?? '', + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),), + subtitle: Text(item.attributes?.data?.funcionarioResumo?.liquido?.real() ?? '0'), + ); + }, + onTap: (DatumHolerite item) { + CustomNavigator.routeClass(context, DetalhesHolerite(item)); + }, + endScroll: () async { + if(holerite.pageSize == 0 && ((holerite.holerites?.meta?.pagination?.pageCount ?? 0) < holerite.page)){ + await holerite.newPageHolerite(); + } + }, + ) ), - - if(kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone) - Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(height: 10,), - Container( - alignment: Alignment.topLeft, - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Container( - height: 35, - constraints: BoxConstraints(maxWidth: width >= 1052 ? 400 : 200), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - border: Border.all(color: Colors.grey, width: 1) - ), - child: DropdownButton( - isExpanded: true, - dropdownColor: Colors.white, - value: holerite.dropdowndata, - iconSize: 20, - elevation: 0, - icon: Icon(Icons.arrow_drop_down, color: Colors.black,), - style: TextStyle(color: Colors.black), - underline: Container(), - onChanged: ( newValue) { - holerite.dropdowndata = newValue!; - dadosHolerite(); - }, - items: holerite.listcompetencias.map((e) => e.descricao). - toList().map>(( value) { - return DropdownMenuItem( - value: value ?? '', - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8), - child: CustomText.text(value ?? ''), - ), - ); - }).toList(), - ), - ), - ), - ], - ), ], ) ); diff --git a/lib/ui/smartphone/intro/intro_screen.dart b/lib/ui/smartphone/intro/intro_screen.dart index 102a901..04e6f44 100644 --- a/lib/ui/smartphone/intro/intro_screen.dart +++ b/lib/ui/smartphone/intro/intro_screen.dart @@ -8,8 +8,10 @@ import '../../../controllers/controllers.dart'; class IntroScreen extends StatefulWidget { + const IntroScreen({super.key}); + @override - _IntroScreenState createState() => _IntroScreenState(); + State createState() => _IntroScreenState(); } class _IntroScreenState extends State { @@ -18,9 +20,12 @@ class _IntroScreenState extends State { @override void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 800), (){ - if(mounted){ - UpdateAppManager().checkVersion(context); + WidgetsBinding.instance.addPostFrameCallback((_) { + try { + final UpdateAppManager service = UpdateAppManager(); + service.checkVersion(context); + } catch (e) { + Navigator.pushNamedAndRemoveUntil(context, '/login', (route) => false); } }); } @@ -29,8 +34,7 @@ class _IntroScreenState extends State { Widget build(BuildContext context) { return Container( alignment: Alignment.center, - - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topRight, end: Alignment.bottomLeft, @@ -38,7 +42,7 @@ class _IntroScreenState extends State { ) ), child: Container( - constraints: BoxConstraints(maxWidth: 500), + constraints: const BoxConstraints(maxWidth: 500), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -47,7 +51,7 @@ class _IntroScreenState extends State { child: Image.asset('assets/imagens/LOGO_ASSECONT.png', fit: BoxFit.fitWidth, package: 'assecontservices'), ), - Container( + const SizedBox( width: 50, child: LinearProgressIndicator(minHeight: 10, backgroundColor: Colors.transparent,) ) diff --git a/lib/ui/smartphone/tela_base/custom_menu_item.dart b/lib/ui/smartphone/tela_base/custom_menu_item.dart index 9dcf6de..95183d8 100644 --- a/lib/ui/smartphone/tela_base/custom_menu_item.dart +++ b/lib/ui/smartphone/tela_base/custom_menu_item.dart @@ -1,18 +1,19 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:responsive_framework/responsive_breakpoints.dart'; +import 'package:responsive_framework/responsive_framework.dart'; + import '../../../config.dart'; import '../../../common/common.dart'; class CustomMenuItem extends StatelessWidget { - CustomMenuItem(this.icon, this.titulo, this.function, {this.isSelect = false}); + const CustomMenuItem(this.icon, this.titulo, this.function, {super.key, this.isSelect = false}); - Widget icon; - String titulo; - VoidCallback function; - bool isSelect; + final Widget icon; + final String titulo; + final VoidCallback function; + final bool isSelect; @override Widget build(BuildContext context) { @@ -42,31 +43,31 @@ class CustomMenuItem extends StatelessWidget { ), ), ), - ) : Container( + ) : SizedBox( width: 115, child: Column( children: [ InkWell( onTap: function, child: Container( - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), height: 70, width: 70, - decoration: BoxDecoration( + decoration: const BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(20)), color: Config.corPri ), child: IconTheme( - data: IconThemeData(color: Colors.white, size: 40), + data: const IconThemeData(color: Colors.white, size: 40), child: icon ), ), ), if(kIsWeb) - SizedBox(height: 5,), + const SizedBox(height: 5,), Padding( padding: const EdgeInsets.all(2.0), child: CustomText.text(titulo, textAlign: TextAlign.center, autoSize: true, - style: TextStyle(height: 0)), + style: const TextStyle(height: 0)), ) ], ), diff --git a/lib/ui/smartphone/tela_base/custom_scaffold.dart b/lib/ui/smartphone/tela_base/custom_scaffold.dart index 6d0affe..1d20773 100644 --- a/lib/ui/smartphone/tela_base/custom_scaffold.dart +++ b/lib/ui/smartphone/tela_base/custom_scaffold.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -15,32 +16,59 @@ import 'custom_menu_item.dart'; import 'drawer_web.dart'; +class HomeWidget extends StatelessWidget { + const HomeWidget({super.key, this.keyListMenu, required this.listMenu, + this.height, required this.body, this.foto, this.dados, this.keyMenu, + this.key1, this.key2, this.key3, this.key4, this.key5, this.key6, + required this.appTitle, this.nome, this.cargo, this.onAlter, this.buttom, + this.isListView = true, this.onFoto = true, this.showRegistro = false, + this.modalPass + }); -class CustomScaffold { - - static home({GlobalKey? keyListMenu, required List listMenu, double? height, Widget? buttom, - required BuildContext context,required Widget body, bool isListView = true, String? foto, Widget? dados, - GlobalKey? keyMenu, GlobalKey? key1, GlobalKey? key2, GlobalKey? key3, GlobalKey? key4, GlobalKey? key5, - required String appTitle,String? nome, String? cargo}){ + final GlobalKey? keyListMenu; + final List listMenu; + final double? height; + final Widget? buttom; + final Widget body; + final bool isListView; + final String? foto; + final Widget? dados; + final GlobalKey? keyMenu; + final GlobalKey? key1; + final GlobalKey? key2; + final GlobalKey? key3; + final GlobalKey? key4; + final GlobalKey? key5; + final GlobalKey? key6; + final String appTitle; + final String? nome; + final String? cargo; + final bool onFoto; + final bool showRegistro; + final Function()? onAlter; + final Function()? modalPass; + @override + Widget build(BuildContext context) { double h = 180 + MediaQuery.of(context).padding.top; - return kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone - ? homeWeb( - context: context, + return kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone + ? HomeWebWidget( body: body, nome:nome , cargo:cargo , buttom: buttom, listMenus: listMenu, - foto: Hero( + onAlter: onAlter, + foto: onFoto ? Hero( tag: "foto", child: GestureDetector( onTap: () async { await Navigator.push(context, MaterialPageRoute( builder: (context) => ImageHero( - foto == null ? null : base64Decode(foto) + foto == null ? null : base64Decode(foto!) )) ); //setState(() {}); @@ -59,7 +87,7 @@ class CustomScaffold { color: Config.corPri, image: foto != null ? DecorationImage( - image: MemoryImage(base64Decode(foto)), + image: MemoryImage(base64Decode(foto!)), fit: BoxFit.cover) : null), child: foto == null ? const Icon( @@ -69,14 +97,14 @@ class CustomScaffold { ) : null, ), ), - ), + ) : null, dados: dados, appTitle: appTitle - - ) : custom( + ) : HomeIoWidget( key: Config.scaffoldKey, body: body, height: height ?? h, + onAlter: onAlter, appbar: SafeArea( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -100,7 +128,12 @@ class CustomScaffold { key2: key2, key3: key3, key4: key4, - key5: key5), + key5: key5, + key6: key6, + onAlter: onAlter, + registro: showRegistro, + modalPass: modalPass + ), ], ), const SizedBox( @@ -112,55 +145,66 @@ class CustomScaffold { Expanded( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10), - child: dados ?? Container(), + child: dados ?? Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CustomText.text(nome, + style: const TextStyle(fontSize: 20, color: Colors.white), + textAlign: TextAlign.center,), + CustomText.text(cargo, + style: const TextStyle(fontSize: 14, color: Colors.white), + textAlign: TextAlign.center), + ], + ), ), ), - Padding( - padding: const EdgeInsets.all(5.0), - child: Hero( - tag: "foto", - child: GestureDetector( - onTap: () async { - await Navigator.push(context, - MaterialPageRoute( - builder: (context) => ImageHero( - foto == null ? null : base64Decode(foto) - )) - ); - //setState(() {}); - }, - child: Container( - alignment: Alignment.topCenter, - height: 100, - width: 100, - decoration: BoxDecoration( - border: foto != null - ? Border.all( - color: Config.corPri, width: 2) - : Border.all( - color: Colors.white, width: 5), - borderRadius: BorderRadius.circular(100), - color: Config.corPri, - image: foto != null - ? DecorationImage( - image: MemoryImage(base64Decode(foto)), - fit: BoxFit.cover) - : null), - child: foto == null ? const Icon( - CupertinoIcons.person, - color: Colors.white, - size: 90, - ) : null, + if(onFoto) + Padding( + padding: const EdgeInsets.all(5.0), + child: Hero( + tag: "foto", + child: GestureDetector( + onTap: () async { + await Navigator.push(context, + MaterialPageRoute( + builder: (context) => ImageHero( + foto == null ? null : base64Decode(foto!) + )) + ); + //setState(() {}); + }, + child: Container( + alignment: Alignment.topCenter, + height: 100, + width: 100, + decoration: BoxDecoration( + border: foto != null + ? Border.all( + color: Config.corPri, width: 2) + : Border.all( + color: Colors.white, width: 5), + borderRadius: BorderRadius.circular(100), + color: Config.corPri, + image: foto != null + ? DecorationImage( + image: MemoryImage(base64Decode(foto!)), + fit: BoxFit.cover) + : null), + child: foto == null ? const Icon( + CupertinoIcons.person, + color: Colors.white, + size: 90, + ) : null, + ), ), ), ), - ), ], ), ], ), ), - context: context, buttom: buttom, home: true , expanAppbar: Container( @@ -169,51 +213,90 @@ class CustomScaffold { height: 120, alignment: Alignment.center, child: isListView ? - ListView( - scrollDirection: Axis.horizontal, - padding: EdgeInsets.symmetric(horizontal: 10), - children: listMenu, - ) : - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: listMenu, - ), + ListView( + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.symmetric(horizontal: 10), + children: listMenu, + ) : + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: listMenu, + ), ), ); } +} + - static calendario({GlobalKey? key, required Function(DateTime) funcData, - required CalendarWeekController controller, required Widget body, - required List listdecoration, required String appTitle, Widget? buttom, - required BuildContext context, DateTime? dataInit, DateTime? dataMin, DateTime? dataMax}){ +class HomeCalendarioWidget extends StatefulWidget { + const HomeCalendarioWidget({super.key, this.globalKey, required this.funcData, + required this.controller, required this.body, required this.listdecoration, this.showActions = true, + required this.appTitle, this.buttom, this.dataInit, this.dataMin, this.dataMax}); - if(dataInit != null){ - controller.jumpToDate(dataInit); + final GlobalKey? globalKey; + final Function(DateTime) funcData; + final CalendarWeekController controller; + final Widget body; + final List listdecoration; + final String appTitle; + final Widget? buttom; + final DateTime? dataInit; + final DateTime? dataMin; + final DateTime? dataMax; + final showActions; + + @override + State createState() => _HomeCalendarioWidgetState(); +} + +class _HomeCalendarioWidgetState extends State { + + @override + void initState() { + + if(widget.dataInit != null){ + if(widget.dataMax != null){ + DateTime data = widget.dataInit!.isBefore(widget.dataMax!) ? widget.dataInit! : widget.dataMax!; + + print(data); + widget.controller.jumpToDate(data); + }else{ + widget.controller.jumpToDate(widget.dataInit!); + } } + super.initState(); + } - return custom( - key: key, - body: body, - appTitle: appTitle, + @override + Widget build(BuildContext context) { + return HomeIoWidget( + key: widget.globalKey, + body: widget.body, + appTitle: widget.appTitle, height: 110, - buttom: buttom, + showActions: widget.showActions, + buttom: widget.buttom, appbar: CalendarWeek( - controller: controller, + controller: widget.controller, height: 100, showMonth: true, - activeIcon: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone, - backgroundColor: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone + activeIcon: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone, + backgroundColor: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? Config.corPribar : Colors.transparent, - minDate: dataMin ?? DateTime(2020), - maxDate: dataMax ?? DateTime(DateTime.now().year + 1), - dateStyle: TextStyle(color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? Config.corPri : Colors.white,), - dayOfWeekStyle: TextStyle(color: Config.corPri), - todayDateStyle: TextStyle(color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? Config.corPri : Colors.white,), - monthStyle: TextStyle(color: Colors.white), + minDate: widget.dataMin ?? DateTime(2019,12,29), + maxDate: widget.dataMax ?? DateTime(DateTime.now().year + 1), + dateStyle: TextStyle(color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? Config.corPri : Colors.white,), + dayOfWeekStyle: const TextStyle(color: Config.corPri), + todayDateStyle: TextStyle(color: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? Config.corPri : Colors.white,), + monthStyle: const TextStyle(color: Colors.white), pressedDateBackgroundColor: Colors.white30, pressedDateStyle: const TextStyle(color: Colors.white), - weekendsStyle: TextStyle(color: Config.corPri), - onDatePressed: funcData, + weekendsStyle: const TextStyle(color: Config.corPri), + onDatePressed: widget.funcData, dayOfWeek: const [ "Seg", "Tec", @@ -237,36 +320,69 @@ class CustomScaffold { "Novembro", "Dezembro" ], - decorations: listdecoration + decorations: widget.listdecoration ), - context: context, ); } +} - static custom({GlobalKey? key, required BuildContext context, required double height, bool conf = false, - Widget? appbar, required Widget body, bool home = false, Widget? expanAppbar, String? appTitle, Widget? buttom}){ - return Scaffold( - key: key, - appBar: appTitle == null || kIsWeb && !ResponsiveBreakpoints.of(context).isMobile - && !ResponsiveBreakpoints.of(context).isPhone && appTitle != 'Configurações' ? null : AppBar( - title: CustomText.text(appTitle, style: TextStyle(fontSize: 16), textAlign: TextAlign.center), - centerTitle: true, - actions: [ - actions(context, aponta: home, config: conf), - ], - ), - body: SizedBox( - height: MediaQuery.of(context).size.height, - width: double.infinity, - child: Column( + +class HomeIoWidget extends StatelessWidget { + const HomeIoWidget({super.key, this.globalKey, required this.height, + this.onAlter, this.appbar, required this.body, this.expanAppbar, this.showActions = true, + this.appTitle, this.buttom, this.conf = false, this.home = false, this.floatingActionButtonLocation, + }); + final GlobalKey? globalKey; + final double height; + final bool conf; + final Function()? onAlter; + final Widget? appbar; + final Widget body; + final bool home; + final Widget? expanAppbar; + final String? appTitle; + final Widget? buttom; + final bool showActions; + final FloatingActionButtonLocation? floatingActionButtonLocation; + + + @override + Widget build(BuildContext context) { + return SafeArea( + bottom: Platform.isAndroid, + left: false, + right: false, + top: false, + child: Scaffold( + key: globalKey, + appBar: appTitle == null || kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone && appTitle != 'Configurações' ? null : AppBar( + title: CustomText.text(appTitle, style: const TextStyle(fontSize: 16), textAlign: TextAlign.center), + centerTitle: true, + backgroundColor: context.watch().darkTemas + ? Theme.of(context).appBarTheme.backgroundColor : Config.corPribar, + foregroundColor: context.watch().darkTemas + ? Theme.of(context).appBarTheme.backgroundColor : Config.corPribar, + shadowColor: context.watch().darkTemas + ? Theme.of(context).appBarTheme.backgroundColor : Config.corPribar, + surfaceTintColor: context.watch().darkTemas + ? Theme.of(context).appBarTheme.backgroundColor : Config.corPribar, + actions: showActions ? [ + actions(context, aponta: home, config: conf, onAlter: onAlter), + ] : null, + scrolledUnderElevation: 0, elevation: 0, + ), + body: Column( children: [ Stack( children: [ Container( height: height, width: MediaQuery.of(context).size.width, - decoration: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile && !ResponsiveBreakpoints.of(context).isPhone ? null : BoxDecoration( + decoration: kIsWeb && !ResponsiveBreakpoints.of(context).isMobile + && !ResponsiveBreakpoints.of(context).isPhone ? null + : BoxDecoration( color: context.watch().darkTemas ? Theme.of(context).appBarTheme.backgroundColor : Config.corPribar, borderRadius: const BorderRadius.only( @@ -277,90 +393,110 @@ class CustomScaffold { child: appbar ), if(expanAppbar != null) - expanAppbar + expanAppbar! ], ), Expanded( child: body ), ], - ) + ), + floatingActionButtonLocation: buttom == null ? null + : floatingActionButtonLocation ?? FloatingActionButtonLocation.centerFloat, + floatingActionButton: buttom ), - floatingActionButtonLocation: buttom == null ? null : FloatingActionButtonLocation.centerFloat, - floatingActionButton: buttom ); } +} - - static homeWeb({GlobalKey? key, required BuildContext context, Widget? buttom, - required Widget body, required List listMenus, required Widget foto, - Widget? dados, required String appTitle,required String? nome,required String? cargo, }){ +class HomeWebWidget extends StatelessWidget { + const HomeWebWidget({super.key, this.globalKey, this.buttom, required this.body, this.onAlter, + required this.listMenus, this.foto, this.dados, required this.appTitle, this.nome, + this.cargo, }); + final GlobalKey? globalKey; + final Widget? buttom; + final Widget body; + final List listMenus; + final Widget? foto; + final Function()? onAlter; + final Widget? dados; + final String appTitle; + final String? nome; + final String? cargo; - return Scaffold( - key: key, - body: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Card( - margin: EdgeInsets.zero, - elevation: 4, - child: Container( - width: 180, height: double.infinity, - color: Theme.of(context).appBarTheme.backgroundColor, - child: DrawerWebView(listMenus, foto, appTitle ) + @override + Widget build(BuildContext context) { + return SafeArea( + bottom: Platform.isAndroid, + left: false, + right: false, + top: false, + child: Scaffold( + key: globalKey, + body: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Card( + margin: EdgeInsets.zero, + elevation: 4, + child: Container( + width: 180, height: double.infinity, + color: Theme.of(context).appBarTheme.backgroundColor, + child: DrawerWebView(listMenus, foto, appTitle ) + ), ), - ), - Expanded( - child: Scaffold( - body: Column( - children: [ - Container( - decoration: BoxDecoration( - color: context.watch().darkTemas - ? Theme.of(context).appBarTheme.backgroundColor : Colors.white, - boxShadow: const [ - BoxShadow( - color: Colors.grey, - offset: Offset(5.5, 0), // Ajuste a sombra vertical aqui - blurRadius: 4, // Ajuste a intensidade da sombra aqui + Expanded( + child: Scaffold( + body: Column( + children: [ + Container( + decoration: BoxDecoration( + color: context.watch().darkTemas + ? Theme.of(context).appBarTheme.backgroundColor : Colors.white, + boxShadow: const [ + BoxShadow( + color: Colors.grey, + offset: Offset(5.5, 0), // Ajuste a sombra vertical aqui + blurRadius: 4, // Ajuste a intensidade da sombra aqui + ), + ], ), - ], - ), - margin: EdgeInsets.zero, - child: Padding( - padding: const EdgeInsets.only(top: 10, left: 20, right: 10, bottom: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.only(top: 10, left: 20, right: 10, bottom: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - CustomText.text(nome, - style: TextStyle(fontSize: 20), textAlign: TextAlign.center), - CustomText.text(cargo, - style: TextStyle(fontSize: 10), textAlign: TextAlign.center), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomText.text(nome, + style: const TextStyle(fontSize: 20), textAlign: TextAlign.center), + CustomText.text(cargo, + style: const TextStyle(fontSize: 10), textAlign: TextAlign.center), + ], + ), + + actions(context, aponta: true, onAlter: onAlter), ], ), - - actions(context, aponta: true), - ], + ), ), - ), - ), - Expanded( - child: body + Expanded( + child: body + ), + ], ), - ], + floatingActionButtonLocation: buttom == null ? null + : FloatingActionButtonLocation.centerFloat, + floatingActionButton: buttom ), - floatingActionButtonLocation: buttom == null ? null : FloatingActionButtonLocation.centerFloat, - floatingActionButton: buttom ), - ), - ], + ], + ), ), - ); } -} \ No newline at end of file +} diff --git a/lib/ui/smartphone/tela_base/drawer_web.dart b/lib/ui/smartphone/tela_base/drawer_web.dart index 3aa0cec..f8ab7d8 100644 --- a/lib/ui/smartphone/tela_base/drawer_web.dart +++ b/lib/ui/smartphone/tela_base/drawer_web.dart @@ -1,15 +1,14 @@ -import 'package:assecontservices/assecontservices.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class DrawerWebView extends StatefulWidget { - Widget foto; - String? titulo; - List children; + final Widget? foto; + final String? titulo; + final List children; - DrawerWebView(this.children, this.foto, this.titulo, {Key? key}) : super(key: key); + const DrawerWebView(this.children, this.foto, this.titulo, {super.key}); @override State createState() => _DrawerWebViewState(); @@ -25,14 +24,17 @@ class _DrawerWebViewState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( - padding: const EdgeInsets.only(top: 10), - child: widget.foto, - ), - const Padding( - padding: EdgeInsets.all(8.0), - child: Divider(), - ), + if(widget.foto != null)...[ + Padding( + padding: const EdgeInsets.only(top: 10), + child: widget.foto, + ), + const Padding( + padding: EdgeInsets.all(8.0), + child: Divider(), + ), + ], + Expanded( child: ListView( children: widget.children diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 9374f27..4ace0e5 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -5,6 +5,6 @@ export 'smartphone/tela_base/custom_scaffold.dart'; export 'smartphone/config/config_screen.dart'; -export 'smartphone/holerite/detelhes_holerite_pdf.dart'; export 'smartphone/holerite/detelhes_holerite.dart'; -export 'smartphone/holerite/holerite_screen.dart'; \ No newline at end of file +export 'smartphone/holerite/holerite_screen.dart'; +export 'smartphone/holerite/graficos_holerite.dart'; \ No newline at end of file diff --git a/lib/utils/camera.dart b/lib/utils/camera.dart index 66ee96a..5c19dc0 100644 --- a/lib/utils/camera.dart +++ b/lib/utils/camera.dart @@ -17,7 +17,8 @@ class CameraService { await _picker.pickImage( source: ImageSource.camera, preferredCameraDevice: CameraDevice.front, - maxHeight: 600, + imageQuality: 90, + maxHeight: 1280, //imageQuality: 70, ).then((value) async { if(value != null){ @@ -34,7 +35,7 @@ class CameraService { }); return img; }catch (e){ - debugPrint('Erro camera ' + e.toString()); + debugPrint('Erro camera $e'); return null; } } @@ -45,8 +46,8 @@ class CameraService { try{ await _picker.pickImage( source: ImageSource.gallery, - imageQuality: 60, - maxHeight: 600, + imageQuality: 90, + maxHeight: 1280, ).then((value) async { if(value != null){ if(kIsWeb){ @@ -63,7 +64,7 @@ class CameraService { }); return img; }catch (e){ - debugPrint('Erro getGallery ' + e.toString()); + debugPrint('Erro getGallery $e'); return null; } } diff --git a/lib/utils/conversoes.dart b/lib/utils/conversoes.dart index 5ef12e3..3865e04 100644 --- a/lib/utils/conversoes.dart +++ b/lib/utils/conversoes.dart @@ -1,15 +1,16 @@ +import 'dart:async'; import 'package:universal_io/io.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; +import 'package:flutter_html_to_pdf_plus/flutter_html_to_pdf_plus.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:geocoding/geocoding.dart' as geo; class Conversoes { + static Future htmlToPdf({required String html, String? nome}) async { try{ var htmlContent = ''' @@ -20,9 +21,11 @@ class Conversoes { '''; Directory tempDir = await getTemporaryDirectory(); - String savedPath = nome ?? ("contrato - " + DateTime.now().microsecondsSinceEpoch.toString()); + String savedPath = nome ?? ("contrato - ${DateTime.now().microsecondsSinceEpoch}"); File? file = await FlutterHtmlToPdf.convertFromHtmlContent( - htmlContent, tempDir.path, savedPath + content: htmlContent, configuration: PrintPdfConfiguration( + targetDirectory: tempDir.path, targetName: savedPath + ) ); return file; @@ -32,6 +35,24 @@ class Conversoes { } + static Future fileHtmlToPdf({required File html, String? nome}) async { + try{ + Directory tempDir = await getTemporaryDirectory(); + String savedPath = nome ?? DateTime.now().microsecondsSinceEpoch.toString(); + + File? file = await FlutterHtmlToPdf.convertFromHtmlFile( + htmlFile: html, configuration: PrintPdfConfiguration( + targetDirectory: tempDir.path, targetName: savedPath + ) + ); + + return file; + }catch(e){ + debugPrint(e.toString()); + } + } + + static double redimencionarTamanhos(double? widthOriginal, double? heightOriginal, double tamanhoNovo, bool newWidth){ if(widthOriginal == null || heightOriginal == null) return 0; double result = 0; @@ -44,18 +65,5 @@ class Conversoes { return result; } - - - static Future getEndereco(double? latitude, double? longitude) async { - if(latitude == null || longitude == null) return null; - List placemarks = await geo.placemarkFromCoordinates(latitude, longitude, localeIdentifier: 'pt_BR'); - if(placemarks.isNotEmpty){ - geo.Placemark place = placemarks.first; - - String endereco = '${place.street}, ${place.subThoroughfare} - ${place.subLocality}, ${place.subAdministrativeArea} - ${place.country}'; - - return endereco; - } - } } diff --git a/lib/utils/cpf_email_formatter.dart b/lib/utils/cpf_email_formatter.dart new file mode 100644 index 0000000..5dff48f --- /dev/null +++ b/lib/utils/cpf_email_formatter.dart @@ -0,0 +1,68 @@ +import 'package:brasil_fields/brasil_fields.dart'; +import 'package:flutter/services.dart'; + +import 'package:assecontservices/utils/validacoes.dart'; + +import 'package:brasil_fields/src/formatters/compound_formatters/compound_formatter.dart'; +import 'package:brasil_fields/src/formatters/cpf_input_formatter.dart'; +import 'package:brasil_fields/src/interfaces/compoundable_formatter.dart'; + + + +class CpfOrEmailFormatter extends TextInputFormatter { + final CpfInputFormatter cpfFormatter = CpfInputFormatter(); + final EmailInputFormatter emailFormatter = EmailInputFormatter(); + + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + if (CPFValidator.isValid(newValue.text)) { + return cpfFormatter.formatEditUpdate(oldValue, newValue); + } else { + return emailFormatter.formatEditUpdate(oldValue, newValue); + } + } +} + +class EmailInputFormatter extends TextInputFormatter { + + + @override + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { + String text = newValue.text.trim().toLowerCase(); + int selectionIndex = newValue.selection.end; + + // Apply basic mask by removing spaces and converting to lowercase + if (text.contains(' ')) { + text = text.replaceAll(' ', ''); + selectionIndex = text.length; + } + + if (Validacoes.emailValid(text) || text.isEmpty) { + return TextEditingValue( + text: text, + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } + return newValue; + } +} + +class CpfOrEmailFormatter2 extends CompoundFormatter { + CpfOrEmailFormatter2() : super([CpfInputFormatter(), EmailInputFormatter2()]); +} + + +class EmailInputFormatter2 extends TextInputFormatter implements CompoundableFormatter{ + @override + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { + if (newValue.text.isEmpty || Validacoes.emailValid(newValue.text) ) { + return newValue; + } + return newValue; + } + + @override + // TODO: implement maxLength + int get maxLength => 50; +} diff --git a/lib/cpf_rg_formatter.dart b/lib/utils/cpf_rg_formatter.dart similarity index 95% rename from lib/cpf_rg_formatter.dart rename to lib/utils/cpf_rg_formatter.dart index 986a678..3fac370 100644 --- a/lib/cpf_rg_formatter.dart +++ b/lib/utils/cpf_rg_formatter.dart @@ -1,4 +1,3 @@ -import 'package:brasil_fields/src/formatters/cnpj_input_formatter.dart'; import 'package:brasil_fields/src/formatters/compound_formatters/compound_formatter.dart'; import 'package:brasil_fields/src/formatters/cpf_input_formatter.dart'; import 'package:brasil_fields/src/interfaces/compoundable_formatter.dart'; diff --git a/lib/utils/extensions.dart b/lib/utils/extensions.dart new file mode 100644 index 0000000..593daa5 --- /dev/null +++ b/lib/utils/extensions.dart @@ -0,0 +1,82 @@ +import 'package:flutter/cupertino.dart'; +import 'package:intl/intl.dart'; + + + +extension FormatesDateTime on DateTime? { + String dateFormat({String? format}) { + if(this == null ) return ''; + return DateFormat(format ?? 'dd/MM/yyyy', 'pt_BR').format(this!); + } + + DateTime addMonths(int monthsToAdd) { + DateTime originalDate; + if(this == null) { + originalDate = DateTime.now(); + } else { + originalDate = this!; + } + if(monthsToAdd == 0) return originalDate; + + + int newYear = originalDate.year; + int newMonth = originalDate.month + monthsToAdd; + + // Ajusta o ano e o mês caso o novo mês seja maior que 12 ou menor que 1 + while (newMonth > 12) { + newYear++; + newMonth -= 12; + } + while (newMonth < 1) { + newYear--; + newMonth += 12; + } + + int day = originalDate.day; + int maxDay = DateTime(newYear, newMonth + 1, 0).day; // Último dia do novo mês + + // Ajusta o dia caso seja maior que o último dia do novo mês + if (day > maxDay) { + day = maxDay; + } + + return DateTime(newYear, newMonth, day, originalDate.hour, originalDate.minute, originalDate.second); + } +} + +extension FormatesDouble on double? { + String real() { + if(this == 0) return 'R\$0,00'; + var _mask = NumberFormat.currency(locale: 'pt_Br', customPattern: 'R\$#,##0.00'); + return _mask.format(this ?? 0); + } +} + +extension FormatesDynamic on dynamic { + double toDouble() { + try { + if(this == null) return 0; + final d = double.tryParse(this.toString().replaceAll('.', '').replaceAll(',', '.')); + return d ?? 0; + } catch (e) { + debugPrint('FormatesDynamic toDouble: $e'); + return 0; + } + } + + DateTime? toDate() { + try { + if(this == null) return null; + final l = this.toString().split('/'); + return DateTime(int.parse(l[2]), int.parse(l[1]), int.parse(l[0])); + } catch (e) { + debugPrint('FormatesDynamic toDate: $e'); + try{ + return DateTime.tryParse(this.toString()); + }catch(ex){ + debugPrint('FormatesDynamic toDate2: $ex'); + } + } + return null; + } +} \ No newline at end of file diff --git a/lib/utils/external_share.dart b/lib/utils/external_share.dart index c5386e4..8abc092 100644 --- a/lib/utils/external_share.dart +++ b/lib/utils/external_share.dart @@ -1,10 +1,11 @@ -import 'package:flutter/services.dart'; import 'package:share_extend/share_extend.dart'; import '../enums/enums.dart'; +export '../enums/enums.dart'; + class ExternalShare { static share(String titulo, String texto, String url) async { diff --git a/lib/utils/get_file.dart b/lib/utils/get_file.dart index 0c6e3a5..53a15cf 100644 --- a/lib/utils/get_file.dart +++ b/lib/utils/get_file.dart @@ -3,12 +3,11 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:universal_io/io.dart'; import 'dart:typed_data'; -import 'package:universal_html/html.dart' as webFile; -import 'package:flutter_html_to_pdf/flutter_html_to_pdf.dart'; import 'package:path_provider/path_provider.dart'; import '../services/http/http_cliente.dart'; +import 'conversoes.dart'; class CustomFile { @@ -22,7 +21,7 @@ class CustomFile { var tempDir = await getTemporaryDirectory(); - File file = await File('${tempDir.path}/${name}.${responseData.extencao ?? 'jpg'}').writeAsBytes( + File file = await File('${tempDir.path}/${name}.${responseData.extencao ?? 'pdf'}').writeAsBytes( buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes)); return file; } @@ -38,7 +37,7 @@ class CustomFile { return file; } - static Future contentHtml(String nomeFile, {String? html}) async { + static Future contentHtml(String nomeFile, {String? html}) async { var htmlContent = ''' @@ -46,19 +45,15 @@ class CustomFile { '''; - Directory tempDir = await getTemporaryDirectory(); - File? file = await FlutterHtmlToPdf.convertFromHtmlContent( - htmlContent, tempDir.path, nomeFile - ); + File? file = await Conversoes.htmlToPdf(html: htmlContent, nome: nomeFile); return file; } - static Future fileHtml( File html,{String? nomeFile,}) async { + static Future fileHtml( File html,{String? nomeFile,}) async { String name = nomeFile ?? DateTime.now().microsecondsSinceEpoch.toString(); - Directory tempDir = await getTemporaryDirectory(); - File? file = await FlutterHtmlToPdf.convertFromHtmlFile( - html, tempDir.path, name + File? file = await Conversoes.fileHtmlToPdf( + html: html, nome: name ); return file; } diff --git a/lib/utils/num_inputformatter.dart b/lib/utils/num_inputformatter.dart new file mode 100644 index 0000000..b262add --- /dev/null +++ b/lib/utils/num_inputformatter.dart @@ -0,0 +1,32 @@ +import 'package:flutter/services.dart'; + + + +/// Formata o valor do campo com a mascara kg,g (ex: `103,8`) +class NumInputFormatter extends TextInputFormatter { + static final TextInputFormatter digitsOnly = FilteringTextInputFormatter.deny( + RegExp(r'[^0-9,]|(?<=,)[^0-9]') + ); + + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + // verifica o tamanho máximo do campo + + + var posicaoCursor = newValue.selection.end; + var substrIndex = 0; + final valorFinal = StringBuffer(); + + + + if (newValue.text.length >= substrIndex) { + valorFinal.write(newValue.text.substring(substrIndex)); + } + + return TextEditingValue( + text: valorFinal.toString(), + selection: TextSelection.collapsed(offset: posicaoCursor), + ); + } +} diff --git a/lib/utils/url_launcher.dart b/lib/utils/url_launcher.dart index 4d3dca6..5b8129b 100644 --- a/lib/utils/url_launcher.dart +++ b/lib/utils/url_launcher.dart @@ -10,7 +10,7 @@ class UrlLauncher { try{ await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication); }catch(e){ - debugPrint('catch UrlLauncher - openUrl - ' + e.toString()); + debugPrint('catch UrlLauncher - openUrl - $e'); } } @@ -35,15 +35,15 @@ class UrlLauncher { ); await launchUrl(launchUri, mode: LaunchMode.externalApplication); }catch(e){ - debugPrint('catch UrlLauncher - openUrlHttp - ' + e.toString()); + debugPrint('catch UrlLauncher - openUrlHttp - $e'); } } static openMail(String url) async { try { - await launchUrl(Uri.parse('mailto:' + url)); + await launchUrl(Uri.parse('mailto:$url')); }catch(e){ - debugPrint('catch UrlLauncher - openMail - ' + e.toString()); + debugPrint('catch UrlLauncher - openMail - $e'); } } @@ -55,7 +55,7 @@ class UrlLauncher { ); await launchUrl(telLaunchUri); }catch(e){ - debugPrint('catch UrlLauncher - openTel - ' + e.toString()); + debugPrint('catch UrlLauncher - openTel - $e'); } } @@ -67,7 +67,7 @@ class UrlLauncher { ); await launchUrl(smsLaunchUri); }catch(e){ - debugPrint('catch UrlLauncher - openSms - ' + e.toString()); + debugPrint('catch UrlLauncher - openSms - $e'); } } @@ -75,7 +75,7 @@ class UrlLauncher { try { await launchUrl(Uri.file(filePath)); } catch(e){ - debugPrint('catch UrlLauncher - openFile - ' + e.toString()); + debugPrint('catch UrlLauncher - openFile - $e'); } } } diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 96d8aef..bf944db 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -6,4 +6,6 @@ export 'custom_navigator.dart'; export 'external_share.dart'; export 'get_file.dart'; export 'url_launcher.dart'; -export 'validacoes.dart'; \ No newline at end of file +export 'validacoes.dart'; +export 'extensions.dart'; + diff --git a/lib/utils/validacoes.dart b/lib/utils/validacoes.dart index 0c2350a..1dc395a 100644 --- a/lib/utils/validacoes.dart +++ b/lib/utils/validacoes.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:core'; +import 'package:assecontservices/assecontservices.dart'; import 'package:flutter/material.dart'; @@ -522,7 +523,12 @@ class Validacoes { DateTime.parse(str); return true; } catch (e) { - return false; + try { + DateTime? date = str.toDate(); + return date != null; + } catch (e) { + return false; + } } } diff --git a/packages/flutter_html_to_pdf_plus/CHANGELOG.md b/packages/flutter_html_to_pdf_plus/CHANGELOG.md new file mode 100644 index 0000000..78b6ee1 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/CHANGELOG.md @@ -0,0 +1,8 @@ +# 0.1.0 + +Initial release of this updated version of the plugin (forked from [flutter_html_to_pdf](https://github.com/afur/flutter_html_to_pdf)) + +Features: +- Added support for generating PDF from HTML templates +- Added support for displaying images in the PDF +- Added support for customizing margins, page size and orientation \ No newline at end of file diff --git a/packages/flutter_html_to_pdf_plus/LICENSE b/packages/flutter_html_to_pdf_plus/LICENSE new file mode 100644 index 0000000..75de305 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/flutter_html_to_pdf_plus/README.md b/packages/flutter_html_to_pdf_plus/README.md new file mode 100644 index 0000000..7f13923 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/README.md @@ -0,0 +1,80 @@ +# flutter_html_to_pdf_plus + +[![pub package](https://img.shields.io/pub/v/flutter_html_to_pdf_plus.svg)](https://pub.dartlang.org/packages/flutter_html_to_pdf_plus) + +Flutter plugin for generating PDF files from HTML + +### Usage + +#### From a raw HTML content + +```dart +var targetPath = "/your/sample/path"; +var targetFileName = "example_pdf_file" + +var generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlContent( + content: htmlContent, + configuration: PdfPrinterConfiguration( + targetPath: targetPath, + targetFileName: targetFileName, + margins: PdfPrinterMargins(top: 10, bottom: 10, left: 10, right: 10), + orientation: PrintOrientation.Landscape, + printSize: PrintSize.A4 + ), +); +``` + +#### From an HTML file +```dart +var file = File("/sample_path/example.html"); +var generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlFile( + htmlFile: file, + configuration: PdfPrinterConfiguration( + targetPath: targetPath, + targetFileName: targetFileName, + margins: PdfPrinterMargins(top: 10, bottom: 10, left: 10, right: 10), + orientation: PrintOrientation.Landscape, + printSize: PrintSize.A4 + ), +); +``` + +#### From an HTML file path +```dart +var filePath = "/sample_path/example.html"; +var generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlFilePath( + htmlFilePath: filePath, + configuration: PdfPrinterConfiguration( + targetPath: targetPath, + targetFileName: targetFileName, + margins: PdfPrinterMargins(top: 10, bottom: 10, left: 10, right: 10), + orientation: PrintOrientation.Landscape, + printSize: PrintSize.A4 + ), +); +``` + +> /!\ Caveats : Customization of orientation is not supported on iOS. Any config will be ignored. + +#### Images +If your want to add local image from device to your **HTML** you need to pass path to image as ***src*** value. + +```html +web-img +``` +or if you want to use the image ***File*** object +```html +web-img +``` + +Many images inside your document can significantly affect the final file size so we suggest to use [flutter_image_compress](https://github.com/OpenFlutter/flutter_image_compress) plugin to compress images before generating PDF. + +## Contributing + +If you want to contribute, please submit a [pull request](https://github.com/originoss/flutter_html_to_pdf_plus/pulls) or [create an issue](https://github.com/originoss/flutter_html_to_pdf_plus/issues). + +## Credits + +- Thanks to [Afur](https://github.com/afur) for the initial work on this plugin +- Thanks to [raister21](https://github.com/raister21) for their work on PDF Size & Orientation +- Thanks to [wiseminds](https://github.com/wiseminds) for the inspiration for margins customization diff --git a/packages/flutter_html_to_pdf_plus/analysis_options.yaml b/packages/flutter_html_to_pdf_plus/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/flutter_html_to_pdf_plus/android/build.gradle b/packages/flutter_html_to_pdf_plus/android/build.gradle new file mode 100644 index 0000000..f890998 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/build.gradle @@ -0,0 +1,68 @@ +group 'com.originoss.flutter_html_to_pdf_plus' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + if (project.android.hasProperty("namespace")) { + namespace 'com.originoss.flutter_html_to_pdf_plus' + } + + compileSdk 34 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } + + defaultConfig { + minSdkVersion 19 + } + + dependencies { + testImplementation 'org.jetbrains.kotlin:kotlin-test' + testImplementation 'org.mockito:mockito-core:5.0.0' + } + + testOptions { + unitTests.all { + useJUnitPlatform() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + } +} diff --git a/packages/flutter_html_to_pdf_plus/android/gradle.properties b/packages/flutter_html_to_pdf_plus/android/gradle.properties new file mode 100644 index 0000000..80db790 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/gradle.properties @@ -0,0 +1,8 @@ +org.gradle.jvmargs=-Xmx1536M \ +--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ +--add-opens=java.base/java.lang=ALL-UNNAMED \ +--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \ +--add-opens=java.base/java.io=ALL-UNNAMED \ +--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/flutter_html_to_pdf_plus/android/settings.gradle b/packages/flutter_html_to_pdf_plus/android/settings.gradle new file mode 100644 index 0000000..ee71b9b --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'flutter_html_to_pdf_plus' diff --git a/packages/flutter_html_to_pdf_plus/android/src/main/AndroidManifest.xml b/packages/flutter_html_to_pdf_plus/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4e78de3 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/android/print/PdfPrinter.kt b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/android/print/PdfPrinter.kt new file mode 100644 index 0000000..aeb9a18 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/android/print/PdfPrinter.kt @@ -0,0 +1,67 @@ +package android.print + +import android.os.Build +import android.os.CancellationSignal +import android.os.ParcelFileDescriptor +import java.io.File + +class PdfPrinter(private val printAttributes: PrintAttributes) { + + interface Callback { + fun onSuccess(filePath: String) + fun onFailure() + } + + + fun print( + printAdapter: PrintDocumentAdapter, + path: File, + fileName: String, + callback: Callback + ) { + // Support for min API 16 is required + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + printAdapter.onLayout( + null, + printAttributes, + null, + object : PrintDocumentAdapter.LayoutResultCallback() { + + override fun onLayoutFinished(info: PrintDocumentInfo, changed: Boolean) { + printAdapter.onWrite(arrayOf(PageRange.ALL_PAGES), + getOutputFile(path, fileName), + CancellationSignal(), + object : PrintDocumentAdapter.WriteResultCallback() { + + override fun onWriteFinished(pages: Array) { + super.onWriteFinished(pages) + + if (pages.isEmpty()) { + callback.onFailure() + } + + File(path, fileName).let { + callback.onSuccess(it.absolutePath) + } + + } + }) + } + }, + null + ) + } + } +} + + +private fun getOutputFile(path: File, fileName: String): ParcelFileDescriptor { + if (!path.exists()) { + path.mkdirs() + } + + File(path, fileName).let { + it.createNewFile() + return ParcelFileDescriptor.open(it, ParcelFileDescriptor.MODE_READ_WRITE) + } +} diff --git a/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/FlutterHtmlToPdfPlugin.kt b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/FlutterHtmlToPdfPlugin.kt new file mode 100644 index 0000000..9debd1f --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/FlutterHtmlToPdfPlugin.kt @@ -0,0 +1,52 @@ +package com.originoss.flutter_html_to_pdf_plus + +import android.content.Context +import androidx.annotation.NonNull + +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.MethodCallHandler +import io.flutter.plugin.common.MethodChannel.Result + +/** FlutterHtmlToPdfPlugin */ +class FlutterHtmlToPdfPlugin: FlutterPlugin, MethodCallHandler { + private lateinit var channel : MethodChannel + private lateinit var applicationContext: Context + + override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_html_to_pdf_plus") + channel.setMethodCallHandler(this) + + applicationContext = flutterPluginBinding.applicationContext + } + + override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + if (call.method == "convertHtmlToPdf") { + convertHtmlToPdf(call, result) + } else { + result.notImplemented() + } + } + + override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } + + private fun convertHtmlToPdf(call: MethodCall, result: Result) { + val htmlFilePath = call.argument("htmlFilePath") + val printSize = call.argument("printSize") + val orientation = call.argument("orientation") + val margins = call.argument>("margins") + + HtmlToPdfConverter().convert(htmlFilePath!!, applicationContext, printSize!!, orientation!!, margins!!, object : HtmlToPdfConverter.Callback { + override fun onSuccess(filePath: String) { + result.success(filePath) + } + + override fun onFailure() { + result.error("ERROR", "Unable to convert html to pdf document!", "") + } + }) + } +} diff --git a/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/HtmlToPdfConverter.kt b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/HtmlToPdfConverter.kt new file mode 100644 index 0000000..600eb1f --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/src/main/kotlin/com/originoss/flutter_html_to_pdf_plus/HtmlToPdfConverter.kt @@ -0,0 +1,88 @@ +package com.originoss.flutter_html_to_pdf_plus + +import android.annotation.SuppressLint +import android.content.Context +import android.os.Build +import android.print.PdfPrinter +import android.print.PrintAttributes +import android.webkit.WebView +import android.webkit.WebViewClient + +import java.io.File + + +class HtmlToPdfConverter { + + interface Callback { + fun onSuccess(filePath: String) + fun onFailure() + } + + @SuppressLint("SetJavaScriptEnabled") + fun convert(filePath: String, applicationContext: Context, printSize: String, orientation: String, margins: List, callback: Callback) { + val webView = WebView(applicationContext) + val htmlContent = File(filePath).readText(Charsets.UTF_8) + webView.settings.javaScriptEnabled = true + webView.settings.javaScriptCanOpenWindowsAutomatically = true + webView.settings.allowFileAccess = true + webView.loadDataWithBaseURL(null, htmlContent, "text/HTML", "UTF-8", null) + webView.webViewClient = object : WebViewClient() { + override fun onPageFinished(view: WebView, url: String) { + super.onPageFinished(view, url) + createPdfFromWebView(webView, applicationContext, printSize, orientation, margins, callback) + } + } + } + + fun createPdfFromWebView(webView: WebView, applicationContext: Context, printSize: String, orientation: String, margins: List, callback: Callback) { + val path = applicationContext.filesDir + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + var mediaSize = PrintAttributes.MediaSize.ISO_A4 + + when (printSize) { + "A0" -> mediaSize = PrintAttributes.MediaSize.ISO_A0 + "A1" -> mediaSize = PrintAttributes.MediaSize.ISO_A1 + "A2" -> mediaSize = PrintAttributes.MediaSize.ISO_A2 + "A3" -> mediaSize = PrintAttributes.MediaSize.ISO_A3 + "A4" -> mediaSize = PrintAttributes.MediaSize.ISO_A4 + "A5" -> mediaSize = PrintAttributes.MediaSize.ISO_A5 + "A6" -> mediaSize = PrintAttributes.MediaSize.ISO_A6 + "A7" -> mediaSize = PrintAttributes.MediaSize.ISO_A7 + "A8" -> mediaSize = PrintAttributes.MediaSize.ISO_A8 + "A9" -> mediaSize = PrintAttributes.MediaSize.ISO_A9 + "A10" -> mediaSize = PrintAttributes.MediaSize.ISO_A10 + } + + when (orientation) { + "LANDSCAPE" -> mediaSize = mediaSize.asLandscape() + "PORTRAIT" -> mediaSize = mediaSize.asPortrait() + } + + val attributes = PrintAttributes.Builder() + .setMediaSize(mediaSize) + .setResolution(PrintAttributes.Resolution("pdf", "pdf", 600, 600)) + .setMinMargins(PrintAttributes.Margins(margins[0], margins[1], margins[2], margins[3])).build() + + val printer = PdfPrinter(attributes) + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + val adapter = webView.createPrintDocumentAdapter(temporaryDocumentName) + + printer.print(adapter, path, temporaryFileName, object : PdfPrinter.Callback { + override fun onSuccess(filePath: String) { + callback.onSuccess(filePath) + } + + override fun onFailure() { + callback.onFailure() + } + }) + } + } + } + + companion object { + const val temporaryDocumentName = "TemporaryDocumentName" + const val temporaryFileName = "TemporaryDocumentFile.pdf" + } +} \ No newline at end of file diff --git a/packages/flutter_html_to_pdf_plus/android/src/test/kotlin/com/afur/flutter_html_to_pdf/FlutterHtmlToPdfPluginTest.kt b/packages/flutter_html_to_pdf_plus/android/src/test/kotlin/com/afur/flutter_html_to_pdf/FlutterHtmlToPdfPluginTest.kt new file mode 100644 index 0000000..08f815f --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/android/src/test/kotlin/com/afur/flutter_html_to_pdf/FlutterHtmlToPdfPluginTest.kt @@ -0,0 +1,27 @@ +package com.originoss.flutter_html_to_pdf_plus + +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import kotlin.test.Test +import org.mockito.Mockito + +/* + * This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation. + * + * Once you have built the plugin's example app, you can run these tests from the command + * line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or + * you can run them directly from IDEs that support JUnit such as Android Studio. + */ + +internal class FlutterHtmlToPdfPluginTest { + @Test + fun onMethodCall_getPlatformVersion_returnsExpectedValue() { + val plugin = FlutterHtmlToPdfPlugin() + + val call = MethodCall("getPlatformVersion", null) + val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java) + plugin.onMethodCall(call, mockResult) + + Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE) + } +} diff --git a/packages/flutter_html_to_pdf_plus/ios/Classes/FileHelper.swift b/packages/flutter_html_to_pdf_plus/ios/Classes/FileHelper.swift new file mode 100644 index 0000000..362e791 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/Classes/FileHelper.swift @@ -0,0 +1,12 @@ +import UIKit + +class FileHelper { + + /** + Creates string with content of provided file + */ + class func getContent(from filePath: String) -> String { + let fileURL = URL(fileURLWithPath: filePath) + return try! String(contentsOf: fileURL, encoding: String.Encoding.utf8) + } +} diff --git a/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.h b/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.h new file mode 100644 index 0000000..b4214c9 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.h @@ -0,0 +1,4 @@ +#import + +@interface FlutterHtmlToPdfPlugin : NSObject +@end diff --git a/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.m b/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.m new file mode 100644 index 0000000..0c5b4f7 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/Classes/FlutterHtmlToPdfPlugin.m @@ -0,0 +1,16 @@ +#import "FlutterHtmlToPdfPlugin.h" +#if __has_include() +#import +#else +// Support project import fallback if the generated compatibility header +// is not copied when this plugin is created as a library. +// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 +#import "flutter_html_to_pdf_plus-Swift.h" +#endif + +@implementation FlutterHtmlToPdfPlugin +UIViewController *_viewController; + ++ (void)registerWithRegistrar:(NSObject*)registrar { + [SwiftFlutterHtmlToPdfPlugin registerWithRegistrar:registrar]; +}@end diff --git a/packages/flutter_html_to_pdf_plus/ios/Classes/PDFCreator.swift b/packages/flutter_html_to_pdf_plus/ios/Classes/PDFCreator.swift new file mode 100644 index 0000000..21c418f --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/Classes/PDFCreator.swift @@ -0,0 +1,65 @@ +import UIKit + +class PDFCreator { + + /** + Creates a PDF using the given print formatter and saves it to the user's document directory. + - returns: The generated PDF path. + */ + class func create(printFormatter: UIPrintFormatter, width: Double, height: Double, orientation: String, margins: [Int]?) -> URL { + + // assign the print formatter to the print page renderer + let renderer = UIPrintPageRenderer() + renderer.addPrintFormatter(printFormatter, startingAtPageAt: 0) + + // assign paperRect and printableRect values + let page = CGRect(x: 0, y: 0, width: width, height: height) + let printable = CGRect(x: Double(margins![0]), y: Double(margins![1]), width: width - Double(margins![0]) - Double(margins![2]), height: height - Double(margins![1]) - Double(margins![3])) + + renderer.setValue(page, forKey: "paperRect") + renderer.setValue(printable, forKey: "printableRect") + + // create pdf context and draw each page + let pdfData = NSMutableData() + UIGraphicsBeginPDFContextToData(pdfData, .zero, nil) + + for i in 0.. [String] { + do { + let regex = try NSRegularExpression(pattern: regex) + let nsString = text as NSString + let results = regex.matches(in: text, range: NSRange(location: 0, length: nsString.length)) + return results.map { nsString.substring(with: $0.range)} + } catch let error { + print("invalid regex: \(error.localizedDescription)") + return [] + } + } +} diff --git a/packages/flutter_html_to_pdf_plus/ios/Classes/SwiftFlutterHtmlToPdfPlugin.swift b/packages/flutter_html_to_pdf_plus/ios/Classes/SwiftFlutterHtmlToPdfPlugin.swift new file mode 100644 index 0000000..44eb88b --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/Classes/SwiftFlutterHtmlToPdfPlugin.swift @@ -0,0 +1,69 @@ +import Flutter +import UIKit +import WebKit + +public class SwiftFlutterHtmlToPdfPlugin: NSObject, FlutterPlugin{ + var wkWebView : WKWebView! + var urlObservation: NSKeyValueObservation? + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "flutter_html_to_pdf_plus", binaryMessenger: registrar.messenger()) + let instance = SwiftFlutterHtmlToPdfPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "convertHtmlToPdf": + let args = call.arguments as? [String: Any] + let htmlFilePath = args!["htmlFilePath"] as? String + let width = Double(args!["width"] as! Int) + let height = Double(args!["height"] as! Int) + let orientation = args!["orientation"] + let margins = args!["margins"] as? [Int] + + let viewControler = UIApplication.shared.delegate?.window?!.rootViewController + wkWebView = WKWebView.init(frame: CGRect(origin: CGPoint(x:0, y:0), size: CGSize(width:width, height: height))) + wkWebView.isHidden = true + wkWebView.tag = 100 + viewControler?.view.addSubview(wkWebView) + + // the `position: fixed` element not working as expected + let contentController = wkWebView.configuration.userContentController + contentController.addUserScript(WKUserScript(source: "document.documentElement.style.webkitUserSelect='none';", injectionTime: .atDocumentEnd, forMainFrameOnly: true)) + contentController.addUserScript(WKUserScript(source: "document.documentElement.style.webkitTouchCallout='none';", injectionTime: .atDocumentEnd, forMainFrameOnly: true)) + wkWebView.scrollView.bounces = false + + let htmlFileContent = FileHelper.getContent(from: htmlFilePath!) // get html content from file + wkWebView.loadHTMLString(htmlFileContent, baseURL: Bundle.main.bundleURL) // load html into hidden webview + let formatter: UIPrintFormatter = UIMarkupTextPrintFormatter(markupText: htmlFileContent) + + urlObservation = wkWebView.observe(\.isLoading, changeHandler: { (webView, change) in + // this is workaround for issue with loading local images + DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { + let convertedFileURL = PDFCreator.create(printFormatter: formatter, width: width, height: height, orientation: orientation as! String, margins: margins!) + let convertedFilePath = convertedFileURL.absoluteString.replacingOccurrences(of: "file://", with: "") // return generated pdf path + if let viewWithTag = viewControler?.view.viewWithTag(100) { + viewWithTag.removeFromSuperview() // remove hidden webview when pdf is generated + + // clear WKWebView cache + if #available(iOS 9.0, *) { + WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in + records.forEach { record in + WKWebsiteDataStore.default().removeData(ofTypes: record.dataTypes, for: [record], completionHandler: {}) + } + } + } + } + + // dispose WKWebView + self.urlObservation = nil + self.wkWebView = nil + result(convertedFilePath) + } + }) + default: + result(FlutterMethodNotImplemented) + } + } +} diff --git a/packages/flutter_html_to_pdf_plus/ios/flutter_html_to_pdf_plus.podspec b/packages/flutter_html_to_pdf_plus/ios/flutter_html_to_pdf_plus.podspec new file mode 100644 index 0000000..933a741 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/ios/flutter_html_to_pdf_plus.podspec @@ -0,0 +1,21 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'flutter_html_to_pdf_plus' + s.version = '0.0.1' + s.summary = 'A Flutter plugin for generating PDF documents from HTML code templates.' + s.description = <<-DESC +A Flutter plugin for generating PDF documents from HTML code templates + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Origin OSS' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + + s.ios.deployment_target = '8.0' +end + diff --git a/packages/flutter_html_to_pdf_plus/lib/flutter_html_to_pdf_plus.dart b/packages/flutter_html_to_pdf_plus/lib/flutter_html_to_pdf_plus.dart new file mode 100644 index 0000000..89f8254 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/lib/flutter_html_to_pdf_plus.dart @@ -0,0 +1,5 @@ +library flutter_html_to_pdf_plus; + +export 'src/flutter_html_to_pdf_plus.dart'; +export 'src/pdf_print_configuration.dart'; +export 'src/print_config_enums.dart'; diff --git a/packages/flutter_html_to_pdf_plus/lib/src/file_utils.dart b/packages/flutter_html_to_pdf_plus/lib/src/file_utils.dart new file mode 100644 index 0000000..b530867 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/lib/src/file_utils.dart @@ -0,0 +1,30 @@ +import 'dart:io'; + +class FileUtils { + static Future createFileWithStringContent( + String content, String path) async { + return await File(path).writeAsString(content); + } + + static File copyAndDeleteOriginalFile( + String generatedFilePath, String targetDirectory, String targetName) { + final fileOriginal = File(generatedFilePath); + final fileCopy = File('$targetDirectory/$targetName.pdf'); + fileCopy.writeAsBytesSync(File.fromUri(fileOriginal.uri).readAsBytesSync()); + fileOriginal.delete(); + return fileCopy; + } + + static Future appendStyleTagToHtmlFile(String htmlPath) async { + String printStyleHtml = """ + + """; + await File(htmlPath).writeAsString(printStyleHtml, mode: FileMode.append); + } +} diff --git a/packages/flutter_html_to_pdf_plus/lib/src/flutter_html_to_pdf_plus.dart b/packages/flutter_html_to_pdf_plus/lib/src/flutter_html_to_pdf_plus.dart new file mode 100644 index 0000000..99c89ef --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/lib/src/flutter_html_to_pdf_plus.dart @@ -0,0 +1,115 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:flutter/services.dart'; +import 'package:flutter_html_to_pdf_plus/src/file_utils.dart'; + +import 'pdf_print_configuration.dart'; +import 'print_config_enums.dart'; + +/// HTML to PDF Converter +class FlutterHtmlToPdf { + static const MethodChannel _channel = + MethodChannel('flutter_html_to_pdf_plus'); + + /// Creates PDF Document from HTML content + /// Can throw a [PlatformException] or (unlikely) a [MissingPluginException] converting html to pdf + static Future convertFromHtmlContent({ + required String content, + required PrintPdfConfiguration configuration, + }) async { + final File temporaryCreatedHtmlFile = + await FileUtils.createFileWithStringContent( + content, + configuration.htmlFilePath, + ); + await FileUtils.appendStyleTagToHtmlFile(temporaryCreatedHtmlFile.path); + + final String generatedPdfFilePath = await _convertFromHtmlFilePath( + temporaryCreatedHtmlFile.path, + configuration.printSize, + configuration.printOrientation, + configuration.margins, + ); + + temporaryCreatedHtmlFile.delete(); + + return FileUtils.copyAndDeleteOriginalFile( + generatedPdfFilePath, + configuration.targetDirectory, + configuration.targetName, + ); + } + + /// Creates PDF Document from File that contains HTML content + /// Can throw a [PlatformException] or (unlikely) a [MissingPluginException] converting html to pdf + static Future convertFromHtmlFile({ + required File htmlFile, + required PrintPdfConfiguration configuration, + }) async { + await FileUtils.appendStyleTagToHtmlFile(htmlFile.path); + final String generatedPdfFilePath = await _convertFromHtmlFilePath( + htmlFile.path, + configuration.printSize, + configuration.printOrientation, + configuration.margins, + ); + + return FileUtils.copyAndDeleteOriginalFile( + generatedPdfFilePath, + configuration.targetDirectory, + configuration.targetName, + ); + } + + /// Creates PDF Document from path to File that contains HTML content + /// Can throw a [PlatformException] or (unlikely) a [MissingPluginException] converting html to pdf + static Future convertFromHtmlFilePath({ + required String htmlFilePath, + required PrintPdfConfiguration configuration, + }) async { + await FileUtils.appendStyleTagToHtmlFile(htmlFilePath); + final String generatedPdfFilePath = await _convertFromHtmlFilePath( + htmlFilePath, + configuration.printSize, + configuration.printOrientation, + configuration.margins, + ); + + return FileUtils.copyAndDeleteOriginalFile( + generatedPdfFilePath, + configuration.targetDirectory, + configuration.targetName, + ); + } + + /// Assumes the invokeMethod call will return successfully + static Future _convertFromHtmlFilePath( + String htmlFilePath, + PrintSize printSize, + PrintOrientation printOrientation, + PdfPageMargin pageMargin, + ) async { + int width = printSize + .getDimensionsInPixels[printOrientation.getWidthDimensionIndex]; + int height = printSize + .getDimensionsInPixels[printOrientation.getHeightDimensionIndex]; + + return await _channel.invokeMethod( + 'convertHtmlToPdf', + { + 'htmlFilePath': htmlFilePath, + 'width': width, + 'height': height, + 'printSize': printSize.printSizeKey, + 'orientation': printOrientation.orientationKey, + 'margins': [ + pageMargin.left, + pageMargin.top, + pageMargin.right, + pageMargin.bottom, + ], + }, + ) as String; + } +} diff --git a/packages/flutter_html_to_pdf_plus/lib/src/pdf_print_configuration.dart b/packages/flutter_html_to_pdf_plus/lib/src/pdf_print_configuration.dart new file mode 100644 index 0000000..7ac3897 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/lib/src/pdf_print_configuration.dart @@ -0,0 +1,45 @@ +import 'package:flutter_html_to_pdf_plus/flutter_html_to_pdf_plus.dart'; + +class PdfPageMargin { + final int top; + final int bottom; + final int left; + final int right; + + const PdfPageMargin({ + required this.top, + required this.bottom, + required this.left, + required this.right, + }); +} + +/// Print Pdf Configuration +class PrintPdfConfiguration { + final String targetDirectory; + final String targetName; + final PdfPageMargin margins; + final PrintSize printSize; + final PrintOrientation printOrientation; + + /// `targetDirectory` is the desired path for the Pdf file. + /// + /// `targetName` is the name of the Pdf file + /// + /// `margins` is the page margin of the Pdf file + /// + /// `printSize` is the print size of the Pdf file + /// + /// `printOrientation` is the print orientation of the Pdf file + PrintPdfConfiguration({ + required this.targetDirectory, + required this.targetName, + this.margins = + const PdfPageMargin(top: 50, bottom: 50, left: 50, right: 50), + this.printSize = PrintSize.A4, + this.printOrientation = PrintOrientation.Portrait, + }); + + /// Returns the final path for temporary Html File + String get htmlFilePath => "$targetDirectory/$targetName.html"; +} diff --git a/packages/flutter_html_to_pdf_plus/lib/src/print_config_enums.dart b/packages/flutter_html_to_pdf_plus/lib/src/print_config_enums.dart new file mode 100644 index 0000000..17fe71a --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/lib/src/print_config_enums.dart @@ -0,0 +1,110 @@ +// ignore_for_file: constant_identifier_names + +enum PrintSize { + A0, + A1, + A2, + A3, + A4, + A5, + A6, + A7, + A8, + A9, + A10, +} + +extension PrintSizeExt on PrintSize { + /// Returns the printing pixel dimensions for `72 PPI` + List get getDimensionsInPixels { + switch (this) { + case PrintSize.A0: + return [2384, 3370]; + case PrintSize.A1: + return [1684, 2384]; + case PrintSize.A2: + return [1191, 1684]; + case PrintSize.A3: + return [842, 1191]; + case PrintSize.A4: + return [595, 842]; + case PrintSize.A5: + return [420, 595]; + case PrintSize.A6: + return [298, 420]; + case PrintSize.A7: + return [210, 298]; + case PrintSize.A8: + return [147, 210]; + case PrintSize.A9: + return [105, 147]; + case PrintSize.A10: + return [74, 105]; + } + } + + /// Returns Key for android implementation + String get printSizeKey { + switch (this) { + case PrintSize.A0: + return "A0"; + case PrintSize.A1: + return "A1"; + case PrintSize.A2: + return "A2"; + case PrintSize.A3: + return "A3"; + case PrintSize.A4: + return "A4"; + case PrintSize.A5: + return "A5"; + case PrintSize.A6: + return "A6"; + case PrintSize.A7: + return "A7"; + case PrintSize.A8: + return "A8"; + case PrintSize.A9: + return "A9"; + case PrintSize.A10: + return "A10"; + } + } +} + +enum PrintOrientation { + Portrait, + Landscape, +} + +extension PrintOrientationExt on PrintOrientation { + /// Returns the index for getting width of print frame from array of + int get getWidthDimensionIndex { + switch (this) { + case PrintOrientation.Landscape: + return 1; + case PrintOrientation.Portrait: + return 0; + } + } + + /// Returns the index for getting height of print frame from array of + int get getHeightDimensionIndex { + switch (this) { + case PrintOrientation.Landscape: + return 0; + case PrintOrientation.Portrait: + return 1; + } + } + + /// Returns Key for android implementation + String get orientationKey { + switch (this) { + case PrintOrientation.Landscape: + return "LANDSCAPE"; + case PrintOrientation.Portrait: + return "PORTRAIT"; + } + } +} diff --git a/packages/flutter_html_to_pdf_plus/pubspec.lock b/packages/flutter_html_to_pdf_plus/pubspec.lock new file mode 100644 index 0000000..f6593d3 --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/pubspec.lock @@ -0,0 +1,72 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + lints: + dependency: transitive + description: + name: lints + sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=3.3.0-0 <4.0.0" + flutter: ">=3.10.0" diff --git a/packages/flutter_html_to_pdf_plus/pubspec.yaml b/packages/flutter_html_to_pdf_plus/pubspec.yaml new file mode 100644 index 0000000..f13667d --- /dev/null +++ b/packages/flutter_html_to_pdf_plus/pubspec.yaml @@ -0,0 +1,25 @@ +name: flutter_html_to_pdf_plus +description: Flutter plugin for generating PDF documents from HTML code templates +version: 0.1.0 +homepage: https://github.com/originoss/flutter_html_to_pdf_plus + +environment: + sdk: '>=2.19.6 <4.0.0' + flutter: ">=3.10.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_lints: ^4.0.0 + +flutter: + plugin: + platforms: + android: + package: com.originoss.flutter_html_to_pdf_plus + pluginClass: FlutterHtmlToPdfPlugin + ios: + pluginClass: FlutterHtmlToPdfPlugin + diff --git a/packages/share_extend/.gitattributes b/packages/share_extend/.gitattributes new file mode 100644 index 0000000..ff1b95c --- /dev/null +++ b/packages/share_extend/.gitattributes @@ -0,0 +1 @@ +* linguist-language=Dart \ No newline at end of file diff --git a/packages/share_extend/.gitignore b/packages/share_extend/.gitignore new file mode 100644 index 0000000..9821784 --- /dev/null +++ b/packages/share_extend/.gitignore @@ -0,0 +1,79 @@ +# Built application files +*.apk +*.ap_ + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +.idea/caches + +# Keystore files +# Uncomment the following line if you do not want to check your keystore files in. +#*.jks + +*.idea +*.packages + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild + +# Google Services (e.g. APIs or Firebase) +google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +pubspec.lock +*.iml + +.DS_Store +.atom/ +.idea/ +.vscode/ +.flutter-plugins-dependencies +.dart_tool +flutter_export_environment.sh \ No newline at end of file diff --git a/packages/share_extend/CHANGELOG.md b/packages/share_extend/CHANGELOG.md new file mode 100644 index 0000000..983eba7 --- /dev/null +++ b/packages/share_extend/CHANGELOG.md @@ -0,0 +1,61 @@ +## 2.0.0 +* support audio share +* null safety support + +## 1.1.9 +* fix ios not found module issue. + +## 1.1.8 +* support android embedding v2 api +* add extraText option for android Intent.EXTRA_TEXT when sharing image or file. + +## 1.1.7 +* set default popover point on the ipad + +## 1.1.6 +* fix some permission issues on some devices. +* update lower bound dart dependency to 2.0.0. + +## 1.1.5 +* fix provider issues for api < 24 + +## 1.1.4 +* add grant uri permission on Android + +## 1.1.3 +* add option subject for sharing multiple images + +## 1.1.2 +* rebuild the provider code on android platform +* update sample code + +## 1.1.1 +* add option param "share panel title" on android +* add option param "subject" on both android and ios +* update sample code with latest image_picker plugin version that fixed video picker bugs + +## 1.1.0 +* 添加多图,多文件分享功能 +* 合并image_picker在ios13中选取视频不可用的补丁 + +## 1.0.9 +* 移除了Android端的内置存储的读写权限,改成由APP端来按需求配置 + +## 1.0.7 +* Android端修改了FileProvider的authorities,继承FileProvider,防止FileProvider冲突 + +## 1.0.6 +* 修复了android端分享应用沙盒内文件可能出错的bug +* 优化了android端分享时的权限请求逻辑 + +## 1.0.5 +* Fix bugs when sharing videos to some apps like WeChat. + +## 1.0.4 + +* Updated to Support Latest Android Dependencies + + +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/share_extend/LICENSE b/packages/share_extend/LICENSE new file mode 100644 index 0000000..fd41d95 --- /dev/null +++ b/packages/share_extend/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 zhouteng + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/share_extend/README-cn.md b/packages/share_extend/README-cn.md new file mode 100644 index 0000000..203fb32 --- /dev/null +++ b/packages/share_extend/README-cn.md @@ -0,0 +1,91 @@ +Language: [English](https://github.com/zhouteng0217/ShareExtend/blob/master/README-en.md) | [中文简体](https://github.com/zhouteng0217/ShareExtend/blob/master/README.md) + +# ShareExtend + +[![pub package](https://img.shields.io/pub/v/share_extend.svg)](https://pub.dartlang.org/packages/share_extend) + +调用系统分享的Flutter组件,支持分享文本、图片、视频和文件 + +## 安装 + +``` +dependencies: + share_extend: "^2.0.0" +``` + +### iOS + +添加下面的key到工程的info.plist文件,路径 ```/ios/Runner/Info.plist```,用于将分享的图片保存到相册 + +``` +NSPhotoLibraryAddUsageDescription +这里填写为什么需要相册写入权限的描述语句 +``` + +### Android + +如果涉及到要分享存储空间里面的文件,需要用到读写存储空间权限的,请在项目的android模块的下,添加读写权限,路径为 `/android/app/src/main/AndroidManifest.xml` + +``` + + +``` + +## 导入 + +``` +import 'package:share_extend/share_extend.dart'; +``` + +## 使用 + +``` + +//分享文本 +ShareExtend.share("share text", "text","android share panel title","share subject"); + +//分享图片 (例子中使用了一个image_picker的插件来实现图片的选择) +File f = + await ImagePicker.pickImage(source: ImageSource.gallery); +ShareExtend.share(f.path, "image"); + +//分享视频 +File f = await ImagePicker.pickVideo( + source: ImageSource.gallery); +ShareExtend.share(f.path, "video"); + +//分享文件 +Directory dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); +File testFile = new File("${dir.path}/flutter/test.txt"); +if (!await testFile.exists()) { + await testFile.create(recursive: true); + testFile.writeAsStringSync("test for share documents file"); +} +ShareExtend.share(testFile.path, "file"); + +//分享多图(借助了MultiImagePicker来多选获取图片图片,由于该库没有提供文件路径,因此demo里面先将图片保存为图片再调用分享) +_shareMultipleImages() async { + List assetList = await MultiImagePicker.pickImages(maxImages: 5); + var imageList = List(); + for (var asset in assetList) { + String path = + await _writeByteToImageFile(await asset.getByteData(quality: 30)); + imageList.add(path); + } + ShareExtend.shareMultiple(imageList, "image",subject: "share muti image"); +} + +Future _writeByteToImageFile(ByteData byteData) async { + Directory dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); + File imageFile = new File( + "${dir.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png"); + imageFile.createSync(recursive: true); + imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0)); + return imageFile.path; +} + +``` \ No newline at end of file diff --git a/packages/share_extend/README.md b/packages/share_extend/README.md new file mode 100644 index 0000000..2e09309 --- /dev/null +++ b/packages/share_extend/README.md @@ -0,0 +1,94 @@ +Language: [English](https://github.com/zhouteng0217/ShareExtend/blob/master/README.md) | [中文简体](https://github.com/zhouteng0217/ShareExtend/blob/master/README-cn.md) + +# ShareExtend + +[![pub package](https://img.shields.io/pub/v/share_extend.svg)](https://pub.dartlang.org/packages/share_extend) + +A Flutter plugin for iOS and Android for sharing text, image, video and file with system ui. + +## Installation + +First, add `share_extend` as a dependency in your pubspec.yaml file. + +``` +dependencies: + share_extend: "^2.0.0" +``` + +### iOS + +Add the following key to your info.plist file, located in `/ios/Runner/Info.plist` for saving shared images to photo library. + +``` +NSPhotoLibraryAddUsageDescription +describe why your app needs access to write photo library +``` + +### Android + +If your project needs read and write permissions for sharing external storage file, please add the following permissions to your AndroidManifest.xml, located in `/android/app/src/main/AndroidManifest.xml` + +``` + + +``` + +## Import + +``` +import 'package:share_extend/share_extend.dart'; +``` + + +## Example + +``` + +//share text +ShareExtend.share("share text", "text","android share panel title","share subject"); + +//share image +File f = + await ImagePicker.pickImage(source: ImageSource.gallery); +ShareExtend.share(f.path, "image"); + +//share video +File f = await ImagePicker.pickVideo( + source: ImageSource.gallery); +ShareExtend.share(f.path, "video"); + +//share file +Directory dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); +File testFile = new File("${dir.path}/flutter/test.txt"); +if (!await testFile.exists()) { + await testFile.create(recursive: true); + testFile.writeAsStringSync("test for share documents file"); +} +ShareExtend.share(testFile.path, "file"); + +///share multiple images +_shareMultipleImages() async { + List assetList = await MultiImagePicker.pickImages(maxImages: 5); + var imageList = List(); + for (var asset in assetList) { + String path = + await _writeByteToImageFile(await asset.getByteData(quality: 30)); + imageList.add(path); + } + ShareExtend.shareMultiple(imageList, "image",subject: "share muti image"); +} + +Future _writeByteToImageFile(ByteData byteData) async { + Directory dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); + File imageFile = new File( + "${dir.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png"); + imageFile.createSync(recursive: true); + imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0)); + return imageFile.path; +} + +``` \ No newline at end of file diff --git a/packages/share_extend/android/.gitignore b/packages/share_extend/android/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/packages/share_extend/android/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/packages/share_extend/android/build.gradle b/packages/share_extend/android/build.gradle new file mode 100644 index 0000000..ce3d1d9 --- /dev/null +++ b/packages/share_extend/android/build.gradle @@ -0,0 +1,38 @@ +group 'com.zt.shareextend' +version '1.0-SNAPSHOT' + +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.google.gms:google-services:4.3.10' + } +} + +rootProject.allprojects { + repositories { + google() + jcenter() + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 34 + namespace "com.zt.shareextend" + defaultConfig { + minSdkVersion 19 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + lintOptions { + disable 'InvalidPackage' + } +} + +dependencies { + api 'androidx.legacy:legacy-support-core-utils:1.0.0' +} diff --git a/packages/share_extend/android/gradle.properties b/packages/share_extend/android/gradle.properties new file mode 100644 index 0000000..678cd62 --- /dev/null +++ b/packages/share_extend/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/packages/share_extend/android/settings.gradle b/packages/share_extend/android/settings.gradle new file mode 100644 index 0000000..586a10e --- /dev/null +++ b/packages/share_extend/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'share_extend' diff --git a/packages/share_extend/android/src/main/AndroidManifest.xml b/packages/share_extend/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2a44432 --- /dev/null +++ b/packages/share_extend/android/src/main/AndroidManifest.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/MethodCallHandlerImpl.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/MethodCallHandlerImpl.java new file mode 100644 index 0000000..6812036 --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/MethodCallHandlerImpl.java @@ -0,0 +1,36 @@ +package com.zt.shareextend; + +import androidx.annotation.NonNull; + +import java.util.Map; + +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; + +/** + * Created by zhouteng on 2020/6/27 + */ +public class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler { + + private static final String METHOD_SHARE = "share"; + + private Share share; + + public MethodCallHandlerImpl(Share share) { + this.share = share; + } + + @Override + public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { + if (METHOD_SHARE.equals(call.method)) { + if (!(call.arguments instanceof Map)) { + throw new IllegalArgumentException("Map argument expected"); + } + share.share(call); + result.success(null); + } else { + result.notImplemented(); + } + } + +} diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/MimeUtils.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/MimeUtils.java new file mode 100644 index 0000000..d45bb31 --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/MimeUtils.java @@ -0,0 +1,129 @@ +package com.zt.shareextend; + +import android.text.TextUtils; +import android.webkit.MimeTypeMap; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +/** + * Created by zhouteng on 2020-03-29 + */ +public class MimeUtils { + + private static final String DEFAULT_MINE_TYPE = "application/octet-stream"; + + private static final Map extensionToMimeTypeMap = new HashMap<>(); + + static { + add("epub", "application/epub+zip"); + add("ogx", "application/ogg"); + add("odp", "application/vnd.oasis.opendocument.presentation"); + add("otp", "application/vnd.oasis.opendocument.presentation-template"); + add("yt", "application/vnd.youtube.yt"); + add("hwp", "application/x-hwp"); + add("3gpp", "video/3gpp"); + add("3gp", "video/3gpp"); + add("3gpp2", "video/3gpp2"); + add("3g2", "video/3gpp2"); + add("oga", "audio/ogg"); + add("ogg", "audio/ogg"); + add("spx", "audio/ogg"); + add("dng", "image/x-adobe-dng"); + add("cr2", "image/x-canon-cr2"); + add("raf", "image/x-fuji-raf"); + add("nef", "image/x-nikon-nef"); + add("nrw", "image/x-nikon-nrw"); + add("orf", "image/x-olympus-orf"); + add("rw2", "image/x-panasonic-rw2"); + add("pef", "image/x-pentax-pef"); + add("srw", "image/x-samsung-srw"); + add("arw", "image/x-sony-arw"); + add("ogv", "video/ogg"); + add("tgz", "application/x-gtar-compressed"); + add("taz", "application/x-gtar-compressed"); + add("csv", "text/csv"); + add("gz", "application/gzip"); + add("cab", "application/vnd.ms-cab-compressed"); + add("7z", "application/x-7z-compressed"); + add("bz", "application/x-bzip"); + add("bz2", "application/x-bzip2"); + add("z", "application/x-compress"); + add("jar", "application/x-java-archive"); + add("lzma", "application/x-lzma"); + add("xz", "application/x-xz"); + add("m3u", "audio/x-mpegurl"); + add("m3u8", "audio/x-mpegurl"); + add("p7b", "application/x-pkcs7-certificates"); + add("spc", "application/x-pkcs7-certificates"); + add("p7c", "application/pkcs7-mime"); + add("p7s", "application/pkcs7-signature"); + add("es", "application/ecmascript"); + add("js", "application/javascript"); + add("json", "application/json"); + add("ts", "application/typescript"); + add("perl", "text/x-perl"); + add("pl", "text/x-perl"); + add("pm", "text/x-perl"); + add("py", "text/x-python"); + add("py3", "text/x-python"); + add("py3x", "text/x-python"); + add("pyx", "text/x-python"); + add("wsgi", "text/x-python"); + add("rb", "text/ruby"); + add("sh", "application/x-sh"); + add("yaml", "text/x-yaml"); + add("yml", "text/x-yaml"); + add("asm", "text/x-asm"); + add("s", "text/x-asm"); + add("cs", "text/x-csharp"); + add("azw", "application/vnd.amazon.ebook"); + add("ibooks", "application/x-ibooks+zip"); + add("mobi", "application/x-mobipocket-ebook"); + add("woff", "font/woff"); + add("woff2", "font/woff2"); + add("msg", "application/vnd.ms-outlook"); + add("eml", "message/rfc822"); + add("eot", "application/vnd.ms-fontobject"); + add("ttf", "font/ttf"); + add("otf", "font/otf"); + add("ttc", "font/collection"); + add("markdown", "text/markdown"); + add("md", "text/markdown"); + add("mkd", "text/markdown"); + add("conf", "text/plain"); + add("ini", "text/plain"); + add("list", "text/plain"); + add("log", "text/plain"); + add("prop", "text/plain"); + add("properties", "text/plain"); + add("rc", "text/plain"); + add("flv", "video/x-flv"); + } + + private static void add(String extension, String mimeType) { + if (!extensionToMimeTypeMap.containsKey(extension)) { + extensionToMimeTypeMap.put(extension, mimeType); + } + } + + public static String getMineType(File file) { + final int lastDot = file.getName().lastIndexOf('.'); + if (lastDot < 0) { + return DEFAULT_MINE_TYPE; + } + + final String extension = file.getName().substring(lastDot + 1).toLowerCase(); + String mineType = extensionToMimeTypeMap.get(extension); + if (!TextUtils.isEmpty(mineType)) { + return mineType; + } + + mineType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if (!TextUtils.isEmpty(mineType)) { + return mineType; + } + return DEFAULT_MINE_TYPE; + } +} diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/Share.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/Share.java new file mode 100644 index 0000000..8189add --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/Share.java @@ -0,0 +1,125 @@ +package com.zt.shareextend; + +import android.Manifest; +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; + +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import io.flutter.plugin.common.MethodCall; + +/** + * Created by zhouteng on 2020/6/27 + *

+ * Handles share action + */ +public class Share { + + private static final int CODE_ASK_PERMISSION = 100; + + private Context context; + private MethodCall call; + + public Share(Context context) { + this.context = context; + } + + void share() { + share(call); + } + + void share(MethodCall call) { + + if (call == null) { + return; + } + + this.call = call; + + List list = call.argument("list"); + String type = call.argument("type"); + String sharePanelTitle = call.argument("sharePanelTitle"); + String subject = call.argument("subject"); + ArrayList extraTexts = call.argument("extraTexts"); + + if (list == null || list.isEmpty()) { + throw new IllegalArgumentException("Non-empty list expected"); + } + + ArrayList uriList = new ArrayList<>(); + + Intent shareIntent = new Intent(); + shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject); + + if ("text".equals(type)) { + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_TEXT, list.get(0)); + shareIntent.setType("text/plain"); + } else { + if (ShareUtils.shouldRequestPermission(list)) { + if (!checkPermission()) { + requestPermission(); + return; + } + } + for (String path : list) { + File f = new File(path); + Uri uri = ShareUtils.getUriForFile(context, f); + uriList.add(uri); + } + + if ("image".equals(type)) { + shareIntent.setType("image/*"); + } else if ("video".equals(type)) { + shareIntent.setType("video/*"); + } else if ("audio".equals(type)) { + shareIntent.setType("audio/*"); + } else { + shareIntent.setType("application/*"); + } + if (uriList.size() == 1) { + shareIntent.putExtra(Intent.EXTRA_TEXT, extraTexts != null && !extraTexts.isEmpty() ? extraTexts.get(0) : null); + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_STREAM, uriList.get(0)); + } else { + shareIntent.putExtra(Intent.EXTRA_TEXT, extraTexts); + shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE); + shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uriList); + } + } + startChooserActivity(shareIntent, sharePanelTitle, uriList); + } + + private void startChooserActivity(Intent shareIntent, String sharePanelTitle, ArrayList uriList) { + Intent chooserIntent = Intent.createChooser(shareIntent, sharePanelTitle); + ShareUtils.grantUriPermission(context, uriList, chooserIntent); + + if (context instanceof Activity) { + context.startActivity(chooserIntent); + } else { + chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(chooserIntent); + } + } + + private boolean checkPermission() { + return ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) + == PackageManager.PERMISSION_GRANTED; + } + + private void requestPermission() { + if (!(context instanceof Activity)) { + return; + } + ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, CODE_ASK_PERMISSION); + } +} diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendPlugin.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendPlugin.java new file mode 100644 index 0000000..e48690d --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendPlugin.java @@ -0,0 +1,94 @@ +package com.zt.shareextend; + +import android.content.Context; +import android.content.pm.PackageManager; + +import androidx.annotation.NonNull; + +import io.flutter.embedding.engine.plugins.FlutterPlugin; +import io.flutter.embedding.engine.plugins.activity.ActivityAware; +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; +import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.PluginRegistry; +import io.flutter.plugin.common.PluginRegistry.Registrar; + +/** + * Plugin method host for presenting a share sheet via Intent + */ +public class ShareExtendPlugin implements FlutterPlugin, ActivityAware, PluginRegistry.RequestPermissionsResultListener { + + /// the authorities for FileProvider + private static final int CODE_ASK_PERMISSION = 100; + private static final String CHANNEL = "com.zt.shareextend/share_extend"; + + private FlutterPluginBinding pluginBinding; + private ActivityPluginBinding activityBinding; + + private MethodChannel methodChannel; + private MethodCallHandlerImpl callHandler; + private Share share; + + public static void registerWith(Registrar registrar) { + ShareExtendPlugin plugin = new ShareExtendPlugin(); + plugin.setUpChannel(registrar.context(), registrar.messenger(), registrar, null); + } + + @Override + public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { + pluginBinding = flutterPluginBinding; + } + + @Override + public void onDetachedFromEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { + pluginBinding = null; + } + + @Override + public void onAttachedToActivity(@NonNull ActivityPluginBinding activityPluginBinding) { + activityBinding = activityPluginBinding; + setUpChannel(activityBinding.getActivity(), pluginBinding.getBinaryMessenger(), null, activityBinding); + } + + @Override + public void onDetachedFromActivityForConfigChanges() { + onDetachedFromActivity(); + } + + @Override + public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding activityPluginBinding) { + onAttachedToActivity(activityPluginBinding); + } + + @Override + public void onDetachedFromActivity() { + tearDown(); + } + + private void setUpChannel(Context context, BinaryMessenger messenger,Registrar registrar, ActivityPluginBinding activityBinding) { + methodChannel = new MethodChannel(messenger, CHANNEL); + share = new Share(context); + callHandler = new MethodCallHandlerImpl(share); + methodChannel.setMethodCallHandler(callHandler); + if (registrar != null) { + registrar.addRequestPermissionsResultListener(this); + } else { + activityBinding.addRequestPermissionsResultListener(this); + } + } + + private void tearDown() { + activityBinding.removeRequestPermissionsResultListener(this); + activityBinding = null; + methodChannel.setMethodCallHandler(null); + methodChannel = null; + } + + @Override + public boolean onRequestPermissionsResult(int requestCode, String[] perms, int[] grantResults) { + if (requestCode == CODE_ASK_PERMISSION && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + share.share(); + } + return false; + } +} diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendProvider.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendProvider.java new file mode 100644 index 0000000..d9029ef --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareExtendProvider.java @@ -0,0 +1,160 @@ +package com.zt.shareextend; + +import android.content.ContentProvider; +import android.content.ContentResolver; +import android.content.ContentValues; +import android.content.Context; +import android.content.pm.ProviderInfo; +import android.database.Cursor; +import android.database.MatrixCursor; +import android.net.Uri; +import android.os.ParcelFileDescriptor; +import android.provider.MediaStore; +import android.provider.OpenableColumns; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import java.io.File; +import java.io.FileNotFoundException; + +public class ShareExtendProvider extends ContentProvider { + + private static final String[] COLUMNS = { + OpenableColumns.DISPLAY_NAME, + OpenableColumns.SIZE, + MediaStore.MediaColumns.DATA + }; + + @Override + public void attachInfo(Context context, ProviderInfo info) { + super.attachInfo(context, info); + + // Sanity check our security + if (info.exported) { + throw new SecurityException("Provider must not be exported"); + } + if (!info.grantUriPermissions) { + throw new SecurityException("Provider must grant uri permissions"); + } + } + + @Override + public boolean onCreate() { + return false; + } + + @Nullable + @Override + public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException { + final File file = getFileForUri(uri); + final int fileMode = modeToMode(mode); + return ParcelFileDescriptor.open(file, fileMode); + } + + private static int modeToMode(String mode) { + int modeBits; + if ("r".equals(mode)) { + modeBits = ParcelFileDescriptor.MODE_READ_ONLY; + } else if ("w".equals(mode) || "wt".equals(mode)) { + modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY + | ParcelFileDescriptor.MODE_CREATE + | ParcelFileDescriptor.MODE_TRUNCATE; + } else if ("wa".equals(mode)) { + modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY + | ParcelFileDescriptor.MODE_CREATE + | ParcelFileDescriptor.MODE_APPEND; + } else if ("rw".equals(mode)) { + modeBits = ParcelFileDescriptor.MODE_READ_WRITE + | ParcelFileDescriptor.MODE_CREATE; + } else if ("rwt".equals(mode)) { + modeBits = ParcelFileDescriptor.MODE_READ_WRITE + | ParcelFileDescriptor.MODE_CREATE + | ParcelFileDescriptor.MODE_TRUNCATE; + } else { + throw new IllegalArgumentException("Invalid mode: " + mode); + } + return modeBits; + } + + @Nullable + @Override + public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) { + + File file = getFileForUri(uri); + + if (projection == null) { + projection = COLUMNS; + } + + String[] cols = new String[projection.length]; + Object[] values = new Object[projection.length]; + int i = 0; + for (String col : projection) { + if (OpenableColumns.DISPLAY_NAME.equals(col)) { + cols[i] = OpenableColumns.DISPLAY_NAME; + values[i++] = file.getName(); + } else if (OpenableColumns.SIZE.equals(col)) { + cols[i] = OpenableColumns.SIZE; + values[i++] = file.length(); + } else if (MediaStore.MediaColumns.DATA.equals(col)) { + cols[i] = MediaStore.MediaColumns.DATA; + values[i++] = file.getAbsolutePath(); + } + } + + cols = copyOf(cols, i); + values = copyOf(values, i); + + final MatrixCursor cursor = new MatrixCursor(cols, 1); + cursor.addRow(values); + return cursor; + } + + private static String[] copyOf(String[] original, int newLength) { + final String[] result = new String[newLength]; + System.arraycopy(original, 0, result, 0, newLength); + return result; + } + + private static Object[] copyOf(Object[] original, int newLength) { + final Object[] result = new Object[newLength]; + System.arraycopy(original, 0, result, 0, newLength); + return result; + } + + @Nullable + @Override + public String getType(@NonNull Uri uri) { + return MimeUtils.getMineType(getFileForUri(uri)); + } + + public static Uri getUriForPath(String authority, String path) { + return new Uri.Builder() + .scheme(ContentResolver.SCHEME_CONTENT) + .authority(authority) + .path(Uri.encode(path)) + .build(); + } + + private File getFileForUri(Uri uri) { + String path = Uri.decode(uri.getPath()).substring(1); + return new File(path); + } + + @Nullable + @Override + public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { + throw new UnsupportedOperationException("No external inserts"); + } + + @Override + public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { + throw new UnsupportedOperationException("No external deletes"); + } + + @Override + public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) { + throw new UnsupportedOperationException("No external updates"); + } +} diff --git a/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareUtils.java b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareUtils.java new file mode 100644 index 0000000..e9fddea --- /dev/null +++ b/packages/share_extend/android/src/main/java/com/zt/shareextend/ShareUtils.java @@ -0,0 +1,55 @@ +package com.zt.shareextend; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.os.Build; +import android.os.Environment; + +import java.io.File; +import java.util.List; + +class ShareUtils { + + /// get the uri for file + static Uri getUriForFile(Context context, File file) { + + String authorities = context.getPackageName() + ".shareextend.fileprovider"; + + return ShareExtendProvider.getUriForPath(authorities, file.getAbsolutePath()); + } + + static void grantUriPermission(Context context, List uriList, Intent intent) { + // some devices will crash when calling queryIntentActivities, so add try catch temporarily. + try { + for (Uri uri : uriList) { + List resolveInfos = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); + for (ResolveInfo resolveInfo : resolveInfos) { + context.grantUriPermission(resolveInfo.activityInfo.packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); + } + } + } catch (Exception e) { + + } + } + + static boolean shouldRequestPermission(List pathList) { + for (String path : pathList) { + if (shouldRequestPermission(path)) { + return true; + } + } + return false; + } + + private static boolean shouldRequestPermission(String path) { + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isPathInExternalStorage(path); + } + + private static boolean isPathInExternalStorage(String path) { + File storagePath = Environment.getExternalStorageDirectory(); + return path.startsWith(storagePath.getAbsolutePath()); + } +} diff --git a/packages/share_extend/example/.gitignore b/packages/share_extend/example/.gitignore new file mode 100644 index 0000000..47e0b4d --- /dev/null +++ b/packages/share_extend/example/.gitignore @@ -0,0 +1,71 @@ +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# Visual Studio Code related +.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/example/.metadata b/packages/share_extend/example/.metadata similarity index 70% rename from example/.metadata rename to packages/share_extend/example/.metadata index 05f4d5d..e372436 100644 --- a/example/.metadata +++ b/packages/share_extend/example/.metadata @@ -4,7 +4,5 @@ # This file should be version controlled and should not be manually edited. version: - revision: 097d3313d8e2c7f901932d63e537c1acefb87800 - channel: stable - -project_type: app + revision: 13684e4f8e9edb4c2b2a0fd8e1439f93e6e30fde + channel: unknown diff --git a/packages/share_extend/example/README.md b/packages/share_extend/example/README.md new file mode 100644 index 0000000..511e08f --- /dev/null +++ b/packages/share_extend/example/README.md @@ -0,0 +1,8 @@ +# share_extend_example + +Demonstrates how to use the share_extend plugin. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](https://flutter.io/). diff --git a/example/android/app/build.gradle b/packages/share_extend/example/android/app/build.gradle similarity index 65% rename from example/android/app/build.gradle rename to packages/share_extend/example/android/app/build.gradle index a4bcde7..6699f6c 100644 --- a/example/android/app/build.gradle +++ b/packages/share_extend/example/android/app/build.gradle @@ -22,33 +22,23 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 34 + compileSdkVersion 28 - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + lintOptions { + disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.assecont.servicos.assecontservices_example" - minSdkVersion 23 - targetSdkVersion 34 + applicationId "com.zt.shareextendexample" + minSdkVersion 19 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - multiDexEnabled true + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -65,9 +55,7 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.android.material:material:1.6.0-alpha01' - implementation 'com.android.support:multidex:2.0.1' - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.core:core:1.7.0' -} \ No newline at end of file + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.1.2-alpha01' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01' +} diff --git a/packages/share_extend/example/android/app/src/main/AndroidManifest.xml b/packages/share_extend/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c34a48a --- /dev/null +++ b/packages/share_extend/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/share_extend/example/android/app/src/main/java/com/zt/shareextendexample/EmbeddingV1Activity.java b/packages/share_extend/example/android/app/src/main/java/com/zt/shareextendexample/EmbeddingV1Activity.java new file mode 100644 index 0000000..7752f8f --- /dev/null +++ b/packages/share_extend/example/android/app/src/main/java/com/zt/shareextendexample/EmbeddingV1Activity.java @@ -0,0 +1,25 @@ +package com.zt.shareextendexample; + +import android.os.Bundle; + +import com.vitanov.multiimagepicker.MultiImagePickerPlugin; +import com.zt.shareextend.ShareExtendPlugin; + +import io.flutter.app.FlutterActivity; +import io.flutter.embedding.engine.plugins.FlutterPlugin; +import io.flutter.plugins.GeneratedPluginRegistrant; +import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin; +import io.flutter.plugins.imagepicker.ImagePickerPlugin; +import io.flutter.plugins.pathprovider.PathProviderPlugin; + +public class EmbeddingV1Activity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + ShareExtendPlugin.registerWith(registrarFor("com.zt.shareextend.ShareExtendPlugin")); + ImagePickerPlugin.registerWith(registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin")); + MultiImagePickerPlugin.registerWith(registrarFor("com.vitanov.multiimagepicker.MultiImagePickerPlugin")); + PathProviderPlugin.registerWith(registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); + FlutterAndroidLifecyclePlugin.registerWith(registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin")); + } +} diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/packages/share_extend/example/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from example/android/app/src/main/res/drawable/launch_background.xml rename to packages/share_extend/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/share_extend/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/share_extend/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/share_extend/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/share_extend/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/share_extend/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/share_extend/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/share_extend/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/share_extend/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/share_extend/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/share_extend/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/share_extend/example/android/app/src/main/res/values/styles.xml b/packages/share_extend/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..00fa441 --- /dev/null +++ b/packages/share_extend/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + diff --git a/example/android/build.gradle b/packages/share_extend/example/android/build.gradle similarity index 58% rename from example/android/build.gradle rename to packages/share_extend/example/android/build.gradle index cb313ca..2627e66 100644 --- a/example/android/build.gradle +++ b/packages/share_extend/example/android/build.gradle @@ -1,24 +1,23 @@ buildscript { - ext.kotlin_version = '1.8.10' repositories { google() - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:3.3.1' } } allprojects { repositories { google() - mavenCentral() + jcenter() } } rootProject.buildDir = '../build' + subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } @@ -26,6 +25,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/example/android/gradle.properties b/packages/share_extend/example/android/gradle.properties similarity index 78% rename from example/android/gradle.properties rename to packages/share_extend/example/android/gradle.properties index 94adc3a..b6e61b6 100644 --- a/example/android/gradle.properties +++ b/packages/share_extend/example/android/gradle.properties @@ -1,3 +1,4 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true android.enableJetifier=true +android.useAndroidX=true +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true diff --git a/packages/share_extend/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/share_extend/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..585b78a --- /dev/null +++ b/packages/share_extend/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Feb 07 10:23:11 EST 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/packages/share_extend/example/android/settings.gradle b/packages/share_extend/example/android/settings.gradle new file mode 100644 index 0000000..5a2f14f --- /dev/null +++ b/packages/share_extend/example/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/packages/share_extend/example/ios/Flutter/AppFrameworkInfo.plist similarity index 97% rename from example/ios/Flutter/AppFrameworkInfo.plist rename to packages/share_extend/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f..9367d48 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/share_extend/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 8.0 diff --git a/packages/share_extend/example/ios/Flutter/Debug.xcconfig b/packages/share_extend/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..e8efba1 --- /dev/null +++ b/packages/share_extend/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/share_extend/example/ios/Flutter/Flutter.podspec b/packages/share_extend/example/ios/Flutter/Flutter.podspec new file mode 100644 index 0000000..2c4421c --- /dev/null +++ b/packages/share_extend/example/ios/Flutter/Flutter.podspec @@ -0,0 +1,18 @@ +# +# NOTE: This podspec is NOT to be published. It is only used as a local source! +# This is a generated file; do not edit or check into version control. +# + +Pod::Spec.new do |s| + s.name = 'Flutter' + s.version = '1.0.0' + s.summary = 'High-performance, high-fidelity mobile apps.' + s.homepage = 'https://flutter.io' + s.license = { :type => 'MIT' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } + s.ios.deployment_target = '8.0' + # Framework linking is handled by Flutter tooling, not CocoaPods. + # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. + s.vendored_frameworks = 'path/to/nothing' +end diff --git a/packages/share_extend/example/ios/Flutter/Release.xcconfig b/packages/share_extend/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..399e934 --- /dev/null +++ b/packages/share_extend/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/share_extend/example/ios/Podfile b/packages/share_extend/example/ios/Podfile new file mode 100644 index 0000000..252d9ec --- /dev/null +++ b/packages/share_extend/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/packages/share_extend/example/ios/Runner.xcodeproj/project.pbxproj similarity index 69% rename from example/ios/Runner.xcodeproj/project.pbxproj rename to packages/share_extend/example/ios/Runner.xcodeproj/project.pbxproj index 7f889de..94ea62e 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/share_extend/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,13 +3,15 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 84FDDEBB9BBADAD8164AA15C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0A688444B97628794691EEF /* Pods_Runner.framework */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 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 */; }; @@ -29,19 +31,24 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 07029D33E422EE11C426D7C7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 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 = ""; }; 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 817ED98B236B2F6900BBAFE4 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; 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; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 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 = ""; }; + CD456C76FAC541BD38BB2841 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + E0A688444B97628794691EEF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +56,21 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 84FDDEBB9BBADAD8164AA15C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1929A27D658C0F8DBB7285DC /* Frameworks */ = { + isa = PBXGroup; + children = ( + E0A688444B97628794691EEF /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +88,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + A73596DA6A4E5A47E033894D /* Pods */, + 1929A27D658C0F8DBB7285DC /* Frameworks */, ); sourceTree = ""; }; @@ -86,18 +104,37 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + 817ED98B236B2F6900BBAFE4 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + A73596DA6A4E5A47E033894D /* Pods */ = { + isa = PBXGroup; + children = ( + 07029D33E422EE11C426D7C7 /* Pods-Runner.debug.xcconfig */, + CD456C76FAC541BD38BB2841 /* Pods-Runner.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -105,12 +142,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 41B0890A4A82A6143DF13DD5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + E909F93B03931C31C89F1BEB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -127,20 +166,22 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 67JZ7MB7A8; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -183,6 +224,24 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 41B0890A4A82A6143DF13DD5 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -197,6 +256,36 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + E909F93B03931C31C89F1BEB /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BSGridCollectionViewLayout/BSGridCollectionViewLayout.framework", + "${BUILT_PRODUCTS_DIR}/BSImagePicker/BSImagePicker.framework", + "${BUILT_PRODUCTS_DIR}/BSImageView/BSImageView.framework", + "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", + "${BUILT_PRODUCTS_DIR}/multi_image_picker/multi_image_picker.framework", + "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", + "${BUILT_PRODUCTS_DIR}/share_extend/share_extend.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BSGridCollectionViewLayout.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BSImagePicker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BSImageView.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/multi_image_picker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_extend.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -204,7 +293,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -231,77 +321,6 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - 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; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.assecont.servicos.assecontservicesExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -349,7 +368,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -398,12 +417,9 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.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; }; @@ -416,15 +432,21 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 67JZ7MB7A8; ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "@executable_path/Frameworks", + "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.assecont.servicos.assecontservicesExample; + PRODUCT_BUNDLE_IDENTIFIER = com.zt.shareExtendExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -438,15 +460,21 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 67JZ7MB7A8; ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "@executable_path/Frameworks", + "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.assecont.servicos.assecontservicesExample; + PRODUCT_BUNDLE_IDENTIFIER = com.zt.shareExtendExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; @@ -460,7 +488,6 @@ buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -470,7 +497,6 @@ buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/share_extend/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/share_extend/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/share_extend/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 94% rename from example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/share_extend/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..e4f93ed 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/share_extend/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + - - + + + + + + diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/share_extend/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/share_extend/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/share_extend/example/ios/Runner/AppDelegate.h b/packages/share_extend/example/ios/Runner/AppDelegate.h new file mode 100644 index 0000000..36e21bb --- /dev/null +++ b/packages/share_extend/example/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/packages/share_extend/example/ios/Runner/AppDelegate.m b/packages/share_extend/example/ios/Runner/AppDelegate.m new file mode 100644 index 0000000..59a72e9 --- /dev/null +++ b/packages/share_extend/example/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#include "AppDelegate.h" +#include "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..3d43d11 Binary files /dev/null and b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/share_extend/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/share_extend/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/share_extend/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/packages/share_extend/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from example/ios/Runner/Base.lproj/Main.storyboard rename to packages/share_extend/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/example/ios/Runner/Info.plist b/packages/share_extend/example/ios/Runner/Info.plist similarity index 83% rename from example/ios/Runner/Info.plist rename to packages/share_extend/example/ios/Runner/Info.plist index 88b35e2..e6c2691 100644 --- a/example/ios/Runner/Info.plist +++ b/packages/share_extend/example/ios/Runner/Info.plist @@ -3,9 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Assecontservices + en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - assecontservices_example + share_extend_example CFBundlePackageType APPL CFBundleShortVersionString @@ -43,5 +41,9 @@ UIViewControllerBasedStatusBarAppearance + NSPhotoLibraryAddUsageDescription + App needs photo library permission for saving images + NSPhotoLibraryUsageDescription + Used to demonstrate image picker plugin diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/packages/share_extend/example/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from example/ios/Runner/Runner-Bridging-Header.h rename to packages/share_extend/example/ios/Runner/Runner-Bridging-Header.h diff --git a/packages/share_extend/example/ios/Runner/main.m b/packages/share_extend/example/ios/Runner/main.m new file mode 100644 index 0000000..dff6597 --- /dev/null +++ b/packages/share_extend/example/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/packages/share_extend/example/lib/main.dart b/packages/share_extend/example/lib/main.dart new file mode 100644 index 0000000..b5ec2a1 --- /dev/null +++ b/packages/share_extend/example/lib/main.dart @@ -0,0 +1,123 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:share_extend/share_extend.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:path_provider/path_provider.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + final _picker = ImagePicker(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: Center( + child: Column( + children: [ + ElevatedButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.white70), + foregroundColor: WidgetStateProperty.all(Colors.black)), + onPressed: () { + ShareExtend.share("share text", "text", + sharePanelTitle: "share text title", + subject: "share text subject"); + }, + child: const Text("share text"), + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.white70), + foregroundColor: WidgetStateProperty.all(Colors.black)), + onPressed: () async { + final res = + await _picker.pickImage(source: ImageSource.gallery); + if (res?.path != null) { + ShareExtend.share(res!.path, "image", + sharePanelTitle: "share image title", + subject: "share image subject"); + } + }, + child: const Text("share image"), + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.white70), + foregroundColor: WidgetStateProperty.all(Colors.black)), + onPressed: () async { + final res = + await _picker.pickVideo(source: ImageSource.gallery); + if (res?.path != null) { + ShareExtend.share(res!.path, "video"); + } + }, + child: const Text("share video"), + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Colors.white70), + foregroundColor: WidgetStateProperty.all(Colors.black)), + onPressed: () { + _shareStorageFile(); + }, + child: const Text("share file"), + ), + ], + ), + ), + ), + ); + } + + ///share multiple images + + + Future _writeByteToImageFile(ByteData byteData) async { + Directory? dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); + File imageFile = File( + "${dir?.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png"); + imageFile.createSync(recursive: true); + imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0)); + return imageFile.path; + } + + ///share the storage file + _shareStorageFile() async { + Directory? dir = Platform.isAndroid + ? await getExternalStorageDirectory() + : await getApplicationDocumentsDirectory(); + File testFile = File("${dir?.path}/flutter/test.txt"); + if (!await testFile.exists()) { + await testFile.create(recursive: true); + testFile.writeAsStringSync("test for share documents file"); + } + ShareExtend.share(testFile.path, "file"); + } +} diff --git a/packages/share_extend/example/pubspec.yaml b/packages/share_extend/example/pubspec.yaml new file mode 100644 index 0000000..a9f472f --- /dev/null +++ b/packages/share_extend/example/pubspec.yaml @@ -0,0 +1,79 @@ +name: share_extend_example +description: Demonstrates how to use the share_extend plugin. + +# 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. +# Read more about versioning at semver.org. +version: 1.0.0+1 + +environment: + sdk: ">=2.17.0 <3.0.0" + +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: any + path_provider: any + image_picker: any +# image_picker: +# git: +# url: git@github.com:miguelpruivo/plugins.git +# path: packages/image_picker +# ref: image_picker-Fix-#41046 + +dev_dependencies: + flutter_test: + sdk: flutter + + share_extend: + path: ../ + + + +# For information on the generic Dart part of this file, see the +# following page: https://www.dartlang.org/tools/pub/pubspec + +# The following section is specific to Flutter. +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 + + # 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.io/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.io/assets-and-images/#from-packages + + # 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.io/custom-fonts/#from-packages diff --git a/packages/share_extend/example/test/widget_test.dart b/packages/share_extend/example/test/widget_test.dart new file mode 100644 index 0000000..0df88c8 --- /dev/null +++ b/packages/share_extend/example/test/widget_test.dart @@ -0,0 +1,25 @@ +// This is a basic Flutter widget test. +// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter +// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to +// find child widgets in the widget tree, read text, and verify that the values of widget properties +// are correct. + +//import 'package:flutter/material.dart'; +//import 'package:flutter_test/flutter_test.dart'; + +//import 'package:share_extend_example/main.dart'; + +void main() { +// testWidgets('Verify Platform version', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(new MyApp()); +// +// // Verify that platform version is retrieved. +// expect( +// find.byWidgetPredicate( +// (Widget widget) => +// widget is Text && widget.data.startsWith('Running on:'), +// ), +// findsOneWidget); +// }); +} diff --git a/packages/share_extend/ios/.gitignore b/packages/share_extend/ios/.gitignore new file mode 100644 index 0000000..710ec6c --- /dev/null +++ b/packages/share_extend/ios/.gitignore @@ -0,0 +1,36 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig diff --git a/packages/share_extend/ios/Assets/.gitkeep b/packages/share_extend/ios/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/share_extend/ios/Classes/ShareExtendPlugin.h b/packages/share_extend/ios/Classes/ShareExtendPlugin.h new file mode 100644 index 0000000..b37955b --- /dev/null +++ b/packages/share_extend/ios/Classes/ShareExtendPlugin.h @@ -0,0 +1,4 @@ +#import + +@interface ShareExtendPlugin : NSObject +@end diff --git a/packages/share_extend/ios/Classes/ShareExtendPlugin.m b/packages/share_extend/ios/Classes/ShareExtendPlugin.m new file mode 100644 index 0000000..910f825 --- /dev/null +++ b/packages/share_extend/ios/Classes/ShareExtendPlugin.m @@ -0,0 +1,75 @@ +#import "ShareExtendPlugin.h" + +@implementation ShareExtendPlugin + ++ (void)registerWithRegistrar:(NSObject*)registrar { + FlutterMethodChannel* shareChannel = [FlutterMethodChannel + methodChannelWithName:@"com.zt.shareextend/share_extend" + binaryMessenger:[registrar messenger]]; + + [shareChannel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) { + if ([@"share" isEqualToString:call.method]) { + NSDictionary *arguments = [call arguments]; + NSArray *array = arguments[@"list"]; + NSString *shareType = arguments[@"type"]; + NSString *subject = arguments[@"subject"]; + + if (array.count == 0) { + result( + [FlutterError errorWithCode:@"error" message:@"Non-empty list expected" details:nil]); + return; + } + + NSNumber *originX = arguments[@"originX"]; + NSNumber *originY = arguments[@"originY"]; + NSNumber *originWidth = arguments[@"originWidth"]; + NSNumber *originHeight = arguments[@"originHeight"]; + + CGRect originRect = CGRectZero; + if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) { + originRect = CGRectMake([originX doubleValue], [originY doubleValue], + [originWidth doubleValue], [originHeight doubleValue]); + } + + if ([shareType isEqualToString:@"text"]) { + [self share:array atSource:originRect withSubject:subject]; + result(nil); + } else if ([shareType isEqualToString:@"image"]) { + NSMutableArray * imageArray = [[NSMutableArray alloc] init]; + for (NSString * path in array) { + UIImage *image = [UIImage imageWithContentsOfFile:path]; + [imageArray addObject:image]; + } + [self share:imageArray atSource:originRect withSubject:subject]; + } else { + NSMutableArray * urlArray = [[NSMutableArray alloc] init]; + for (NSString * path in array) { + NSURL *url = [NSURL fileURLWithPath:path]; + [urlArray addObject:url]; + } + [self share:urlArray atSource:originRect withSubject:subject]; + result(nil); + } + } else { + result(FlutterMethodNotImplemented); + } + }]; +} + ++ (void)share:(NSArray *)sharedItems atSource:(CGRect)origin withSubject:(NSString *) subject { + UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:sharedItems applicationActivities:nil]; + + UIViewController *controller =[UIApplication sharedApplication].keyWindow.rootViewController; + activityViewController.popoverPresentationController.sourceView = controller.view; + + if (CGRectIsEmpty(origin)) { + origin = CGRectMake(0, 0, controller.view.bounds.size.width, controller.view.bounds.size.width /2); + } + activityViewController.popoverPresentationController.sourceRect = origin; + + [activityViewController setValue:subject forKey:@"subject"]; + + [controller presentViewController:activityViewController animated:YES completion:nil]; +} + +@end diff --git a/packages/share_extend/ios/share_extend.podspec b/packages/share_extend/ios/share_extend.podspec new file mode 100644 index 0000000..21f8258 --- /dev/null +++ b/packages/share_extend/ios/share_extend.podspec @@ -0,0 +1,21 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'share_extend' + s.version = '0.0.1' + s.summary = 'A new flutter plugin project.' + s.description = <<-DESC +A new flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + + s.ios.deployment_target = '12.0' +end + diff --git a/packages/share_extend/lib/share_extend.dart b/packages/share_extend/lib/share_extend.dart new file mode 100644 index 0000000..1891407 --- /dev/null +++ b/packages/share_extend/lib/share_extend.dart @@ -0,0 +1,87 @@ +/// A flutter plugin to share text, image, file with system ui. +/// It is compatible with both android and ios. +/// +/// +/// A open source authorized by zhouteng [https://github.com/zhouteng0217/ShareExtend](https://github.com/zhouteng0217/ShareExtend). + +import 'dart:async'; +import 'package:flutter/services.dart'; + +/// Plugin for summoning a platform share sheet. +class ShareExtend { + /// [MethodChannel] used to communicate with the platform side. + static const MethodChannel _channel = + MethodChannel('com.zt.shareextend/share_extend'); + + /// method to share with system ui + /// It uses the ACTION_SEND Intent on Android and UIActivityViewController + /// on iOS. + /// [list] can be text or path list + /// [type] "text", "image", "audio", "video" or "file" + /// [sharePositionOrigin] only supports iPad os + /// [sharePanelTitle] only supports android (some devices may not support) + /// [subject] Intent.EXTRA_SUBJECT on Android and "subject" on iOS. + /// [extraText] only supports android for Intent.EXTRA_TEXT when sharing image or file. + /// + static Future shareMultiple(List list, String type, + {Rect? sharePositionOrigin, + String? sharePanelTitle, + String subject = "", + List? extraTexts}) { + assert(list.isNotEmpty); + return _shareInner(list, type, + sharePositionOrigin: sharePositionOrigin, + subject: subject, + sharePanelTitle: sharePanelTitle, + extraTexts: extraTexts); + } + + /// method to share with system ui + /// It uses the ACTION_SEND Intent on Android and UIActivityViewController + /// on iOS. + /// [list] can be text or path list + /// [type] "text", "image", "audio", "video" or "file" + /// [sharePositionOrigin] only supports iPad os + /// [sharePanelTitle] only supports android (some devices may not support) + /// [subject] Intent.EXTRA_SUBJECT on Android and "subject" on iOS. + /// [extraText] only supports android for Intent.EXTRA_TEXT when sharing image or file. + /// + static Future share(String text, String type, + {Rect? sharePositionOrigin, + String? sharePanelTitle, + String subject = "", + String extraText = ""}) { + assert(text.isNotEmpty); + List list = [text]; + return _shareInner( + list, + type, + sharePositionOrigin: sharePositionOrigin, + sharePanelTitle: sharePanelTitle, + subject: subject, + extraTexts: [extraText], + ); + } + + static Future _shareInner(List list, String type, + {Rect? sharePositionOrigin, + String? sharePanelTitle, + String? subject, + List? extraTexts}) { + assert(list.isNotEmpty); + final Map params = { + 'list': list, + 'type': type, + 'sharePanelTitle': sharePanelTitle, + 'subject': subject, + 'extraTexts': extraTexts + }; + if (sharePositionOrigin != null) { + params['originX'] = sharePositionOrigin.left; + params['originY'] = sharePositionOrigin.top; + params['originWidth'] = sharePositionOrigin.width; + params['originHeight'] = sharePositionOrigin.height; + } + return _channel.invokeMethod('share', params); + } +} diff --git a/packages/share_extend/pubspec.yaml b/packages/share_extend/pubspec.yaml new file mode 100644 index 0000000..6f682de --- /dev/null +++ b/packages/share_extend/pubspec.yaml @@ -0,0 +1,26 @@ +name: share_extend +description: A Flutter plugin for Android and iOS for sharing text, image, video and file with system ui. +version: 2.0.1 +author: zhouteng +homepage: https://github.com/zhouteng0217/ShareExtend + +environment: + sdk: '>=2.17.0 <4.0.0' + flutter: ">=2.12.0" + +dependencies: + flutter: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://www.dartlang.org/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + plugin: + platforms: + android: + package: com.zt.shareextend + pluginClass: ShareExtendPlugin + ios: + pluginClass: ShareExtendPlugin diff --git a/pubspec.yaml b/pubspec.yaml index dbfc561..2d2dbbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,36 +13,35 @@ dependencies: flutter_localizations: sdk: flutter - provider: ^6.1.1 + provider: ^6.1.2 flutter_awesome_alert_box: ^2.1.1 - top_snackbar_flutter: ^3.1.0 + top_snackbar_flutter: ^3.2.0 - sqflite: ^2.3.0 #^2.0.2 - sqflite_common_ffi: ^2.3.0+4 - sqflite_common_ffi_web: ^0.4.0 + sqflite: ^2.3.3+1 #^2.0.2 + sqflite_common_ffi: ^2.3.4+4 + sqflite_common_ffi_web: ^0.4.5+4 - responsive_framework: ^1.1.1 + hive: ^2.2.3 + hive_flutter: ^1.1.0 + + responsive_framework: ^1.5.1 ###^0.2.0 - http: ^1.1.0 + http: ^1.2.2 intl: any #^0.18.1 - image_picker: ^1.0.4 - filesystem_picker: ^4.0.0 #^2.0.2 - - local_auth: ^2.1.7 + image_picker: ^1.1.2 + filesystem_picker: ^4.1.0 #^2.0.2 - photo_view: ^0.14.0 - - geocoding: ^2.1.1 - location: ^5.0.3 + local_auth: ^2.3.0 + photo_view: ^0.15.0 #$google_maps_flutter: ^2.2.5 - url_launcher: ^6.2.1 + url_launcher: ^6.3.1 flutter_carousel_slider: ^1.1.0 @@ -63,28 +62,28 @@ dependencies: ref: main #webcontent_converter: ^0.0.7+1 - flutter_html_to_pdf: ^0.7.0 + #flutter_html_to_pdf: ^0.7.0 + flutter_html_to_pdf_plus: + path: packages/flutter_html_to_pdf_plus #syncfusion_flutter_pdfviewer: ^23.1.39 - syncfusion_flutter_pdfviewer: - git: - url: https://github.com/pretolio/syncfusion_flutter_pdfviewer.git - ref: main + syncfusion_flutter_pdfviewer: ^26.2.13 - path_provider: ^2.1.1 - shared_preferences: ^2.2.2 - external_path: ^1.0.3 + path_provider: ^2.1.5 + shared_preferences: ^2.5.2 + external_path: ^2.0.1 cpf_cnpj_validator: ^2.0.0 #open_file_safe: ^3.2.3 - share_extend: ^2.0.0 + share_extend: + path: packages/share_extend universal_io: ^2.2.2 universal_html: ^2.2.4 - connectivity_plus: any + connectivity_plus: ^6.1.1 package_info_plus: any #^3.0.2 #^1.4.2 #device_info_plus: ^9.0.0 @@ -93,29 +92,32 @@ dependencies: url: https://github.com/pretolio/safe_device.git ref: main - brasil_fields: ^1.14.0 + brasil_fields: ^1.15.0 datetime_picker_formfield_new: ^2.1.0 - in_app_review: ^2.0.8 - launch_review: ^3.0.1 + in_app_review: ^2.0.10 + launch_app_store: ^1.1.1 #store_launcher: ^1.0.1 auto_size_text: ^3.0.0 + auto_animated: ^3.2.0 + shimmer: ^3.0.0 schedulers: ^1.0.1 - device_preview: ^1.1.0 + device_preview: ^1.2.0 -dependency_overrides: - #intl: ^0.17.0 +dependency_overrides: dev_dependencies: flutter_test: sdk: flutter flutter_lints: any + hive_generator: any + build_runner: any # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -139,33 +141,4 @@ flutter: windows: pluginClass: AssecontservicesPlugin - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your plugin package, 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 in packages, see - # https://flutter.dev/custom-fonts/#from-packages +