commit 71cb7b74ef135111a7e8fa4e24e1405ffa0cbe00 Author: ASUS Date: Sun May 25 08:34:17 2025 +0300 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..d77a4e0 --- /dev/null +++ b/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "c23637390482d4cf9598c3ce3f2be31aa7332daf" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: android + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: ios + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: linux + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: macos + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: web + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: windows + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..3f79b9c --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# guycom + +A new Flutter project. + +## 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://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..e2d9cf5 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.my_app" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.my_app" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a9a8f4d --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/my_app/MainActivity.kt b/android/app/src/main/kotlin/com/example/my_app/MainActivity.kt new file mode 100644 index 0000000..afc52a8 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/my_app/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.my_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..89176ef --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..f018a61 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..afa1e8e --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..a439442 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") diff --git a/assets/database/orderdb.db b/assets/database/orderdb.db new file mode 100644 index 0000000..6ebdfe2 Binary files /dev/null and b/assets/database/orderdb.db differ diff --git a/assets/database/products2.db b/assets/database/products2.db new file mode 100644 index 0000000..c70d727 Binary files /dev/null and b/assets/database/products2.db differ diff --git a/assets/database/usersDb.db b/assets/database/usersDb.db new file mode 100644 index 0000000..0b952ad Binary files /dev/null and b/assets/database/usersDb.db differ diff --git a/assets/database/work.db b/assets/database/work.db new file mode 100644 index 0000000..3955b9a Binary files /dev/null and b/assets/database/work.db differ diff --git a/assets/youm.ico b/assets/youm.ico new file mode 100644 index 0000000..f5119fe Binary files /dev/null and b/assets/youm.ico differ diff --git a/assets/youmaz2.png b/assets/youmaz2.png new file mode 100644 index 0000000..ff98ebe Binary files /dev/null and b/assets/youmaz2.png differ diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..7c56964 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/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/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/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/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..38399b8 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,46 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.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! + # Add This Line + pod 'PhoneNumberKit', '~> 4.0.1' + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # target 'RunnerTests' do + # inherit! :search_paths + # end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..0b32d88 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,129 @@ +PODS: + - charset_converter (0.0.1): + - Flutter + - DKImagePickerController/Core (4.3.9): + - DKImagePickerController/ImageDataManager + - DKImagePickerController/Resource + - DKImagePickerController/ImageDataManager (4.3.9) + - DKImagePickerController/PhotoGallery (4.3.9): + - DKImagePickerController/Core + - DKPhotoGallery + - DKImagePickerController/Resource (4.3.9) + - DKPhotoGallery (0.0.19): + - DKPhotoGallery/Core (= 0.0.19) + - DKPhotoGallery/Model (= 0.0.19) + - DKPhotoGallery/Preview (= 0.0.19) + - DKPhotoGallery/Resource (= 0.0.19) + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Core (0.0.19): + - DKPhotoGallery/Model + - DKPhotoGallery/Preview + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Model (0.0.19): + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Preview (0.0.19): + - DKPhotoGallery/Model + - DKPhotoGallery/Resource + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Resource (0.0.19): + - SDWebImage + - SwiftyGif + - file_picker (0.0.1): + - DKImagePickerController/PhotoGallery + - Flutter + - Flutter (1.0.0) + - flutter_pdfview (1.0.2): + - Flutter + - image_picker_ios (0.0.1): + - Flutter + - libphonenumber_plugin (0.0.1): + - Flutter + - PhoneNumberKit + - open_file_ios (0.0.1): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - PhoneNumberKit (4.0.1): + - PhoneNumberKit/PhoneNumberKitCore (= 4.0.1) + - PhoneNumberKit/UIKit (= 4.0.1) + - PhoneNumberKit/PhoneNumberKitCore (4.0.1) + - PhoneNumberKit/UIKit (4.0.1): + - PhoneNumberKit/PhoneNumberKitCore + - SDWebImage (5.21.0): + - SDWebImage/Core (= 5.21.0) + - SDWebImage/Core (5.21.0) + - sqflite_darwin (0.0.4): + - Flutter + - FlutterMacOS + - SwiftyGif (5.4.5) + - url_launcher_ios (0.0.1): + - Flutter + +DEPENDENCIES: + - charset_converter (from `.symlinks/plugins/charset_converter/ios`) + - file_picker (from `.symlinks/plugins/file_picker/ios`) + - Flutter (from `Flutter`) + - flutter_pdfview (from `.symlinks/plugins/flutter_pdfview/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - libphonenumber_plugin (from `.symlinks/plugins/libphonenumber_plugin/ios`) + - open_file_ios (from `.symlinks/plugins/open_file_ios/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - PhoneNumberKit (~> 4.0.1) + - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + +SPEC REPOS: + trunk: + - DKImagePickerController + - DKPhotoGallery + - PhoneNumberKit + - SDWebImage + - SwiftyGif + +EXTERNAL SOURCES: + charset_converter: + :path: ".symlinks/plugins/charset_converter/ios" + file_picker: + :path: ".symlinks/plugins/file_picker/ios" + Flutter: + :path: Flutter + flutter_pdfview: + :path: ".symlinks/plugins/flutter_pdfview/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" + libphonenumber_plugin: + :path: ".symlinks/plugins/libphonenumber_plugin/ios" + open_file_ios: + :path: ".symlinks/plugins/open_file_ios/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + sqflite_darwin: + :path: ".symlinks/plugins/sqflite_darwin/darwin" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + +SPEC CHECKSUMS: + charset_converter: 82bc1d2e3c70dcb51bf769e9772e3ae5b2571695 + DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c + DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 + file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + flutter_pdfview: 32bf27bda6fd85b9dd2c09628a824df5081246cf + image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a + libphonenumber_plugin: d134f173b22bfa5ede50887071f087f309277f8c + open_file_ios: 5ff7526df64e4394b4fe207636b67a95e83078bb + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + PhoneNumberKit: a74155066daa6450475f6a029068eb919fb00d5d + SDWebImage: f84b0feeb08d2d11e6a9b843cb06d75ebf5b8868 + sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 + SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 + url_launcher_ios: 694010445543906933d732453a59da0a173ae33d + +PODFILE CHECKSUM: a28aa98e3ca7183648527da64078769adf630e89 + +COCOAPODS: 1.16.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fe26561 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,555 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + 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 */; }; + 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 */; }; + ACFB5868BBA6B74A992E1A41 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF94D6584D2E8A3F6BBFAD2 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1FF94D6584D2E8A3F6BBFAD2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 700DD0757496908A05DEFAD8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; 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 = ""; }; + 886ED87D91BD7C88314D0336 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F33AC98EB80D167B1D458E07 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ACFB5868BBA6B74A992E1A41 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + C2405E9D8DA19A1A863D1EDF /* Pods */, + A35EC737372E19786CB8B8AD /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + A35EC737372E19786CB8B8AD /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1FF94D6584D2E8A3F6BBFAD2 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C2405E9D8DA19A1A863D1EDF /* Pods */ = { + isa = PBXGroup; + children = ( + F33AC98EB80D167B1D458E07 /* Pods-Runner.debug.xcconfig */, + 886ED87D91BD7C88314D0336 /* Pods-Runner.release.xcconfig */, + 700DD0757496908A05DEFAD8 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 40AEFA2DCA57AF98219D4A74 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 731B87E0F0D7405841DD9A9D /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 40AEFA2DCA57AF98219D4A74 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + 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; + }; + 731B87E0F0D7405841DD9A9D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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 = 12.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)"; + DEVELOPMENT_TEAM = J39VHLWJ99; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.youmazgestion; + 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 = { + 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; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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 = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = J39VHLWJ99; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.youmazgestion; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = J39VHLWJ99; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.youmazgestion; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..c53e2b3 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..b636303 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@main +@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/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..97711f9 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Youmazgestion + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + youmazgestion + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/Components/OrderedProduct.dart b/lib/Components/OrderedProduct.dart new file mode 100644 index 0000000..43fc720 --- /dev/null +++ b/lib/Components/OrderedProduct.dart @@ -0,0 +1,7 @@ +class OrderedProduct { + String name; + int quantity; + double price; + + OrderedProduct({required this.name, required this.quantity, required this.price}); +} \ No newline at end of file diff --git a/lib/Components/appDrawer.dart b/lib/Components/appDrawer.dart new file mode 100644 index 0000000..f9f9c43 --- /dev/null +++ b/lib/Components/appDrawer.dart @@ -0,0 +1,213 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:youmazgestion/Views/historique.dart'; + +import '../Views/addProduct.dart'; +import '../Views/bilanMois.dart'; +import '../Views/gestionProduct.dart'; +import '../Views/gestionStock.dart'; +import '../Views/listUser.dart'; +import '../Views/loginPage.dart'; +import '../Views/registrationPage.dart'; +import '../accueil.dart'; +import '../controller/userController.dart'; + +class CustomDrawer extends StatelessWidget { + final UserController userController = Get.find(); +Future clearUserData() async { + final prefs = await SharedPreferences.getInstance(); + await prefs.remove('username'); + await prefs.remove('role'); +} + CustomDrawer({super.key}); + + @override + Widget build(BuildContext context) { + return Drawer( + backgroundColor: Colors.white, + child: ListView( + children: [ + GetBuilder( + builder: (controller) => UserAccountsDrawerHeader( + accountEmail: Text(controller.email), + accountName: Text(controller.name), + currentAccountPicture: const CircleAvatar( + backgroundImage: AssetImage("assets/youmaz2.png"), + ), + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [Colors.white, const Color.fromARGB(255, 4, 54, 95)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + )), + ), + ListTile( + leading: const Icon(Icons.home), + iconColor: Colors.lightBlueAccent, + title: const Text("Accueil"), + onTap: () { + // Action lorsque l'utilisateur clique sur "Accueil" + Get.to(const AccueilPage()); + }, + ), + ListTile( + leading: const Icon(Icons.person_add), + iconColor: Colors.green, + title: const Text("Ajouter un utilisateur"), + onTap: () { + if (userController.role == "admin") { + Get.to(const RegistrationPage()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour ajouter un utilisateur"); + } + }, + ), + ListTile( + leading: const Icon(Icons.supervised_user_circle), + iconColor: const Color.fromARGB(255, 4, 54, 95), + title: const Text("Modifier/Supprimer un utilisateur"), + onTap: () { + // Action lorsque l'utilisateur clique sur "Modifier/Supprimer un utilisateur" + if (userController.role == "admin") { + Get.to(const ListUserPage()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour modifier/supprimer un utilisateur"); + } + }, + ), + ListTile( + leading: const Icon(Icons.add), + iconColor: Colors.indigoAccent, + title: const Text("Ajouter un produit"), + onTap: () { + if (userController.role == "admin") { + // Action lorsque l'utilisateur clique sur "Ajouter un produit" + Get.to(const AddProductPage()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour ajouter un produit"); + } + }, + ), + ListTile( + leading: const Icon(Icons.edit), + iconColor: Colors.redAccent, + title: const Text("Modifier/Supprimer un produit"), + onTap: () { + if (userController.role == "admin") { + // Action lorsque l'utilisateur clique sur "Modifier/Supprimer un produit" + Get.to(GestionProduit()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour modifier/supprimer un produit"); + } + }, + ), + ListTile( + leading: const Icon(Icons.bar_chart), + title: const Text("Bilan"), + onTap: () { + if (userController.role == "admin") { + Get.to(const BilanMois()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error_outline_outlined), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour accéder au bilan"); + } + }, + ), + ListTile( + leading: const Icon(Icons.inventory), + iconColor: Colors.blueAccent, + title: const Text("Gestion de stock"), + onTap: () { + if (userController.role == "admin") { + // Action lorsque l'utilisateur clique sur "Gestion de stock" + Get.to(const GestionStockPage()); + } else { + Get.snackbar( + "Accés refusé", + backgroundColor: Colors.red, + colorText: Colors.white, + icon: const Icon(Icons.error), + duration: const Duration(seconds: 3), + snackPosition: SnackPosition.TOP, + "Vous n'avez pas les droits pour accéder à la gestion de stock"); + } + }, + ), + ListTile( + leading: const Icon(Icons.history), + iconColor: Colors.blue, + title: const Text("Historique"), + onTap: () { + // Action lorsque l'utilisateur clique sur "Historique" + Get.to(HistoryPage()); + }, + ), + ListTile( + leading: const Icon(Icons.logout), + iconColor: Colors.red, + title: const Text("Déconnexion"), + onTap: () { + // Action lorsque l'utilisateur clique sur "Déconnexion" + // display confirmation dialog + Get.defaultDialog( + title: "Déconnexion", + content: const Text("Voulez-vous vraiment vous déconnecter ?"), + actions: [ + ElevatedButton( + child: const Text("Oui"), + onPressed: () { + clearUserData(); + Get.offAll(const LoginPage()); + }, + ), + ElevatedButton( + child: const Text("Non"), + onPressed: () { + Get.back(); + }, + ) + ], + ); + }, + ) + ], + ), + ); + } +} diff --git a/lib/Components/app_bar.dart b/lib/Components/app_bar.dart new file mode 100644 index 0000000..83b8e85 --- /dev/null +++ b/lib/Components/app_bar.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; + +class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { + final String title; + + const CustomAppBar({Key? key, required this.title}) : super(key: key); + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight); + + @override + Widget build(BuildContext context) { + return AppBar( + backgroundColor: Colors.transparent, + elevation: 5, + flexibleSpace: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [Colors.white, const Color.fromARGB(255, 4, 54, 95)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Row( + children: [ + const Spacer(), + Align( + alignment: Alignment.center, + child: Text( + title, + style: const TextStyle( + fontSize: 25, + color: Colors.white, + ), + ), + ), + const Spacer(), + Padding( + padding: const EdgeInsets.only(right: 10.0), + child: Align( + alignment: Alignment.centerRight, + child: Image.asset( + 'assets/youmaz2.png', + width: 100, + height: 50, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/Components/cartItem.dart b/lib/Components/cartItem.dart new file mode 100644 index 0000000..16724b3 --- /dev/null +++ b/lib/Components/cartItem.dart @@ -0,0 +1,8 @@ +import '../Models/produit.dart'; + +class CartItem { + final Product product; + int quantity; + + CartItem(this.product, this.quantity); +} \ No newline at end of file diff --git a/lib/Components/panier.dart b/lib/Components/panier.dart new file mode 100644 index 0000000..93e3e23 --- /dev/null +++ b/lib/Components/panier.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:quantity_input/quantity_input.dart'; +import 'cartItem.dart'; + +class PanierPage extends StatelessWidget { + final List selectedProducts; + final Function() saveOrderToDatabase; + + const PanierPage({ + super.key, + required this.selectedProducts, + required this.saveOrderToDatabase, + }); + + double calculateTotalPrice() { + double totalPrice = 0; + for (final cartItem in selectedProducts) { + totalPrice += cartItem.product.price * cartItem.quantity; + } + return totalPrice; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Panier'), + ), + body: Container( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Produits sélectionnés', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: selectedProducts.length, + itemBuilder: (context, index) { + final cartItem = selectedProducts[index]; + final product = cartItem.product; + final quantity = cartItem.quantity; + + return ListTile( + title: Text(product.name), + subtitle: Text(product.category), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text('${product.price.toStringAsFixed(2)} fcfa'), + const SizedBox(width: 8), + Text('x $quantity'), + const SizedBox(width: 8), + QuantityInput( + value: quantity, + minValue: 1, + maxValue: 100, + step: 1, + buttonColor: Colors.orange, + onChanged: (value) {}, + ), + ], + ), + ); + }, + ), + ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: saveOrderToDatabase, + child: Text('Valider la commande (${selectedProducts.length})'), + ), + const SizedBox(height: 16), + Text( + 'Total: ${calculateTotalPrice().toStringAsFixed(2)} fcfa', + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/Models/Order.dart b/lib/Models/Order.dart new file mode 100644 index 0000000..f2e6e6f --- /dev/null +++ b/lib/Models/Order.dart @@ -0,0 +1,36 @@ +class Order { + final int id; + final double totalPrice; + final String dateTime; + final DateTime? startDate; + final String? user; + + Order({ + required this.id, + required this.totalPrice, + required this.dateTime, + this.startDate, + this.user, + }); + + Map toMap() { + return { + 'id': id, + 'total_price': totalPrice, + 'date_time': dateTime, + 'start_date': startDate?.toIso8601String(), + 'user': user, + }; + } + + factory Order.fromMap(Map map) { + return Order( + id: map['id'], + totalPrice: map['total_price'], + dateTime: map['date_time'], + startDate: + map['start_date'] != null ? DateTime.parse(map['start_date']) : null, + user: map['user'], + ); + } +} diff --git a/lib/Models/Work.dart b/lib/Models/Work.dart new file mode 100644 index 0000000..e6c2a19 --- /dev/null +++ b/lib/Models/Work.dart @@ -0,0 +1,28 @@ +class Work { + final int? id; + final String date; + + Work({ + this.id, + required this.date, + }); + + Work copy({ + int? id, + String? date, + }) => + Work( + id: id ?? this.id, + date: date ?? this.date, + ); + + factory Work.fromJson(Map json) => Work( + id: json['id'] as int?, + date: json['date'] as String, + ); + + Map toJson() => { + 'id': id, + 'date': date, + }; +} \ No newline at end of file diff --git a/lib/Models/produit.dart b/lib/Models/produit.dart new file mode 100644 index 0000000..8239e94 --- /dev/null +++ b/lib/Models/produit.dart @@ -0,0 +1,61 @@ +class Product { + final int? id; + final String name; + final double price; + String image; + final String category; + int? stock; // Paramètre optionnel pour le stock + String? description; // Nouveau champ + String? qrCode; // Nouveau champ + String? reference; + + Product({ + this.id, + required this.name, + required this.price, + required this.image, + required this.category, + this.stock = 0, + this.description, + this.qrCode, + this.reference, + }); + + // Vérifie si le stock est défini + bool isStockDefined() { + if (stock != null) { + print("stock is defined : $stock $name"); + return true; + } else { + return false; + } + } + + Map toMap() { + return { + 'id': id, + 'name': name, + 'price': price, + 'image': image, + 'category': category, + 'stock': stock, + 'description': description, + 'qrCode': qrCode, + 'reference':reference + }; + } + + factory Product.fromMap(Map map) { + return Product( + id: map['id'], + name: map['name'], + price: map['price'], + image: map['image'], + category: map['category'], + stock: map['stock'], + description: map['description'], + qrCode: map['qrCode'], + reference:map['reference'] + ); + } +} diff --git a/lib/Models/users.dart b/lib/Models/users.dart new file mode 100644 index 0000000..addedd9 --- /dev/null +++ b/lib/Models/users.dart @@ -0,0 +1,44 @@ +class Users { + int id; + String name; + String lastName; + String email; + String password; + String username; + String role; + + Users({ + required this.id, + required this.name, + required this.lastName, + required this.email, + required this.password, + required this.username, + required this.role, + }); + + Map toMap() { + return { + 'id': id, + 'name': name, + 'lastName': lastName, + 'email': email, + 'password': password, + 'username': username, + 'role': role, + }; + } + + factory Users.fromMap(Map map) { + return Users( + id: map['id'], + name: map['name'], + lastName: map['lastname'], + email: map['email'], + password: map['password'], + username: map['username'], + role: map['role'] + ); + } + +} \ No newline at end of file diff --git a/lib/Services/OrderDatabase.dart b/lib/Services/OrderDatabase.dart new file mode 100644 index 0000000..eb93396 --- /dev/null +++ b/lib/Services/OrderDatabase.dart @@ -0,0 +1,285 @@ +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqflite_ffi; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; +import 'package:intl/intl.dart'; +import '../Models/Order.dart'; +import 'dart:io'; +import 'package:flutter/services.dart'; + +class OrderDatabase { + static final OrderDatabase instance = OrderDatabase._init(); + late Database _database; + + OrderDatabase._init() { + sqflite_ffi.sqfliteFfiInit(); + } + + Future initDatabase() async { + _database = await _initDB('orderdb.db'); + await _createDB(_database, 1); + } + + Future get database async { + if (_database.isOpen) return _database; + + _database = await _initDB('orderdb.db'); + return _database; + } + + Future _initDB(String filePath) async { + // Obtenez le répertoire de stockage local de l'application + final documentsDirectory = await getApplicationDocumentsDirectory(); + final path = join(documentsDirectory.path, filePath); + + // Vérifiez si le fichier de base de données existe déjà dans le répertoire de stockage local + bool dbExists = await File(path).exists(); + if (!dbExists) { + // Si le fichier n'existe pas, copiez-le depuis le dossier assets/database + ByteData data = await rootBundle.load('assets/database/$filePath'); + List bytes = + data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); + await File(path).writeAsBytes(bytes); + } + + // Ouvrez la base de données + return await databaseFactoryFfi.openDatabase(path); + } + + Future _createDB(Database db, int version) async { + final resultOrders = await db.rawQuery( + "SELECT name FROM sqlite_master WHERE type='table' AND name='orders'"); + final resultOrderItems = await db.rawQuery( + "SELECT name FROM sqlite_master WHERE type='table' AND name='order_items'"); + + if (resultOrders.isEmpty) { + await db.execute(''' + CREATE TABLE orders ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + total_price REAL, + date_time TEXT, + start_date TEXT, + user TEXT, + ) + '''); + } + + if (resultOrderItems.isEmpty) { + await db.execute(''' + CREATE TABLE order_items ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + order_id INTEGER, + product_name TEXT, + quantity INTEGER, + price REAL, + FOREIGN KEY (order_id) REFERENCES orders (id) + ) + '''); + } + } + + Future insertOrder( + double totalPrice, + String dateTime, + DateTime? startDate, + String user, + ) async { + final db = await database; + final formattedStartDate = DateFormat('yyyy-MM-dd').format(startDate!); + print("formattedStartDate1 : $formattedStartDate"); + final orderId = await db.insert( + 'orders', + { + 'total_price': totalPrice, + 'date_time': dateTime, + 'start_date': formattedStartDate, + 'user': user, + }, + ); + return orderId; + } + + Future insertOrderItem( + int orderId, + String productName, + int quantity, + double price, + ) async { + final db = await database; + await db.insert( + 'order_items', + { + 'order_id': orderId, + 'product_name': productName, + 'quantity': quantity, + 'price': price, + }, + ); + } + + Future>> getAllOrders() async { + final db = await database; + return db.query('orders'); + } + + Future> getOrderHistory() async { + final orderData = await getAllOrders(); + + return orderData.map((orderMap) { + return Order( + id: orderMap['id'], + totalPrice: orderMap['total_price'], + dateTime: orderMap['date_time'], + startDate: orderMap['start_date'] != null + ? DateTime.parse(orderMap['start_date']) + : null, + user: orderMap['user'], + ); + }).toList(); + } + + Future>> getOrderItems(int orderId) async { + final db = await database; + return db.query( + 'order_items', + where: 'order_id = ?', + whereArgs: [orderId], + ); + } + + Future> getOrdersByStartDate(DateTime startDate) async { + final db = await database; + final formattedStartDate = DateFormat('yyyy-MM-dd').format(startDate); + print("formattedStartDate dans la base: $formattedStartDate"); + final orderData = await db.query( + 'orders', + where: 'start_date = ?', + whereArgs: [formattedStartDate], + ); + + return orderData.map((orderMap) { + return Order( + id: orderMap['id'] as int, + totalPrice: orderMap['total_price'] as double, + dateTime: orderMap['date_time'] as String, + startDate: orderMap['start_date'] != null + ? DateTime.parse(orderMap['start_date'] as String) + : null, + user: orderMap['user'] as String, + ); + }).toList(); + } + + Future> getProductQuantitiesByDate(DateTime date) async { + final db = await database; + final formattedDate = DateFormat('yyyy-MM-dd').format(date); + + final result = await db.rawQuery(''' + SELECT product_name, SUM(quantity) AS total_quantity + FROM order_items + INNER JOIN orders ON order_items.order_id = orders.id + WHERE orders.start_date = ? + GROUP BY product_name + ''', [formattedDate]); + + final productQuantities = {}; + for (final row in result) { + final productName = row['product_name'] as String; + final quantity = row['total_quantity'] as int; + productQuantities[productName] = quantity; + } + + return productQuantities; + } + + Future> getProductQuantitiesByMonth(DateTime date) async { + final db = await database; + final formattedDate = DateFormat('yyyy-MM').format(date); + + final result = await db.rawQuery(''' + SELECT product_name, SUM(quantity) AS total_quantity + FROM order_items + INNER JOIN orders ON order_items.order_id = orders.id + WHERE strftime('%Y-%m', orders.start_date) = ? + GROUP BY product_name + ''', [formattedDate]); + + final productQuantities = {}; + for (final row in result) { + final productName = row['product_name'] as String; + final quantity = row['total_quantity'] as int; + productQuantities[productName] = quantity; + } + + return productQuantities; + } + + Future> getOrdersByMonth(DateTime date) async { + final db = await database; + final formattedDate = DateFormat('yyyy-MM').format(date); + + final orderData = await db.rawQuery(''' + SELECT id, total_price, date_time, start_date, user + FROM orders + WHERE strftime('%Y-%m', start_date) = ? + ''', [formattedDate]); + + return orderData.map((orderMap) { + return Order( + id: orderMap['id'] as int, + totalPrice: orderMap['total_price'] as double, + dateTime: orderMap['date_time'] as String, + startDate: orderMap['start_date'] != null + ? DateTime.parse(orderMap['start_date'] as String) + : null, + user: orderMap['user'] as String, + ); + }).toList(); + } + + // maintenant je vais recuperer les commande par semaine en utilisant les semaines de l'année + Future> getOrdersByWeekNumber(int weekNumber) async { + final db = await database; + + final orderData = await db.rawQuery(''' + SELECT id, total_price, date_time, start_date + FROM orders + WHERE strftime('%W', start_date) = ? + ''', [(weekNumber - 1).toString()]); + + return orderData.map((orderMap) { + return Order( + id: orderMap['id'] as int, + totalPrice: orderMap['total_price'] as double, + dateTime: orderMap['date_time'] as String, + startDate: orderMap['start_date'] != null + ? DateTime.parse(orderMap['start_date'] as String) + : null, + user: orderMap['user'] as String, + ); + }).toList(); + } + + Future> getOrdersByYear(DateTime date) async { + final db = await database; + final formattedDate = DateFormat('yyyy').format(date); + + final orderData = await db.rawQuery(''' + SELECT id, total_price, date_time, start_date + FROM orders + WHERE strftime('%Y', start_date) = ? + ''', [formattedDate]); + + return orderData.map((orderMap) { + return Order( + id: orderMap['id'] as int, + totalPrice: orderMap['total_price'] as double, + dateTime: orderMap['date_time'] as String, + startDate: orderMap['start_date'] != null + ? DateTime.parse(orderMap['start_date'] as String) + : null, + user: orderMap['user'] as String, + ); + }).toList(); + } +} diff --git a/lib/Services/authDatabase.dart b/lib/Services/authDatabase.dart new file mode 100644 index 0000000..f19061c --- /dev/null +++ b/lib/Services/authDatabase.dart @@ -0,0 +1,147 @@ +import 'package:flutter/services.dart'; +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sqflite/sqflite.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqflite_ffi; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; +import 'package:youmazgestion/Models/users.dart'; +import 'dart:io'; + +class AuthDatabase { + static final AuthDatabase instance = AuthDatabase._init(); + late Database _database; + + AuthDatabase._init() { + sqflite_ffi.sqfliteFfiInit(); + } + + Future initDatabase() async { + _database = await _initDB('usersDb.db'); + await _createDB(_database, 1); + } + + Future get database async { + if (_database.isOpen) return _database; + + _database = await _initDB('usersDb.db'); + return _database; + } + + Future _initDB(String filePath) async { + // Obtenez le répertoire de stockage local de l'application + final documentsDirectory = await getApplicationDocumentsDirectory(); + final path = join(documentsDirectory.path, filePath); + + // Vérifiez si le fichier de base de données existe déjà dans le répertoire de stockage local + bool dbExists = await File(path).exists(); + if (!dbExists) { + // Si le fichier n'existe pas, copiez-le depuis le dossier assets/database + ByteData data = await rootBundle.load('assets/database/$filePath'); + List bytes = + data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); + await File(path).writeAsBytes(bytes); + } + + // Ouvrez la base de données + return await databaseFactoryFfi.openDatabase(path); + } + + Future _createDB(Database db, int version) async { + final resultUsers = await db.rawQuery( + "SELECT name FROM sqlite_master WHERE type='table' AND name='users'"); + + if (resultUsers.isEmpty) { + await db.execute(''' + CREATE TABLE users ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT, + lastname TEXT, + email TEXT, + password TEXT, + username TEXT, + role TEXT + ) + '''); + } + } + + Future createUser(Users user) async { + final db = await database; + return await db.insert('users', user.toMap()); + } + + Future deleteUser(int id) async { + final db = await database; + return await db.delete('users', where: 'id = ?', whereArgs: [id]); + } + + Future updateUser(Users user) async { + final db = await database; + return await db + .update('users', user.toMap(), where: 'id = ?', whereArgs: [user.id]); + } + + Future getUserCount() async { + final db = await database; + List> x = + await db.rawQuery('SELECT COUNT (*) from users'); + int result = Sqflite.firstIntValue(x)!; + return result; + } + + // verify username and password existe + Future verifyUser(String username, String password) async { + final db = await database; + List> x = await db.rawQuery( + 'SELECT COUNT (*) from users WHERE username = ? AND password = ?', + [username, password]); + int result = Sqflite.firstIntValue(x)!; + if (result == 1) { + return true; + } else { + return false; + } + } + + //recuperer un user grace a son username + Future getUser(String username) async { + try { + final db = await database; + List> x = await db + .rawQuery('SELECT * from users WHERE username = ?', [username]); + print(x.first); + Users user = Users.fromMap(x.first); + print(user); + return user; + } catch (e) { + print(e); + rethrow; + } + } + + Future?> getUserCredentials(String username, String password) async { + final db = await database; + + List> result = await db.rawQuery( + 'SELECT username, role FROM users WHERE username = ? AND password = ?', + [username, password], + ); + + if (result.isNotEmpty) { + print('username '+result[0]['username']); + return { + 'username': result[0]['username'], + 'role': result[0]['role'], + }; + } else { + return null; // Aucun utilisateur trouvé + } +} + + Future> getAllUsers() async { + final db = await database; + const orderBy = 'id ASC'; + final result = await db.query('users', orderBy: orderBy); + return result.map((json) => Users.fromMap(json)).toList(); + } +} diff --git a/lib/Services/order_Api.dart b/lib/Services/order_Api.dart new file mode 100644 index 0000000..4452ef3 --- /dev/null +++ b/lib/Services/order_Api.dart @@ -0,0 +1,27 @@ +import 'dart:convert'; +import 'package:shelf/shelf.dart'; +import 'package:shelf_router/shelf_router.dart'; +import 'OrderDatabase.dart'; + +class OrderApi { + final Router _router = Router(); + late OrderDatabase _orderDatabase; + + OrderApi() { + _orderDatabase = OrderDatabase.instance; + _router.get('/orders', _getAllOrders); + // Ajoutez d'autres routes nécessaires + } + + Router get router => _router; + + Future _getAllOrders(Request request) async { + await _orderDatabase.initDatabase(); + final orders = await _orderDatabase.getAllOrders(); + + final ordersJson = jsonEncode(orders); + + return Response.ok(ordersJson, + headers: {'content-type': 'application/json'}); + } +} diff --git a/lib/Services/productDatabase.dart b/lib/Services/productDatabase.dart new file mode 100644 index 0000000..cc47bb1 --- /dev/null +++ b/lib/Services/productDatabase.dart @@ -0,0 +1,156 @@ +import 'dart:async'; +import 'dart:io'; +import 'package:flutter/services.dart'; +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; +import '../Models/produit.dart'; + +class ProductDatabase { + static final ProductDatabase instance = ProductDatabase._init(); + late Database _database; + + ProductDatabase._init() { + sqfliteFfiInit(); + } + + ProductDatabase(); + + Future get database async { + if (_database.isOpen) return _database; + _database = await _initDB('products2.db'); + return _database; + } + + Future initDatabase() async { + _database = await _initDB('products2.db'); + await _createDB(_database, 1); + } + + Future _initDB(String filePath) async { + final documentsDirectory = await getApplicationDocumentsDirectory(); + final path = join(documentsDirectory.path, filePath); + + bool dbExists = await File(path).exists(); + if (!dbExists) { + ByteData data = await rootBundle.load('assets/database/$filePath'); + List bytes = + data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); + await File(path).writeAsBytes(bytes); + } + + return await databaseFactoryFfi.openDatabase(path); + } + + Future _createDB(Database db, int version) async { + // Récupère la liste des colonnes de la table "products" + final tables = await db.rawQuery("SELECT name FROM sqlite_master WHERE type='table'"); + final tableNames = tables.map((row) => row['name'] as String).toList(); + + // Si la table "products" n'existe pas encore, on la crée entièrement + if (!tableNames.contains('products')) { + await db.execute(''' + CREATE TABLE products( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT, + price REAL, + image TEXT, + category TEXT, + stock INTEGER, + description TEXT, + qrCode TEXT + reference TEXT + ) + '''); + print("Table 'products' créée avec toutes les colonnes."); + } else { + // Vérifie si les colonnes "description" et "qrCode" existent déjà + final columns = await db.rawQuery('PRAGMA table_info(products)'); + final columnNames = columns.map((e) => e['name'] as String).toList(); + + // Ajoute la colonne "description" si elle n'existe pas + if (!columnNames.contains('description')) { + try { + await db.execute("ALTER TABLE products ADD COLUMN description TEXT"); + print("Colonne 'description' ajoutée."); + } catch (e) { + print("Erreur ajout colonne description : $e"); + } + } + + // Ajoute la colonne "qrCode" si elle n'existe pas + if (!columnNames.contains('qrCode')) { + try { + await db.execute("ALTER TABLE products ADD COLUMN qrCode TEXT"); + print("Colonne 'qrCode' ajoutée."); + } catch (e) { + print("Erreur ajout colonne qrCode : $e"); + } + } + // Ajoute la colonne "reference" si elle n'existe pas + if (!columnNames.contains('reference')) { + try { + await db.execute("ALTER TABLE products ADD COLUMN reference TEXT"); + print("Colonne 'reference' ajoutée."); + } catch (e) { + print("Erreur ajout colonne reference : $e"); + } + } + } +} + + + Future createProduct(Product product) async { + final db = await database; + return await db.insert('products', product.toMap()); + } + + Future> getProducts() async { + final db = await database; + final maps = await db.query('products'); + return List.generate(maps.length, (i) { + return Product.fromMap(maps[i]); + }); + } + + Future updateProduct(Product product) async { + final db = await database; + return await db.update( + 'products', + product.toMap(), + where: 'id = ?', + whereArgs: [product.id], + ); + } + + Future deleteProduct(int? id) async { + final db = await database; + return await db.delete( + 'products', + where: 'id = ?', + whereArgs: [id], + ); + } + + Future> getCategories() async { + final db = await database; + final result = await db.rawQuery('SELECT DISTINCT category FROM products'); + return List.generate( + result.length, (index) => result[index]['category'] as String); + } + + Future> getProductsByCategory(String category) async { + final db = await database; + final maps = await db + .query('products', where: 'category = ?', whereArgs: [category]); + return List.generate(maps.length, (i) { + return Product.fromMap(maps[i]); + }); + } + + Future updateStock(int id, int stock) async { + final db = await database; + return await db + .rawUpdate('UPDATE products SET stock = ? WHERE id = ?', [stock, id]); + } +} diff --git a/lib/Services/workDatabase.dart b/lib/Services/workDatabase.dart new file mode 100644 index 0000000..3502248 --- /dev/null +++ b/lib/Services/workDatabase.dart @@ -0,0 +1,90 @@ +import 'dart:io'; + +import 'package:flutter/services.dart'; +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqflite_ffi; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; + +class WorkDatabase { + static final WorkDatabase instance = WorkDatabase._init(); + late Database _database; + + WorkDatabase._init() { + sqflite_ffi.sqfliteFfiInit(); + } + + Future initDatabase() async { + _database = await _initDB('work.db'); + await _createDB(_database, 1); + } + + Future get database async { + if (_database.isOpen) return _database; + + _database = await _initDB('work.db'); + return _database; + } + + Future _initDB(String filePath) async { + // Obtenez le répertoire de stockage local de l'application + final documentsDirectory = await getApplicationDocumentsDirectory(); + final path = join(documentsDirectory.path, filePath); + + // Vérifiez si le fichier de base de données existe déjà dans le répertoire de stockage local + bool dbExists = await File(path).exists(); + if (!dbExists) { + // Si le fichier n'existe pas, copiez-le depuis le dossier assets/database + ByteData data = await rootBundle.load('assets/database/$filePath'); + List bytes = + data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); + await File(path).writeAsBytes(bytes); + } + + // Ouvrez la base de données + return await databaseFactoryFfi.openDatabase(path); + } + + Future _createDB(Database db, int version) async { + await db.execute(''' + CREATE TABLE IF NOT EXISTS work ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + date TEXT + ) + '''); + } + + Future insertDate(String date) async { + final db = await database; + final existingDates = + await db.query('work', where: 'date = ?', whereArgs: [date]); + + if (existingDates.isNotEmpty) { + // Date already exists, return 0 to indicate no new insertion + return 0; + } + + return await db.insert('work', {'date': date}); + } + + /*Future> getDates() async { + final db = await database; + final result = await db.query('work'); + + return result.map((json) => Work.fromJson(json)).toList(); + }*/ + Future> getDates() async { + final db = await database; + final result = await db.query('work'); + return List.generate( + result.length, (index) => result[index]['date'] as String); + } + + // recuperer les dates par ordre du plus recent au plus ancien + Future> getDatesDesc() async { + final db = await database; + final result = await db.query('work', orderBy: 'date DESC'); + return List.generate( + result.length, (index) => result[index]['date'] as String); + } +} diff --git a/lib/Views/Demarrer.dart b/lib/Views/Demarrer.dart new file mode 100644 index 0000000..636d5d2 --- /dev/null +++ b/lib/Views/Demarrer.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +class DemarrerCaissePage extends StatelessWidget { + const DemarrerCaissePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Accueil'), + ), + body: Center( + child: ElevatedButton( + onPressed: () { + // Mettre à jour la valeur de isRegisterOpen dans le HomeController + }, + child: const Text('Démarrer la caisse'), + ), + ), + ); + } +} diff --git a/lib/Views/ErreurPage.dart b/lib/Views/ErreurPage.dart new file mode 100644 index 0000000..6fac931 --- /dev/null +++ b/lib/Views/ErreurPage.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; + +class ErreurPage extends StatelessWidget { + final String dbPath; + + const ErreurPage({Key? key, required this.dbPath}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: const Text('Erreur'), + ), + body: Center( + child: Text('Base de données introuvable : $dbPath'), + ), + ); + } +} diff --git a/lib/Views/addProduct.dart b/lib/Views/addProduct.dart new file mode 100644 index 0000000..2039623 --- /dev/null +++ b/lib/Views/addProduct.dart @@ -0,0 +1,325 @@ +import 'dart:io'; +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:file_picker/file_picker.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +import '../Components/appDrawer.dart'; +import '../Components/app_bar.dart'; +import '../Models/produit.dart'; +import '../Services/productDatabase.dart'; + +class AddProductPage extends StatefulWidget { + const AddProductPage({super.key}); + + @override + _AddProductPageState createState() => _AddProductPageState(); +} + +class _AddProductPageState extends State { + // Controllers for text fields + final TextEditingController _nameController = TextEditingController(); + final TextEditingController _priceController = TextEditingController(); + final TextEditingController _imageController = TextEditingController(); + final TextEditingController _descriptionController = TextEditingController(); + + String? _qrData; // Variable to store QR code data + final List _categories = ['Sucré', 'Salé', 'Jus', 'Gateaux']; // List of product categories + String? _selectedCategory; // Selected category + File? _pickedImage; // Variable to store the selected image file + late ProductDatabase _productDatabase; // Database instance + + @override + void initState() { + super.initState(); + _productDatabase = ProductDatabase.instance; + _productDatabase.initDatabase(); + _nameController.addListener(_updateQrData); + } + + @override + void dispose() { + _nameController.removeListener(_updateQrData); + _nameController.dispose(); + super.dispose(); + } + + // Function to select an image from files or drop + void _selectImage() async { + final action = await showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Sélectionner une image'), + content: const Text('Choisissez comment sélectionner une image'), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop('pick'); + }, + child: const Text('Choisir depuis les fichiers'), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop('drop'); + }, + child: const Text('Déposer une image'), + ), + ], + ); + }, + ); + + if (action == 'pick') { + final result = await FilePicker.platform.pickFiles( + type: FileType.image, + ); + + if (result != null) { + setState(() { + _pickedImage = File(result.files.single.path!); + _imageController.text = _pickedImage!.path; + }); + } + } else if (action == 'drop') { + // Code to handle image drop + } + } + + // Function to update QR data based on product name + void _updateQrData() { + if (_nameController.text.isNotEmpty) { + final reference = 'PROD_PREVIEW_${_nameController.text}_${DateTime.now().millisecondsSinceEpoch}'; + setState(() { + _qrData = 'https://tonsite.com/$reference'; + }); + } + } + + // Function to get the database location + Future _getDatabaseLocation() async { + final directory = await getApplicationDocumentsDirectory(); + final dbPath = directory.path; + print('Emplacement de la base de données : $dbPath'); + } + + // Function to generate and save QR code + Future _generateAndSaveQRCode(String reference) async { + final qrValidationResult = QrValidator.validate( + data: 'https://tonsite.com/$reference', + version: QrVersions.auto, + errorCorrectionLevel: QrErrorCorrectLevel.L, + ); + final qrCode = qrValidationResult.qrCode; + final painter = QrPainter.withQr( + qr: qrCode!, + color: Colors.black, + emptyColor: Colors.white, + gapless: true, + ); + + final tempDir = await getApplicationDocumentsDirectory(); + final file = File('${tempDir.path}/$reference.png'); + final picData = await painter.toImageData(2048, format: ImageByteFormat.png); + await file.writeAsBytes(picData!.buffer.asUint8List()); + + return file.path; + } + + // Function to add a product to the database + void _addProduct() async { + final name = _nameController.text; + final price = double.tryParse(_priceController.text) ?? 0.0; + final image = _imageController.text; + final category = _selectedCategory; + final description = _descriptionController.text; + + if (name.isNotEmpty && price > 0 && image.isNotEmpty && category != null) { + final reference = 'PROD_${DateTime.now().millisecondsSinceEpoch}'; + final qrPath = await _generateAndSaveQRCode(reference); + + final product = Product( + name: name, + price: price, + image: image, + category: category, + description: description, + qrCode: qrPath, + reference: reference, + ); + + _productDatabase.createProduct(product).then((_) { + Get.snackbar('Succès', 'Produit ajouté avec succès'); + setState(() { + _nameController.clear(); + _priceController.clear(); + _imageController.clear(); + _descriptionController.clear(); + _selectedCategory = null; + _pickedImage = null; + }); + }).catchError((error) { + Get.snackbar('Erreur', 'Impossible d\'ajouter le produit : $error'); + }); + } else { + Get.snackbar( + 'Saisie invalide', + 'Veuillez entrer tous les champs requis.', + ); + } + } + + // Function to display the selected image + Widget _displayImage() { + if (_pickedImage != null) { + return ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.file( + _pickedImage!, + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ); + } else { + return Stack( + alignment: Alignment.center, + children: [ + Container( + width: 100, + height: 100, + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(8.0), + ), + ), + Icon( + Icons.image, + size: 48, + color: Colors.grey[400], + ), + Positioned( + bottom: 4, + child: Text( + 'Aucune image', + style: TextStyle( + fontSize: 12, + color: Colors.grey[400], + ), + ), + ), + ], + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: 'Ajouter un produit'), + drawer: CustomDrawer(), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Text( + 'Ajouter un produit', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 16), + TextField( + controller: _nameController, + decoration: const InputDecoration( + labelText: 'Nom du produit', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 16), + TextField( + controller: _priceController, + decoration: const InputDecoration( + labelText: 'Prix', + border: OutlineInputBorder(), + ), + keyboardType: const TextInputType.numberWithOptions(decimal: true), + ), + const SizedBox(height: 16), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: TextField( + controller: _imageController, + decoration: const InputDecoration( + labelText: 'Image', + border: OutlineInputBorder(), + ), + ), + ), + const SizedBox(width: 8), + ElevatedButton( + onPressed: _selectImage, + child: const Text('Sélectionner une image'), + ), + ], + ), + const SizedBox(height: 16), + _displayImage(), + const SizedBox(height: 16), + DropdownButtonFormField( + value: _selectedCategory, + onChanged: (newValue) { + setState(() { + _selectedCategory = newValue; + }); + }, + decoration: const InputDecoration( + labelText: 'Catégorie', + border: OutlineInputBorder(), + ), + items: _categories.map((category) { + return DropdownMenuItem( + value: category, + child: Text(category), + ); + }).toList(), + ), + const SizedBox(height: 16), + if (_qrData != null) + Column( + children: [ + const SizedBox(height: 16), + const Text('Aperçu du QR Code :'), + QrImageView( + data: _qrData!, + version: QrVersions.auto, + size: 120.0, + ), + ], + ), + const SizedBox(height: 16), + TextField( + controller: _descriptionController, + decoration: const InputDecoration( + labelText: 'Description', + border: OutlineInputBorder(), + ), + maxLines: 3, + ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: _addProduct, + child: const Text('Ajouter le produit'), + ), + ], + ), + ), + ); + } +} diff --git a/lib/Views/bilanDesJourne.dart b/lib/Views/bilanDesJourne.dart new file mode 100644 index 0000000..df57f49 --- /dev/null +++ b/lib/Views/bilanDesJourne.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:intl/intl.dart'; +import 'listCommandeHistory.dart'; + +class BilanDesJourne extends StatelessWidget { + final DateTime selectedDate; + + const BilanDesJourne({super.key, required this.selectedDate}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Bilan des Journées'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Jours du mois', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 10), + Expanded( + child: ListView.builder( + itemCount: + DateTime(selectedDate.year, selectedDate.month + 1, 0).day, + itemBuilder: (context, index) { + final day = index + 1; + final date = + DateTime(selectedDate.year, selectedDate.month, day); + final formattedDate = + '${date.day}-${date.month}-${date.year}'; + + return ListTile( + title: Text( + 'Jour $day', + style: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 18), + ), + subtitle: Text(formattedDate, + style: const TextStyle(fontSize: 16)), + onTap: () { + // Handle the day selection + // You can navigate to a specific page or perform any action + navigateToDetailPage(date.toString()); + }, + ); + }, + ), + ), + ], + ), + ), + ); + } + + void navigateToDetailPage(String selectedDate) { + DateTime parsedDate = DateFormat('yyyy-MM-dd').parse(selectedDate); + Get.to(() => HistoryDetailPage(selectedDate: parsedDate)); + } +} diff --git a/lib/Views/bilanMois.dart b/lib/Views/bilanMois.dart new file mode 100644 index 0000000..71a94a7 --- /dev/null +++ b/lib/Views/bilanMois.dart @@ -0,0 +1,189 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Components/app_bar.dart'; +import 'package:youmazgestion/controller/HistoryController.dart'; + +import 'bilanDesJourne.dart'; + +class BilanMois extends StatefulWidget { + const BilanMois({super.key}); + + @override + _BilanMoisState createState() => _BilanMoisState(); +} + +class _BilanMoisState extends State { + final HistoryController controller = Get.put(HistoryController()); + DateTime selectedDate = DateTime.now(); + + void refreshData(DateTime selectedDate) { + setState(() { + this.selectedDate = selectedDate; + controller.refreshOrders(); + controller.getTotalSumOrdersByMonth(selectedDate); + controller.getOrderCountByMonth(selectedDate); + controller.getProductQuantitiesByMonth(selectedDate); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: 'Bilan du mois'), + body: Column( + children: [ + // Les 3 cartes en haut + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _buildInfoCard( + title: 'Chiffre réalisé', + value: '${controller.totalSum.value.toStringAsFixed(2)} fcfa', + color: Colors.green, + icon: Icons.monetization_on, + ), + _buildInfoCard( + title: 'Total de commandes', + value: controller.orderQuantity.value.toString(), + color: Colors.orange, + icon: Icons.shopping_cart, + ), + ElevatedButton( + onPressed: () { + // Redirect to BilanDesJourne page + Get.to(BilanDesJourne(selectedDate: selectedDate)); + }, + child: const Text('Voir les jours'), + ), + ], + ), + // La zone déroulante + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Detail produit :', + style: + TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 10), + SizedBox( + height: MediaQuery.of(context).size.height * 0.5, + width: MediaQuery.of(context).size.width * 0.9, + child: FutureBuilder>( + future: controller + .getProductQuantitiesByMonth(selectedDate), + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + return const Text( + 'Erreur lors de la récupération des quantités de produits'); + } else { + final quantities = snapshot.data!; + return Column( + children: [ + const SizedBox(height: 20), + Expanded( + child: ListView.builder( + itemCount: quantities.length, + itemBuilder: (context, index) { + final entry = + quantities.entries.elementAt(index); + return ListTile( + leading: + const Icon(Icons.shopping_cart), + title: Text( + entry.key, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18), + ), + subtitle: Text( + 'Quantité : ${entry.value}', + style: + const TextStyle(fontSize: 16)), + ); + }, + ), + ), + ], + ); + } + }, + ), + ), + ], + ), + ), + ), + ), + ], + ), + floatingActionButton: FloatingActionButton( + onPressed: () => refreshData(selectedDate), + backgroundColor: Colors.deepOrange, + focusColor: Colors.deepOrangeAccent, + hoverColor: Colors.deepOrangeAccent, + child: const Icon(Icons.refresh), + ), + persistentFooterButtons: [ + TextButton( + onPressed: () async { + final DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime(DateTime.now().year - 5), + lastDate: DateTime(DateTime.now().year + 5), + ); + if (pickedDate != null) { + refreshData(pickedDate); + } + }, + child: const Text( + 'Changer la date', + style: TextStyle(fontSize: 16), + ), + ), + ], + ); + } + + Widget _buildInfoCard({ + required String title, + required String value, + required Color color, + required IconData icon, + }) { + return Card( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Icon( + icon, + size: 40, + color: color, + ), + const SizedBox(height: 10), + Text( + title, + style: const TextStyle(fontSize: 18), + ), + const SizedBox(height: 10), + Text( + value, + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + ], + ), + ), + ); + } +} diff --git a/lib/Views/capability_profile.json b/lib/Views/capability_profile.json new file mode 100644 index 0000000..0d1d33e --- /dev/null +++ b/lib/Views/capability_profile.json @@ -0,0 +1,6 @@ +{ + "model": "generic", + "type": "network", + "width": 48, + "cutter": true +} diff --git a/lib/Views/detailHistory.dart b/lib/Views/detailHistory.dart new file mode 100644 index 0000000..0ef8a5c --- /dev/null +++ b/lib/Views/detailHistory.dart @@ -0,0 +1,116 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../Models/Order.dart'; +import '../controller/HistoryController.dart'; + +class DetailPage extends StatelessWidget { + final Order order; + final HistoryController historyController = Get.find(); + + DetailPage({super.key, required this.order}) { + historyController.fetchOrderItems(order.id); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Détails de la commande #${order.id}'), + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Total: ${order.totalPrice}', + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const SizedBox(height: 8.0), + Text( + 'Date: ${order.dateTime}', + style: const TextStyle( + fontSize: 16.0, + color: Colors.grey, + ), + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey[300], + ), + const SizedBox(height: 16), + Obx( + () => historyController.orderItems.isEmpty + ? const Center( + child: Text( + 'Aucun article trouvé', + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: Colors.red, + ), + ), + ) + : ListView.builder( + shrinkWrap: true, + itemCount: historyController.orderItems.length, + itemBuilder: (context, index) { + final item = historyController.orderItems[index]; + + return Card( + elevation: 2.0, + margin: const EdgeInsets.symmetric( + horizontal: 16.0, + vertical: 8.0, + ), + color: Colors.white, + child: ListTile( + leading: const Icon( + Icons.add_shopping_cart_rounded, + color: Colors.green, + ), + title: Text( + item['product_name'], + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Quantité: ${item['quantity']}', + style: const TextStyle( + color: Colors.grey, + ), + ), + Text( + 'Prix: ${item['price']}', + style: const TextStyle( + color: Colors.grey, + ), + ), + ], + ), + ), + ); + }, + ), + ), + ], + ), + ); + } +} diff --git a/lib/Views/editProduct.dart b/lib/Views/editProduct.dart new file mode 100644 index 0000000..1e6ca1d --- /dev/null +++ b/lib/Views/editProduct.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../Models/produit.dart'; +import '../Services/productDatabase.dart'; +import 'gestionProduct.dart'; + +class EditProductPage extends StatelessWidget { + final Product product; + final TextEditingController _nameController; + final TextEditingController _priceController; + final TextEditingController _categoryController; + + EditProductPage({super.key, required this.product}) + : _nameController = TextEditingController(text: product.name), + _priceController = + TextEditingController(text: product.price.toString()), + _categoryController = TextEditingController(text: product.category); + + void _saveChanges() async { + final name = _nameController.text; + final price = double.tryParse(_priceController.text) ?? 0.0; + final category = _categoryController.text; + + if (name.isNotEmpty && price > 0) { + final updatedProduct = Product( + id: product.id, + name: name, + price: price, + image: product.image, + category: category, + ); + + await ProductDatabase.instance.updateProduct(updatedProduct); + + Get.to(GestionProduit()); + } else { + Get.snackbar( + 'Entrée invalide', + 'Veuillez entrer un nom et un prix valides', + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Modifier le produit'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Text( + 'Modifier le produit', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 16), + TextField( + controller: _nameController, + decoration: const InputDecoration(labelText: 'Nom du produit'), + ), + const SizedBox(height: 16), + TextField( + controller: _priceController, + decoration: const InputDecoration(labelText: 'Prix'), + keyboardType: + const TextInputType.numberWithOptions(decimal: true), + ), + const SizedBox(height: 16), + TextField( + controller: _categoryController, + decoration: const InputDecoration(labelText: 'Catégorie'), + ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: _saveChanges, + child: const Text('Enregistrer les modifications'), + ), + ], + ), + ), + ); + } +} diff --git a/lib/Views/editUser.dart b/lib/Views/editUser.dart new file mode 100644 index 0000000..16ed576 --- /dev/null +++ b/lib/Views/editUser.dart @@ -0,0 +1,186 @@ +import 'package:flutter/material.dart'; +import 'package:youmazgestion/Models/users.dart'; +import '../Services/authDatabase.dart'; + +class EditUserPage extends StatefulWidget { + final Users user; + + const EditUserPage({super.key, required this.user}); + + @override + _EditUserPageState createState() => _EditUserPageState(); +} + +class _EditUserPageState extends State { + late TextEditingController _nameController; + late TextEditingController _lastNameController; + late TextEditingController _emailController; + late TextEditingController _usernameController; + late TextEditingController _passwordController; + String _selectedRole = ''; + + @override + void initState() { + super.initState(); + _nameController = TextEditingController(text: widget.user.name); + _lastNameController = TextEditingController(text: widget.user.lastName); + _emailController = TextEditingController(text: widget.user.email); + _usernameController = TextEditingController(text: widget.user.username); + _passwordController = + TextEditingController(); // Leave password field empty initially + _selectedRole = widget.user.role; + } + + @override + void dispose() { + _nameController.dispose(); + _lastNameController.dispose(); + _emailController.dispose(); + _usernameController.dispose(); + _passwordController.dispose(); + super.dispose(); + } + + void _updateUser() { + final String name = _nameController.text; + final String lastName = _lastNameController.text; + final String email = _emailController.text; + final String username = _usernameController.text; + final String password = + _passwordController.text; // Get the entered password + final String role = _selectedRole; + + final Users updatedUser = Users( + id: widget.user.id, + name: name, + lastName: lastName, + email: email, + password: password.isNotEmpty + ? password + : widget.user + .password, // Use entered password if not empty, otherwise keep the existing password + username: username, + role: role, + ); + + AuthDatabase.instance.updateUser(updatedUser).then((value) { + // User update successful + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Update Successful'), + content: const Text('User information has been updated.'), + actions: [ + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + Navigator.pop(context, + true); // Return true to indicate successful update + }, + child: const Text('OK'), + ), + ], + ); + }, + ); + }).catchError((error) { + print(error); + // Update failed + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Update Failed'), + content: + const Text('An error occurred during user information update.'), + actions: [ + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text('OK'), + ), + ], + ); + }, + ); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Edit User'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + controller: _nameController, + decoration: const InputDecoration( + labelText: 'First Name', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _lastNameController, + decoration: const InputDecoration( + labelText: 'Last Name', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _emailController, + decoration: const InputDecoration( + labelText: 'Email', + ), + keyboardType: TextInputType.emailAddress, + ), + const SizedBox(height: 16.0), + TextField( + controller: _usernameController, + decoration: const InputDecoration( + labelText: 'Username', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _passwordController, + decoration: const InputDecoration( + labelText: 'Password', + ), + obscureText: true, + ), + const SizedBox(height: 16.0), + DropdownButton( + value: _selectedRole, + onChanged: (String? newValue) { + setState(() { + _selectedRole = newValue!; + }); + }, + items: ['admin', 'user'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + const SizedBox(height: 16.0), + ElevatedButton( + onPressed: _updateUser, + child: const Text('Update'), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/Views/gestionProduct.dart b/lib/Views/gestionProduct.dart new file mode 100644 index 0000000..fb89cae --- /dev/null +++ b/lib/Views/gestionProduct.dart @@ -0,0 +1,130 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Components/app_bar.dart'; + +import '../Components/appDrawer.dart'; +import '../Models/produit.dart'; +import '../Services/productDatabase.dart'; +import 'editProduct.dart'; +import 'dart:io'; + +class GestionProduit extends StatelessWidget { + final ProductDatabase _productDatabase = ProductDatabase.instance; + + const GestionProduit({super.key}); + + @override + Widget build(BuildContext context) { + final screenWidth = MediaQuery.of(context).size.width * 0.8; + + return Scaffold( + appBar: const CustomAppBar(title: 'Gestion des produits'), + drawer: CustomDrawer(), + body: FutureBuilder>( + future: _productDatabase.getProducts(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (snapshot.hasError) { + return const Center( + child: Text('Une erreur s\'est produite'), + ); + } + + final products = snapshot.data; + + if (products == null || products.isEmpty) { + return const Center( + child: Text('Aucun produit disponible'), + ); + } + + return ListView.builder( + itemCount: products.length, + itemBuilder: (context, index) { + final product = products[index]; + return Container( + width: screenWidth, + margin: const EdgeInsets.symmetric(vertical: 2, horizontal: 20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + border: Border.all( + color: Colors.grey, + width: 1.0, + ), + ), + child: ListTile( + leading: CircleAvatar( + backgroundImage: product.image != null + ? FileImage(File(product.image)) as ImageProvider< + Object> // Charger l'image à partir du chemin d'accès + : const AssetImage( + 'assets/placeholder_image.png'), // Image de substitution si le chemin d'accès est vide + ), + title: Text(product.name), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Price: \$${product.price.toStringAsFixed(2)}'), + Text('Category: ${product.category}'), + ], + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + onPressed: () { + _productDatabase + .deleteProduct(product.id) + .then((value) { + Get.snackbar( + 'Produit supprimé', + 'Le produit a été supprimé avec succès', + snackPosition: SnackPosition.TOP, + duration: const Duration(seconds: 3), + backgroundColor: Colors.green, + colorText: Colors.white, + ); + }); + }, + icon: const Icon(Icons.delete), + color: Colors.red, + ), + IconButton( + onPressed: () { + Get.to(EditProductPage(product: product)) + ?.then((result) { + if (result != null && result is Product) { + _productDatabase + .updateProduct(result) + .then((value) { + Get.snackbar( + 'Produit mis à jour', + 'Le produit a été mis à jour avec succès', + snackPosition: SnackPosition.TOP, + duration: const Duration(seconds: 3), + backgroundColor: Colors.green, + colorText: Colors.white, + ); + }); + } + }); + }, + icon: const Icon(Icons.edit), + color: Colors.blue, + ), + ], + ), + ), + ); + }, + ); + }, + ), + ); + } +} diff --git a/lib/Views/gestionStock.dart b/lib/Views/gestionStock.dart new file mode 100644 index 0000000..3612775 --- /dev/null +++ b/lib/Views/gestionStock.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; +import 'package:youmazgestion/Components/app_bar.dart'; +import '../Models/produit.dart'; +import '../Services/productDatabase.dart'; + +class GestionStockPage extends StatefulWidget { + const GestionStockPage({super.key}); + + @override + _GestionStockPageState createState() => _GestionStockPageState(); +} + +class _GestionStockPageState extends State { + late Future> _productsFuture; + + @override + void initState() { + super.initState(); + _loadProducts(); + } + + Future _loadProducts() async { + final productDatabase = ProductDatabase.instance; + _productsFuture = productDatabase.getProducts(); + } + + Future _refreshProducts() async { + final productDatabase = ProductDatabase.instance; + _productsFuture = productDatabase.getProducts(); + setState(() {}); + } + + Future _updateStock(int id, int stock) async { + final productDatabase = ProductDatabase.instance; + await productDatabase.updateStock(id, stock); + _refreshProducts(); + } + + //popup pour modifier le stock + + Future _showStockDialog(Product product) async { + int stock = product.stock ?? 0; + final quantityController = TextEditingController(text: stock.toString()); + + await showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text('Modifier le stock'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(product.name), + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + icon: const Icon(Icons.remove), + onPressed: () { + setState(() { + if (stock > 0) { + stock--; + quantityController.text = stock.toString(); + } + }); + }, + ), + Expanded( + child: TextField( + controller: quantityController, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + onChanged: (value) { + setState(() { + stock = int.parse(value); + }); + }, + ), + ), + IconButton( + icon: const Icon(Icons.add), + onPressed: () { + setState(() { + stock++; + quantityController.text = stock.toString(); + }); + }, + ), + ], + ), + ], + ), + actions: [ + TextButton( + child: const Text('Annuler'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ElevatedButton( + child: const Text('Enregistrer'), + onPressed: () { + // Enregistrer la nouvelle quantité dans la base de données + _updateStock(product.id!, stock); + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: 'Gestion du stock'), + body: FutureBuilder>( + future: _productsFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator(), + ); + } else if (snapshot.hasError) { + return const Center( + child: Text('Une erreur s\'est produite'), + ); + } else if (!snapshot.hasData || snapshot.data!.isEmpty) { + return const Center( + child: Text('Aucun produit trouvé'), + ); + } else { + final products = snapshot.data!; + return ListView.builder( + itemCount: products.length, + itemBuilder: (context, index) { + final product = products[index]; + Color stockColor; + if (product.stock != null) { + if (product.stock! > 30) { + stockColor = Colors.green; + } else if (product.stock! > 10) { + stockColor = Colors.red; + } else { + stockColor = Colors.red; + } + } else { + stockColor = Colors.red; + } + + return Card( + margin: + const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + elevation: 4, + shadowColor: Colors.deepOrangeAccent, + child: ListTile( + leading: const Icon(Icons.shopping_basket), + title: Text( + product.name, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Text( + 'Stock: ${product.stock ?? 'Non disponible'}', + style: TextStyle( + fontSize: 16, + color: stockColor, + ), + ), + trailing: IconButton( + icon: const Icon(Icons.edit), + onPressed: () { + _showStockDialog(product); + }, + ), + ), + ); + }, + ); + } + }, + ), + ); + } +} diff --git a/lib/Views/historique.dart b/lib/Views/historique.dart new file mode 100644 index 0000000..2e6a50a --- /dev/null +++ b/lib/Views/historique.dart @@ -0,0 +1,123 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Components/app_bar.dart'; +import 'package:intl/intl.dart'; +import '../Components/appDrawer.dart'; +import '../controller/HistoryController.dart'; +import 'listCommandeHistory.dart'; + +class HistoryPage extends GetView { + @override + HistoryController controller = Get.put(HistoryController()); + + HistoryPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: 'Historique'), + drawer: CustomDrawer(), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: ElevatedButton( + onPressed: () { + controller.refreshOrders(); + controller.onInit(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.deepOrangeAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.0), + ), + ), + child: const Text( + 'Rafraîchir', + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + ), + ), + ), + ), + Expanded( + child: Obx( + () { + final distinctDates = controller.workDays; + + if (distinctDates.isEmpty) { + return const Center( + child: Text( + 'Aucune journée de travail trouvée', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + ); + } + + return ListView.builder( + itemCount: distinctDates.length, + itemBuilder: (context, index) { + final date = distinctDates[index]; + return Card( + elevation: 2.0, + margin: const EdgeInsets.symmetric( + horizontal: 16.0, + vertical: 8.0, + ), + child: ListTile( + title: Text( + 'Journée du $date', + style: const TextStyle( + fontWeight: FontWeight.bold, + ), + ), + leading: const CircleAvatar( + backgroundColor: Colors.deepOrange, + child: Icon( + Icons.calendar_today, + color: Colors.white, + ), + ), + trailing: const Icon( + Icons.arrow_forward, + color: Colors.deepOrange, + ), + onTap: () => navigateToDetailPage(date), + ), + ); + }, + ); + }, + ), + ), + ], + ), + ); + } + + String formatDate(String date) { + try { + final parsedDate = DateFormat('dd-MM-yyyy').parse(date); + print('parsedDate1: $parsedDate'); + final formattedDate = DateFormat('yyyy-MM-dd').format(parsedDate); + print('formattedDate1: $formattedDate'); + return formattedDate; + } catch (e) { + print('Error parsing date: $date'); + return ''; + } + } + + // transformer string en DateTime + void navigateToDetailPage(String selectedDate) { + print('selectedDate: $selectedDate'); + DateTime parsedDate = DateFormat('yyyy-MM-dd').parse(selectedDate); + print('parsedDate: $parsedDate'); + + Get.to(() => HistoryDetailPage(selectedDate: parsedDate)); + } +} diff --git a/lib/Views/listCommandeHistory.dart b/lib/Views/listCommandeHistory.dart new file mode 100644 index 0000000..401e9c5 --- /dev/null +++ b/lib/Views/listCommandeHistory.dart @@ -0,0 +1,219 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Components/app_bar.dart'; +import 'package:youmazgestion/Views/voirPlus.dart'; +import 'package:youmazgestion/controller/HistoryController.dart'; +import '../Models/Order.dart'; +import 'package:youmazgestion/Views/detailHistory.dart'; + +class HistoryDetailPage extends StatelessWidget { + final DateTime selectedDate; + final HistoryController controller = Get.find(); + double totalSum = 0.0; + late Future> productQuantities; + + HistoryDetailPage({super.key, required this.selectedDate}) { + calculateTotalSum(); + totalQuantity(); + } + + void calculateTotalSum() { + totalSum = controller.getTotalSumOrdersByStartDate(selectedDate); + } + + void totalQuantity() { + productQuantities = controller.getProductQuantitiesByDate(selectedDate); + print(productQuantities); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: controller, + builder: (controller) { + return Scaffold( + appBar: const CustomAppBar(title: 'Historique de la journée'), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + ElevatedButton( + onPressed: () { + controller.refreshOrders(); + calculateTotalSum(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.deepOrange, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.0), + ), + ), + child: const Row( + children: [ + Icon(Icons.refresh, color: Colors.white), + SizedBox(width: 5), + Text( + 'Rafraîchir', + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + ), + ), + ], + ), + ), + ElevatedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + FutureBuilder>( + future: productQuantities, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const CircularProgressIndicator(); + } else if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return VoirPlusPage( + productQuantities: snapshot.data!); + } + }, + ), + ), + ); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.deepOrange, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.0), + ), + ), + child: const Row( + children: [ + Icon(Icons.feed_outlined, color: Colors.white), + SizedBox(width: 5), + Text( + 'Voir Plus', + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + ), + ), + ], + ), + ), + ], + ), + ), + Text( + 'Total Somme: $totalSum fcfa', + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + Expanded( + child: FutureBuilder>( + future: controller.getOrdersByStartDate(selectedDate), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (snapshot.hasError) { + return const Center( + child: Text( + 'Une erreur s\'est produite', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + ); + } + + final orders = snapshot.data; + + if (orders == null || orders.isEmpty) { + return const Center( + child: Text( + 'Aucune commande trouvée pour cette journée', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + ); + } + + return ListView.builder( + itemCount: orders.length, + itemBuilder: (context, index) { + final order = orders[index]; + + return Card( + elevation: 4.0, + shadowColor: Colors.red, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.0), + ), + margin: const EdgeInsets.symmetric( + horizontal: 16.0, + vertical: 8.0, + ), + child: ListTile( + title: Row( + children: [ + Text( + 'Commande #${order.id}', + style: const TextStyle( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(width: 10), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8.0, vertical: 4.0), + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: BorderRadius.circular(10.0), + ), + child: const Text( + 'Terminé', + style: TextStyle( + color: Colors.white, + fontSize: 12.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + subtitle: Text('Total: ${order.totalPrice} fcfa'), + trailing: Text('Date: ${order.dateTime}'), + leading: Text('vendeur: ${order.user}'), + onTap: () { + Get.to(() => DetailPage(order: order)); + }, + ), + ); + }, + ); + }, + ), + ), + ], + ), + ); + }, + ); + } +} diff --git a/lib/Views/listUser.dart b/lib/Views/listUser.dart new file mode 100644 index 0000000..9ee1dd6 --- /dev/null +++ b/lib/Views/listUser.dart @@ -0,0 +1,125 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Models/users.dart'; +import '../Components/app_bar.dart'; +import '../Services/authDatabase.dart'; +import 'editUser.dart'; + +class ListUserPage extends StatefulWidget { + const ListUserPage({super.key}); + + @override + _ListUserPageState createState() => _ListUserPageState(); +} + +class _ListUserPageState extends State { + List userList = []; + + @override + void initState() { + super.initState(); + getUsersFromDatabase(); + } + + Future getUsersFromDatabase() async { + try { + List users = await AuthDatabase.instance.getAllUsers(); + setState(() { + userList = users; + }); + } catch (e) { + print(e); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: 'Liste des utilisateurs'), + body: ListView.builder( + itemCount: userList.length, + itemBuilder: (context, index) { + Users user = userList[index]; + return Card( + elevation: 3, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + shadowColor: Colors.deepOrange, + borderOnForeground: true, + child: ListTile( + title: Text( + "${user.name} ${user.lastName}", + style: const TextStyle( + fontWeight: FontWeight.bold, + ), + ), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 4), + Text("Username: ${user.username}"), + const SizedBox(height: 4), + Text("Privilège: ${user.role}"), + ], + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: const Icon(Icons.delete), + color: Colors.red, + onPressed: () { + // Action de suppression + // Vous pouvez appeler une méthode de suppression appropriée ici + // confirmation de suppression + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text("Supprimer"), + content: const Text( + "Êtes-vous sûr de vouloir supprimer cet utilisateur?"), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text("Annuler"), + ), + TextButton( + onPressed: () async { + await AuthDatabase.instance + .deleteUser(user.id); + Navigator.of(context).pop(); + setState(() { + userList.removeAt(index); + }); + }, + child: const Text("Supprimer"), + ), + ], + ); + }, + ); + }, + ), + IconButton( + icon: const Icon(Icons.edit), + color: Colors.blue, + onPressed: () { + // Action de modification + // Vous pouvez naviguer vers la page de modification avec les détails de l'utilisateur + // en utilisant Navigator.push ou showDialog, selon votre besoin + Get.to(() => EditUserPage(user: user)); + }, + ), + ], + ), + ), + ); + }, + ), + ); + } +} diff --git a/lib/Views/loginPage.dart b/lib/Views/loginPage.dart new file mode 100644 index 0000000..70f312f --- /dev/null +++ b/lib/Views/loginPage.dart @@ -0,0 +1,183 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:youmazgestion/Views/particles.dart' show ParticleBackground; +import 'package:youmazgestion/accueil.dart'; +import 'package:youmazgestion/Services/authDatabase.dart'; + +import '../Models/users.dart'; +import '../controller/userController.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + _LoginPageState createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + late TextEditingController _usernameController; + late TextEditingController _passwordController; + final UserController userController = Get.put(UserController()); + bool _isErrorVisible = false; + + @override + void initState() { + super.initState(); + _usernameController = TextEditingController(); + _passwordController = TextEditingController(); + checkUserCount(); + } + + void checkUserCount() async { + final userCount = await AuthDatabase.instance.getUserCount(); + if (userCount == 0) { + // No user found, redirect to home page + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const AccueilPage()), + ); + } + } + + @override + void dispose() { + _usernameController.dispose(); + _passwordController.dispose(); + super.dispose(); + } +Future saveUser(String? username,String? role)async{ + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('username', username!); + await prefs.setString('role', role!); +} + void _login() async { + final String username = _usernameController.text; + final String password = _passwordController.text; + print(username); + print(password); + + try { + bool isValidUser = + await AuthDatabase.instance.verifyUser(username, password); + Users user = await AuthDatabase.instance.getUser(username); + + Map? getUserCredentials = await AuthDatabase.instance.getUserCredentials(username,password); + print(isValidUser); + if (isValidUser) { + print('User is valid'); + print(user); + userController.setUser(user); + + setState(() { + _isErrorVisible = false; + }); + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const AccueilPage()), + ); + saveUser(getUserCredentials?['username'], getUserCredentials?['role']); + } else { + setState(() { + _isErrorVisible = true; + }); + } + } catch (error) { + print(error); + setState(() { + _isErrorVisible = true; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text( + 'Login', + style: TextStyle(color:Colors.white), + ), + backgroundColor: const Color.fromARGB(255, 4, 54, 95), + centerTitle: true, + ), + body: ParticleBackground( + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.5, + height: MediaQuery.of(context).size.height * 0.8, + padding: const EdgeInsets.all(16.0), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(30.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: const Icon( + Icons.lock_outline, + size: 100.0, + color: Color.fromARGB(255, 4, 54, 95), + ), + ), + TextField( + controller: _usernameController, + decoration: InputDecoration( + labelText: 'Username', + prefixIcon: + const Icon(Icons.person, color: Colors.blueAccent), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _passwordController, + decoration: InputDecoration( + labelText: 'Password', + prefixIcon: const Icon(Icons.lock, color: Colors.redAccent), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + obscureText: true, + ), + const SizedBox(height: 16.0), + Visibility( + visible: _isErrorVisible, + child: const Text( + 'Invalid username or password', + style: TextStyle( + color: Colors.red, + ), + ), + ), + const SizedBox(height: 16.0), + ElevatedButton( + onPressed: _login, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF0015B7), // Nouvelle couleur + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + child: const Text( + 'Login', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/Views/par b/lib/Views/par new file mode 100644 index 0000000..e69de29 diff --git a/lib/Views/particles.dart b/lib/Views/particles.dart new file mode 100644 index 0000000..5f24e7d --- /dev/null +++ b/lib/Views/particles.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:particles_fly/particles_fly.dart'; + +class ParticleBackground extends StatelessWidget { + final Widget child; + final double numberOfParticles; + + const ParticleBackground({ + super.key, + required this.child, + this.numberOfParticles = 100, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + + return Stack( + children: [ + ParticlesFly( + height: size.height, + width: size.width, + connectDots: true, + numberOfParticles: numberOfParticles, + ), + child, // contenu au-dessus des particules + ], + ); + } +} diff --git a/lib/Views/registrationPage.dart b/lib/Views/registrationPage.dart new file mode 100644 index 0000000..b8eef8c --- /dev/null +++ b/lib/Views/registrationPage.dart @@ -0,0 +1,187 @@ +import 'package:flutter/material.dart'; +import 'package:youmazgestion/Models/users.dart'; +import 'package:youmazgestion/accueil.dart'; + +import '../Services/authDatabase.dart'; + +class RegistrationPage extends StatefulWidget { + const RegistrationPage({super.key}); + + @override + _RegistrationPageState createState() => _RegistrationPageState(); +} + +class _RegistrationPageState extends State { + late TextEditingController _nameController; + late TextEditingController _lastNameController; + late TextEditingController _emailController; + late TextEditingController _usernameController; + late TextEditingController _passwordController; + String _selectedRole = 'user'; // Default role is 'user' + + @override + void initState() { + super.initState(); + _nameController = TextEditingController(); + _lastNameController = TextEditingController(); + _emailController = TextEditingController(); + _usernameController = TextEditingController(); + _passwordController = TextEditingController(); + AuthDatabase.instance.initDatabase(); + } + + @override + void dispose() { + _nameController.dispose(); + _lastNameController.dispose(); + _emailController.dispose(); + _usernameController.dispose(); + _passwordController.dispose(); + super.dispose(); + } + + void _register() { + // Get the entered user information + final String name = _nameController.text; + final String lastName = _lastNameController.text; + final String email = _emailController.text; + final String username = _usernameController.text; + final String password = _passwordController.text; + final String role = _selectedRole; + + // Create a new user object + final Users user = Users( + id: 0, // The id will be assigned automatically by the database + name: name, + lastName: lastName, + email: email, + password: password, + username: username, + role: role, + ); + + // Save the user in the database + AuthDatabase.instance.createUser(user).then((value) { + // Registration successful + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Registration Successful'), + content: const Text('You have successfully registered.'), + actions: [ + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + // Navigate to the login page + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const AccueilPage()), + ); + }, + child: const Text('OK'), + ), + ], + ); + }, + ); + }).catchError((error) { + print(error); + // Registration failed + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Registration Failed'), + content: const Text('An error occurred during registration.'), + actions: [ + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text('OK'), + ), + ], + ); + }, + ); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Registration'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + controller: _nameController, + decoration: const InputDecoration( + labelText: 'First Name', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _lastNameController, + decoration: const InputDecoration( + labelText: 'Last Name', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _emailController, + decoration: const InputDecoration( + labelText: 'Email', + ), + keyboardType: TextInputType.emailAddress, + ), + const SizedBox(height: 16.0), + TextField( + controller: _usernameController, + decoration: const InputDecoration( + labelText: 'Username', + ), + ), + const SizedBox(height: 16.0), + TextField( + controller: _passwordController, + decoration: const InputDecoration( + labelText: 'Password', + ), + obscureText: true, + ), + const SizedBox(height: 16.0), + DropdownButton( + value: _selectedRole, + onChanged: (String? newValue) { + setState(() { + _selectedRole = newValue!; + }); + }, + items: ['admin', 'user'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + const SizedBox(height: 16.0), + ElevatedButton( + onPressed: _register, + child: const Text('Register'), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/Views/ticketPage.dart b/lib/Views/ticketPage.dart new file mode 100644 index 0000000..d04f606 --- /dev/null +++ b/lib/Views/ticketPage.dart @@ -0,0 +1,488 @@ +import 'dart:io'; + +import 'package:esc_pos_printer/esc_pos_printer.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:intl/intl.dart'; +import 'package:esc_pos_utils/esc_pos_utils.dart'; +import 'package:open_file/open_file.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:pdf/pdf.dart'; +import 'package:pdf/widgets.dart' as pw; + +import '../Components/cartItem.dart'; +import '../accueil.dart'; + +class TicketPage extends StatelessWidget { + final String businessName; + final String businessAddress; + final String businessPhoneNumber; + final List cartItems; + final double totalCartPrice; + final double amountPaid; + + const TicketPage({ + Key? key, + required this.businessName, + required this.businessAddress, + required this.businessPhoneNumber, + required this.cartItems, + required this.totalCartPrice, + required this.amountPaid, + }) : super(key: key); + + Future _printTicket() async { + final profile = await CapabilityProfile.load(); + final printer = NetworkPrinter(PaperSize.mm80, profile); + + printer.text('Ticket de caisse', + styles: const PosStyles( + align: PosAlign.center, + height: PosTextSize.size2, + width: PosTextSize.size2, + )); + + printer.text('Entreprise : $businessName'); + printer.text('Adresse : $businessAddress'); + printer.text('Numéro de téléphone : $businessPhoneNumber'); + + printer.hr(); + printer.row([ + PosColumn( + text: 'Produit', + width: 3, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + PosColumn( + text: 'Quantité', + width: 1, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + PosColumn( + text: 'Prix unitaire', + width: 1, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + PosColumn( + text: 'Total', + width: 1, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + ]); + printer.hr(); + + for (final cartItem in cartItems) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final productTotal = product.price * quantity; + + printer.row([ + PosColumn( + text: product.name, + width: 3, + ), + PosColumn( + text: quantity.toString(), + width: 1, + ), + PosColumn( + text: '${product.price.toStringAsFixed(2)} fcfa', + width: 1, + ), + PosColumn( + text: '${productTotal.toStringAsFixed(2)} fcfa', + width: 1, + ), + ]); + } + + printer.hr(); + printer.row([ + PosColumn( + text: 'Total :', + width: 3, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + PosColumn( + text: '${totalCartPrice.toStringAsFixed(2)} fcfa', + width: 1, + styles: const PosStyles(align: PosAlign.left, bold: true), + ), + ]); + printer.row([ + PosColumn( + text: 'Somme remise :', + width: 3, + styles: const PosStyles(align: PosAlign.left), + ), + PosColumn( + text: '${amountPaid.toStringAsFixed(2)} fcfa', + width: 1, + styles: const PosStyles(align: PosAlign.left), + ), + ]); + printer.row([ + PosColumn( + text: 'Somme rendue :', + width: 3, + styles: const PosStyles(align: PosAlign.left), + ), + PosColumn( + text: '${(amountPaid - totalCartPrice).toStringAsFixed(2)} fcfa', + width: 1, + styles: const PosStyles(align: PosAlign.left), + ), + ]); + printer.hr(); + printer.text('Youmaz vous remercie pour votre achat!!!'); + printer.feed(2); + + printer.cut(); + printer.disconnect(); // Fermez la connexion après l'impression + + Get.snackbar('Impression', 'Ticket imprimé avec succès'); + } + + Future _generateAndSavePDF() async { + final pdf = pw.Document(); + + // Ajoutez le contenu de votre ticket au document ici + pdf.addPage( + pw.Page( + build: (context) { + return pw.Column( + children: [ + pw.Text('Ticket de caisse', + style: const pw.TextStyle(fontSize: 24)), + pw.SizedBox(height: 16), + pw.Text('Entreprise : $businessName', + style: const pw.TextStyle(fontSize: 18)), + pw.SizedBox(height: 8), + pw.Text('Adresse : $businessAddress', + style: const pw.TextStyle(fontSize: 16)), + pw.SizedBox(height: 8), + pw.Text('Numéro de téléphone : $businessPhoneNumber', + style: const pw.TextStyle(fontSize: 16)), + pw.SizedBox(height: 24), + pw.Table.fromTextArray( + border: null, + headerStyle: pw.TextStyle(fontWeight: pw.FontWeight.bold), + headerDecoration: + const pw.BoxDecoration(color: PdfColors.grey300), + headers: ['Produit', 'Quantité', 'Prix unitaire', 'Total'], + data: [ + ...cartItems.map((cartItem) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final productTotal = product.price * quantity; + + return [ + product.name, + quantity.toString(), + '${product.price.toStringAsFixed(2)} fcfa', + '${productTotal.toStringAsFixed(2)} fcfa', + ]; + }).toList(), + ], + ), + pw.SizedBox(height: 16), + pw.Divider(height: 8, thickness: 1, color: PdfColors.black), + pw.SizedBox(height: 8), + pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.Text('Total :', + style: pw.TextStyle( + fontSize: 18, fontWeight: pw.FontWeight.bold)), + pw.Text('${totalCartPrice.toStringAsFixed(2)} fcfa', + style: pw.TextStyle( + fontSize: 18, fontWeight: pw.FontWeight.bold)), + ], + ), + pw.SizedBox(height: 8), + pw.Divider(height: 8, thickness: 0, color: PdfColors.black), + pw.SizedBox(height: 8), + pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.Text('Somme remise :', + style: const pw.TextStyle(fontSize: 16)), + pw.Text('${amountPaid.toStringAsFixed(2)} fcfa', + style: const pw.TextStyle(fontSize: 16)), + ], + ), + pw.SizedBox(height: 8), + pw.Row( + mainAxisAlignment: pw.MainAxisAlignment.spaceBetween, + children: [ + pw.Text('Somme rendue :', + style: const pw.TextStyle(fontSize: 16)), + pw.Text( + '${(amountPaid - totalCartPrice).toStringAsFixed(2)} fcfa', + style: const pw.TextStyle(fontSize: 16)), + ], + ), + pw.SizedBox(height: 24), + pw.Text('Youmaz vous remercie pour votre achat!!!', + style: pw.TextStyle( + fontSize: 18, fontWeight: pw.FontWeight.bold)), + ], + ); + }, + ), + ); + + // Obtenez le répertoire de documents de l'utilisateur + final directory = await getApplicationDocumentsDirectory(); + final path = '${directory.path}/ticket.pdf'; + + // Enregistrez le PDF localement + final file = File(path); + await file.writeAsBytes(await pdf.save()); + + // Ouvrez le PDF après l'avoir enregistré + final result = await OpenFile.open(path); + + if (result.type == ResultType.done) { + Get.snackbar('Ouverture PDF', 'Ticket PDF ouvert avec succès'); + } else { + Get.snackbar('Ouverture PDF', 'Impossible d\'ouvrir le PDF'); + } + + Get.snackbar('Enregistrement PDF', 'Ticket PDF enregistré avec succès'); + } + + @override + Widget build(BuildContext context) { + double totalOrderAmount = 0; + + // Calculer la somme totale de la commande + for (final cartItem in cartItems) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final productTotal = product.price * quantity; + totalOrderAmount += productTotal; + } + + // Obtenir la date actuelle + final currentDate = DateTime.now(); + final formattedDate = DateFormat('dd/MM/yyyy HH:mm').format(currentDate); + + // Calculer la somme remise + final double discount = totalOrderAmount - totalCartPrice; + + // Calculer la somme rendue + final double change = amountPaid - totalOrderAmount; + + return Scaffold( + appBar: AppBar( + title: const Text('Ticket Youmaz'), + actions: [ + IconButton( + onPressed: () { + Get.to( + () => const AccueilPage()); // Naviguez vers la page d'accueil + }, + icon: const Icon(Icons.home), + alignment: Alignment.centerLeft, + ), + IconButton( + onPressed: _generateAndSavePDF, + icon: const Icon(Icons.print), + alignment: Alignment.centerLeft, + ), + ], + ), + body: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.5, + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Ticket de caisse', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ), + ), + const SizedBox(height: 16), + Text( + 'Entreprise : $businessName', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Text( + 'Adresse : $businessAddress', + style: const TextStyle(fontSize: 16), + ), + const SizedBox(height: 8), + Text( + 'Numéro de téléphone : $businessPhoneNumber', + style: const TextStyle(fontSize: 16), + ), + const SizedBox(height: 24), + Table( + columnWidths: const { + 0: FlexColumnWidth(2), + 1: FlexColumnWidth(1), + 2: FlexColumnWidth(1), + 3: FlexColumnWidth(1), + }, + children: [ + const TableRow( + children: [ + TableCell( + child: Text( + 'Produit', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + TableCell( + child: Center( + child: Text( + 'Quantité', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + TableCell( + child: Center( + child: Text( + 'Prix unitaire', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + TableCell( + child: Center( + child: Text( + 'Total', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + ], + ), + ...cartItems.map((cartItem) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final productTotal = product.price * quantity; + + return TableRow( + children: [ + TableCell( + child: Text(product.name), + ), + TableCell( + child: Center( + child: Text(quantity.toString()), + ), + ), + TableCell( + child: Center( + child: Text( + '${product.price.toStringAsFixed(2)} fcfa', + ), + ), + ), + TableCell( + child: Center( + child: Text( + '${productTotal.toStringAsFixed(2)} fcfa', + ), + ), + ), + ], + ); + }).toList(), + ], + ), + const SizedBox(height: 16), + const Divider( + height: 8, + thickness: 1, + color: Colors.black, + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Total :', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + Text( + '${totalOrderAmount.toStringAsFixed(2)} fcfa', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + const SizedBox(height: 8), + const Divider( + height: 8, + thickness: 0, + color: Colors.black, + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Somme remise :', + style: TextStyle( + fontSize: 16, + ), + ), + Text( + '${amountPaid.toStringAsFixed(2)} fcfa', + style: const TextStyle( + fontSize: 16, + ), + ), + ], + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Somme rendue :', + style: TextStyle( + fontSize: 16, + ), + ), + Text( + '${change.toStringAsFixed(2)} fcfa', + style: const TextStyle( + fontSize: 16, + ), + ), + ], + ), + const SizedBox(height: 24), + const Text( + 'Youmaz vous remercie pour votre achat!!!', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/Views/voirPlus.dart b/lib/Views/voirPlus.dart new file mode 100644 index 0000000..ee8f1f6 --- /dev/null +++ b/lib/Views/voirPlus.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; + +class VoirPlusPage extends StatelessWidget { + final Map productQuantities; + + const VoirPlusPage({super.key, required this.productQuantities}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Voir Plus'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Contenu de productQuantities :', + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 16), + // Afficher les valeurs de productQuantities + for (var entry in productQuantities.entries) + Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Row( + children: [ + const Icon( + Icons.stars, + color: Colors.orange, + ), + const SizedBox(width: 8), + Expanded( + flex: 2, + child: Text( + '${entry.key}:', + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(width: 8), + Expanded( + flex: 1, + child: Text( + '${entry.value}', + style: const TextStyle( + fontSize: 16, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/accueil.dart b/lib/accueil.dart new file mode 100644 index 0000000..e9983de --- /dev/null +++ b/lib/accueil.dart @@ -0,0 +1,526 @@ +import 'dart:io'; +import 'package:intl/intl.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:quantity_input/quantity_input.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:youmazgestion/Views/particles.dart' show ParticleBackground; +import 'Components/appDrawer.dart'; +import 'Components/app_bar.dart'; +import 'Components/cartItem.dart'; +import 'Models/produit.dart'; +import 'Services/OrderDatabase.dart'; +import 'Services/productDatabase.dart'; +import 'Views/ticketPage.dart'; +import 'controller/userController.dart'; +import 'my_app.dart'; +import 'Services/workDatabase.dart'; + +class AccueilPage extends StatefulWidget { + const AccueilPage({super.key}); + + @override + _AccueilPageState createState() => _AccueilPageState(); +} + +class _AccueilPageState extends State { + final UserController userController = Get.put(UserController()); + final ProductDatabase productDatabase = ProductDatabase(); + late Future>> productsFuture; + final OrderDatabase orderDatabase = OrderDatabase.instance; + final WorkDatabase workDatabase = WorkDatabase.instance; + String? username; + String? role; + DateTime? startDate; + + int orderId = 0; + List selectedProducts = []; + int selectedQuantity = 1; // Quantité sélectionnée par défaut + double totalCartPrice = 0; + double amountPaid = 0; + + @override + void initState() { + super.initState(); + initorder(); + initwork(); + loadUserData(); + productsFuture = _initDatabaseAndFetchProducts(); + } + + Future loadUserData() async { + final prefs = await SharedPreferences.getInstance(); + setState(() { + username = prefs.getString('username') ?? 'Nom inconnu'; + role = prefs.getString('role') ?? 'Rôle inconnu'; + }); + } + Future saveOrderToDatabase() async { + final totalPrice = calculateTotalPrice(); + final dateTime = DateTime.now().toString(); + String user = userController.username; + + // Insert the order into the database + orderId = await orderDatabase.insertOrder( + totalPrice, dateTime, MyApp.startDate!, user); + + // Insert order items into the database + for (final cartItem in selectedProducts) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final price = product.price * quantity; + + await orderDatabase.insertOrderItem( + orderId, product.name, quantity, price); + + // Mettre à jour le stock du produit + final updatedStock = product.stock! - quantity; + await productDatabase.updateStock(product.id!, updatedStock); + } + showTicketPage(); + } + + Future>> _initDatabaseAndFetchProducts() async { + await productDatabase.initDatabase(); + final categories = await productDatabase.getCategories(); + final productsByCategory = >{}; + + // Trier les catégories selon votre préférence + categories.sort(); + + for (final categoryName in categories) { + final products = + await productDatabase.getProductsByCategory(categoryName); + productsByCategory[categoryName] = products; + } + + return productsByCategory; + } + + void initorder() async { + await orderDatabase.initDatabase(); + } + + void initwork() async { + await workDatabase.initDatabase(); + } + + double calculateTotalPrice() { + double totalPrice = 0; + for (final cartItem in selectedProducts) { + totalPrice += cartItem.product.price * cartItem.quantity; + } + return totalPrice; + } + + void addToCartWithDetails(Product product) { + setState(() { + final existingCartItem = selectedProducts.firstWhere( + (cartItem) => cartItem.product == product, + orElse: () => CartItem(product, 0), + ); + if (existingCartItem.quantity == 0) { + selectedProducts.add(CartItem(product, selectedQuantity)); + } else { + existingCartItem.quantity += selectedQuantity; + } + }); + + // Afficher une notification + Get.snackbar( + 'Produit ajouté', + 'Le produit ${product.name} a été ajouté au panier', + snackPosition: SnackPosition.TOP, + duration: const Duration(seconds: 1), + backgroundColor: Colors.green, + colorText: Colors.white, + ); + resetQuantityAfterDelay(); + } + + Future resetQuantityAfterDelay() async { + await Future.delayed(const Duration(seconds: 1)); + setState(() { + selectedQuantity = 1; + }); + } + + void showTicketPage() { + // Calculer la somme totale du panier + final double totalCartPrice = calculateTotalPrice(); + + // Vérifier si des produits sont présents dans le panier + if (selectedProducts.isNotEmpty) { + // Vérifier si la somme payée est suffisante et supérieure ou égale au total du panier + if (amountPaid >= totalCartPrice) { + // Passer les produits et les informations de l'entreprise à la page du ticket + Get.offAll(TicketPage( + businessName: 'Youmaz', + businessAddress: + 'quartier escale, Diourbel, Sénégal, en face de Sonatel', + businessPhoneNumber: '77 446 92 68', + cartItems: selectedProducts, + totalCartPrice: totalCartPrice, + amountPaid: amountPaid, + )); + } else { + // Afficher un message d'erreur si la somme payée est insuffisante + Get.snackbar( + 'Paiement incomplet', + 'Le montant payé est insuffisant. Veuillez payer le montant total du panier.', + snackPosition: SnackPosition.BOTTOM, + duration: const Duration(seconds: 3), + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + } else { + // Afficher un message d'erreur si le panier est vide + Get.snackbar( + 'Panier vide', + 'Le panier est vide. Veuillez ajouter des produits avant de passer commande.', + snackPosition: SnackPosition.BOTTOM, + duration: const Duration(seconds: 3), + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: const CustomAppBar(title: "Accueil"), + drawer: CustomDrawer(), + body: ParticleBackground( + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [Colors.white, const Color.fromARGB(255, 4, 54, 95)], + ), + ), + child: FutureBuilder>>( + future: productsFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + print('erreur:${snapshot.error}'); + return const Center( + child: Text("Erreur lors du chargement des produits")); + } else if (snapshot.hasData) { + final Map> productsByCategory = + snapshot.data!; + final categories = productsByCategory.keys.toList(); + + if (!MyApp.isRegisterOpen) { + // Afficher le bouton "Démarrer la caisse" si la variable isRegisterOpen est false + return Column( + children: [ + Text('welcome $username ! votre role est $role'), + Center( + child: ElevatedButton( + onPressed: () { + setState(() { + MyApp.isRegisterOpen = true; + // mettre startDate à la date actuelle et au format yyyy-MM-dd + String formattedDate = + DateFormat('yyyy-MM-dd').format(DateTime.now()); + startDate = + DateFormat('yyyy-MM-dd').parse(formattedDate); + MyApp.startDate = startDate; + + var datee = DateFormat('yyyy-MM-dd') + .format(startDate!) + .toString(); + workDatabase.insertDate(datee); + }); + }, + child: const Text('Démarrer la caisse'), + ), + ), + ], + ); + } else { + // Afficher le contenu de la page d'accueil + return Row( + children: [ + Expanded( + flex: 3, + child: ListView.builder( + itemCount: categories.length, + itemBuilder: (context, index) { + final category = categories[index]; + final products = productsByCategory[category]!; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Text( + category, + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic, + decorationThickness: 2, + ), + textAlign: TextAlign.center, + ), + ), + ), + GridView.builder( + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 4, + childAspectRatio: 1, + ), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: products.length, + itemBuilder: (context, index) { + final product = products[index]; + + return Card( + elevation: 7, + shadowColor: Colors.redAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: InkWell( + onTap: () {}, + child: Container( + padding: const EdgeInsets.all(8), + child: Align( + alignment: Alignment.center, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + child: AspectRatio( + aspectRatio: 14, + child: product.image != null + ? Image.file( + File(product.image), + fit: BoxFit.cover, + ) + : Image.asset( + 'assets/placeholder_image.png', + fit: BoxFit.cover, + ), + ), + ), + Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Text( + product.name, + style: const TextStyle( + fontWeight: + FontWeight.bold, + fontSize: 16, + ), + ), + const SizedBox(height: 4), + Text( + '${product.price.toStringAsFixed(2)} fcfa', + style: const TextStyle( + fontWeight: + FontWeight.bold, + fontSize: 14, + color: Colors.green, + ), + ), + if (product + .isStockDefined()) ...[ + const SizedBox(height: 8), + const Text( + 'En stock', + style: TextStyle( + fontWeight: + FontWeight.bold, + fontSize: 12, + color: Colors.green, + ), + ), + ], + const SizedBox(height: 8), + QuantityInput( + value: selectedQuantity, + minValue: 1, + maxValue: 100, + step: 1, + inputWidth: 60, + buttonColor: + Colors.redAccent, + onChanged: + (String value) { + setState(() { + selectedQuantity = + int.parse(value); + }); + }, + ), + const SizedBox(height: 8), + ElevatedButton( + onPressed: () { + addToCartWithDetails( + product); + }, + style: ElevatedButton + .styleFrom( + backgroundColor: + const Color.fromARGB(255, 4, 54, 95), + onPrimary: Colors.white, + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular(18), + ), + ), + child: const Text( + 'Ajouter au panier' + , + style: TextStyle(color: Colors.white), + ), + + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + }, + ), + ], + ); + }, + ), + ), + Expanded( + flex: 1, + child: Container( + color: Colors.grey[200], + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Panier', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: const Color.fromARGB(255, 4, 54, 95), + ), + ), + Icon( + Icons.shopping_cart, + color: Colors.red, + ), + ], + ), + const SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: selectedProducts.length, + itemBuilder: (context, index) { + final cartItem = selectedProducts[index]; + final product = cartItem.product; + final quantity = cartItem.quantity; + + return ListTile( + title: Text(product.name), + subtitle: Text(product.category), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '${product.price.toStringAsFixed(2)} fcfa'), + const SizedBox(width: 8), + Text('x $quantity'), + const SizedBox(width: 8), + IconButton( + icon: const Icon(Icons.delete), + onPressed: () { + setState(() { + selectedProducts.removeAt(index); + }); + }, + color: Colors.redAccent, + ), + ], + ), + ); + }, + ), + ), + const SizedBox(height: 16), + Text( + 'Total: ${calculateTotalPrice().toStringAsFixed(2)} fcfa', + textAlign: TextAlign.end, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + TextFormField( + keyboardType: TextInputType.number, + decoration: const InputDecoration( + labelText: 'Montant payé', + ), + onChanged: (value) { + setState(() { + amountPaid = double.parse(value); + }); + }, + ), + const SizedBox(height: 8), + ElevatedButton( + onPressed: () { + saveOrderToDatabase(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: const Color.fromARGB(255, 4, 54, 95), + onPrimary: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18), + ), + ), + child: const Text('Payer'), + ), + ], + ), + ), + ), + ], + ); + } + } else { + return const Center(child: Text("Aucun produit disponible")); + } + }, + ), + ), + ), + ); + } +} diff --git a/lib/controller/AccueilController.dart b/lib/controller/AccueilController.dart new file mode 100644 index 0000000..14cc579 --- /dev/null +++ b/lib/controller/AccueilController.dart @@ -0,0 +1,151 @@ +import 'package:get/get.dart'; +import 'package:flutter/material.dart'; +import 'package:youmazgestion/controller/userController.dart'; +import '../Components/cartItem.dart'; +import '../Models/produit.dart'; +import '../Services/OrderDatabase.dart'; +import '../Services/WorkDatabase.dart'; +import '../Services/productDatabase.dart'; +import '../Views/ticketPage.dart'; +import '../my_app.dart'; + +class AccueilController extends GetxController { + final UserController userController = Get.find(); + final ProductDatabase productDatabase = ProductDatabase(); + final Rx>> productsFuture = Rx({}); // Observable + final OrderDatabase orderDatabase = OrderDatabase.instance; + final WorkDatabase workDatabase = WorkDatabase.instance; + DateTime? startDate; + + final RxInt orderId = RxInt(0); // Observable + final RxList selectedProducts = [].obs; // Observable list + final RxInt selectedQuantity = RxInt(1); // Observable + final RxDouble totalCartPrice = RxDouble(0.0); // Observable + final RxDouble amountPaid = RxDouble(0.0); // Observable + + @override + void onInit() { + super.onInit(); + initOrder(); + initWork(); + _initDatabaseAndFetchProducts(); + } + + Future saveOrderToDatabase() async { + final totalPrice = _calculateTotalPrice(); + final dateTime = DateTime.now().toString(); + String user = userController.username; + + orderId.value = await orderDatabase.insertOrder( + totalPrice, dateTime, MyApp.startDate!, user); + + for (final cartItem in selectedProducts) { + final product = cartItem.product; + final quantity = cartItem.quantity; + final price = product.price * quantity; + + await orderDatabase.insertOrderItem( + orderId.value, product.name, quantity, price); + + final updatedStock = product.stock! - quantity; + await productDatabase.updateStock(product.id!, updatedStock); + } + showTicketPage(); + } + + Future _initDatabaseAndFetchProducts() async { + await productDatabase.initDatabase(); + final categories = await productDatabase.getCategories(); + final productsByCategory = >{}; + + categories.sort(); + + for (final categoryName in categories) { + final products = + await productDatabase.getProductsByCategory(categoryName); + productsByCategory[categoryName] = products; + } + + productsFuture.value = productsByCategory; + } + + void initOrder() async { + await orderDatabase.initDatabase(); + } + + void initWork() async { + await workDatabase.initDatabase(); + } + + double _calculateTotalPrice() { + double totalPrice = 0; + for (final cartItem in selectedProducts) { + totalPrice += cartItem.product.price * cartItem.quantity; + } + return totalPrice; + } + + void addToCartWithDetails(Product product) { + final existingCartItem = selectedProducts.firstWhere( + (cartItem) => cartItem.product == product, + orElse: () => CartItem(product, 0), + ); + if (existingCartItem.quantity == 0) { + selectedProducts.add(CartItem(product, selectedQuantity.value)); + } else { + existingCartItem.quantity += selectedQuantity.value; + } + + // Afficher une notification + Get.snackbar( + 'Produit ajouté', + 'Le produit ${product.name} a été ajouté au panier', + snackPosition: SnackPosition.TOP, + duration: const Duration(seconds: 1), + backgroundColor: Colors.green, + colorText: Colors.white, + ); + resetQuantityAfterDelay(); + } + + Future resetQuantityAfterDelay() async { + await Future.delayed(const Duration(seconds: 1)); + selectedQuantity.value = 1; + } + + void showTicketPage() { + final double totalCartPrice = _calculateTotalPrice(); + + if (selectedProducts.isNotEmpty) { + if (amountPaid.value >= totalCartPrice) { + Get.offAll(TicketPage( + businessName: 'Youmaz', + businessAddress: + 'quartier escale, Diourbel, Sénégal, en face de Sonatel', + businessPhoneNumber: '77 446 92 68', + cartItems: selectedProducts, + totalCartPrice: totalCartPrice, + amountPaid: amountPaid.value, + )); + } else { + Get.snackbar( + 'Paiement incomplet', + 'Le montant payé est insuffisant. Veuillez payer le montant total du panier.', + snackPosition: SnackPosition.BOTTOM, + duration: const Duration(seconds: 3), + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + } else { + Get.snackbar( + 'Panier vide', + 'Le panier est vide. Veuillez ajouter des produits avant de passer commande.', + snackPosition: SnackPosition.BOTTOM, + duration: const Duration(seconds: 3), + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + } +} diff --git a/lib/controller/HistoryController.dart b/lib/controller/HistoryController.dart new file mode 100644 index 0000000..ed50ae3 --- /dev/null +++ b/lib/controller/HistoryController.dart @@ -0,0 +1,168 @@ +import 'package:get/get.dart'; +import '../Models/Order.dart'; +import '../Services/OrderDatabase.dart'; +import '../Services/WorkDatabase.dart'; + +class HistoryController extends GetxController { + final OrderDatabase _orderDatabase = OrderDatabase.instance; + final WorkDatabase _workDatabase = WorkDatabase.instance; + final RxList orders = [].obs; + late RxList> orderItems = >[].obs; + late RxList filteredOrders = [].obs; + late RxList workDays = [].obs; + RxDouble totalSum = RxDouble(0.0); + RxInt orderQuantity = RxInt(0); + + @override + void onInit() { + super.onInit(); + + // Initialize databases + _orderDatabase.initDatabase(); + _workDatabase.initDatabase(); + + // Fetch orders and work days + fetchOrders(); + fetchWorkDays(); + getTotalSumOrdersByMonth(DateTime.now()); + getOrdersByMonth(DateTime.now()); + getOrderCountByMonth(DateTime.now()); + + + } + + Future fetchOrders() async { + try { + final orderHistory = await _orderDatabase.getOrderHistory(); + orders.value = orderHistory; + } catch (e) { + // Handle the error + } + } + + Future fetchOrderItems(int orderId) async { + final items = await _orderDatabase.getOrderItems(orderId); + orderItems.value = items; + } + + Future refreshOrders() async { + final newOrders = await _orderDatabase.getOrderHistory(); + orders.value = newOrders; + } + + Future fetchWorkDays() async { + try { + final workDates = await WorkDatabase.instance.getDatesDesc(); + workDays.value = workDates; + } catch (e) { + print(e); + // Handle the error + } + } + + + + + List getDistinctDates() { + final currentDate = DateTime.now(); + final dates = [...orders.map((order) => order.startDate), currentDate] + .where((date) => date != null) + .toList(); + return dates.toSet().toList(); + } + + List filterOrdersByDateRange(DateTime startDate) { + final filteredList = orders + .where((order) => order.startDate != null && order.startDate!.isAtSameMomentAs(startDate)) + .toList(); + filteredOrders.value = filteredList; + return filteredList; + } + + Future> getOrdersByStartDate(DateTime startDate) async { + try { + final ordersByStartDate = await _orderDatabase.getOrdersByStartDate(startDate); + return ordersByStartDate; + } catch (e) { + print(e); + return []; + } + } + + double getTotalSumOrdersByStartDate (DateTime startDate) { + final filteredOrders = filterOrdersByDateRange(startDate); + double totalSum = filteredOrders.fold(0, (sum, order) => sum + order.totalPrice); + return totalSum; + } + + Future getTotalSumOrdersByMonth(DateTime date) async { + final filteredOrders = await getOrdersByMonth(date); + double totalsum = filteredOrders.fold(0, (sum, order) => sum + order.totalPrice); + totalSum.value = totalsum; + print(totalSum.value); + return totalSum; + + } + + Future> getProductQuantitiesByDate(DateTime date) async { + try { + return await _orderDatabase.getProductQuantitiesByDate(date); + } catch (e) { + print(e); + return {}; + } + } + + Future> getProductQuantitiesByMonth(DateTime date) async { + try { + return await _orderDatabase.getProductQuantitiesByMonth(date); + } catch (e) { + print(e); + return {}; + } + } + + Future> getOrdersByMonth(DateTime date) async { + try { + final ordersByMonth = await _orderDatabase.getOrdersByMonth(date); + print("ma"); + return ordersByMonth; + } catch (e) { + print(e); + return []; + } + } + + Future> getOrdersByYear(DateTime date) async { + try { + final ordersByYear = await _orderDatabase.getOrdersByYear(date); + return ordersByYear; + } catch (e) { + print(e); + return []; + } + } + + Future> getOrdersByWeek(int week) async { + try { + final ordersByWeek = await _orderDatabase.getOrdersByWeekNumber(week); + return ordersByWeek; + } catch (e) { + print(e); + return []; + } + } + + + + Future getOrderCountByMonth(DateTime month) async { + List orders = await getOrdersByMonth(month); + int orderCount = orders.length; + orderQuantity.value = orderCount; + return orderCount; + } + + + + +} diff --git a/lib/controller/productController.dart b/lib/controller/productController.dart new file mode 100644 index 0000000..bccbdb9 --- /dev/null +++ b/lib/controller/productController.dart @@ -0,0 +1,29 @@ +import 'package:get/get.dart'; + +import '../Models/produit.dart'; + +class ProductController extends GetxController { + final _products = [].obs; + + List get products => _products.toList(); + + void setProducts(List productList) { + _products.clear(); + _products.addAll(productList); + } + + void addProduct(Product product) { + _products.add(product); + } + + void updateProduct(Product updatedProduct) { + final index = _products.indexWhere((product) => product.id == updatedProduct.id); + if (index != -1) { + _products[index] = updatedProduct; + } + } + + void deleteProduct(int ?productId) { + _products.removeWhere((product) => product.id == productId); + } +} diff --git a/lib/controller/userController.dart b/lib/controller/userController.dart new file mode 100644 index 0000000..82c5a3c --- /dev/null +++ b/lib/controller/userController.dart @@ -0,0 +1,33 @@ +import 'package:get/get.dart'; +import 'package:youmazgestion/Models/users.dart'; + +class UserController extends GetxController { + final _username = ''.obs; + final _email = ''.obs; + final _role = ''.obs; + final _name = ''.obs; + final _lastname = ''.obs; + final _password = ''.obs; + + String get username => _username.value; + String get email => _email.value; + String get role => _role.value; + String get name => _name.value; + String get lastname => _lastname.value; + String get password => _password.value; + + void setUser(Users user) { + _username.value = user.username; + print(_username.value); + _email.value = user.email; + print(_email.value); + _role.value = user.role; + print(_role.value); + _name.value = user.name; + print(_name.value); + _lastname.value = user.lastName; + print(_lastname.value); + _password.value = user.password; + print(_password.value); + } +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..9a3a170 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:youmazgestion/Services/authDatabase.dart'; +import 'Services/productDatabase.dart'; +import 'my_app.dart'; +import 'package:logging/logging.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await ProductDatabase.instance.initDatabase(); + await AuthDatabase.instance.initDatabase(); + + setupLogger(); // Appel à la fonction setupLogger() + + //await OrderDatabase.instance.initDatabase(); + runApp(const GetMaterialApp( + debugShowCheckedModeBanner: false, + home: MyApp(), + )); +} + +void setupLogger() { + Logger.root.level = Level.ALL; + Logger.root.onRecord.listen((record) { + print('${record.level.name}: ${record.time}: ${record.message}'); + }); +} diff --git a/lib/my_app.dart b/lib/my_app.dart new file mode 100644 index 0000000..b8b6d42 --- /dev/null +++ b/lib/my_app.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; + +import 'Views/ErreurPage.dart'; +import 'Views/loginPage.dart'; + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + static bool isRegisterOpen = false; + static DateTime? startDate; + static late String path; + + static const Gradient primaryGradient = LinearGradient( + colors: [ + Colors.white, + const Color.fromARGB(255, 4, 54, 95), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + debugShowCheckedModeBanner: false, + theme: ThemeData( + canvasColor: Colors.transparent, + ), + home: Builder( + builder: (context) { + return FutureBuilder( + future: + checkLocalDatabasesExist(), // Appel à la fonction de vérification + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Affichez un indicateur de chargement si nécessaire + return const CircularProgressIndicator(); + } else if (snapshot.hasError || !(snapshot.data ?? false)) { + // S'il y a une erreur ou si les bases de données n'existent pas + return ErreurPage( + dbPath: + path); // Redirigez vers la page d'erreur en affichant le chemin de la base de données + } else { + // Si les bases de données existent, affichez la page d'accueil normalement + return Container( + decoration: const BoxDecoration( + gradient: MyApp.primaryGradient, + ), + child: const LoginPage(), + ); + } + }, + ); + }, + ), + ); + } + + Future checkLocalDatabasesExist() async { + final documentsDirectory = await getApplicationDocumentsDirectory(); + final dbPath = documentsDirectory.path; + path = dbPath; + + // Vérifier si le fichier de base de données products2.db existe + final productsDBFile = File('$dbPath/products2.db'); + final productsDBExists = await productsDBFile.exists(); + + // Vérifier si le fichier de base de données auth.db existe + final authDBFile = File('$dbPath/usersDb.db'); + final authDBExists = await authDBFile.exists(); + + // Vérifier si d'autres bases de données nécessaires existent, le cas échéant + + return productsDBExists && authDBExists; + } +} diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt new file mode 100644 index 0000000..582f02e --- /dev/null +++ b/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "guycom") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.guycom") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/linux/flutter/CMakeLists.txt b/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..ea57761 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,27 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include +#include +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) charset_converter_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "CharsetConverterPlugin"); + charset_converter_plugin_register_with_registrar(charset_converter_registrar); + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); + g_autoptr(FlPluginRegistrar) open_file_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "OpenFileLinuxPlugin"); + open_file_linux_plugin_register_with_registrar(open_file_linux_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..e734d46 --- /dev/null +++ b/linux/flutter/generated_plugins.cmake @@ -0,0 +1,27 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + charset_converter + file_selector_linux + open_file_linux + url_launcher_linux +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/linux/runner/CMakeLists.txt b/linux/runner/CMakeLists.txt new file mode 100644 index 0000000..e97dabc --- /dev/null +++ b/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/linux/runner/main.cc b/linux/runner/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc new file mode 100644 index 0000000..3bd1164 --- /dev/null +++ b/linux/runner/my_application.cc @@ -0,0 +1,130 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "guycom"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "guycom"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/linux/runner/my_application.h b/linux/runner/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/linux/runner/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..af0c805 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,24 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import file_picker +import file_selector_macos +import open_file_mac +import path_provider_foundation +import shared_preferences_foundation +import sqflite_darwin +import url_launcher_macos + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) + OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) +} diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..29c8eb3 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.14' + +# 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', 'ephemeral', '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 Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/macos/Podfile.lock b/macos/Podfile.lock new file mode 100644 index 0000000..dfee238 --- /dev/null +++ b/macos/Podfile.lock @@ -0,0 +1,54 @@ +PODS: + - file_picker (0.0.1): + - FlutterMacOS + - file_selector_macos (0.0.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + - open_file_mac (0.0.1): + - FlutterMacOS + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - sqflite_darwin (0.0.4): + - Flutter + - FlutterMacOS + - url_launcher_macos (0.0.1): + - FlutterMacOS + +DEPENDENCIES: + - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) + - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + - open_file_mac (from `Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`) + - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) + +EXTERNAL SOURCES: + file_picker: + :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos + file_selector_macos: + :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos + FlutterMacOS: + :path: Flutter/ephemeral + open_file_mac: + :path: Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + sqflite_darwin: + :path: Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin + url_launcher_macos: + :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos + +SPEC CHECKSUMS: + file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a + file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31 + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + open_file_mac: 01874b6d6a2c1485ac9b126d7105b99102dea2cf + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 + url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673 + +PODFILE CHECKSUM: 7eb978b976557c8c1cd717d8185ec483fd090a82 + +COCOAPODS: 1.16.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..63feb71 --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,801 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 59778DBF9EA8F1CB9CCC2108 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15FB7EB4AC7187001B072D51 /* Pods_Runner.framework */; }; + A0CEB54525B1F0B0C1D100E3 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E8ACA9E1BD346A172D3CEC /* Pods_RunnerTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 15FB7EB4AC7187001B072D51 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* guycom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = guycom.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 5D5EC2D377BE76DCCBCCEE01 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 708B8C12DB26166ACF267991 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 79E8ACA9E1BD346A172D3CEC /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 936DC6F354BF3FC293DF4A28 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + CC9D53DA39123A8C07833DC9 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + D1DE6AA8E66689E29A856796 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + E177040F0EBC6F1F184F03CF /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A0CEB54525B1F0B0C1D100E3 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 59778DBF9EA8F1CB9CCC2108 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 9A1FE910A830659E644C6F3A /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* guycom.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 9A1FE910A830659E644C6F3A /* Pods */ = { + isa = PBXGroup; + children = ( + D1DE6AA8E66689E29A856796 /* Pods-Runner.debug.xcconfig */, + 5D5EC2D377BE76DCCBCCEE01 /* Pods-Runner.release.xcconfig */, + 936DC6F354BF3FC293DF4A28 /* Pods-Runner.profile.xcconfig */, + E177040F0EBC6F1F184F03CF /* Pods-RunnerTests.debug.xcconfig */, + CC9D53DA39123A8C07833DC9 /* Pods-RunnerTests.release.xcconfig */, + 708B8C12DB26166ACF267991 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 15FB7EB4AC7187001B072D51 /* Pods_Runner.framework */, + 79E8ACA9E1BD346A172D3CEC /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 3F75B1600951D026F5E414FB /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + E75D7BDBC57E7F5C2FAE1E98 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 118060763A0D757AAEE216E9 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* guycom.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 118060763A0D757AAEE216E9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 3F75B1600951D026F5E414FB /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-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; + }; + E75D7BDBC57E7F5C2FAE1E98 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + 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; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E177040F0EBC6F1F184F03CF /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.guycom.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/guycom.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/guycom"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CC9D53DA39123A8C07833DC9 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.guycom.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/guycom.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/guycom"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 708B8C12DB26166ACF267991 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.guycom.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/guycom.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/guycom"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..0380802 --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..b3c1761 --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..00a3ffc --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = guycom + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.guycom + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..f7dd379 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1210 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + another_flushbar: + dependency: transitive + description: + name: another_flushbar + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + url: "https://pub.dev" + source: hosted + version: "1.12.30" + another_transformer_page_view: + dependency: transitive + description: + name: another_transformer_page_view + sha256: a7cd46ede62d621c5abe7e58c7cb2745abe67b3bfec64f59b8889c93d7be7a8e + url: "https://pub.dev" + source: hosted + version: "2.0.1" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + barcode: + dependency: transitive + description: + name: barcode + sha256: "7b6729c37e3b7f34233e2318d866e8c48ddb46c1f7ad01ff7bb2a8de1da2b9f4" + url: "https://pub.dev" + source: hosted + version: "2.2.9" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + charset_converter: + dependency: transitive + description: + name: charset_converter + sha256: a601f27b78ca86c3d88899d53059786d9c3f3c485b64974e9105c06c2569aef5 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + console: + dependency: transitive + description: + name: console + sha256: e04e7824384c5b39389acdd6dc7d33f3efe6b232f6f16d7626f194f6a01ad69a + url: "https://pub.dev" + source: hosted + version: "4.1.0" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + decimal: + dependency: transitive + description: + name: decimal + sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21" + url: "https://pub.dev" + source: hosted + version: "2.3.3" + equatable: + dependency: transitive + description: + name: equatable + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + esc_pos_printer: + dependency: "direct main" + description: + name: esc_pos_printer + sha256: "312b05f909f3f7dd1e6a3332cf384dcee2c3a635138823654cd9c0133d8b5c45" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + esc_pos_utils: + dependency: "direct main" + description: + name: esc_pos_utils + sha256: "8ec0013d7a7f1e790ced6b09b95ce3bf2c6f9468a3e2bc49ece000761d86c6f8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + file_picker: + dependency: "direct main" + description: + name: file_picker + sha256: "8986dec4581b4bcd4b6df5d75a2ea0bede3db802f500635d05fa8be298f9467f" + url: "https://pub.dev" + source: hosted + version: "10.1.2" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.dev" + source: hosted + version: "0.9.3+4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_charts: + dependency: "direct main" + description: + name: flutter_charts + sha256: eb9d2bf98bfc779c1da9cf1fe80afd598094aed33e536cf04845d8f266f48c11 + url: "https://pub.dev" + source: hosted + version: "0.5.2" + flutter_dropzone: + dependency: "direct main" + description: + name: flutter_dropzone + sha256: d0917c4e366ebb3a98c9c02faac79223d119af5e236967c70e7e4002cdfb20d3 + url: "https://pub.dev" + source: hosted + version: "4.2.1" + flutter_dropzone_platform_interface: + dependency: transitive + description: + name: flutter_dropzone_platform_interface + sha256: "96d2c51c86063ba150551c3b40fd26c5a18785bee071c0c751502d28a545df3b" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + flutter_dropzone_web: + dependency: transitive + description: + name: flutter_dropzone_web + sha256: "03b216f9443add6ad1d075ab513a354a47edf3d1b87d830a8ed314f0d3a2beac" + url: "https://pub.dev" + source: hosted + version: "4.2.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" + source: hosted + version: "2.0.3" + flutter_login: + dependency: "direct main" + description: + name: flutter_login + sha256: "97f27a52bd68038090bd79f22600ad9ae86158f1d55c47e3d0cef66b299579f3" + url: "https://pub.dev" + source: hosted + version: "4.2.1" + flutter_pdfview: + dependency: "direct main" + description: + name: flutter_pdfview + sha256: "51413e36ab3f1a2fe0edf97ebfa770e20182ea4a066bc9f292920330d9245c9d" + url: "https://pub.dev" + source: hosted + version: "1.4.0+1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "5a1e6fb2c0561958d7e4c33574674bda7b77caaca7a33b758876956f2902eea3" + url: "https://pub.dev" + source: hosted + version: "2.0.27" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: d3a89184101baec7f4600d58840a764d2ef760fe1c5a20ef9e6b0e9b24a07a3a + url: "https://pub.dev" + source: hosted + version: "10.8.0" + gbk_codec: + dependency: transitive + description: + name: gbk_codec + sha256: "3af5311fc9393115e3650ae6023862adf998051a804a08fb804f042724999f61" + url: "https://pub.dev" + source: hosted + version: "0.4.0" + get: + dependency: "direct main" + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: transitive + description: + name: get_it + sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1 + url: "https://pub.dev" + source: hosted + version: "7.7.0" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 + url: "https://pub.dev" + source: hosted + version: "6.2.1" + grouped_list: + dependency: "direct main" + description: + name: grouped_list + sha256: fef106470186081c32636aa055492eee7fc7fe8bf0921a48d31ded24821af19f + url: "https://pub.dev" + source: hosted + version: "5.1.2" + hex: + dependency: transitive + description: + name: hex + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + html: + dependency: transitive + description: + name: html + sha256: "9475be233c437f0e3637af55e7702cbbe5c23a68bd56e8a5fa2d426297b7c6c8" + url: "https://pub.dev" + source: hosted + version: "0.15.5+1" + http: + dependency: transitive + description: + name: http + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + url: "https://pub.dev" + source: hosted + version: "1.3.0" + http_methods: + dependency: transitive + description: + name: http_methods + sha256: "6bccce8f1ec7b5d701e7921dca35e202d425b57e317ba1a37f2638590e29e566" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: "direct main" + description: + name: image + sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + url: "https://pub.dev" + source: hosted + version: "3.3.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + url: "https://pub.dev" + source: hosted + version: "0.8.9" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "8bd392ba8b0c8957a157ae0dc9fcf48c58e6c20908d5880aea1d79734df090e9" + url: "https://pub.dev" + source: hosted + version: "0.8.12+22" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + intl_phone_number_input: + dependency: transitive + description: + name: intl_phone_number_input + sha256: "1c4328713a9503ab26a1fdbb6b00b4cada68c18aac922b35bedbc72eff1297c3" + url: "https://pub.dev" + source: hosted + version: "0.7.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + url: "https://pub.dev" + source: hosted + version: "10.0.8" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + libphonenumber_platform_interface: + dependency: transitive + description: + name: libphonenumber_platform_interface + sha256: f801f6c65523f56504b83f0890e6dad584ab3a7507dca65fec0eed640afea40f + url: "https://pub.dev" + source: hosted + version: "0.4.2" + libphonenumber_plugin: + dependency: transitive + description: + name: libphonenumber_plugin + sha256: c615021d9816fbda2b2587881019ed595ecdf54d999652d7e4cce0e1f026368c + url: "https://pub.dev" + source: hosted + version: "0.3.3" + libphonenumber_web: + dependency: transitive + description: + name: libphonenumber_web + sha256: "8186f420dbe97c3132283e52819daff1e55d60d6db46f7ea5ac42f42a28cc2ef" + url: "https://pub.dev" + source: hosted + version: "0.3.2" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logger: + dependency: transitive + description: + name: logger + sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + url: "https://pub.dev" + source: hosted + version: "2.5.0" + logging: + dependency: "direct main" + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + 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: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + url: "https://pub.dev" + source: hosted + version: "1.0.6" + msix: + dependency: "direct main" + description: + name: msix + sha256: e3de4d9f52543ad6e4b0f534991e1303cbd379d24be28dd241ac60bd9439a201 + url: "https://pub.dev" + source: hosted + version: "3.7.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + open_file: + dependency: "direct main" + description: + name: open_file + sha256: d17e2bddf5b278cb2ae18393d0496aa4f162142ba97d1a9e0c30d476adf99c0e + url: "https://pub.dev" + source: hosted + version: "3.5.10" + open_file_android: + dependency: transitive + description: + name: open_file_android + sha256: "58141fcaece2f453a9684509a7275f231ac0e3d6ceb9a5e6de310a7dff9084aa" + url: "https://pub.dev" + source: hosted + version: "1.0.6" + open_file_ios: + dependency: transitive + description: + name: open_file_ios + sha256: "02996f01e5f6863832068e97f8f3a5ef9b613516db6897f373b43b79849e4d07" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + open_file_linux: + dependency: transitive + description: + name: open_file_linux + sha256: d189f799eecbb139c97f8bc7d303f9e720954fa4e0fa1b0b7294767e5f2d7550 + url: "https://pub.dev" + source: hosted + version: "0.0.5" + open_file_mac: + dependency: transitive + description: + name: open_file_mac + sha256: "1440b1e37ceb0642208cfeb2c659c6cda27b25187a90635c9d1acb7d0584d324" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + open_file_platform_interface: + dependency: transitive + description: + name: open_file_platform_interface + sha256: "101b424ca359632699a7e1213e83d025722ab668b9fd1412338221bf9b0e5757" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + open_file_web: + dependency: transitive + description: + name: open_file_web + sha256: e3dbc9584856283dcb30aef5720558b90f88036360bd078e494ab80a80130c4f + url: "https://pub.dev" + source: hosted + version: "0.0.4" + open_file_windows: + dependency: transitive + description: + name: open_file_windows + sha256: d26c31ddf935a94a1a3aa43a23f4fff8a5ff4eea395fe7a8cb819cf55431c875 + url: "https://pub.dev" + source: hosted + version: "0.0.3" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + particles_fly: + dependency: "direct main" + description: + name: particles_fly + sha256: "6638eee64aa474727b98139ff9fb85633fbd8fa573c20972aac076f8cd145778" + url: "https://pub.dev" + source: hosted + version: "0.0.9" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12" + url: "https://pub.dev" + source: hosted + version: "2.2.16" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + pdf: + dependency: "direct main" + description: + name: pdf + sha256: "10659b915e65832b106f6d1d213e09b789cc1f24bf282ee911e49db35b96be4d" + url: "https://pub.dev" + source: hosted + version: "3.8.4" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + phone_numbers_parser: + dependency: transitive + description: + name: phone_numbers_parser + sha256: "62451b689d842791ed1fd5dc9eacf36ffa8bad23a78ad6cde732dc2fb222fae2" + url: "https://pub.dev" + source: hosted + version: "8.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: transitive + description: + name: provider + sha256: "489024f942069c2920c844ee18bb3d467c69e48955a4f32d1677f71be103e310" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + qr: + dependency: transitive + description: + name: qr + sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + qr_flutter: + dependency: "direct main" + description: + name: qr_flutter + sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + quantity_input: + dependency: "direct main" + description: + name: quantity_input + sha256: "69a05b0aacfe83dbd89e0a7ff2819da2170d420aa9652dadb93b539971420e43" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + rational: + dependency: transitive + description: + name: rational + sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336 + url: "https://pub.dev" + source: hosted + version: "2.2.3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.dev" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" + url: "https://pub.dev" + source: hosted + version: "2.4.10" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: "direct main" + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_router: + dependency: "direct main" + description: + name: shelf_router + sha256: f5e5d492440a7fb165fe1e2e1a623f31f734d3370900070b2b1e0d0428d59864 + url: "https://pub.dev" + source: hosted + version: "1.1.4" + sign_in_button: + dependency: transitive + description: + name: sign_in_button + sha256: "977b9b0415d2f3909e642275dfabba7919ba8e111324641b76cae6d1acbd183e" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sqflite: + dependency: "direct main" + description: + name: sqflite + sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "84731e8bfd8303a3389903e01fb2141b6e59b5973cacbb0929021df08dddbe8b" + url: "https://pub.dev" + source: hosted + version: "2.5.5" + sqflite_common_ffi: + dependency: "direct main" + description: + name: sqflite_common_ffi + sha256: "1f3ef3888d3bfbb47785cc1dda0dc7dd7ebd8c1955d32a9e8e9dae1e38d1c4c1" + url: "https://pub.dev" + source: hosted + version: "2.3.5" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + sqlite3: + dependency: transitive + description: + name: sqlite3 + sha256: "310af39c40dd0bb2058538333c9d9840a2725ae0b9f77e4fd09ad6696aa8f66e" + url: "https://pub.dev" + source: hosted + version: "2.7.5" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + syncfusion_flutter_charts: + dependency: "direct main" + description: + name: syncfusion_flutter_charts + sha256: bdb7cc5814ceb187793cea587f4a5946afcffd96726b219cee79df8460f44b7b + url: "https://pub.dev" + source: hosted + version: "21.2.4" + syncfusion_flutter_core: + dependency: transitive + description: + name: syncfusion_flutter_core + sha256: "8db8f55c77f56968681447d3837c10f27a9e861e238a898fda116c7531def979" + url: "https://pub.dev" + source: hosted + version: "21.2.10" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "0669c70faae6270521ee4f05bffd2919892d42d1276e6c495be80174b6bc0ef6" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4" + url: "https://pub.dev" + source: hosted + version: "6.3.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" + url: "https://pub.dev" + source: hosted + version: "6.3.3" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + url: "https://pub.dev" + source: hosted + version: "3.2.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.dev" + source: hosted + version: "3.1.4" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + win32: + dependency: transitive + description: + name: win32 + sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f + url: "https://pub.dev" + source: hosted + version: "5.12.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..fb36bc3 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,127 @@ +name: youmazgestion +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=2.19.6 <3.0.0' + + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + get: ^4.6.5 + sqflite: ^2.2.8+4 + + flutter_dropzone: ^4.2.1 + image_picker: ^0.8.7+5 + file_picker: ^10.1.2 + sqflite_common_ffi: ^2.2.5 + quantity_input: ^1.0.2 + grouped_list: ^5.1.2 + esc_pos_printer: ^4.0.1 + esc_pos_utils: ^1.1.0 + flutter_login: ^4.1.1 + image: ^3.0.2 + logging: ^1.2.0 + msix: ^3.7.0 + flutter_charts: ^0.5.1 + syncfusion_flutter_charts: ^21.2.4 + shelf: ^1.4.1 + shelf_router: ^1.1.4 + pdf: ^3.8.4 + intl: ^0.17.0 + flutter_pdfview: ^1.3.1 + open_file: ^3.3.2 + particles_fly: ^0.0.8 + qr_flutter: ^4.0.0 + path_provider: ^2.0.15 + shared_preferences: ^2.2.2 + + + + + + + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + + - assets/youmaz2.png + - assets/youm.ico + - assets/database/orderdb.db + - assets/database/products2.db + - assets/database/usersdb.db + - assets/database/work.db + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/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.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..d079089 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. 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:guycom/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/web/favicon.png b/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/web/icons/Icon-maskable-512.png differ diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..bb38455 --- /dev/null +++ b/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + guycom + + + + + + diff --git a/web/manifest.json b/web/manifest.json new file mode 100644 index 0000000..8f50bfa --- /dev/null +++ b/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "guycom", + "short_name": "guycom", + "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/windows/.gitignore b/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt new file mode 100644 index 0000000..41d583d --- /dev/null +++ b/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(guycom LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "guycom") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..903f489 --- /dev/null +++ b/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..a342058 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + CharsetConverterPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("CharsetConverterPlugin")); + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); +} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..5d12043 --- /dev/null +++ b/windows/flutter/generated_plugins.cmake @@ -0,0 +1,26 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + charset_converter + file_selector_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/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc new file mode 100644 index 0000000..b8c8926 --- /dev/null +++ b/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "guycom" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "guycom" "\0" + VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "guycom.exe" "\0" + VALUE "ProductName", "guycom" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..955ee30 --- /dev/null +++ b/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/windows/runner/flutter_window.h b/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp new file mode 100644 index 0000000..a8a431a --- /dev/null +++ b/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"guycom", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/windows/runner/resource.h b/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/windows/runner/resources/app_icon.ico differ diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..153653e --- /dev/null +++ b/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp new file mode 100644 index 0000000..3a0b465 --- /dev/null +++ b/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/windows/runner/utils.h b/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp new file mode 100644 index 0000000..60608d0 --- /dev/null +++ b/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/windows/runner/win32_window.h b/windows/runner/win32_window.h new file mode 100644 index 0000000..e901dde --- /dev/null +++ b/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_